go-sdk/auth
Repository files (latest commit first)
Filename Latest commit message Latest commit date
BorisTyshkevich d54751a8ee
auth: add AllowMissingExpiration option to RequireBearerTokenOptions (#971)
## Summary

- Add an `AllowMissingExpiration bool` field to
`RequireBearerTokenOptions` that opts the middleware out of the existing
`tokenInfo.Expiration.IsZero()` reject.
- Default false preserves the existing strict behaviour: every TokenInfo
must carry an Expiration.

## Motivation

Some IdPs emit session-bound bearer tokens that do not carry a
standalone `exp` claim — the token's lifetime is bounded by an external
session and is not advertised in-band. Resource servers integrating with
such IdPs today have to synthesise a fake Expiration from their
TokenVerifier callback (dishonest data through the auth layer) or fork
`RequireBearerToken` to bypass the check.

This option lets the verifier honestly report "no expiration in the
token" via a zero `Expiration` and have the middleware accept it — while
still applying the elapsed-validity check for tokens that DO carry an
Expiration.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: Guglielmo Colombo <guglielmoc@google.com>
2026-06-02 10:12:44 +02:00
..
extauth mcp: add optional issuer validator for pre-registered client validation (SEP-2352) (#946) 2026-05-29 12:46:34 +00:00
auth.go auth: add AllowMissingExpiration option to RequireBearerTokenOptions (#971) 2026-06-02 10:12:44 +02:00
auth_test.go auth: add AllowMissingExpiration option to RequireBearerTokenOptions (#971) 2026-06-02 10:12:44 +02:00
authorization_code.go mcp: add optional issuer validator for pre-registered client validation (SEP-2352) (#946) 2026-05-29 12:46:34 +00:00
authorization_code_test.go mcp: add optional issuer validator for pre-registered client validation (SEP-2352) (#946) 2026-05-29 12:46:34 +00:00
client.go Enterprise managed authorization (#770) 2026-03-30 16:29:30 +02:00
shared.go all: stabilize client OAuth support (#861) 2026-03-31 12:36:31 +02:00
shared_test.go all: stabilize client OAuth support (#861) 2026-03-31 12:36:31 +02:00