Class: Gcloud::Datastore::Credentials
- Inherits:
-
Credentials
- Object
- Credentials
- Gcloud::Datastore::Credentials
- Defined in:
- lib/gcloud/datastore/credentials.rb
Overview
Authentication credentials to Google Cloud. The most common way to create this object is to provide the path to the JSON keyfile downloaded from Google Cloud.
developers.google.com/accounts/docs/application-default-credentials
Constant Summary collapse
- SCOPE =
:nodoc:
["https://www.googleapis.com/auth/datastore", "https://www.googleapis.com/auth/userinfo.email"]
- PATH_ENV_VARS =
%w(DATASTORE_KEYFILE GCLOUD_KEYFILE GOOGLE_CLOUD_KEYFILE)
- JSON_ENV_VARS =
%w(DATASTORE_KEYFILE_JSON GCLOUD_KEYFILE_JSON GOOGLE_CLOUD_KEYFILE_JSON)
Constants inherited from Credentials
Credentials::AUDIENCE, Credentials::DEFAULT_PATHS, Credentials::TOKEN_CREDENTIAL_URI
Instance Attribute Summary
Attributes inherited from Credentials
Instance Method Summary collapse
-
#sign_http_request(request) ⇒ Object
Sign OAuth 2.0 API calls.
Methods inherited from Credentials
Constructor Details
This class inherits a constructor from Gcloud::Credentials
Instance Method Details
#sign_http_request(request) ⇒ Object
Sign OAuth 2.0 API calls.
35 36 37 38 39 40 41 |
# File 'lib/gcloud/datastore/credentials.rb', line 35 def sign_http_request request #:nodoc: if @client @client.fetch_access_token! if @client.expired? @client.generate_authenticated_request request: request end request end |