Class: Sinatra::Jwt::JwkLoader::Loader
- Inherits:
-
Object
- Object
- Sinatra::Jwt::JwkLoader::Loader
- Defined in:
- lib/sinatra/jwt/jwk_loader.rb
Instance Method Summary collapse
Instance Method Details
#call(options = {}) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/sinatra/jwt/jwk_loader.rb', line 11 def call( = {}) if [:kid_not_found] && @cache_last_update < Time.now.to_i - 300 logger.info("Invalidating JWK cache. #{[:kid]} not found from previous cache") @cached_keys = nil end @cached_keys ||= begin @cache_last_update = Time.now.to_i load end rescue StandardError raise JwkLoadError, "Could not load the jwk file" end |
#load ⇒ Object
7 8 9 |
# File 'lib/sinatra/jwt/jwk_loader.rb', line 7 def load raise StandardError, "Jwk load is not implemented" end |