Class: Authentic::OIDCKey

Inherits:
Object
  • Object
show all
Defined in:
lib/authentic/oidc_key.rb

Overview

Internal: JWKs cache data.

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#expiresObject (readonly)

Returns the value of attribute expires.



7
8
9
# File 'lib/authentic/oidc_key.rb', line 7

def expires
  @expires
end

#valueObject (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

Returns:

  • (Boolean)


14
15
16
# File 'lib/authentic/oidc_key.rb', line 14

def expired?
  !expires.nil? && Time.now.utc > expires
end