chadtmiller.com/group-host
atmosphere group host
A space's access record grants each role scopes there
MergedThis moves the space access record to the proposal's shape: grants per role, public, and an optional writableBy. createSpace, updateSpace and deleteSpace follow, as does everything that reads access.
I read the core logic and found nothing wrong. That covers rbac.rs (Access::of, reads, writes, can_read, can_write_own), oauth_scope.rs, group_spaces.rs and group.rs. Grants count only in the space their record is in, and public stays "signed in". The create path ends the space again if its access record fails to write. updateSpace still guards the members space (member must keep read, no writableBy), and deleteSpace now handles a space that isn't in the index.
I did not read the following files in this review:
- the other
srcfiles:actors.rs,authority.rs,authorization.rs,group_api.rs,group_tokens.rs,index_api.rs,token_writes.rs; - the tests;
- the lexicons and
harness/lexicons.mjs; - the docs;
- the console route.
On checks, check, lexicons, docs and e2e passed. test was still running and web still queued when I looked, so the 100% coverage gate and the Rust tests are unconfirmed. Make sure test passes before merging.
One thing to be aware of: access records already stored with readableBy or credentialScopes read as having no grants once this lands, so they would be unreadable by anyone but a public-less group. This is fine if no host holds such data yet, as the pull's framing implies.
What changes
The access record grants scopes.
fyi.opensocial.accesstakes the opensocial proposal's shape:grants, onefyi.opensocial.defs#spaceGranta role (its id and the OAuth scopes it holds in this space and no other), andpublic, in place ofreadableBy,writableBy's default,credentialScopesandcreatedAt. The host reads each grant's scopes as it reads a token's, against the space the record is in:readthere (space:<type>?action=read, or a scope naming no action) reads the space;readwrites there in their own name, where before any member could;credentialScopessaid, and may publish them in the public repo as before;publicis anyone signed in, never anyone at all: a credential still takes a signed-in user.A scope naming another type, key or authority grants nothing in the space.
What the proposal's shape cannot say is kept beside it.
writableBystays, optional, for a space where fewer write in their own name than read it (an announcements channel).people, a space for chosen people by DID, stays and is now in the lexicon. Itsreviewersare the roles grantedread.createSpacetakes and answers the proposal's shape. It takestype(wasspaceType),skey,access(fyi.opensocial.defs#accessConfig:grants,public, and this host'swritableBy) andindex(default true; false leaves the space out of the index). It answersspaceand strong references to the access record and, when indexed, the index entry. It refuses the meta and members types (ReservedSpace), a role the group has not (UnknownRole), a scope that is no space scope (InvalidScope), two grants of one role, and an access record no one but the group would read.groupandnamestay, as every method here names its group and the index entry keeps its name.updateSpaceanddeleteSpacefollow.updateSpacetakesaccess, replacing the record whole, in place of the three lists, with the same checks; the members space must still grantmemberread, and itswritableBystays unset. Meta's declaration followspublic.deleteSpacedeletes a space left out of the index too, and refuses meta and members withReservedSpace(wasWellKnownSpace).Everything that reads access follows. A new group's meta is
public(or grants each named roleread) and grantsadminspace:fyi.opensocial.meta?collection=fyi.opensocial.profile&collection=fyi.opensocial.rule; its members space grantsmemberspace:fyi.opensocial.members?action=read, as the proposal's example has it.getGroupshows a space'spublic,grants,peopleandwritableByto whoever reads it;listGroupslists a group whose meta ispublic. The authority, the index, tokens,getGroupAuthand the console's visibility setting read the grants. Moving a group needed nothing: it carries access records as records.docs/design/spaces.mdandgroups.mdsay what the access record is now.Why
The host follows the proposal's records and methods, so that apps written to it work here, in its own
fyi.opensocial.*namespace. The lexicon check lets the proposal's bare-string scopes, itstypefield name and its required fields through, each by its exact finding, and lists the removed fields whose names the code still quotes elsewhere.How it was checked
The rbac, group spaces, groups, tokens, group tokens, OAuth scope, index, moderation, group config, migration and interop tests pass with the new shape, with new cases for grants in another space, collections written by grant, a space left out of the index, the strong references
createSpaceanswers, and each refusal. Theopensocialcommand's tests, clippy,node harness/lexicons.mjs,node harness/docs.mjsand the console'snpm run checkpass. Coverage and e2e are left to CI.Shortcomings
updateSpace, not throughcom.atproto.space.*writes as the proposal has it, and neither checks that the writer grants only scopes and roles they hold (assignable): that belongs with permission sets and assignable roles.include:…) is refused asInvalidScope: the host expands no permission set in an access record yet.createSpaceis still asked as the member, withspace.create, not with a group-DID session holdingmanage=create.🤖 Generated with Claude Code