control-plane: Snapshot authorization model and retryable staleness error (1/7) - #3341
Open
bbartman wants to merge 2 commits into
Open
control-plane: Snapshot authorization model and retryable staleness error (1/7)#3341bbartman wants to merge 2 commits into
bbartman wants to merge 2 commits into
Conversation
This was referenced Aug 11, 2026
Open
…able staleness error Adds validation::Error::AuthorizationSnapshotStale and is_authz_snapshot_stale() as the retryable signal that an authorization denial was evaluated against a Snapshot which may not yet reflect a committed grant. Adds the in-process authorization surface to Snapshot: the three-way Authorization enum (Authorized / Denied / Stale) with ok_or_stale(), user_authorization / role_authorization over the snapshot's grants, spec_capabilities() for error-message rendering, and STALE_RETRY_WAKE. Also renames App::snapshot to App::snapshot_watch, ahead of follow-ups where executors pin per-poll Snapshot tokens distinct from the watch itself. This PR is purely additive; nothing consumes the new surface yet. Split 1 of 4 from #3155.
bbartman
force-pushed
the
bmb/2781-stack-1-snapshot-authz
branch
from
August 11, 2026 18:23
cf94b28 to
96ea0b5
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.
What
Split 1 of 4 of #3155 (issue #2781): the foundation layer for moving catalog
authorization out of SQL and onto the in-memory authorization
Snapshot.validation: addsError::AuthorizationSnapshotStale { catalog_name }—the retryable signal that an authorization denial was evaluated against a
Snapshot which may not yet reflect a committed grant — and
is_authz_snapshot_stale()to classify it afteranyhowwrapping.control-plane-apiSnapshot authorization model (server/snapshot.rs):Authorizationenum (Authorized/Denied/Stale) withok_or_stale(), which converts a provisional denial into the retryableerror above.
Snapshot::resolve_authorization(),user_authorization(),role_authorization()— grant evaluation against the pinned Snapshot,classified by whether the Snapshot postdates the operation's freshness
anchor (
taken_after, allowingTEMPORAL_SKEW).Snapshot::spec_capabilities()— in-process replacement for theSQL-computed
spec_capabilitiescolumn, used to render "Available grantsare:" error messages.
STALE_RETRY_WAKE, the re-poll interval used by later splits.App::snapshot→App::snapshot_watch, ahead of follow-upswhere executors pin per-poll
Snapshottokens distinct from the watch.This PR is purely additive: nothing consumes the new surface yet.
Tests
Unit tests in
server/snapshot.rs(no DB required):test_resolve_authorization— the three-way classification, including thetemporal-skew boundary.
test_spec_capabilities— insta snapshots of capability rendering againstSnapshot::build_fixture.test_taken_after_allows_for_temporal_skew.Stack