feat(server): inbound service-auth verification (proposal 0014) #125
Labels
No labels
breaking-change
bug
documentation
duplicate
enhancement
good first issue
help wanted
performance
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Grandiras/ATProto.NET#125
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Part of the v0.7.0 update cycle (wave 5). AT Protocol's model for app → service calls is inter-service JWTs, revised in April 2026 (proposal 0014). The SDK can mint them but has no general verifier: feed generators, labelers and AppViews built on
ATProtoNet.Serverhave nothing to plug in. The only verifier is Spaces-specific.Generator (
ServiceAuthGenerator)audisdid#serviceId(bare DIDs are deprecated): validate it and document it.issmust not carry a fragment.lxmis required for XRPC calls.kidheader (default#atproto).jti.Verifier
A general
ServiceAuthVerifierthat checks:{did#svc, did}during the transition);lxmbound to the NSID being called;kidallow-list (default#atproto);isswithout a fragment;exp/iatwith clock skew;jtirequired and replay-checked.It verifies against a cached identity and refetches once on signature failure.
Generalize
ISpaceReplayStoreinto a JTI replay store with the in-memory and EF implementations.ASP.NET Core: an
AddAtProtoServiceAuth(...)authentication scheme (claimsdid,lxm,aud) and integration with the XRPC endpoint hosting, solxmis checked against the endpoint's NSID automatically.Rebuild the Spaces service-auth verifier on it. Fix the wrong "jti is optional" comment and accept the
audforms Spaces needs.Docs: a "Serving XRPC to other services" section.
The old PDS-token-forwarding bearer handler is removed by the Server restructure issue; this issue provides its replacement.
CHANGELOG
Added(the verifier and scheme),Changed/Breaking changes(generator validation, stricter verifier defaults).From #118 (pre-existing, found while refactoring the primitives): a JWT whose
exporiatfalls outside years 1–9999 throwsArgumentOutOfRangeException(fromDateTimeOffset.FromUnixTimeSeconds) insideSpaceTokens.Parse, whereTryParsethen throws instead of returning false. The same happens inDPoPProofValidatorandSpaceServiceAuthVerifier. A crafted token therefore produces a 500 instead of a 401. It is not an auth bypass. The general service-auth verifier this issue builds must range-check the numeric claims and reject out-of-range values as a validation failure. Fix the three existing sites the same way (or in #133).