Class: Google::Auth::IDTokens::StaticKeySource
- Inherits:
-
Object
- Object
- Google::Auth::IDTokens::StaticKeySource
- Defined in:
- lib/googleauth/id_tokens/key_sources.rb
Overview
A key source that contains a static set of keys.
Instance Attribute Summary collapse
-
#current_keys ⇒ Array<KeyInfo>
(also: #refresh_keys)
readonly
Return the current keys.
Class Method Summary collapse
-
.from_jwk(jwk) ⇒ StaticKeySource
Create a static key source containing a single key parsed from a single JWK, which may be given as either a hash or an unparsed JSON string.
-
.from_jwk_set(jwk_set) ⇒ StaticKeySource
Create a static key source containing multiple keys parsed from a JWK Set, which may be given as either a hash or an unparsed JSON string.
Instance Method Summary collapse
-
#initialize(keys) ⇒ StaticKeySource
constructor
Create a static key source with the given keys.
Constructor Details
#initialize(keys) ⇒ StaticKeySource
Create a static key source with the given keys.
193 194 195 |
# File 'lib/googleauth/id_tokens/key_sources.rb', line 193 def initialize keys @current_keys = Array(keys) end |
Instance Attribute Details
#current_keys ⇒ Array<KeyInfo> (readonly) Also known as: refresh_keys
Return the current keys. Does not perform any refresh.
202 203 204 |
# File 'lib/googleauth/id_tokens/key_sources.rb', line 202 def current_keys @current_keys end |
Class Method Details
.from_jwk(jwk) ⇒ StaticKeySource
Create a static key source containing a single key parsed from a single JWK, which may be given as either a hash or an unparsed JSON string.
214 215 216 |
# File 'lib/googleauth/id_tokens/key_sources.rb', line 214 def from_jwk jwk new KeyInfo.from_jwk jwk end |
.from_jwk_set(jwk_set) ⇒ StaticKeySource
Create a static key source containing multiple keys parsed from a JWK Set, which may be given as either a hash or an unparsed JSON string.
226 227 228 |
# File 'lib/googleauth/id_tokens/key_sources.rb', line 226 def from_jwk_set jwk_set new KeyInfo.from_jwk_set jwk_set end |