chadtmiller.com/group-host
atmosphere group host
0
0
The console signs in with one OAuth client on atproto-client 0.6
Merged Approved
This pull moves the console onto one atproto-client 0.6 OAuth client for console sign-ins and account moves. It also checks service auth with verify_any. I read the whole diff and the base AGENTS.md. I didn't read the checks or run the tests.
- Browser check: the callback compares the cookie to the returned
statebefore anything is redeemed. A sign-in arriving at the wrong callback is refused as one this browser didn't start, and a session it was granted is given back withdiscard. - Move session store:
KEEP_SESSIONinserts only while the account'saccount_moverow exists, and the store answersStoreError::Endedotherwise. TheINSERT … SELECT … WHERE … ON CONFLICTparses in SQLite and counts one row changed on both insert and update. - Finish and cancel: they forget the move before giving the session back, which closes the race the pull describes.
- Callback order: the move callback now does
keep_moveand the give-back of the previous account beforekeep. This also fixes a latent case where signing in again to the same account could have revoked the session just stored. - Service auth:
service_callerstill checks the method and the audience before any key is read, then callsverify_any. Each caller's audience rule moved into a closure and keeps its earlier meaning. - Other changes: the changeset, the
signing-in.mdupdate and the new tests are present, and theInvalidTokenchange matches the body.
Approved
Since my approval at a1de846, the pull only adds a test in spaces.rs. A Bearer nonsense token sent to notifyCredentialsRevoked must answer 401 with BadJwt. The test fits the verify_any change and doesn't touch the earlier findings. I did not run it. My earlier approval stands.
All checks have passed
9 passed
Merged as 4692a97
What changes
One OAuth client. The console signs people in, and signs in to accounts being moved here, with one
atproto-client0.6 client in place of two.authorizereturns the request'sstate, which the browser's cookie now holds, so the callback no longer peeks at the stored request. The callback takes the login unkept (callback_unkept), checks the route it came back to and, for a move, that its mover is still the one signed in; then a move's session is kept (keep) and a console sign-in's given back at once (discard). A sign-in coming back to the other callback is refused as one this browser did not start, approved or refused: a failed callback now carries itsapp_state, and the host's refusal reads the failure'scause.A move ended stays ended. The move session store keeps a session only while its account's move is kept, and answers
StoreError::Endedotherwise, so a move finished, cancelled or swept while its session was being refreshed is not brought back: the crate gives the refreshed tokens back, and the move answersNotFound. Finishing and cancelling now forget the move before giving its session back.Service auth by
verify_any.service_caller(the host's own methods,notifyRepoUpdate,notifyCredentialsRevoked) and the account-import token check withatproto_client::service_auth::verify_any, in place ofResolver::with_keyand a hand-read document, each for the audience it took before (this host's DID or any of its services; a space's authority or its host; a repo hosted here). Audience and method are judged before any key is read. An import token whose DID can't be resolved is nowInvalidToken, as one naming no key is, where it wasInvalidRequest.Docs.
signing-in.mdsays what the cookie holds now and that one client serves both.Why
Pull 2 worked around atproto-client 0.4/0.5: two clients, as a sign-in ended any session its client kept; the state carried in
app_statewith a store peek; noapp_stateon a refused callback; no way for a store to say a session ended. 0.5 and 0.6 add what each lacked.How it was checked
New tests: a console sign-in's state arriving at the move callback, approved and refused, is refused and keeps nothing; a move cancelled while its session refreshes answers
NotFound, and the refreshed tokens are revoked.account_move,console_login,groups,spacesandimportpass locally; the gate and e2e are left to CI.