Migrate revocation channel to SET delivery (RFC 8417/8935)#9
Conversation
|
@greptile |
Greptile SummaryThis PR migrates the provider-driven invalidation channel from OIDC Back-Channel Logout tokens to RFC 8417 Security Event Token push delivery (RFC 8935), touching the endpoint path, JWT
Confidence Score: 5/5Safe to merge — the migration is internally consistent and the previously missing events-claim validation is now correctly implemented. All seven changed layers (endpoint path, JWT typ, Content-Type, discovery field, response shape, events-claim dispatch, and error-code mapping) are updated in lock-step. The verifySecEventJwt path now validates iss, aud, jti, sub, and the events object before any state mutation, and the response codes match RFC 8935 §2.4. No sensitive fields are logged and no TLS validation is bypassed. No files require special attention; the two style notes are about code organization and an inline comment, neither of which affects correctness. Important Files Changed
|
|
@greptile |
Switch from logout-token to RFC 8417 Security Event Tokens delivered per
RFC 8935 push. The endpoint, discovery field, and grant field rename to
match what the channel is actually doing — delivering security events, not
just revocations.
Service side
- Rename agent_auth.revocation_uri → agent_auth.events_endpoint
- Rename /agent/auth/revoke → /agent/event/notify
- Receiver accepts application/secevent+jwt and the JWT typ "secevent+jwt"
- Success returns 202 Accepted (RFC 8935 §2.4); errors return
{ "err": "<code>", "description": "..." } with codes from §2.4
(invalid_request, invalid_key, invalid_issuer, invalid_audience,
authentication_failed)
- Rename verifyLogoutJwt → verifySecEventJwt
Provider side
- mintLogoutJwt → mintSecEventJwt (typ: secevent+jwt)
- Grant field revocation_uri → events_uri; create-grant body renamed
- Outbound POST sends Content-Type: application/secevent+jwt
Docs + demos
- Update both READMEs, AUTH.md, and both home.ts demos to describe SET
delivery, the new path, and the RFC 8935 response shape
verifySecEventJwt was collapsing every jose error into invalid_signature, which left the invalid_audience branch in mapSecEventError unreachable — providers got authentication_failed back on aud mismatch instead of the RFC 8935 §2.4 invalid_audience code. Mirror what verifyIdJag does and pick out expired and audience errors before the catch-all. Also extend the v0.2.0 changelog entry to describe the SET migration end-to-end (endpoint/discovery/typ/Content-Type/response-shape) and bump the release date to 2026-06-04. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Each PR in this stack ships as a separate merge to main, so each gets its own version. Move the SET migration items out of v0.2.0 and into a fresh v0.3.0 entry; restore v0.2.0 to the identity/credential-split scope it actually had. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
@greptile |
Aligning with the actual merge date. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Stack
Summary
Switch the provider-driven invalidation channel from a logout-token at
agent_auth.revocation_urito a Security Event Token (RFC 8417) delivered via push (RFC 8935) atagent_auth.events_endpoint. The discovery field, endpoint path, JWT typ, content-type, and response shape all switch together.agent_auth.revocation_uri→agent_auth.events_endpoint/agent/auth/revoke→/agent/event/notifylogout+jwt→secevent+jwt; Content-Type:application/logout+jwt→application/secevent+jwt{ "err": "<code>", "description": "..." }on failure with codes from §2.4 (invalid_request,invalid_key,invalid_issuer,invalid_audience,authentication_failed)mintLogoutJwt→mintSecEventJwt; grant input fieldrevocation_uri→events_uriThe top-level OAuth
revocation_endpoint(/oauth2/revoke, RFC 7009) is unrelated and stays as-is.