chadtmiller.com/group-host
atmosphere group host
Permission sets, limits and shapes are the opensocial proposal's
MergedThis pull adds four permission sets (manageMembers, manageSpaces, moderate, participate). It moves membership roles to bare ids read through rbac::roles_of, and it adds invite to requestJoin along with the new status, membership and request answers. It also raises the message and image limits, and renames defs#joinRequestView to defs#joinRequest. I found no bugs, and I read only part of it.
What I read and found sound:
oauth_scope.rs:SETS,needs,set_ofandscopes_of. A set is kept only when the roles hold every action it needs,participateis never kept, and a non-setinclude:is not made concrete.request_joiningroup_join.rs. A named invite that is not the caller's live one from this group failsInvalidInvite, and an unnamed live invite still redeems. Theexpectafteraskis safe because the row was just written.- A repo search of
"role"on the branch turned up no remaining reader of a membership's[{role}]objects: the writes ingroup.rsandput_membership, the reads ingroup_config.rs,group_members.rsandgroup.rs, and the new tests all use bare ids. NoInviteRequiredis left either. lexicons/fyi/opensocial/manageMembers.json,moderate.jsonandrequestJoin.json, which match the description.
I did not read the other test files, the other lexicon changes, docs/design/* and harness/lexicons.mjs, the other source files, or the web changes. I have not seen the checks run.
The shortcomings you list are real. Memberships stored before this read as holding no roles, so any existing group would lose its admins until they are rewritten. Since nothing is released yet this is acceptable, but a migration should come before any real data is held.
Since my approval at 1baab65, the only change is the merge of main into the branch. It had conflicts in group.rs, group_api.rs, oauth_scope.rs, rbac.rs, tests/oauth_scope.rs and harness/lexicons.mjs. I read the merged oauth_scope.rs in full. It is coherent: SETS, needs, set_of and scopes_of are as before. In narrow, a set is kept only when held (from actions_for) contains every action it needs. Sets count as writes for the blob: rule, and concrete expands each set into its scopes. I also searched "role" across crates/ at the head. The remaining hits are the API's object-shaped inputs and views (listed, objects) and the role and grant records. None reads a stored membership's [{role}] objects.
I did not read the resolved conflicts in the other files line by line: group.rs, group_api.rs, rbac.rs, tests/oauth_scope.rs and harness/lexicons.mjs. At this head, check (fmt and clippy) and docs pass. test, web and lexicons are still queued, and e2e is running. They are the check on those conflict resolutions, so look at them before you merge.
My earlier note about migrating stored memberships still stands. It does not block this pull.
Since my approval at 40c8763, the only change is the merge of main into the branch. It also edits participate to list fyi.opensocial.createReport, which the shortcomings section had left for the moderation pull. I read lexicons/fyi/opensocial/participate.json at this head. createReport.json now exists on the branch, so the new lxm entry resolves, and the set's detail already mentions reporting. The PR body's shortcoming about participate having no report method is out of date now. Update or remove it.
I did not read the rest of the merge, which is main's own changes. At this head, check, docs, lexicons, web and e2e pass. test is still running, so look at it before you merge. My earlier note about migrating stored [{role}] memberships still stands and does not block this pull.
What changes
Permission sets. Beside
fyi.opensocial.configure, which stays, the host has the proposal's other four:manageMembers,manageSpaces,moderateandparticipate, each listing what the proposal's does in this host's NSIDs (moderate's labels are this host'sfyi.opensocial.label;manageMembersalso listsadmitMember,assignRoles,ejectMember,createInvite,listInvitesandrevokeInvite, which are how this host does what writing a membership or an invite does there;participatelistsrequestJoin,cancelJoinRequest,getJoinRequest,leaveGroup,getActorInvitesanddeclineInvite). At approval a set is kept when the member's roles hold every action it covers:configureforgroup.configure;manageMembersforadmit,eject,role.assignandinvite;manageSpacesforspace.configure;moderateformod.read,mod.resolveandlabel.participateis for a person's own session and is never kept for a group's. A kept set is made concrete from its lexicon asconfigurewas: a space scope per space permission, anrpc:scope per method. The approval page shows each set asked for in its lexicon'sdetail.configure'sdetailis the proposal's.Shapes.
defs#joinPolicy(open,approval,invite) is referenced fromprofile,createGroupandupdateProfile; thefyi.opensocial.profile#…andrequestforms are gone, andjoin_policytakes the three words only.defs#roleIdis a role's record key, and a membership'srolesare those ids (["member", "admin"], at most 100), read withrbac::roles_of.defs#joinRequestViewis nowdefs#joinRequest, the proposal's:member, notdid, and noinvite;listJoinRequests,getJoinRequest,getGroupandviewerStateanswer it.requestJoin. It takes
invite, an invite's at-uri: one that is not the caller's live invite from this group failsInvalidInvite, and one that is redeems. Unnamed, a live invite still redeems, as before. It answersstatus, withmembership(the strong ref of the membership written) when admitted, orrequestwhen pending.InviteRequiredis nowJoinClosed.Limits. An invite's and a join request's
messageare 2,000 graphemes / 20,000 bytes (createInvite,invite,requestJoin,defs#joinRequest). A profile's avatar and banner are 2,000,000 bytes (profile,updateProfile), and so isuploadImage's cap.The console reads
memberfor a join request and the plain join policy words.Why
The host follows the opensocial proposal's records, methods and flows in its own
fyi.opensocial.*namespace, so that apps written to the proposal work with it. These are the proposal's permission sets, limits and smaller shapes.configurestays because the proposal keeps it, with the same collections.harness/lexicons.mjslets the retyped fields through by name inretracted, and the membership's bare role ids and their newmaxLengththroughasProposed, the one place the proposal's arrays of bare values are taken as they are.How it was checked
oauth_scope: each set is kept for roles holding all it covers and withheld otherwise (a role withadmit,ejectandrole.assignbut noinvitegets nomanageMembers);participateand a non-setinclude:are withheld; each set is made concrete into its space and rpc scopes.authorization: the approval page labelsconfigureandmoderatein their lexicons' words, and a token getsmoderate's rpc scopes.joiningandinvites: the membership strong ref when admitted, the request when pending,JoinClosed, a named invite redeemed, and two named wrongly refused; messages of 2,000 graphemes taken and 2,001 refused.group_config: a 2,000,000-byte picture uploaded and set on the profile, 2,000,001 refused; aprofile#invitejoin policy refused.cargo test --workspace, clippy, fmt,node harness/lexicons.mjs,node harness/docs.mjs,node harness/layers.mjsandnpm run checkinweb/, run here. e2e is left to CI.Shortcomings
configureis for. SomanageMembers,manageSpacesandmoderategive an app scopes that write nothing here yet. Writing memberships, invites, access records and labels as records, as the proposal does, is a later pull.participatedoes not list a report method. This host takes reports atcom.atproto.moderation.createReport, which a set of ours cannot name. The moderation pull can addfyi.opensocial.createReportonce it exists.[{role}]objects, reads as holding no roles. Nothing here rewrites stored memberships.scopesandassignableare still lists of objects. The proposal'sgroupGranthas bare values, and moving it to them goes with the access record's change.Review
Start at
oauth_scope.rs(SETS,set_of,scopes_of) andgroup_join.rs(request_join).🤖 Generated with Claude Code