googleauth - Class Google::Auth::IAMCredentials (v1.15.0)

Reference documentation and code samples for the googleauth class Google::Auth::IAMCredentials.

Authenticates requests using IAM credentials.

Inherits

  • Object

Methods

#apply

  def 
  
 apply 
 ( 
 a_hash 
 ) 
  
 - 
>  
 Hash 
 

Returns a clone of a_hash updated with the authorization header

Parameter
  • a_hash(Hash) — The hash to clone and update with credentials
Returns
  • (Hash) — A new hash with credentials

#apply!

  def 
  
 apply! 
 ( 
 a_hash 
 ) 
  
 - 
>  
 Hash 
 

Adds the credential fields to the hash.

Parameter
  • a_hash(Hash) — The hash to update with credentials
Returns
  • (Hash) — The updated hash with credentials

#initialize

  def 
  
 initialize 
 ( 
 selector 
 , 
  
 token 
 ) 
  
 - 
>  
 IAMCredentials 
 

Initializes an IAMCredentials.

Parameters
  • selector(String) — The IAM selector.
  • token(String) — The IAM token.
Returns
Raises
  • (TypeError) — If selector or token is not a String

#updater_proc

  def 
  
 updater_proc 
 () 
  
 - 
>  
 Proc 
 

Returns a reference to the #apply method, suitable for passing as a closure

Returns
  • (Proc) — A procedure that updates a hash with credentials

Constants

SELECTOR_KEY

value: "x-goog-iam-authority-selector".freeze

TOKEN_KEY

value: "x-goog-iam-authorization-token".freeze

Create a Mobile Website
View Site in Mobile | Classic
Share by: