class Google::Auth::IDTokens::AggregateKeySource

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.

Public Class Methods

new(sources) click to toggle source

Create a key source that aggregates other key sources.

@param sources [Array<key source>] The key sources to aggregate.

# File lib/googleauth/id_tokens/key_sources.rb, line 357
def initialize sources
  @sources = Array(sources)
end

Public Instance Methods

current_keys() click to toggle source

Return the current keys, without attempting to refresh.

@return [Array<KeyInfo>]

# File lib/googleauth/id_tokens/key_sources.rb, line 366
def current_keys
  @sources.flat_map(&:current_keys)
end
refresh_keys() click to toggle source

Attempt to refresh keys and return the new keys.

@return [Array<KeyInfo>] @raise [KeySourceError] if key retrieval failed.

# File lib/googleauth/id_tokens/key_sources.rb, line 376
def refresh_keys
  @sources.flat_map(&:refresh_keys)
end