Skip to content

Send deployment routing headers from cluster metadata - #83

Merged
rmorehig merged 3 commits into
mainfrom
rafa/client-routing-headers
Oct 17, 2026
Merged

rmorehig merged 3 commits into
mainfrom
rafa/client-routing-headers

Conversation

@rmorehig

@rmorehig rmorehig commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Session and OAuth requests now discover the selected cluster through the existing /v1/clusters?organization=<name> endpoint and send its serving deployment headers automatically. Existing CLI commands, cluster paths, organization query parameters and the size catalog stay unchanged.

GET /v1/clusters?organization=acme
Authorization: Bearer <session>

{ "clusters": [{ "id": "...", "name": "production", "deployment_id": "12abcdef", "cloud_region": "us-east-1" }] }

POST /v1/query?organization=acme&cluster=production
Authorization: Bearer <session>
X-RawTree-Deployment-Id: 12abcdef
X-RawTree-Region: us-east-1

Routing metadata is cached for 30 seconds and invalidated by cluster/organization mutations. Both headers are omitted when metadata is absent or invalid, preserving the gateway migration fallback. API keys use embedded routing and skip discovery. Explicit request timeouts include discovery; gzip, bodies, idempotency keys and JWT/OAuth token contents retain their behavior.

Prepares CLI 0.7.0; publication is deferred. The organization-scoped endpoint migration is outside this PR.

Companions: Platform https://github.com/rawtreedb/rawtree-platform/pull/1524 and MCP rawtreedb/rawtree-mcp#34.

Validation: all CLI unit and contract tests pass, including routing, browser login and unchanged cluster URL assertions. Six live CLI tests pass against the rebuilt backend. P3 autoreview and thermonuclear maintainability review are clean.

@rmorehig rmorehig changed the title Scope cluster endpoints to organizations and resolve routing headers Send deployment routing headers from cluster metadata Oct 17, 2026
@rmorehig
rmorehig merged commit 05af8c8 into main Oct 17, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant