chadtmiller.com/group-host
atmosphere group host
An app signed in as a group calls the host's methods and reads its spaces
MergedThis pull lets a group-signed app call the host's moderation and join methods under rpc: scopes. It also adds getDelegationToken for reading the group's spaces. Whatever a grant buys (delegation tokens, credentials, sync registrations) is tied to the grant and ended with it.
What I read: I read authority.rs, authority_api.rs, group_api.rs, group_spaces.rs, group_tokens.rs, group_members.rs, token_writes.rs, oauth_scope.rs and store.rs, with the callers of end_grant_reads and revoke_token. I did not read the web console, the docs or the MCP crate.
What holds up:
doingre-checks the group,rpc:lxmand the member's action on every call.getDelegationTokenrequires the session's space read scope and the member's current read.authorize_space_syncre-asksgrant_readsfor any delegation a grant was given.- Every place a grant or a member's read ends calls
end_grant_reads: revoke, the/oauthrevoke, member cut-off, app-password revoke, members-space writes and policy updates.
Minor, not blocking: grant_reads finds the grant with grant_by_id, which doesn't check expires_at. A grant whose refresh token has lapsed, with no revoke, can still buy a credential from a delegation token already issued, until that token expires. No event ends it earlier. Exposure is bounded by the short token lifetime, but "while the grant lasts" would be exact if grant_reads also compared expires_at with the current time.
The CI checks for test, check, web and e2e hadn't finished when I looked, so the 100% coverage gate is unconfirmed.
crates/group-host/src/authority.rsline 569
return Ok(false); | |
}; | |
self.may(uri, space, Some(&grant.member), Access::Read) | |
} |
grant_by_id returns the row even when the grant's expires_at has passed (it is only deleted on revoke), so a lapsed grant still reads here until its delegation token expires. Consider also checking grant.expires_at > now().
The changes since my approval at 8550b247 are only formatting in web/src/lib/permissions.ts, regenerated doc screenshots, and one consent-text line in apps-revoke-access.txt. That line now reads "…and what it reads of the group's spaces stops now", which matches the revoke behavior.
The readsOnly rewrite is a re-indentation of the same sort and map. The logic and messages are unchanged. I didn't look at the CI checks this round.
My earlier note was that grant_reads doesn't compare the grant's expires_at with the current time. This diff doesn't touch it. It was not blocking and still isn't.
My approval stands.
8 passed, 1 skipped
An app signed in as a group now calls the host's own methods with
rpc:permissions, and reads the group's spaces through a delegation token the group signs. What its grant bought (credentials, sync registrations) ends with the grant, or when its member stops reading. The short-lived installed-apps methods are taken back out, and the consent page says plainly what a reading app reads and calls.Claude Opus 5.5 · high effort
What changes
Group sessions call the host's methods. Approval keeps
rpc:org.atgrp.listJoinRequests,denyJoinRequest,listModSubjects,getModSubjectHistoryandresolveModSubject(aud this host or*) for a member whose roles hold the action. The methods take the session's DPoP token and ask the member's roles again at each call./oauth/tokennames the member who approved the grant (member).Reading spaces as the group.
com.atproto.space.getDelegationTokenanswers a group session as a PDS answers its accounts' apps: a token the group signs for one of its spaces, which buys a credential fromauthorizeSpaceSync. The session's scope must read the space (ScopeMissing), and its member must read it at that moment (NotAuthorized).What a grant bought ends with it. Delegation tokens given to a grant, and the credentials and notify registrations they buy, are kept with it. A grant ending, or its member no longer reading a space after a members-space write or a policy change, revokes them (writers' PDSes told) and withdraws the registrations. What other grants bought stays.
Installed apps go.
org.atgrp.installApp,uninstallApp,listApps,admitMember,assignRole,ejectMember,createInvite,applyLabelandremoveRecordgo, with their lexicons, routes, docs and tests: the console,atgrpand MCP do these as writes of membership, invite and label records. A member stepping down tomemberis refused only asLastConfigurer, which now says so as a person reads it.Consent page. A grant that only reads says which spaces (profile and rules, members, roles and labels, a content space by type, meta and members first) and that it writes nothing. One calling the host's methods says what they do. Revoking an app says its reads stop too.
Also:
DID_WEB_HOSTSreads some did:webs' documents elsewhere, for test networks;harness/firehose.mjsand a test read the firehose as@atproto/syncdoes, authenticated and as a Jetstream.Why
The Atmosphere Groups proposal's shared application session reads meta, members and an app's own space through the group's session rather than an app identity of its own, so installed apps were the wrong shape. A grant's reads must not outlive the grant or its member's access.
How it was checked
just covat 100% lines and functions on the spaces alpha CI pins (GROUP_HOST_DEV_ENV). New tests cover approval keeping the rpc: methods, calls through a session including throughinclude:org.atgrp.authModerateand anaudnaming this host, delegation reads, and grants' reads ending on revoke and on losing read while another grant's credential and registration stay.include:arm of a session's rpc check (sets are expanded at approval). A failure ending a revoked grant's reads is logged at info with the rest of the revoke.rpc:org.atgrp.listJoinRequests, calling it, and revoking it.Shortcomings
Review
authority.rs(end_grant_reads),group_api.rs(doing), andtests/tokens.rs.