Idea #1885

Updated by Tom Clegg about 10 years ago

Useful for external and federated clients. 

 * Use API host and token provided in environment variables to get (and periodically update) the list of Keep servers at startup. servers. 
 * Use node selection algorithm (see Python SDK) to select probe order when reading and writing. 
 * Forward @Authorization@ header if provided by the client. No need to verify it: Keep servers. servers will do that. 
 * PUT: 
 ** When writing, use 2x replication, i.e., write to 2 Keep servers (future: client specifies this in a header) 
 ** in response headers, say "X-Data-Replication: 2" 
 * GET: 
 ** 405 if @--no-GET@ flag was given. 
 ** For now: do not implement GET. Do not even start up unless @--no-GET@ flag is given. 
 * GET /index*: 
 ** 403 

 Important but not strictly a blocker: 
 * PUT: verify Authorization header by requesting /users/current from apiserver, respond 401 if not valid. 

 Nice Use node selection algorithm (see Python SDK) to have: 
 * Periodically request the latest list of Keep servers. (This has an easy workaround: TERM the server as needed.) 
 * HEAD: 
 ** 405 if @--no-HEAD@ flag was given, otherwise forward to Keep servers in select probe order until it succeeds, send first successful response (or last failure, if none) to client when reading and writing. 

 * Probably best reasonable to do this with Go. Perhaps something like or even plain net/http. (But definitely as a separate project, not by adding "proxy mode" to the Keep server itself.)