chadtmiller.com/group-host
atmosphere group host
A space read's bad signature is BadSpaceSignature, and a wrong audience a 401
MergedThis pull makes space_api::credential return 401 BadSpaceSignature for a failed signature, and for an audience header that is missing or not a DID. That DID check now runs before the signature check. An audience that is a DID but isn't the repo being read now gets 401 BadSpaceAudience. That check runs only after the signature and the revocation check pass. The ordering and status codes match what the description says the reference PDS does. I could not check that against @atproto/pds. The atproto 0.3.1 bump and the Cargo.lock change are consistent with it. The test covers each case, including the signed-for-another-repo case, which the old test did not. I did not run the tests or read the checks. I found nothing that needs changing.
7 passed
A space credential's request with a failed signature now gets 401
BadSpaceSignature, the spaces alpha's name for it; we answeredBadSignature. A request signed for another repo now gets 401BadSpaceAudiencerather than a 400. The audience and signature are also checked in the order the reference PDS uses.Claude Opus 5.5 · high effort
What changes
The signature's error name. The fix is in atproto 0.3.1 (knotless.dev/chadtmiller.com/atproto, pull at://did:plc:bcgltzqazw5tb6k2g3ttenbj/dev.knotless.pull/3n33xfty5rw2v):
space_auth::sign_requestandverify_requestnow refuse withBadSpaceSignature. This workspace now requires0.3.1.The audience.
space_api::credentialnow checks the audience the same way as@atproto/pds'sspaceCredentialAuthandassertCredentialSpace:atproto-space-audienceheader that is missing or not a DID gets 401BadSpaceSignature. This is checked before the signature.BadSpaceAudience. This is checked once the signature holds and the credential isn't revoked.BadSpaceAudience, and the audience was compared before the signature was checked.Why
In
@atproto/space(0.0.0-spaces-alpha-20261113224550, and every alpha since 20261022),SpaceSignatureErrorhascode = 'BadSpaceSignature'.@atproto/pdsauth-verifier.jsanswers it as a 401 under that name, andapi/com/atproto/space/util.jsthrowsBadSpaceAudienceas anAuthRequiredError(401). A client that tells these refusals apart by name got names and statuses no other host gives.How it was checked
just t -p group-host --test spacespasses, 14 tests.reads_only_with_a_credential_the_authority_issuednow covers each case:Shortcomings
One more mismatch is left: a credential for another space of the same authority gets 401
BadJwtSubhere, because we passsubto the token check. The reference's PDS doesn't pass it; its handler answers 400InvalidCredential.