Repository navigation
control-plane-api: accept a prefix scope header - #3407
Draft
GregorShear wants to merge 1 commit into
Draft
GregorShear wants to merge 1 commit into
GregorShear wants to merge 1 commit into
Conversation
GregorShear
force-pushed
the
greg/scoped-prefix-header
branch
from
October 5, 2026 16:54
8344dd9 to
c5b70ee
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
An authenticated client can send
X-Estuary-Scope-Prefix: acmeCo/to narrow a request using the existingprefix_scopeauthorization policy. With an unscoped bearer, changing the header switches the selected tenant without obtaining another token; delegated prefixes remain available according to the existing grant graph.Envelopeapplies the header to a request-local copy of verified claims. Existing handlers and credential-creation guards consume those effective claims. The header is also allowed by CORS. Omitting it preserves existing behavior.A token that already carries
prefix_scopeaccepts only a matching header, using the token's existing trailing-slash normalization. A different header returns HTTP 400, including a textual child prefix: graph scopes cannot safely be composed by string containment. Empty, malformed, non-ASCII, and repeated headers return HTTP 400; a valid header without authentication returns HTTP 401. Capability masks remain intact.The change is limited to request extraction, the CORS allowlist, documentation, and tests. It uses the authorization machinery merged in #3543 without changing grant traversal, legacy capabilities, database schemas, or dashboard code.
Validation:
cargo check -p control-plane-apiwithSQLX_OFFLINE=true.cargo fmt --all --checkandgit diff --check.The test build used temporary SQLx metadata for ten existing test-only queries missing from the checked-in cache. No metadata or database changes are included. The full API test suite was not run.