Skip to content

feat(secureservice): enforce admission tokens#683

Draft
ZanzyTHEbar wants to merge 4 commits into
anyproto:mainfrom
ZanzyTHEbar:federated-admission-enforcement
Draft

feat(secureservice): enforce admission tokens#683
ZanzyTHEbar wants to merge 4 commits into
anyproto:mainfrom
ZanzyTHEbar:federated-admission-enforcement

Conversation

@ZanzyTHEbar
Copy link
Copy Markdown

Summary

  • Add a provider-neutral inbound admission enforcement wrapper around credential checking.
  • Add public NewWithAdmissionVerifier wiring so callers can inject an AdmissionVerifier without package-private mutation.
  • Fail fast when admission is enabled by config without a verifier, until JWKS/config construction lands in a later stack slice.

Stack

Security

  • Admission remains disabled by default.
  • Required admission rejects missing tokens before invoking the verifier.
  • Denials map to existing invalid-credentials handshake behavior; no token or verifier details are sent to peers.
  • Network ID is only read when admission is enabled, preserving existing mock/runtime behavior for disabled deployments.

Validation

  • PASS: go test ./net/secureservice ./net/secureservice/handshake
  • PASS: go test ./... -run '^$'
  • PASS: go test ./net/transport/quic ./net/transport/webtransport ./net/transport/yamux
  • PASS: worktree review after public constructor fix found no findings.
  • KNOWN PRE-EXISTING FAIL: go test ./... still fails at net/rpc/limiter TestLimiter_Concurrent_Bursts with the same threshold instability observed before this stack.

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.
Add an additive handshake credentials field for provider-neutral admission tokens and propagate it through secureservice contexts. This only carries tokens for future admission enforcement; it does not validate tokens or change existing handshake behavior.
Add provider-neutral inbound admission enforcement by composing AdmissionVerifier with credential checking. Admission remains disabled by default, config-only enablement fails fast until verifier construction is wired, and callers can inject a verifier through NewWithAdmissionVerifier.
@ZanzyTHEbar
Copy link
Copy Markdown
Author

/oc please review this draft stacked PR, focusing on the delta after #682

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