~ knotless Search/
↑↓ move↵ open⇧↵ all results
0
0

Permission sets, limits and shapes are the opensocial proposal's

Merged
Merged chadtmiller.com asked to merge into main from chadtmiller.com/group-host:proposal/shapes

What changes

Permission sets. Beside fyi.opensocial.configure, which stays, the host has the proposal's other four: manageMembers, manageSpaces, moderate and participate, each listing what the proposal's does in this host's NSIDs (moderate's labels are this host's fyi.opensocial.label; manageMembers also lists admitMember, assignRoles, ejectMember, createInvite, listInvites and revokeInvite, which are how this host does what writing a membership or an invite does there; participate lists requestJoin, cancelJoinRequest, getJoinRequest, leaveGroup, getActorInvites and declineInvite). At approval a set is kept when the member's roles hold every action it covers: configure for group.configure; manageMembers for admit, eject, role.assign and invite; manageSpaces for space.configure; moderate for mod.read, mod.resolve and label. participate is for a person's own session and is never kept for a group's. A kept set is made concrete from its lexicon as configure was: a space scope per space permission, an rpc: scope per method. The approval page shows each set asked for in its lexicon's detail. configure's detail is the proposal's.

Shapes. defs#joinPolicy (open, approval, invite) is referenced from profile, createGroup and updateProfile; the fyi.opensocial.profile#… and request forms are gone, and join_policy takes the three words only. defs#roleId is a role's record key, and a membership's roles are those ids (["member", "admin"], at most 100), read with rbac::roles_of. defs#joinRequestView is now defs#joinRequest, the proposal's: member, not did, and no invite; listJoinRequests, getJoinRequest, getGroup and viewerState answer it.

requestJoin. It takes invite, an invite's at-uri: one that is not the caller's live invite from this group fails InvalidInvite, and one that is redeems. Unnamed, a live invite still redeems, as before. It answers status, with membership (the strong ref of the membership written) when admitted, or request when pending. InviteRequired is now JoinClosed.

Limits. An invite's and a join request's message are 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 is uploadImage's cap.

The console reads member for 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.

configure stays because the proposal keeps it, with the same collections.

harness/lexicons.mjs lets the retyped fields through by name in retracted, and the membership's bare role ids and their new maxLength through asProposed, 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 with admit, eject and role.assign but no invite gets no manageMembers); participate and a non-set include: are withheld; each set is made concrete into its space and rpc scopes.
  • authorization: the approval page labels configure and moderate in their lexicons' words, and a token gets moderate's rpc scopes.
  • joining and invites: 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; a profile#invite join policy refused.
  • cargo test --workspace, clippy, fmt, node harness/lexicons.mjs, node harness/docs.mjs, node harness/layers.mjs and npm run check in web/, run here. e2e is left to CI.

Shortcomings

  • Of the four new sets, only what they name can be granted. A token calls none of the host's own methods, which take a member's service auth, and writes in the meta and members spaces only what configure is for. So manageMembers, manageSpaces and moderate give 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.
  • participate does not list a report method. This host takes reports at com.atproto.moderation.createReport, which a set of ours cannot name. The moderation pull can add fyi.opensocial.createReport once it exists.
  • A membership stored before this, with [{role}] objects, reads as holding no roles. Nothing here rewrites stored memberships.
  • The permissions record's scopes and assignable are still lists of objects. The proposal's groupGrant has 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) and group_join.rs (request_join).

🤖 Generated with Claude Code

Approved

This 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_of and scopes_of. A set is kept only when the roles hold every action it needs, participate is never kept, and a non-set include: is not made concrete.
  • request_join in group_join.rs. A named invite that is not the caller's live one from this group fails InvalidInvite, and an unnamed live invite still redeems. The expect after ask is 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 in group.rs and put_membership, the reads in group_config.rs, group_members.rs and group.rs, and the new tests all use bare ids. No InviteRequired is left either.
  • lexicons/fyi/opensocial/manageMembers.json, moderate.json and requestJoin.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.

Approved

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.

Approved

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.

Merged as e320d63