chadtmiller.com/group-host
atmosphere group host
0
0
The Apps page names apps by their metadata and says changes in words
Merged Approved
This names apps by their client metadata and serves their icons through the host at /img/app. It also says each change made as the group in words, and listGroupTokens gains optional client, space and description parts.
I read apps.rs, group_tokens.rs, permission_sets.rs, authorization.rs, group_spaces.rs, lib.rs and activity.ts in full. I did not open the harness, docs, screenshots, tests or the other Svelte, CSS and message files. I found nothing that must change.
- Icon check: the same-origin, https and no-userinfo/fragment rules,
Host::pinnedwith no redirect, the 256 KiB cap, and the magic-byte sniff with SVG never served all hold. The response headers (nosniff, a sandboxing CSP) are sound. write_offix: filtering the collection withis_nsidstopsspace at:spaceparsing as a write. The newspace_oflog words are handled apart from writes.- Open endpoint:
/img/app?id=is unauthenticated, and each newidmakes the host fetch that client's metadata.Logoscaches misses, but only up to 100 entries before it clears everything. A caller can therefore keep triggering outbound fetches by rotating ids. Pinned addresses and the size cap bound the harm. If you see abuse, consider a per-IP limit or a cap on in-flight fetches.
All checks have passed
8 passed, 1 skipped
Merged as cb4a8cd
What changes
Apps acting as the group. Each app is named by its client metadata: its
client_name, its icon (logo_uri), and the domain of its client ID beside the name (Grain next.grain.social), in place of a cut client ID (next.grain.social/oauth). Under the name, a line says what the app's scope lets it do. An app that writes gets "Can post and make changes as the group". An app that only reads gets what it reads and calls, for example "Can read the group's profile, members and pool, and see requests to join" for Grain's read-only client. Then comes who let it in: "Approved by @chadtmiller.com", "With an app password created by @bob.test", or "In the console, by …", each with when it was last used. Two clients of one app, as Grain has, are told apart by that line.App icons. The host reads an app's icon and serves it at
/img/app?id=<client ID>, which the console already proxies with/img/. The reader's browser never loads a third party's URL. The host fetches alogo_urionly when it is https (http only while the host itself is on http) on the client ID's own origin, with no userinfo or fragment. It fetches throughHost::pinned, which reaches public addresses only and follows no redirect. It keeps the icon only when the answer succeeds, is 256 KiB at most, and its bytes start as a PNG, JPEG, GIF or WebP. SVG is never served, and the server's Content-Type is not trusted. The host keeps what it read for 10 minutes, misses too, for up to 100 clients. It serves the icon withnosniff,default-src 'none'; sandboxandprivate, max-age=600, and anything else is a 404. An app without an icon, or one that fails to load, is drawn as its initial on a square (Avatar app).getAuthorization'sclient.logo(anduri) are now given only when they pass the same check, and the approval screen shows the icon beside "<app> wants to sign in as one of your groups".Changes made as the group. The third card was "What apps did as the group", but it also listed members' own changes from the console. It is now "Changes made as the group", with the intro "By apps, and by members in the console, newest first.", and every row says where its change came from: "Approved by @x" for an app, "App password created by @x" for an app password, and "In the console" for a member there.
changed a record of space at:space.write_ofsplitupdated space <uri>at its first/, so it parsed as a write of collectionspace at:space. Space log entries now come asspace: {space, operation, publicRead?}.updateSpacelogsopened space <uri>when it lets anyone read the space andclosed space <uri>when it stops that. On the meta space those read "@x made the group members-only" and "@x made the group visible to anyone". On any other space, the space is named by what the group keeps there, never by its URI: "the group's profile", "the group's members", "the group's pool".social.grain.actor.profile→ "Grain profile"), as "the group's …" for aselfrecord and "a/an …" otherwise. Under the sentence goes its lexicon'sdescription, where the host can resolve the lexicon:writeView.description, read over DNS-over-HTTPS as permission sets are, the two sharing one cached read of a lexicon.org.atgrp.internal.listGroupTokensgrows#clientView(sessionView.client,activityView.client),#spaceView(activityView.space) andwriteView.description, all optional.The pictures below the body, in order: the Apps tab before (main, with the test world's Darkroom in place of production's two Grain clients), the approval page before, then after: the Apps tab desktop light and phone dark, and the approval page desktop light and phone dark.
Why
People running a group couldn't tell what an app was, what it could do, or what a log line meant. The facts were on the host already (client metadata, the scope, the space and its policy, other apps' lexicons), so the host now hands them over in parts and the console says them in words.
The icon is proxied rather than loaded from
logo_uri. The reference provider (@atproto/oauth-provider-ui,client-avatar.tsx) showslogo_urionly for clients its operator marks trusted, loads it in the browser underimg-src https:, and carries a TODO to proxy instead. This host has no trusted list. Proxying keeps the reader's browser from contacting an app's server, and lets the host check and cap what it serves.For the card's heading, I chose to retitle it over marking console rows alone. The card is the group's audit of what was done as it, and a member's change in the console is part of that.
How it was checked
tests/oauth_clients.rscovers a metadata client throughgetAuthorization,listGroupTokensand/img/app: every 404 case, the cache expiring and clearing, and unit tests of the origin check and the image sniffing.tests/proxy.rscovers lexicon descriptions over a fake DNS-over-HTTPS and PDS.tests/group_spaces.rscovers the opened, closed and updated log words. Tests now pointDNS_OVER_HTTPSat a closed port, so none reaches the internet.just ton these passes, and fmt, clippy,just lexandjust docsare clean.just covpasses the 100% gate for every group-host file. Locally it missed onlycrates/atgrp/src/lib.rs'saccount importlines, whose one test returns early on a PDS without the space alpha; CI runs it with the alpha.just lookdrew the Apps tab and the approval page for both apps, desktop light and phone dark, and a fresh agent critiqued them. I acted on its notes on "made by" (now "created by"), on "records", and on the card's title. Its notes on the approval page's layout are about what was there before.harness/oauth-app.mjs: Darkroom, with an icon, which writes its own profile for the group on sign-in, and Darkroom's read-only client, which has no icon. They also get a DNS-over-HTTPS of their own, so nothing asks the internet.apps:/…look lines open those apps. The e2eAppnow sharesOAuthClientwith them. The new seednightshift-oauthapproves both clients through the console and makes Night shift members-only.docs/guides/signing-in-as-a-group.mdhas a new section on approving an app, andjust shotsdrew its pictures again.docs/design/signing-in.mdanddocs/reference/api.mdsay the new route and fields.Shortcomings
updated space <uri>, which never said what changed. They read "@x changed who sees the group's profile", not "made the group members-only". New ones say which.Host::clientkeeps successes only). A hanging metadata server can add up to the 10 s outgoing timeout to the Apps page.client.urion the approval page is also given only on the client ID's origin. It is narrower than before, and keeps an app from showing another site as its home page.Review
The design of
listGroupTokens' new fields, thencrates/group-host/src/apps.rs(the icon check and proxy) andweb/src/lib/activity.ts(the sentences).