Reference documentation and code samples for the googleauth module Google::Auth::CredentialsLoader.
CredentialsLoader contains the behaviour used to locate and find default credentials files on the file system.
Methods
.load_gcloud_project_id
def
self
.
load_gcloud_project_id
()
Finds project_id from gcloud CLI configuration
#from_env
def
from_env
(
scope
=
nil
,
options
=
{})
Creates an instance from the path specified in an environment variable.
- scope(string|array|nil) — the scope(s) to access
- 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
AProc
that returns a connection.
-
#from_system_default_path
def
from_system_default_path
(
scope
=
nil
,
options
=
{})
Creates an instance from the system default path
- scope(string|array|nil) — the scope(s) to access
- 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
AProc
that returns a connection.
-
#from_well_known_path
def
from_well_known_path
(
scope
=
nil
,
options
=
{})
Creates an instance from a well known path.
- scope(string|array|nil) — the scope(s) to access
- 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
AProc
that returns a connection.
-
#make_creds
def
make_creds
(
*
args
)
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.
Constants
ENV_VAR
value: "GOOGLE_APPLICATION_CREDENTIALS".freeze
PRIVATE_KEY_VAR
value: "GOOGLE_PRIVATE_KEY".freeze
CLIENT_EMAIL_VAR
value: "GOOGLE_CLIENT_EMAIL".freeze
CLIENT_ID_VAR
value: "GOOGLE_CLIENT_ID".freeze
CLIENT_SECRET_VAR
value: "GOOGLE_CLIENT_SECRET".freeze
REFRESH_TOKEN_VAR
value: "GOOGLE_REFRESH_TOKEN".freeze
ACCOUNT_TYPE_VAR
value: "GOOGLE_ACCOUNT_TYPE".freeze
PROJECT_ID_VAR
value: "GOOGLE_PROJECT_ID".freeze
AWS_REGION_VAR
value: "AWS_REGION".freeze
AWS_DEFAULT_REGION_VAR
value: "AWS_DEFAULT_REGION".freeze
AWS_ACCESS_KEY_ID_VAR
value: "AWS_ACCESS_KEY_ID".freeze
AWS_SECRET_ACCESS_KEY_VAR
value: "AWS_SECRET_ACCESS_KEY".freeze
AWS_SESSION_TOKEN_VAR
value: "AWS_SESSION_TOKEN".freeze
GCLOUD_POSIX_COMMAND
value: "gcloud".freeze
GCLOUD_WINDOWS_COMMAND
value: "gcloud.cmd".freeze
GCLOUD_CONFIG_COMMAND
value: "config config-helper --format json --verbosity none".freeze
CREDENTIALS_FILE_NAME
value: "application_default_credentials.json".freeze
NOT_FOUND_ERROR
value: "Unable to read the credential file specified by # ENV_VAR ".freeze
WELL_KNOWN_PATH
value: "gcloud/# CREDENTIALS_FILE_NAME ".freeze
WELL_KNOWN_ERROR
value: "Unable to read the default credential file".freeze
SYSTEM_DEFAULT_ERROR
value: "Unable to read the system default credential file".freeze
CLOUD_SDK_CLIENT_ID
value: "764086051850-6qr4p6gpi6hn506pt8ejuq83di341hur.app" \ "s.googleusercontent.com".freeze