chadtmiller.com/monolith
An atproto PDS
OAuth permission sets, resolved, expanded and shown on consent
MergedThis adds OAuth permission sets. An include:<nsid> scope is resolved at PAR, on the authorization page, at the code grant and at refresh. Resolution goes from DNS or PDS_LEXICON_AUTHORITY_DID to the authority's DID document, then a proven getRecord. The grant is expanded to scope strings, which XRPC authorises against, and the consent page shows set rows.
I read sets.rs down to the tests, the proven_record code in pds-repo, the oauth.rs, page.rs, scope.rs and lib.rs changes, spec/OAUTH-PERMISSION-SETS.md and the README changes. They hold together:
- Spec to code: the code matches the spec's resolution steps, grant table and cache bounds.
- Proof check: the commit's DID, version and signature are checked, and every block is hashed to its CID.
- Refresh and code grant: both resolve before the lock is taken. A failure leaves the session's expansion as it was, or answers
invalid_requestat the code grant, as the spec says. - Crates and docs:
hickory-resolveris a DNS crate, not an atproto or MCP one. The README says what is built, not how. - Spec coverage: the new behaviour is in the spec, including the new outbound target and the departures from the reference, each given a reason.
I did not read these files, so I say nothing about them: harness/checks/permission-sets.mjs, harness/checks/pages.mjs, harness/lib/sets.mjs, harness/lib/processes.mjs, harness/lib/adapters.mjs, harness/lib/env.mjs, the other harness check changes, the web/ components, the spec pages OAUTH-PAGES.md, OAUTH-SCOPES.md, OPERATIONS.md and PDS.md, and Cargo.lock. They are too large to read in full here.
One small point: spec/OAUTH-PERMISSION-SETS.md says step 15 "refused every include: while sets were not served". That describes how the page came to be, which AGENTS.md keeps out of the spec. Drop the parenthetical when you next touch it.
The pull's head is now a rebase of the same commit onto a newer main. The pull is still one commit on top of 58c4669. The earlier diff from 188ed45 is mostly the base's changes, so I did not read it. I did not re-read the pull's own files either, so my earlier approval stands. My earlier request, to drop the "while sets were not served" parenthetical from spec/OAUTH-PERMISSION-SETS.md, is done: a search of the head finds no such text. I have nothing further.
The head is a rebase of the same commit onto a newer main. The pull is still one commit, now on top of af117b9, which brings the base's PDS_BIND_ADDRESS, agents-leave-gates and harness-adapters changes. The diff from my approved commit 615df28 is mostly those changes, and they are not the pull's. I did not read it, and I did not re-read the pull's own files. I have no new finding, and my earlier approval stands.
The head is a rebase of the same single commit onto a newer main. The base now includes the Dockerfile, the 0.1.0 version bump and the harness bad-starts fix. The diff from my approved commit b69ed5c is mostly those base changes, so I did not read it. I did not re-read the pull's own files either. I have no new finding, and my earlier approval stands.
OAuth permission sets: a client can ask for
include:<nsid>, and the server resolves the app's set, grants what it says and shows it on consent in the app's own words. Checked beside the reference, with sets published on a third PDS.Claude Opus 5.5 · high
What changes
Spec.
spec/OAUTH-PERMISSION-SETS.mdis new: how aninclude:token is read; how a set is resolved (_lexicon.<authority>in DNS, orPDS_LEXICON_AUTHORITY_DID), its record fetched bycom.atproto.sync.getRecordand its proof and document checked; the cache (stale after an hour, kept up to 90 days while its authority fails, failures for five minutes, 10000 sets, memory only); which permissions a set grants and the exact scope strings it expands to; and where it departs from the reference.OAUTH.mdgains PAR's step 15 (invalid_scopefor a set that does not resolve), the page'spermissionSets, and the token's scope: each include's grant in request order, then the other tokens, expanded again at refresh.OAUTH-PAGES.mdgains row 5, one per titled set: its title and detail (English, plain text, cut at 60 and 140 characters),From <authority>, or a sentence made from what it grants, each app named once (Add and remove posts and change profiles in flashes.blue; act as you on any service.); untitled sets join the data and services rows; Technical details lists each set's grant under its token.OAUTH-SCOPES.md,PDS.mdandOPERATIONS.md(outbound targetlexicon) follow.Harness.
harness/lib/sets.mjsholds eleven sets, from one granting every kind of permission to ones partly or wholly dropped, not a set, of the wrong id, malformed, or missing; a thirdTestPdssharing the PLC publishes them, and both servers are pointed at its DID.checks/permission-sets.mjscompares PAR's answers, the sign-in, the code and refresh grants'scope, and the writes and service calls a set's session may make.--pagesdraws clients asking for sets and holds the consent rows and the nested Technical details to the spec. The other implementations incompat.mjscannot be given a lexicon authority, so skip the area.Server and page.
crates/pds-server/src/oauth/sets.rsresolves, caches, grants and expands;pds-repogainsproven_record, a CAR checked from its signed commit down to the record. A session keeps its expansion, logged with it and with each refresh, and XRPC authorises against that alone. The page shows the set rows (web/src/lib/scopes.ts,Permission,PermissionList,TechnicalDetails).hickory-resolveris added for the TXT lookup.Why
Permission sets are how an app says, in its own words, what it asks for; without them an
include:was refused at PAR. Keeping to the reference where the harness compares (droppinginheritAudwith no audience, a case-sensitive namespace, no dedup,invalid_requestat the code grant) keeps clients written for it working here. Three departures are spec'd: an hour before a set is stale rather than five minutes, a 90-day limit on a stale one, and the proof checked even for a record the server holds itself.How it was checked
step 29 (seed 1): OAuth: PAR (sets) differs(reference 201, server 400invalid_scope), and--pagesat step 0.step 9 (seed 2): OAuth: token: code (sets) differs,atprotofirst on the server, last on the reference. Put back.compare.mjsseeds 1 to 5 at 300 steps, a 400-step crash run with the firehose,--pagesseeds 1 to 4 at 15 to 20 flows. Pages seed 4 found a long detail pushing six rows 17px past a phone; the detail's cut went from 280 to 140 characters, in the spec, harness and page.--pagesseed 1 at step 4 on the build before it (Quick notes).cargo test -p pds-server(321),-p pds-repo(18, with the proof's tampering cases), clippy, fmt,cargo deny; the DNS path against a stub DNS server in the tests.just gatesis left to the pull'sgatesworkflow.Shortcomings
From <authority>is an element of its own between heading and sentence; a set with only a non-Englishtitle:langis untitled; a set's clauses name collections in the order its grant's strings do; an audience is percent-encoded but for letters, digits,-_.!~*'(),:and/.Review
The design of the consent rows for sets (
OAUTH-PAGES.md, row 5), andsets.rs'sgrantagainst the spec's "As scope strings" table.