Repository navigation
Conversation
bbartman
added this pull request to stack #3485
September 11, 2026 15:17
bbartman
force-pushed
the
bmb/3376-masked-user-walk
branch
from
September 14, 2026 13:29
81670f1 to
1bb0c47
Compare
bbartman
force-pushed
the
bmb/3376-masked-user-walk
branch
from
September 14, 2026 16:56
1bb0c47 to
852e86f
Compare
The `UserGrant` grant walk takes an explicit `authz::CapabilityMask`: `reachable_nodes`, `is_authorized`, `reachable_prefixes`, and `get_user_capability`. The mask is applied at every node emission inside `next_neighbors` (`edge & delegatable & mask`), which makes traversal itself subject to the mask: a node the mask leaves with neither Delegate nor Assume is terminal, so a mask holding neither bit confines the token to direct user grants, and Assume cannot re-widen a child beyond the mask. `reachable_prefixes` omits prefixes the mask attenuates to an empty bit set, gated on `has_all_capabilities()` so a mask which hides nothing keeps the unmasked walk's empty-bit delegation nodes surfacing as they do today. `get_user_capability` masks reachability but reports a reached node's legacy value un-attenuated: it is compatibility metadata, not an authorization decision. The `RoleGrant` walk keeps its signatures and pins `ALL_CAPABILITIES` internally, since no user bearer participates in role-to-role authorization. Zero behavior change: only the tables-crate signatures change, and every caller (control-plane-api and agent) passes `ALL_CAPABILITIES` explicitly. Threading the bearer's real mask from `Envelope::capability_mask` is the next layer. Tests pin unmasked parity, empty-mask denial, direct-only traversal without Delegate, multi-hop clamping with Delegate, Assume containment, attenuated-prefix omission with its unmasked contrast, parent-prefix pickup, and `get_user_capability` legacy pass-through.
bbartman
force-pushed
the
bmb/3376-masked-user-walk
branch
from
September 15, 2026 11:33
852e86f to
1386b09
Compare
Contributor
Author
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.
Part of #3376. Stacked on #3484 — review only the top commit here.
What
The
tables::UserGrantgrant walk takes an explicitauthz::CapabilityMaskonreachable_nodes,is_authorized,reachable_prefixes, andget_user_capability. The mask is applied at every node emission insidenext_neighbors(edge & delegatable & mask), so traversal itself is subject to the mask: a node the mask leaves with neitherDelegatenorAssumeis terminal, a mask holding neither bit confines the token to direct user grants, andAssumecannot re-widen a child beyond the mask.reachable_prefixesomits prefixes the mask attenuates to an empty bit set. The skip is gated onhas_all_capabilities()(a "can this mask hide anything" test, never an "is the bearer masked" test) so a mask which hides nothing keeps the unmasked walk's own empty-bit delegation nodes surfacing.get_user_capabilitymasks reachability but reports a reached node's legacy value un-attenuated: compatibility metadata, not an authorization decision.RoleGrantwalk keeps its signatures and pinsALL_CAPABILITIESinternally; no user bearer participates in role-to-role authorization.Zero behavior change
Only the tables-crate signatures change. Every caller in
control-plane-apiandagent(24 call sites) passesmodels::authz::CapabilityMask::ALL_CAPABILITIESexplicitly; nothing above the tables crate changes shape. Threading the bearer's real mask fromEnvelope::capability_maskis the next layer.Tests
New
test_masked_walk_*tests incrates/tables/src/behaviors.rspin: unmasked parity (full reachable-set literal), empty-mask denial, direct-only traversal withoutDelegate, multi-hop clamping withDelegate,Assumecontainment, attenuated-prefix omission with its unmasked contrast, parent-prefix pickup, andget_user_capabilitylegacy pass-through. Red was verified by stubbing out the emission-timemask.applyand thereachable_prefixesgate independently.Full
mise run ci:nextest-run: 1945 passed, 1 skipped.