Class: JwkLoader::JwksUriProvider

Inherits:
Object
  • Object
show all
Defined in:
lib/jwk_loader/jwks_uri_provider.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(uri:, cache:, cache_grace_period:) ⇒ JwksUriProvider

Returns a new instance of JwksUriProvider.



7
8
9
10
11
# File 'lib/jwk_loader/jwks_uri_provider.rb', line 7

def initialize(uri:, cache:, cache_grace_period:)
  @uri          = uri
  @cache        = cache
  @cache_grace_period = cache_grace_period
end

Instance Attribute Details

#cacheObject (readonly)

Returns the value of attribute cache.



5
6
7
# File 'lib/jwk_loader/jwks_uri_provider.rb', line 5

def cache
  @cache
end

#cache_grace_periodObject (readonly)

Returns the value of attribute cache_grace_period.



5
6
7
# File 'lib/jwk_loader/jwks_uri_provider.rb', line 5

def cache_grace_period
  @cache_grace_period
end

#uriObject (readonly)

Returns the value of attribute uri.



5
6
7
# File 'lib/jwk_loader/jwks_uri_provider.rb', line 5

def uri
  @uri
end

Instance Method Details

#call(options) ⇒ Object



13
14
15
16
# File 'lib/jwk_loader/jwks_uri_provider.rb', line 13

def call(options)
  invalidate_cache! if options[:kid_not_found] || options[:invalidate]
  jwks
end