Skip to content

control-plane: Snapshot authorization model and retryable staleness error (1/7) - #3341

Open
bbartman wants to merge 2 commits into
masterfrom
bmb/2781-stack-1-snapshot-authz
Open

control-plane: Snapshot authorization model and retryable staleness error (1/7)#3341
bbartman wants to merge 2 commits into
masterfrom
bmb/2781-stack-1-snapshot-authz

Conversation

@bbartman

@bbartman bbartman commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

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: adds Error::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 after anyhow wrapping.
  • control-plane-api Snapshot authorization model (server/snapshot.rs):
    • Authorization enum (Authorized / Denied / Stale) with
      ok_or_stale(), which converts a provisional denial into the retryable
      error 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, allowing TEMPORAL_SKEW).
    • Snapshot::spec_capabilities() — in-process replacement for the
      SQL-computed spec_capabilities column, used to render "Available grants
      are:" error messages.
    • STALE_RETRY_WAKE, the re-poll interval used by later splits.
  • Rename App::snapshotApp::snapshot_watch, ahead of follow-ups
    where executors pin per-poll Snapshot tokens 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 the
    temporal-skew boundary.
  • test_spec_capabilities — insta snapshots of capability rendering against
    Snapshot::build_fixture.
  • test_taken_after_allows_for_temporal_skew.

Stack

  1. → this PR — Snapshot authorization model + retryable staleness error
  2. control-plane, agent: move catalog authorization in-process against a pinned Snapshot (2/7) #3342 — move authorization in-process against a pinned Snapshot
  3. agent: publications executor defers on stale authorization snapshots (3/7) #3343 — publications executor defers on stale snapshots
  4. agent: discovers executor authorizes data-planes via Snapshot and defers on staleness (4/7) #3344 — discovers executor authorizes via Snapshot and defers on staleness

…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
bbartman force-pushed the bmb/2781-stack-1-snapshot-authz branch from cf94b28 to 96ea0b5 Compare August 11, 2026 18:23
@bbartman bbartman changed the title control-plane: Snapshot authorization model and retryable staleness error (1/4) control-plane: Snapshot authorization model and retryable staleness error (1/7) Aug 12, 2026
@bbartman

Copy link
Copy Markdown
Contributor Author

Note that this combines what was previously two PRs #3155 and #3300

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