Expand description
OAuth 2.0 for atproto (plan/oauth.md).
Built in slices; see each submodule’s own doc for what it covers and what
it deliberately does not. dpop is the RFC 9449 verifier side, and
scope is didbot-scope, the granular atproto scope grammar as a typed
value with containment and intersection — the substrate a ceiling is
expressed over, shared with every other program that computes one.
The authorization server itself — pushed authorization requests,
authorize, token, refresh rotation, client metadata — is sibling work
landing in sibling files under this module. Each of those endpoints holds a
dpop::DpopVerifier and calls dpop::DpopVerifier::verify once per
request.
Re-exports§
pub use didbot_scope as scope;
Modules§
- authorize
GET /oauth/authorize, the authorization response, and the ceiling.- browser
- Browser sessions: an account signs its own browser in, so the authorize
page can hand a code only to a browser signed in as the account a sign-in
names. See
plan/browser-binding.md. - client_
auth - Confidential clients:
private_key_jwtclient authentication. - client_
metadata - Fetching, validating, and caching OAuth client metadata documents.
- consent
- The consent seam.
- decision
- Decision records: what a pushed authorization request becomes, and what an agent answers.
- discovery
- Authorization server metadata:
GET /.well-known/oauth-authorization-server. Protected-resource metadata:GET /.well-known/oauth-protected-resource. - dpop
- DPoP proof verification (RFC 9449), the verifier side.
- dpop_
seam - The narrow interface every caller needs from DPoP verification (RFC 9449).
- error
- The error shape OAuth’s own endpoints use.
- par
- Pushed authorization requests (RFC 9126), and where a sign-in is decided.
- permission_
set - What an
include:scope grants: the permission set it names, resolved from the set’s lexicon authority and cached. - token
POST /oauth/token: authorization code exchange and refresh rotation.
Structs§
- OAuth
State - Every collaborator the OAuth authorization server routes need, bundled so
crate::routes::AuthStatecarries one field instead of a dozen.
Constants§
- DPOP_
NONCE_ 🔒TTL - How long a DPoP nonce is handed out before a fresh one replaces it.
- DPOP_
SKEW 🔒 - How far a DPoP proof’s
iatmay sit from this server’s own clock, either direction — and, perdpop::DpopVerifier::new’s own doc, also how long ajtiis retained in the replay cache, since the two are the same number for the reason named there. Matchestoken::ACCESS_TTL: a proof need only stay fresh for about as long as the token it mints or presents is good for.
Functions§
- client_
metadata_ http_ client - The client
OAuthState::defaultfetches client metadata documents with.