chadtmiller.com/group-host
atmosphere group host
0
0
People sign in to the console as themselves, at their own PDS
Merged Approved
This pull signs people in to the console at their own PDS. The host acts as a confidential OAuth client, learns the person's DID, revokes the token at once, and sets a signed session cookie. caller now accepts that cookie when there is no Authorization header. I read every file in the diff and found nothing that blocks merging.
What I checked:
- Callback binding: the state-naming cookie, the
isscheck, PKCE, thesubcheck against the DID that started the sign-in, and the pinned public-address fetches for every outbound call are all sound. - Redirect target:
back_toonly lets local paths through. - Sign-out:
iat > atrefuses every cookie signed before a sign-out. - Fallback in
caller: it applies only whenAuthorizationis absent, so a bad service-auth header does not quietly fall back to a cookie. - Checks: all of them pass on this head.
Two small things, neither blocking:
- The cookie signature is compared with
!=on strings (console_login.rs:204). Comparing the MAC in constant time is cheap insurance. docs/reference/config.mdstill describesCONSOLE_URLonly as where/authorizelives. It is now also the console's OAuth client id and callback origin, and it decides whether cookies areSecure. AGENTS.md asks for that page to change with an environment variable's meaning.
crates/group-host/src/console_login.rsline 204Outdated
These lines can no longer be read.
This compares the MAC as plain strings, which is not constant time. Compare the decoded bytes with a constant-time equality instead.
Merged as ee0ba62
What changes
Signing in to the console (
console_login.rs). People sign in as themselves, at their own PDS. The host is a confidential OAuth client of it, as knotless-serve is of its accounts'. Its client id is<CONSOLE_URL>/console/client-metadata.json, and its ES256 key is derived from the host's secret.It asks for
atprotoalone. The console's methods act as the group, never as the person, so the host needs only to know who they are.The steps:
/console/loginresolves the person's handle or DID to their PDS and its authorization server, pushes the request with PKCE, DPoP, a client assertion and their handle as the hint, and sends the browser there to approve./console/callbackchecks the browser coming back is the one that started (a cookie naming the state) and that the answer is from that server, then exchanges the code. It checks the token'ssubis the person who started, revokes the token at once, and signs them in. The host keeps nothing of theirs./console/logoutsigns out, and refuses every cookie signed before.The session is a cookie the host signs, naming the person: HttpOnly, SameSite=Lax, and Secure on an https console, good for thirty days. Every method that asks who calls (
caller) now takes it beside service auth. Sign-ins under way are kept in SQLite for fifteen minutes; sign-outs by person.Reaching only public servers. Every server a handle leads to is reached only at a public address, as a client's metadata is. The pinned public fetch from the OAuth pull is now a shared client (
Host::pinned,Host::public_json).The console forwards
/console/*to the host, cookies and all (hooks.server.ts), and its header has a sign-in form (SignIn).atproto::josegainsjson_of.Also from the provisioning review:
signing-in.mdnow says what a provisioning that fails after the group is made leaves.Why
Step 7's first part, and step 6's last line in
docs/design/README.md: the console signs its people in at their own PDS, as a confidential client, as knotless does. It differs from knotless in keeping no session at the PDS. The console only needs to know who someone is, and a token it does not keep is one nobody can take from it.How it was checked
tests/console_login.rsruns against a fake PDS and authorization server, each of whose answers can be made wrong:createGroup, and a forged or unknown one refused;backoutside the console sent home;sub, a person not found, one with no PDS, an answer in a browser that did not start it;Local coverage is 100% of lines and functions. The web checks (svelte-check and the layers) pass.