Class: RackJwtVerifier::KeySource::RemoteJwks
- Defined in:
- lib/rack_jwt_verifier/key_source.rb
Overview
A JSON Web Key Set served at a URL (typically /.well-known/jwks.json).
Constant Summary collapse
- CACHE_KEY_PREFIX =
"rack_jwt_verifier:jwks"
Constants inherited from Remote
RackJwtVerifier::KeySource::Remote::DEFAULT_CACHE_TTL, RackJwtVerifier::KeySource::Remote::DEFAULT_HTTP_TIMEOUT, RackJwtVerifier::KeySource::Remote::DEFAULT_REFETCH_INTERVAL, RackJwtVerifier::KeySource::Remote::MAX_RESPONSE_BYTES
Instance Attribute Summary
Attributes inherited from Remote
Instance Method Summary collapse
- #jwks? ⇒ Boolean
-
#jwks_loader ⇒ Object
ruby-jwt calls the loader once, and again with kid_not_found: true when the token's kid is absent from the set it got — the rotation signal for JWKS.
Methods inherited from Remote
Constructor Details
This class inherits a constructor from RackJwtVerifier::KeySource::Remote
Instance Method Details
#jwks? ⇒ Boolean
308 309 310 |
# File 'lib/rack_jwt_verifier/key_source.rb', line 308 def jwks? true end |
#jwks_loader ⇒ Object
ruby-jwt calls the loader once, and again with kid_not_found: true when the token's kid is absent from the set it got — the rotation signal for JWKS. Refresh (rate-limited) on that signal, then hand back the set.
315 316 317 318 319 320 |
# File 'lib/rack_jwt_verifier/key_source.rb', line 315 def jwks_loader lambda do || refresh! if [:kid_not_found] || [:invalidate] material end end |