Expand description
OAuth 2.1 server state management.
Manages registered clients, pending authorization codes, refresh tokens, and delegates token issuance to PolicyService via ZMQ.
Structs§
- Authorize
Binding - Server-side state stashed between
authorize_getandauthorize_post, keyed by the consent nonce. Carries the complete resolved authorization request so hidden form fields never become mutable authority on POST. - OAuth
State - Shared OAuth server state.
- Pending
Auth Code - A pending authorization code awaiting token exchange.
- Pending
Device Code - A pending device authorization code (RFC 8628).
- Pending
External Auth - Pending external OIDC authentication flow.
- Pending
Federate Owner Link - Public
GitCanary Record - Pushed
Auth Request - A Pushed Authorization Request (RFC 9126) awaiting consumption.
- Refresh
Token Entry - A stored refresh token entry (OAuth 2.1 rotation).
- Registered
Client - A dynamically registered OAuth client (RFC 7591) or Client ID Metadata Document client.
- Ucan
Grant Refresh - Re-evaluation context persisted alongside a UCAN-grant refresh token so the
refresh path can re-present the grant to
evaluate_refresh(MAC #547 / B1 #673). Carrying the grant itself (not just an id) lets the gate chain re-check the ceiling against current state on every refresh.
Enums§
- Device
Code Status - Status of a pending device authorization code (RFC 8628).
- Scope
Error - Errors raised by
validate_requested_scopes. - Subject
DidError - Errors raised by
subject_did_for/OAuthState::subject_did.
Constants§
- ATPROTO_
SCOPE - The atproto transition scope name. Its presence in a granted scope set
activates the strict atproto OAuth profile (#1113 rev2): DPoP-mandatory,
DID subject,
token_type: DPoPresponse, scope enforcement.
Traits§
- Atproto
DidDocument Resolver - Read-only resolver used by the ATProto service-auth exchange perimeter.
Functions§
- atproto_
profile_ active - True when the granted scope set activates the atproto strict profile.
- canonical_
issuer_ origin - Canonicalize an issuer/external URL to an exact origin (scheme://host[:port])
with no trailing slash and no path (#1113 rev2 finding 5). Returns
Nonewhen the URL has no scheme or authority. - evaluate_
atproto_ eligibility - Evaluate atproto account eligibility from the account’s stored keys and profile (#1113 r5 / #1124 split). Free-function form so it is unit-testable without constructing an OAuthState or UserStore.
- normalize_
scope_ token - Normalize a single scope token. RFC 6749 §3.3 scope tokens are
1*(%x21 / %x23-5B / %x5D-7E)— no space, no", no control chars. ReturnsNonefor tokens that are empty or contain characters outside the allowed set. - subject_
did_ for - Validate that a subject is a real, resolvable atproto account DID (#1113 rev2 → #1124 split).
- validate_
requested_ scopes - Validate a requested scope set against the server-supported and (optionally) client-declared scopes (#1113 rev2 finding 4).