Class: Authentic::OIDCKey
- Inherits:
-
Object
- Object
- Authentic::OIDCKey
- Defined in:
- lib/authentic/oidc_key.rb
Overview
Internal: JWKs cache data.
Instance Attribute Summary collapse
-
#expires ⇒ Object
readonly
Returns the value of attribute expires.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #expired? ⇒ Boolean
-
#initialize(value, max_age_seconds) ⇒ OIDCKey
constructor
A new instance of OIDCKey.
Constructor Details
#initialize(value, max_age_seconds) ⇒ OIDCKey
Returns a new instance of OIDCKey.
9 10 11 12 |
# File 'lib/authentic/oidc_key.rb', line 9 def initialize(value, max_age_seconds) @value = value @expires = max_age_seconds.nil? ? nil : Time.now.utc + max_age_seconds end |
Instance Attribute Details
#expires ⇒ Object (readonly)
Returns the value of attribute expires.
7 8 9 |
# File 'lib/authentic/oidc_key.rb', line 7 def expires @expires end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
7 8 9 |
# File 'lib/authentic/oidc_key.rb', line 7 def value @value end |
Instance Method Details
#expired? ⇒ Boolean
14 15 16 |
# File 'lib/authentic/oidc_key.rb', line 14 def expired? !expires.nil? && Time.now.utc > expires end |