chadtmiller.com/monolith
An atproto PDS
Permission sets grant space permissions, as the spaces alpha does
MergedThis pull lets permission sets grant space permissions, as spaces/proposal.md ("Permission sets") and the pinned alpha allow. Each part is in place:
- Spec.
OAUTH-PERMISSION-SETS.mdcovers what is kept, what is dropped, how it is written and how it is rewritten in the expansion.OAUTH-SCOPES.mdcovers the sets' space types, and the departure from the released reference is listed. - Harness. The spaces-run cases compare PAR, the page, the token's
scopeand every space method with the alpha. The dropped set tests each reason on its own. - Server.
sets.rskeeps a permission using the sameparams("space")table aspace:token is parsed by, and writes it throughSpacePermission::new/to_scope. Space types are now counted from the expanded grant, so the page and the code grant resolve a set's declarations. - Other files. There is a changeset, and
docs/guide/comparing.mdis updated.
space_grants agrees with the spec's table rows. The pages check now chooses its "Asks for nothing" sentence from the whole grant, not from the tables. That matches OAUTH-PAGES.md, which saves that sentence for a set that grants nothing, so it fixes the check rather than loosening it. In the main runs no set grants a space permission, so nothing changes there.
I found nothing that needs changing. Two notes:
- No gate results yet. No runs are reported for this head, so I couldn't see the gates pass.
- Files I may have missed. The full diff was too long to read in one piece, and I couldn't get its list of files. I found the files by name instead and read 11:
.changeset/set-space-permissions.md,oauth/page.rs,oauth/sets.rs,oauth/space_scope.rs,spec/OAUTH-PERMISSION-SETS.md,spec/OAUTH-SCOPES.md,harness/spaces/scopes.mjs,harness/lib/sets.mjs,harness/checks/pages.mjs,web/src/lib/scopes.ts,web/src/lib/molecules/Grant.svelteanddocs/guide/comparing.md. If the pull changes any file beyond these, I haven't reviewed it.
I approved this pull at d07e8d3. The only commit since then is a merge of main (49996df, the consent pull, squashed). I read the pull's own diff as it stands now, from main to 8fa5c24. It changes the same files as the round I approved: the changeset, oauth/page.rs, scope.rs, sets.rs, space_scope.rs, docs/guide/comparing.md, harness/checks/pages.mjs, harness/lib/sets.mjs, harness/spaces/scopes.mjs, both spec pages, Grant.svelte and web/src/lib/scopes.ts. The merge brought in nothing of its own and lost nothing.
What I approved still holds:
- Server. A set's
spacepermissions are kept by the sameparams("space")table aspace:token is parsed by, with the type inside the set's namespace and the collections anywhere. They are written throughSpacePermission::new/to_scope. - Space types.
space_typesnow counts the sets' types, so the page and the code grant resolve their declarations. - Spec and harness. Both match the server. The pages check's "Asks for nothing" sentence now depends on the whole grant, which fixes the check and doesn't loosen it.
There's nothing new to ask for.
On the checks: gates fails at this head on its code step, only on cargo fmt --all --check. All the lines it flags are in crates/pds-server/src/oauth/sets.rs: the Cow::Owned extend in granted and the long json! lines in space_grants. Run cargo fmt and push. Because of that failure, the test, build and harness steps were skipped, so this head's unit tests and harness haven't been run by CI yet. The gate will show them once the formatting is fixed.
I approved this pull at 8fa5c24. The only change since then is cargo fmt in crates/pds-server/src/oauth/sets.rs. It rewraps the Cow::Owned extend in granted and the long json! lines in the space_grants and space-types tests. That is what my last review asked for, and it changes no behaviour. What I approved still stands.
On the checks at 60dfdc6: docs, citations and store-bench-small pass. gates was still running when I looked. Its test, build and harness steps have never run for this pull, because formatting stopped them before. Let them finish before merging, but I have nothing to ask for.
1 failed, 2 passed, 1 skipped
A permission set can now grant
spacepermissions, as the spaces proposal ("Permission sets") and the pinned spaces alpha allow. Before this, an app that asked for its space access through aninclude:got a token the space methods refused.Claude Opus 5.5 · high
What changes
Spec.
OAUTH-PERMISSION-SETS.md, "What a set grants": a set keeps aspacepermission whose fields are those ofOAUTH-SCOPES.md's "Which parse" table.spaceType,authorityandskeymust be strings;collection,actionandmanagenon-empty string arrays; every value one the table allows. ThespaceTypemust be under the set's namespace (*never is); the collections are not checked and may be*or anywhere. "As scope strings": such a permission is written as aspace:token is written again, with examples. "The token's scope": everyspace:string of the expansion is rewritten (a bare type gets its declared collections,selfbecomes the DID).OAUTH-SCOPES.md, "Space type declarations": the sets' types join those resolved for the page and the code grant. "Where the reference departs": the released reference drops these permissions; we follow the alpha.Harness. In
harness/spaces/scopes.mjs, the run's lexicon authority now publishes eight sets beside its declarations: a bare type, managing every authority, a key and actions, collections of another namespace and*, a type with no collections, a type with no document, a mix withrepoandrpc, and one whose permissions are each dropped for one reason. Eight sign-in cases ask for them. Each compares PAR, the page, the token'sscopeand every space method's answer with the alpha. Inharness/lib/sets.mjs,grantOfwritesspacepermissions. I checked it against the alpha's@atproto/oauth-scopeson 19 kept and dropped permissions: the same strings. The pages check's "grants nothing" sentence now depends on the whole grant.Server and pages. In
pds-server'soauth/sets.rs, the server keeps and writesspacepermissions, rewrites everyspace:string of the expansion, andspace_typescounts the sets' types for the page and the code grant.web/src/lib/scopes.tslists them under theinclude:in Technical details.Why
spec/spaces/proposal.md, "Permission sets", lets a set bundlespacepermissions, and the pinned alpha grants them. We dropped them, so a token was narrower than the one the alpha gives.How it was checked
--seed 1) fails on the server as it was, at the first set case: the alpha's token holdsspace:com.example.workspace?authority=…&collection=…, ours onlyatproto. With the namespace check on a set'sspaceTypeplanted away, it fails on the dropped set: the server letsorg.other.spacethrough and its page answersinvalid_scope.cargo test -p pds-server --lib -- oauth::sets oauth::space_scope oauth::scope: 10 pass, the newspace_grantsamong them.npm run checkandnpm run buildpass.Shortcomings
Details: they appear only in Technical details. A set granting nothing but space permissions shows the intro sentence with no table under it. A follow-up pull draws spaces on the consent page as the alpha does.