chadtmiller.com/group-host
atmosphere group host
0
0
Apps sign in to a group with app passwords its members make
Merged Approved
This adds app passwords: a member who may do anything as the group makes one, and an app signs in with it through createSession, refreshSession and deleteSession. The sessions are Bearer JWTs that the host looks up by hash. I read all of app_passwords.rs, the store, scope, resource and write-path changes, and the migration. I did not read the tests, the docs or the lockfile, and I did not look at the checks.
I found nothing that must change.
- Only the SHA-256 of a password is stored, and it is unique.
standschecks the maker at every use, insession, in refresh and at sign-in.- Revoking a password, or a maker losing the role or leaving, ends its sessions.
- Refresh and
getSessiononly accept grants whose source isappPassword. - An OAuth token sent as Bearer is refused, and an app-password session fails the DPoP key check.
generic()widens only the repo and blob checks.may_repostill checks the member's current roles, so the scope grants no more than the member already has.- The publish check now takes per-action writes from the space role, as the earlier review asked.
Merged as 864817f
What changes
App passwords (
app_passwords.rs). An app that signs in with a handle and a password, as the Bluesky app does, signs in to a group with an app password.A group has no password, and an app password doesn't give it one. A member who may do anything as the group (every repo collection) makes one in the console with
createAppPassword, named for where it's used, and it stays theirs.listAppPasswordsshows every one to the group's configurers, and each maker their own.revokeAppPasswordtakes one away (its maker's own, or any for a configurer) and signs out every app signed in with it.Sessions.
com.atproto.server.createSessionsigns in with one, by the group's handle or DID.refreshSessiongives a new pair of tokens and ends the old.deleteSessionsigns out.A session is a grant like any other, listed among the group's with source
appPassword, and logged. Its tokens are bearer JWTs, as a PDS's are, because the Bluesky app reads when they lapse; the host still finds them by their hash. A lapsed access token is a 400ExpiredToken, the app's sign to refresh. Its scope isatproto transition:generic, which reaches the group's repo and blobs but never a space; a privileged one addstransition:chat.bsky. The resource side now takesBearerfor these sessions alone: an OAuth token sent as Bearer isInvalidToken.An app password works only while its maker could make it. The host asks at each use, sign-in and refresh. Once they couldn't (they lost the role, or left), every app password of theirs is forgotten and every session from one signed out.
From the sessions pull's review:
Why
Step 6's fourth part: the way in for apps without OAuth. Provisioning comes next, and closes the step.
What changed from the prototype:
exp.getSessionalready answered for a token (the token pull), so it serves app-password sessions too.How it was checked
tests/app_passwords.rs:@) or DID, and each wrong identifier or password;getSession, the session inlistGroupTokens, a privileged session's scope;tests/group_tokens.rsgainspublishes_only_as_the_role_may_write_in_the_space.tests/tokens.rschecks that an OAuth token sent as Bearer is refused.These port
appPasswords.test.ts. Every test passes here; CI runs the coverage gate.