Class: Firebase::Auth::IDToken::PublicKeys

Inherits:
Array
  • Object
show all
Defined in:
lib/firebase/auth/id_token/public_keys.rb

Defined Under Namespace

Classes: FailedToFetchFromRemote, NotFound

Instance Method Summary collapse

Constructor Details

#initializePublicKeys

Returns a new instance of PublicKeys.



14
15
16
17
18
# File 'lib/firebase/auth/id_token/public_keys.rb', line 14

def initialize
  public_keys_from_remote.each do |kid, certificate|
    self << PublicKey.new(kid: kid, certificate: certificate)
  end
end

Instance Method Details

#find_by!(kid:) ⇒ Object

Raises:



20
21
22
23
24
25
26
# File 'lib/firebase/auth/id_token/public_keys.rb', line 20

def find_by!(kid:)
  public_key = self.find { |public_key| public_key.kid == kid }

  raise NotFound unless public_key

  public_key
end