Skip to content

feat(secureservice): add JWT admission verifier#681

Draft
ZanzyTHEbar wants to merge 2 commits into
anyproto:mainfrom
ZanzyTHEbar:federated-admission-jwt
Draft

feat(secureservice): add JWT admission verifier#681
ZanzyTHEbar wants to merge 2 commits into
anyproto:mainfrom
ZanzyTHEbar:federated-admission-jwt

Conversation

@ZanzyTHEbar

Copy link
Copy Markdown

Stack

This is the second PR in the federated admission stack and is intentionally marked draft until #680 lands.

  1. feat(secureservice): add admission primitives #680 adds provider-neutral admission primitives and config.
  2. This PR adds a static JWKS-backed JWT admission verifier behind that interface.

Please review this PR as the delta after #680.

Summary

  • Add a provider-neutral JWT AdmissionVerifier implementation backed by a static JWKS document.
  • Validate token signature, issuer, audience, expiry, network id, Anytype identity binding, subject, and required claims.
  • Support standard asymmetric JWT algorithms (RS256/384/512, ES256/384/512, EdDSA) without wiring the verifier into the handshake yet.

Security

  • No runtime authentication behavior changes in this PR.
  • No provider-specific logic or Authentik-specific assumptions.
  • Rejects unsigned/unsupported algorithms by construction.
  • Binds the JWT identity claim to the presented Anytype account identity to prevent token reuse with another identity.

Validation

  • PASS: go test ./net/secureservice
  • PASS: go test ./net/secureservice/handshake
  • PASS: go test ./... -run '^$'
  • KNOWN UNRELATED FAILURE: go test ./... fails in github.com/anyproto/any-sync/net/rpc/limiter at TestLimiter_Concurrent_Bursts; this was reproduced before this PR and still reproduces.

Introduce provider-neutral admission config and verifier types for future federated network admission support. The new config is disabled by default and does not change handshake behavior.
Add a static JWKS-backed AdmissionVerifier implementation for provider-neutral federated admission. The verifier validates token signature, issuer, audience, expiry, network id, Anytype identity binding, subject, and required claims without wiring it into the handshake yet.
@github-actions

github-actions Bot commented May 20, 2026

Copy link
Copy Markdown

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@ZanzyTHEbar

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

@ZanzyTHEbar

Copy link
Copy Markdown
Author

recheck

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant