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

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

Extends Signet::OAuth2::Client so that the auth token is obtained from the GCE metadata server.

Methods

.on_gce?

  def 
  
 self 
 . 
 on_gce? 
 ( 
 _options 
  
 = 
  
 {}, 
  
 _reload 
  
 = 
  
 false 
 ) 
  
 - 
>  
 Boolean 
 

Detect if this appear to be a GCE instance, by checking if metadata is available. The parameters are deprecated and unused.

Returns
  • (Boolean)

.reset_cache

  def 
  
 self 
 . 
 reset_cache 
 () 
 
Aliases

.unmemoize_all

  def 
  
 self 
 . 
 unmemoize_all 
 () 
 
Alias Of: .reset_cache

#duplicate

  def 
  
 duplicate 
 ( 
 options 
  
 = 
  
 {}) 
 

Creates a duplicate of these credentials without the Signet::OAuth2::Client-specific transient state (e.g. cached tokens)

Parameter
  • options(Hash) —

    Overrides for the credentials parameters. The following keys are recognized in addition to keys in the Signet::OAuth2::Client

    • :universe_domain_overridden Whether the universe domain was overriden during credentials creation

#fetch_access_token

  def 
  
 fetch_access_token 
 ( 
 _options 
  
 = 
  
 {}) 
  
 - 
>  
 Hash 
 

Overrides the super class method to change how access tokens are fetched.

Parameter
  • _options(Hash) — Options for token fetch (not used)
Returns
  • (Hash) — The token data hash
Raises

#initialize

  def 
  
 initialize 
 ( 
 options 
  
 = 
  
 {}) 
  
 - 
>  
 GCECredentials 
 

Construct a GCECredentials

Returns

#update!

  def 
  
 update! 
 ( 
 options 
  
 = 
  
 {}) 
  
 - 
>  
 Google 
 :: 
 Auth 
 :: 
 GCECredentials 
 

Destructively updates these credentials.

This method is called by Signet::OAuth2::Client 's constructor

Parameter
  • options(Hash) —

    Overrides for the credentials parameters. The following keys are recognized in addition to keys in the Signet::OAuth2::Client

    • :universe_domain_overridden Whether the universe domain was overriden during credentials creation
Create a Mobile Website
View Site in Mobile | Classic
Share by: