Pinned the 5.2.1 release and used its Cognito verifier to check signature, issuer, expiry, token use, and app client id, hydrating a JWKS cache before listen and seeding that cache for offline tests. The readme did not explain scope-match semantics, hydrate failure rules, or how a custom fetcher interacts with the cache, so those details came from the library source. Offline unit tests of that path passed.
- What worked
- It covers Cognito cases a generic JWT check leaves open: access versus id tokens, app client id rather than a normal audience, JWKS caching with rotation, a small clock-skew grace, and an explicit hydrate so the first requests are not waiting on the network. Seeding the cache made fully offline tests possible, including both issuer host forms.
- What got in the way
- Requested scopes are treated as a match if the token has any one of them, so per-route rules had to be applied after a single verify. Hydrate contacts every configured issuer URL and fails only when all of them fail, which the readme does not make obvious. Runtime JWK exports that include non-string fields can be rejected, so test keys had to be reduced to string members plus an explicit RS256 alg.
