Actions
Story #1885
closedKeep proxy service: forward external requests to the appropriate keep servers
Status:
Resolved
Priority:
Normal
Assigned To:
Category:
-
Target version:
Start date:
05/08/2014
Due date:
% Done:
100%
Estimated time:
(Total: 26.00 h)
Story points:
3.0
Description
Useful for external and federated clients.
Necessary:- Use API host and token provided in environment variables to get the list of Keep servers at startup.
- Use node selection algorithm (see Python SDK) to select probe order when reading and writing.
- Forward
Authorization
header to Keep servers. - PUT:
- 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.
- 405 if
- GET /index*:
- 403
- PUT: verify Authorization header by requesting /users/current from apiserver, respond 401 if not valid.
- 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 probe order until it succeeds, send first successful response (or last failure, if none) to client
- 405 if
- Probably best to do this with Go. Perhaps something like https://github.com/elazarl/goproxy or even plain net/http. (But definitely as a separate project, not by adding "proxy mode" to the Keep server itself.)
Actions