Class: Google::Auth::IDTokens::AggregateKeySource
- Inherits:
-
Object
- Object
- Google::Auth::IDTokens::AggregateKeySource
- Defined in:
- lib/googleauth/id_tokens/key_sources.rb
Overview
A key source that aggregates other key sources. This means it will aggregate the keys provided by its constituent sources. Additionally, when asked to refresh, it will refresh all its constituent sources.
Instance Method Summary collapse
-
#current_keys ⇒ Array<KeyInfo>
Return the current keys, without attempting to refresh.
-
#initialize(sources) ⇒ AggregateKeySource
constructor
Create a key source that aggregates other key sources.
-
#refresh_keys ⇒ Array<KeyInfo>
Attempt to refresh keys and return the new keys.
Constructor Details
#initialize(sources) ⇒ AggregateKeySource
Create a key source that aggregates other key sources.
357 358 359 |
# File 'lib/googleauth/id_tokens/key_sources.rb', line 357 def initialize sources @sources = Array(sources) end |
Instance Method Details
#current_keys ⇒ Array<KeyInfo>
Return the current keys, without attempting to refresh.
366 367 368 |
# File 'lib/googleauth/id_tokens/key_sources.rb', line 366 def current_keys @sources.flat_map(&:current_keys) end |
#refresh_keys ⇒ Array<KeyInfo>
Attempt to refresh keys and return the new keys.
376 377 378 |
# File 'lib/googleauth/id_tokens/key_sources.rb', line 376 def refresh_keys @sources.flat_map(&:refresh_keys) end |