spec/iap_jwt_assertion_spec.rb
def override_fetch_public_keys
    IapJwtAssertion.instance_eval do
      def fetch_public_keys
        response = File.read('spec/test-keys/public_key.json')
        response_hash = JSON.parse(response)
        public_keys = response_hash.map {|kid, pubkey| [kid, OpenSSL::PKey::EC.new(pubkey)]}.to_h

        return public_keys
      end
    end
  end
# override fetch_public_keys so that we can test with our own keys
override fetch_public_keys so that we can test with our own keys
override fetch_public_keys so that we can test with our own keys
def override_fetch_public_keys
    IapJwtAssertion.instance_eval do
      def fetch_public_keys
        response = File.read('spec/test-keys/public_key.json')
        response_hash = JSON.parse(response)
        public_keys = response_hash.map {|kid, pubkey| [kid, OpenSSL::PKey::EC.new(pubkey)]}.to_h
        return public_keys
      end
    end
  end
def override_fetch_public_keys IapJwtAssertion . instance_eval do def fetch_public_keys response = File . read ( 'spec/test-keys/public_key.json' ) response_hash = JSON . parse ( response ) public_keys = response_hash . map { | kid , pubkey | [ kid , OpenSSL :: PKey :: EC . new ( pubkey ) ] } . to_h return public_keys end end end
override fetch_public_keys so that we can test with our own keys
override fetch_public_keys so that we can test with our own keys