Skip to content

Commit

Permalink
Updated readme with GOOGLE_CREDENTIALS env var
Browse files Browse the repository at this point in the history
Signed-off-by: Christoffer Eide <[email protected]>
  • Loading branch information
christoffer-eide committed Aug 19, 2024
1 parent 3057561 commit 242b218
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,44 @@ you can enable application default credentials using the sdk:
$ gcloud auth application-default login
It's also possible to configure the credentials using the env var ``GOOGLE_CREDENTIALS``.
This can either point to a file or JSON content.

.. code:: sh
export GOOGLE_CREDENTIALS=$(cat credentials.json)
export GOOGLE_CREDENTIALS=credentials.json
Supported formats are:

Credentials file:

.. code:: json
{
"type": "service_account",
"project_id": "my-project",
"private_key_id": "66a4119f8aefbe8687ef0e14c6e7e0e1844b7950",
"private_key": "***",
"client_email": "[email protected]",
"client_id": "1234567890",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/my-service-account%40my-project.iam.gserviceaccount.com",
"universe_domain": "googleapis.com"
}
Access token:

.. code:: json
{
"access_token": "***",
"expires_in": 3599,
"token_type": "Bearer"
}
Encrypting/decrypting with GCP KMS requires a KMS ResourceID. You can use the
cloud console the get the ResourceID or you can create one using the gcloud
sdk:
Expand Down

0 comments on commit 242b218

Please sign in to comment.