agent, control-plane: remove the storage-mappings directive; pin authorization on the GraphQL path (7/7) - #3351
Open
bbartman wants to merge 1 commit into
Conversation
…orization on the GraphQL path The GraphQL storage-mapping mutations superseded the directive on 2026-03-16 (the last routine production application), so the agent-side handler, its Directive variant, and user_has_admin_capability are removed — the latter taking with it a loose-direction prefix comparison that let a sub-prefix admin rewrite the whole tenant's mapping. The still-shared persistence helpers move out of directives/ to control-plane-api/src/storage_mappings.rs. That authorization boundary is now pinned on the GraphQL path instead: sub-prefix and attenuated raw-admin shapes are denied, with tests. The agent crate now sets recursion_limit = 256: laying out the publication pipeline's nested poll future needs a ~130-deep rustc query descent, over the 128 default. Earlier trees compiled only because the since-deleted directive chain happened to pre-compute shared sub-layouts.
Contributor
|
Is there a reason this sits on top of the stack? Correct me if i'm wrong but AFAICT this could be merged independently |
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.
Description:
Part 7 (final) of the snapshot-authorization stack (follows the stack-6 admin-endpoints PR). Decomposed from #3300, which this completes.
The storage-mappings directive is deleted rather than migrated: the GraphQL storage-mapping mutations superseded it on 2026-03-16 (the last routine production application). Removed with it:
crates/agent/src/directives/storage_mappings.rs) and itsDirectivevariant;user_has_admin_capability— which also removes a loose-direction prefix comparison that let a sub-prefix admin rewrite the whole tenant's storage mapping;.sqlxquery metadata.The still-shared persistence helpers move out of
directives/tocontrol-plane-api/src/storage_mappings.rs, and the two import sites (create_data_plane, the GraphQL mutations) retarget to the new location.The authorization boundary the directive used to (incorrectly) hold is now pinned on the GraphQL path instead: new integration tests deny the sub-prefix and attenuated raw-admin shapes.
The agent crate now sets
recursion_limit = 256: laying out the publication pipeline's nested poll future needs a ~130-deep rustc query descent, over the 128 default. Earlier trees compiled only because the since-deleted directive chain happened to pre-compute shared sub-layouts — the raise makes that accident explicit, per rustc's own guidance.Verified locally:
cargo nextest run -p control-plane-api -p agent— 297/297 passing at this branch tip, including the new GraphQL denial tests.Workflow steps:
Applying a storage-mappings directive is no longer possible; storage mappings are managed exclusively through the GraphQL mutations (the dashboard path since March 2026).
Documentation links affected:
None — the directive was never user-facing documentation-wise; the GraphQL path is already the documented one.
Notes for reviewers:
user_has_admin_capabilityand its loose prefix comparison, and the new GraphQL denial tests incrates/agent/src/integration_tests/graphql/mutations/storage_mappings.rsthat pin the corrected boundary — review these first.crates/control-plane-api/src/storage_mappings.rsis a move of the persistence helpers, not new logic; review the move diff for what was dropped (the directive-only pieces) rather than line-by-line.DirectiveHandler::newsignature change (dropslogs_tx) ripples intomain.rsand the test harness.recursion_limit = 256incrates/agent/src/lib.rscarries its rationale in a comment; it is required by this PR's deletion, not incidental.