Classify using session prefix
For gitlab-org/gitlab#465433 (closed)
The changes in this MR supports
- introducing attribute named
session_prefix
in config.toml - classification using a session's prefix.
- A session's prefix matches a cell's
session_prefix
attribute specified in the configuration, so we match this value (which HTTP router would pass to TS) in the request to thesession_prefix
attributes in the TS's configuration to find the right cell to route the request to.
- A session's prefix matches a cell's
With a valid cell name
curl --cacert tmp/certs/ca-cert.pem --cert tmp/certs/client-cert.pem --key tmp/certs/client-key.pem -X POST https://localhost:9096/v1/classify -H "Content-Type: application/json" -d '{"type": "SessionPrefix", "value": "cell-1"}'
{"action":"Proxy","proxy":{"address":"my.cell-1.example.com"}}
With an invalid cell name
curl --cacert tmp/certs/ca-cert.pem --cert tmp/certs/client-cert.pem --key tmp/certs/client-key.pem -X POST https://localhost:9096/v1/classify -H "Content-Type: application/json" -d '{"type": "SessionPrefix", "value": "junk_value"}'
{"code":5,"message":"cell not found: \"junk_value\"","details":[]}
Edited by Manoj M J