googleauth - Class Google::Auth::GCECredentials (v1.13.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 = {})

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

#initialize

def initialize(options = {}) -> GCECredentials

Construct a GCECredentials

Returns