Commit 5ee0f15
committed
feat: add validateAccessJwt to cloudflare:workers
Adds a new validateAccessJwt() function that validates Cloudflare Access
JWTs against team-specific JWKs. The function throws AccessJwtError with
specific error codes on validation failure, making error handling explicit.
Key features:
- No external dependencies (uses WebCrypto APIs)
- Retry logic for JWKS fetch (3 attempts, 5s backoff on 5xx)
- Isolate-level JWKS caching (1 hour TTL)
- Team domain normalization (accepts both short and full forms)
- 60s clock skew tolerance for expiration1 parent 9a381cb commit 5ee0f15
File tree
7 files changed
+1250
-38
lines changed- src/cloudflare
- internal
- test/access-jwt
- types/defines
7 files changed
+1250
-38
lines changed
0 commit comments