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.
179 180 181 |
# File 'lib/googleauth/id_tokens/key_sources.rb', line 179 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.
188 189 190 |
# File 'lib/googleauth/id_tokens/key_sources.rb', line 188 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.
200 201 202 |
# File 'lib/googleauth/id_tokens/key_sources.rb', line 200 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.
212 213 214 |
# File 'lib/googleauth/id_tokens/key_sources.rb', line 212 def from_jwk_set jwk_set new KeyInfo.from_jwk_set jwk_set end |