Class: Keratin::AuthN::FetchingKeychain
- Inherits:
-
Object
- Object
- Keratin::AuthN::FetchingKeychain
- Defined in:
- lib/keratin/authn/fetching_keychain.rb
Instance Method Summary collapse
- #[](kid) ⇒ Object
- #clear ⇒ Object
-
#initialize(issuer:, ttl:) ⇒ FetchingKeychain
constructor
A new instance of FetchingKeychain.
Constructor Details
#initialize(issuer:, ttl:) ⇒ FetchingKeychain
Returns a new instance of FetchingKeychain.
3 4 5 6 |
# File 'lib/keratin/authn/fetching_keychain.rb', line 3 def initialize(issuer:, ttl:) @cache = LruRedux::TTL::ThreadSafeCache.new(25, ttl) @issuer = issuer.chomp('/') end |
Instance Method Details
#[](kid) ⇒ Object
8 9 10 |
# File 'lib/keratin/authn/fetching_keychain.rb', line 8 def [](kid) @cache.getset(kid){ fetch(kid) } end |
#clear ⇒ Object
12 13 14 |
# File 'lib/keratin/authn/fetching_keychain.rb', line 12 def clear @cache.clear end |