Class: Google::Auth::IDTokens::AggregateKeySource

Inherits:
Object
  • Object
show all
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

Constructor Details

#initialize(sources) ⇒ AggregateKeySource

Create a key source that aggregates other key sources.

Parameters:

  • sources (Array<key source>)

    The key sources to aggregate.



371
372
373
# File 'lib/googleauth/id_tokens/key_sources.rb', line 371

def initialize sources
  @sources = Array(sources)
end

Instance Method Details

#current_keysArray<KeyInfo>

Return the current keys, without attempting to refresh.

Returns:



380
381
382
# File 'lib/googleauth/id_tokens/key_sources.rb', line 380

def current_keys
  @sources.flat_map(&:current_keys)
end

#refresh_keysArray<KeyInfo>

Attempt to refresh keys and return the new keys.

Returns:

Raises:



390
391
392
# File 'lib/googleauth/id_tokens/key_sources.rb', line 390

def refresh_keys
  @sources.flat_map(&:refresh_keys)
end