chadtmiller.com/group-host
atmosphere group host
0
0
The console shows who is signed in, approves apps, and is tested end to end
Merged Approved
This pull adds getViewer and getActorGroups to the host. It adds a signed-in header, a "Your groups" list and an /authorize approval page to the console. It also adds a Playwright end-to-end harness that runs the console against a real PDS and the host. I read all 31 files except the harness/e2e sources, the host tests and the docs pages, which I did not open. I found nothing that must change.
get_actor_groups: The "only groups the caller is also in" filter applies to every actor, and for the caller's own DID it returns all of their groups. Paging is stable: groups are sorted by DID and the cursor is the last DID on the page. The name and picture appear only when the viewer can read the access record.get_viewer: It returns{}for no one, and a failed DID-document lookup only drops the handle.- Console changes: The
handleFetchfix buffers the body before forwarding it. The approve and decline forms keeprequest_uriin their address.BackToAppsends the browser on to the app, and its link works without script. The redirect URL comes from the host's own answer, so I saw no open-redirect problem. - Not verified:
harness/pds.mjsnow runsopensslandtls.setDefaultCACertificates(Node 24.5 or later) as soon as it loads, for every user of that file. If thetestworkflow also uses it, its image needsopenssl. That is fine onrust:1.98if it is the full image. Watch the firsttestande2eruns for it.
All checks were still queued when I read the pull, so none had a result, including the new e2e check.
Merged as 9294a06
What changes
Who is looking, and their groups (
actors.rs).getViewer, as knotless's: who is asking, by the console's cookie or service auth, with the handle their DID document names and whether the host lets them start a group;{}for no one. The console can't read the host's signed cookie itself, so only the host can say whom it names.getActorGroups: the groups someone is in, every one of the caller's own and of anyone else's only those the caller is in too, a page at a time by DID, each with its handle, address, member count, and the name and picture the caller may read.The console's pages.
/authorize, where the host sends an app's browser, shows the app's request: for each group the person may sign it in as, what it would get and what it would not, then approve or decline. Signed out, it asks them to sign in first, and comes back. A request answered or lapsed says so.The console end to end (
harness/e2e,just e2e, thee2echeck), as knotless's harness does its pages. Setup runs the reference PDS, the host over it, and the built console behind an https front atconsole.group-host.internal(harness/tls-proxy.mjs, knotless's), since the PDS reaches an OAuth client only over https at a hostname;harness/pds.mjsmakes that name's certificate and resolves it. A group of alice's is made with service auth from her PDS.The flows, in Chromium:
/oauth/authorizeand the console's/authorize; then its code exchanged, and a post written as the group and read back from the host.What the flows found in the console, each fixed here:
redirect_external_not_allowed).BackToApp), with a link without its script.request_uri, and then found the request answered: the forms keep it in their address, and an answered request is the page's to say.Why
Step 7's next part, and the first test of the console with a real PDS and browser, which the unit tests could not be: the sign-in at a person's own PDS and an app's approval only work end to end. Four of the five bugs above would have stopped every real approval.
How it was checked
tests/actors.rs:getViewerfor no one, someone, and a host that would not let them start a group;getActorGroupsfor oneself, for another (only shared groups), a profile one may not read, pages, an unknown handle, no auth, and a group's picture.just e2e: six flows, passing locally in nine seconds.e2eworkflow is new: Chromium and its libraries cached as knotless's are, gated on the console, the host, the lexicons and the harness. Its first run is this pull's.Shortcomings