chadtmiller.com/group-host
atmosphere group host
Invites are records the group writes in the invitee's inbox
MergedThis pull moves invites onto the standard record writes. A group token for the invitee's inbox writes or deletes an fyi.opensocial.invite through write_invite, which keeps the old rules: invite held, no members, a future expiresAt, one invite per invitee, InviteNotFound on delete. The createInvite/revokeInvite methods are gone. The scope mapping, getGroupAuth for inboxes, the console helper and the assistant tools all line up with that. I read group_invites.rs, token_writes.rs, group_tokens.rs, oauth_scope.rs, rbac.rs, asGroup.ts and the console action. I did not read the tests, docs, lexicon JSON, CLI or MCP diffs.
One thing to keep in mind, which the body already flags. In write_invite the waiting_invite lookup and the member check happen before space_write takes its lock. Two concurrent writes with different keys could both see no waiting invite and both write. You say tests/invites.rs covers two writes at once, but I did not confirm that it exercises this interleaving or that the store's INVITE insert rejects the second one. If it doesn't, a follow-up to move the check under the lock would be worth it.
A small point: in inbox_scope, a raw space:fyi.opensocial.invites?… scope with no collection passes the all(...) check vacuously. This is harmless because write_invite only accepts the invite collection, but you may want to require the collection explicitly.
What changes
Invites are written as the group. An app invites someone by writing an
fyi.opensocial.inviterecord in the group's repo in their inbox (at://<invitee>/space/fyi.opensocial.invites/self) throughcom.atproto.space.createRecord,putRecordorapplyWrites(one write), with a session for the group, and takes it back withdeleteRecord. The host makes each such write ascreateInviteandrevokeInvitedid: the member who signed the app in must holdinviteat the time of the write; the invitee may not be a member (AlreadyMember);expiresAtmust be a datetime still to come; one invite per group and invitee, so writing again answers the one waiting unchanged, unless it is written at that one's key, which replaces it; deleting one not waiting isInviteNotFound. The host's list of invites keeps in step, the write is told to the invitee's PDS with the retry outbox, and a delete takes it out of the inbox and the list. An inbox holds invites alone, atself.Sessions for inboxes. The
inviteaction is now granted byspace:fyi.opensocial.invites?authority=*&collection=fyi.opensocial.invite(it wasrpc:…createInvite). At approval, a rawspace:fyi.opensocial.invites?…scope is kept for roles holdinginvitewhen it asks for invites alone, in anyone's inbox or one person's;include:fyi.opensocial.manageMembersalready carried the inbox permission.getGroupAuthalso takes someone's inbox as itsspace: for a member who may invite, a token scoped to writing invites there and nothing in the group's repo.Lexicons.
fyi.opensocial.createInviteandfyi.opensocial.revokeInviteare removed, and with them their methods inmanageMembers.fyi.opensocial.inviteandgetGroupAuthsay how they are written and used now.listInvites,getActorInvitesanddeclineInvitestay.Console, command, assistants. The console's "Invite someone" and "Take back" take a group token for the inbox and write as the group (
web/src/lib/asGroup.ts, a DPoP key made per action, the proof naming the host as its protected-resource metadata names it).opensocial membership inviteandseeddo the same in Rust. The MCP toolscreateInviteandrevokeInvitebecomesendInviteandtakeBackInvite, which make the write the member's own session for the inbox would, in process, logged under the assistant.Smaller.
now_millisandisomoved from the host intoatproto::time, for the command to write acreatedAt.Why
The opensocial proposal has the group author invites in its own repo through the standard CRUD methods with a group-DID session, deleting one to revoke it, so apps written to the proposal invite without methods of this host's. Nobody uses the host yet, so the methods go rather than staying beside the writes. Routing the inbox write to its own function, rather than the access-record path the group's own spaces take, keeps the invite rules (one per invitee, members refused, the host's list) where they were, and leaves the other record writes in
token_writes.rsuntouched.How it was checked
tests/invites.rs: each case the methods' tests held, now as record writes with a group token: written and told to the PDS, answered again, listed and paged, redeemed, refused (member, bad DID, bad or pastexpiresAt, long message, noinvite), taken back and not found, declined, lapsed and swept. New: the token's scope,ScopeMissingin another inbox, a non-invite record, an inbox not atself, two writes at once,applyWritesof one, a put that replaces, and a member who lostinvitesince the token.tests/oauth_scope.rs: the raw inbox scope kept and withheld;tests/rbac.rs: an inbox scope for other records grants nothing.tests/assistants.rsand the MCP crate's tests:sendInvite,takeBackInvite, their refusals and schemas.tests/interop.rs(an invite into an inbox on the reference PDS) and the command's tests, run here over the reference PDS.just e2ehere: inviting, now also taking back and inviting again; the app-password flow no longer expects no grants at all, since the console's own group token from inviting is listed.node harness/lexicons.mjs,node harness/docs.mjs,npm run check. The coverage gate is left to CI.Shortcomings
takeBackInvitenames the invitee, not the invite's URI.🤖 Generated with Claude Code