chadtmiller.com/monolith
An atproto PDS
OAuth: the authorization server, scopes on every method, and web, native and confidential clients
MergedThis pull adds atproto OAuth. That is the authorization server, OAuth access tokens with scopes on every XRPC method, and web, native and confidential clients. It comes with three new spec pages (OAUTH.md, OAUTH-SCOPES.md, OAUTH-CLIENTS.md), the vendored RFCs, server modules, and harness checks.
I did not read the whole 28k-line diff. I read the PDS.md, README.md and lib.rs changes, the Cargo manifests, the compare.mjs and env.mjs wiring, and oauth/clients/fetch.rs, oauth/dpop.rs and replay.rs. I did not read the rest of oauth.rs, scopes.rs, oauth/page.rs, oauth/client.rs or the other oauth/clients/* files, the harness check modules, or the spec pages. I also skipped the vendored RFC and atproto text, the lockfiles, and the changes to blobs.rs, compact.rs, log.rs, repo.rs, server.rs and sessions.rs. Their behaviour is not confirmed by my review.
What I found against .knotless/review.md:
- Spec and README: The new pages are linked from
spec/PDS.md. The new environment variable is listed there, and the README names the new pages and its OAuth gaps. No history or plans appear in what I read. - Dependencies: The new crates (
percent-encoding,serde,url) are general-purpose, not atproto or MCP crates. The harness gains@atproto/oauth-client-node, which is allowed for the harness. - Conformance:
harness/conformance.yamlis untouched, so there are no new excuses to check. - Code I read:
- The DPoP proof check follows the order and the nonce,
athandjtirules the pull describes. - Spent values are stored as SHA-256 digests and replayed from the log.
- The client-document fetch refuses redirects and non-public addresses (including IPv4-mapped IPv6, NAT64 and 6to4 forms), caps size and time, and keeps the development origin mapping behind an environment variable.
- The DPoP proof check follows the order and the nonce,
Two small points, neither blocking:
- The README
--limitssentence now ends a clause with "with password sessions and OAuth tokens," and the next line begins "then holds…". It reads as a fragment and could be reworded. - The
gatesrun on this head was still running when I looked, so the full harness results are not yet in.
atproto OAuth on the PDS: the authorization server, OAuth access tokens on every XRPC method with scopes, and web, native and confidential clients. Three slices, each specified by an agent that probed the reference, checked by a harness written from the spec, and built from the spec alone, then integrated on hardening and spaces.
Spec pages (new)
OAUTH.md, the authorization server:authorization_code,refresh_tokenwith rotation and reuse detection);OAUTH-SCOPES.md: which methods take an OAuth token, and whatatproto,transition:generic,transition:chat.bsky,transition:email, and the granularrepo:,blob:,rpc:,account:andidentity:scopes allow. Every method is in one table (METHODS), and a test holds the table to the router.space:scopes are noted for later: space methods refuse DPoP tokens for now.OAUTH-CLIENTS.md: client IDs (https documents, loopback for development), the client metadata document and its checks, native and web redirect rules, confidential clients withprivate_key_jwt(one-usejti, key rotation), silent sign-in (prompt=none), and the SSRF-safe document fetch.spec/rfc/.Where the server follows the specs rather than the reference. The reference:
state;state;token_endpoint_auth_signing_alg: none, andhttp:URIs on loopback.The pages list each of these with the spec text. The harness holds the server to the page and doesn't compare these with the reference. Clients rely on none of them.
Server:
oauth.rs(withoauth/clients),scopes.rs, andreplay.rs(single-use values: DPoPjtis, client-assertionjtis and codes, durable and compacted). The signing keyoauth.keyis created owner-only. OAuth calls pay their own rate limits (LIMITS.md, "OAuth access tokens").Harness
checks/oauth.mjs: the whole flow, driven through the authorization page's API on both sides, with every refusal compared, plus refresh, rotation, reuse and revocation.checks/oauth-scopes.mjs: OAuth tokens drawn into the random steps on every method, under random scopes.checks/oauth-clients.mjs: client documents served by a stub host.oauth-limits.mjs: inside--limits.Checked on this branch: plain seeds 1–3 (150–180 OAuth comparisons each),
--commands31, crash seed 21 with--firehose,--limits(OAuth checks included),--invites, the spaces run, andcargo test --workspace. The merge queue runs the full gates.🤖 Generated with Claude Code