Module Google::Auth::CredentialsLoader
In: lib/googleauth/credentials_loader.rb

CredentialsLoader contains the behaviour used to locate and find default credentials files on the file system.

Methods

Constants

ENV_VAR = "GOOGLE_APPLICATION_CREDENTIALS".freeze
PRIVATE_KEY_VAR = "GOOGLE_PRIVATE_KEY".freeze
CLIENT_EMAIL_VAR = "GOOGLE_CLIENT_EMAIL".freeze
CLIENT_ID_VAR = "GOOGLE_CLIENT_ID".freeze
CLIENT_SECRET_VAR = "GOOGLE_CLIENT_SECRET".freeze
REFRESH_TOKEN_VAR = "GOOGLE_REFRESH_TOKEN".freeze
ACCOUNT_TYPE_VAR = "GOOGLE_ACCOUNT_TYPE".freeze
PROJECT_ID_VAR = "GOOGLE_PROJECT_ID".freeze
GCLOUD_POSIX_COMMAND = "gcloud".freeze
GCLOUD_WINDOWS_COMMAND = "gcloud.cmd".freeze
GCLOUD_CONFIG_COMMAND = "config config-helper --format json".freeze
CREDENTIALS_FILE_NAME = "application_default_credentials.json".freeze
NOT_FOUND_ERROR = "Unable to read the credential file specified by #{ENV_VAR}".freeze
WELL_KNOWN_PATH = "gcloud/#{CREDENTIALS_FILE_NAME}".freeze
WELL_KNOWN_ERROR = "Unable to read the default credential file".freeze
SYSTEM_DEFAULT_ERROR = "Unable to read the system default credential file".freeze
CLOUD_SDK_CLIENT_ID = "764086051850-6qr4p6gpi6hn506pt8ejuq83di341hur.app"\ "s.googleusercontent.com".freeze
CLOUD_SDK_CREDENTIALS_WARNING = "Your application has authenticated "\ "using end user credentials from Google Cloud SDK. We recommend that "\ "most server applications use service accounts instead. If your "\ "application continues to use end user credentials from Cloud SDK, "\ 'you might receive a "quota exceeded" or "API not enabled" error. For'\ " more information about service accounts, see "\ "https://cloud.google.com/docs/authentication/.".freeze

Public Instance methods

Creates an instance from the path specified in an environment variable.

@param scope [string|array|nil] the scope(s) to access @param options [Hash] Connection options. These may be used to configure

    how OAuth tokens are retrieved, by providing a suitable
    `Faraday::Connection`. For example, if a connection proxy must be
    used in the current network, you may provide a connection with
    with the needed proxy options.
    The following keys are recognized:
    * `:default_connection` The connection object to use.
    * `:connection_builder` A `Proc` that returns a connection.

Creates an instance from the system default path

@param scope [string|array|nil] the scope(s) to access @param options [Hash] Connection options. These may be used to configure

    how OAuth tokens are retrieved, by providing a suitable
    `Faraday::Connection`. For example, if a connection proxy must be
    used in the current network, you may provide a connection with
    with the needed proxy options.
    The following keys are recognized:
    * `:default_connection` The connection object to use.
    * `:connection_builder` A `Proc` that returns a connection.

Creates an instance from a well known path.

@param scope [string|array|nil] the scope(s) to access @param options [Hash] Connection options. These may be used to configure

    how OAuth tokens are retrieved, by providing a suitable
    `Faraday::Connection`. For example, if a connection proxy must be
    used in the current network, you may provide a connection with
    with the needed proxy options.
    The following keys are recognized:
    * `:default_connection` The connection object to use.
    * `:connection_builder` A `Proc` that returns a connection.

Finds project_id from gcloud CLI configuration

make_creds proxies the construction of a credentials instance

By default, it calls new on the current class, but this behaviour can be modified, allowing different instances to be created.

Issues warning if cloud sdk client id is used

[Validate]