chadtmiller.com/group-host
atmosphere group host
A group takes a handle on a domain of its own, and its address back
MergedThis adds checkGroupHandle and updateGroupHandle, a separate address table, and HANDLE_RESOLVERS. It also folds in the lifecycle race fix and the putRule test. The order of steps (PLC update, then store, then #identity) is sound. The unique account.handle column does back the "taken meanwhile" comment. Docs and config reference are updated. I found nothing that blocks the merge, but two things are worth fixing.
- No backfill for the new table. The migration creates
addressempty and onlyinsert_accountfills it. Any group made before this migration has no row. For such a group,configurablehitsexpect("a group has an address")and panics.getGroupandlistGroupsshowaddress: null. If any host already holds groups, addINSERT INTO address SELECT did, handle FROM accountto the migration. If none can exist yet, say so in the pull. - Outbound lookups on a caller's input.
resolve_handlefetches{scheme}://{handle}/.well-known/atproto-didfor a handle chosen by a configurer. The domain may point at an internal address.- Reqwest follows redirects by default and
.text()reads the whole body. Only theLOOKUPtimeout bounds the request, so a hostile host can stream a large body within it. - The resolver-service request has no timeout at all.
- Consider limiting the body size, disabling redirects, and applying
LOOKUPto the service call as well. This is not blocking, sincegroup.configureis required.
Minor: the delete_group doc comment now has one very long line.
crates/group-host/src/group_handle.rsline 48Outdated
These lines can no longer be read.
Panics for an account with no address row. The migration doesn't backfill existing accounts.
crates/group-host/src/identity.rsline 122Outdated
These lines can no longer be read.
The service call has no timeout, unlike the well-known one. Also, .text() and .json() read unbounded bodies, and redirects are followed.
What changes
A group takes a handle on a domain of its own, and its address back.
fyi.opensocial.checkGroupHandle(needsgroup.configure) answers whether a domain is ready and which DID it names now. It changes nothing.fyi.opensocial.updateGroupHandle(needsgroup.configure) takes the handle, in this order:did:plcgets an update signed with the host's rotation key. This is refused withNotControlleronce the host holds no rotation key for the group, or its DID is ended.#identityevent.@.HANDLE_DOMAINa group may take only its own address, otherwiseUnsupportedDomain.HandleNotAvailable.NotPointing.A group's address is kept apart from its handle, in a new
addresstable written when an account is made. It's where its site is served, and it never changes here.getGroupandlistGroupsshow it asaddress.HANDLE_RESOLVERS(new) says how a handle is resolved, each way tried in turn:well-known:<scheme>: the domain's own/.well-known/atproto-did;com.atproto.identity.resolveHandle, which reads its DNS record.The default is
well-known:https,https://public.api.bsky.app, the same as knotless'sKNOTLESS_HANDLE_RESOLVER.From the lifecycle pull's review:
deactivateGroupandactivateGroupnow let the store's answer decide. A switch that raced another getsAlreadyDeactivatedorNotDeactivated, not{}.deleteGroup's comment says syncers are told first. Also a test thatputRulerefuses a key likea/b, from the config pull's review.Why
This is the next part of 4d, following the prototype's
methods/handle.ts. Handles are resolved as knotless resolves them (identity.rs'sresolve_handle), rather than by DNS from the host: a well-known lookup, then a resolver service.NotPlcis listed in the lexicon but never returned, because every group made here is adid:plc.How it was checked
tests/group_handle.rsruns a host whose resolvers arewell-known:http(which finds nothing under.test, covering its failure) and then a stub resolving service. It covers:@and case normalised.#identityevent;getGroupkeeping the address;tests/config.rscoversHANDLE_RESOLVERS.just covis at 100% of lines and functions. Clippy is clean.Shortcomings
/.well-known/atproto-didlookup, because a handle's domain can't be served locally. The lookup is one chain, and its failure is tested.🤖 Generated with Claude Code