Google credentials for Arke.Utils.Gcp.
Resolves application default credentials, then either mints an OAuth access
token (token/0) or returns the service account key to sign blobs with
(signer/0).
Credentials are resolved on every call, first hit wins:
config :arke, :gcp_credentials— a JSON string,{:system, "VAR"}, or a decoded mapGOOGLE_APPLICATION_CREDENTIALS— path to the key fileGOOGLE_APPLICATION_CREDENTIALS_JSON— inline JSONapplication_default_credentials.jsonin the gcloud config dir ($CLOUDSDK_CONFIG, defaulting to~/.config/gcloud) — gcloud ADC- the GCE metadata server
Summary
Functions
Decodes a PEM private key into the term :public_key.sign/3 expects.
The service account able to sign blobs: {client_email, private_key_pem}.
An OAuth access token for the resolved credentials.
Functions
Decodes a PEM private key into the term :public_key.sign/3 expects.
The service account able to sign blobs: {client_email, private_key_pem}.
Only service account credentials carry a private key; metadata server and
gcloud user credentials return {:error, :no_private_key}.
An OAuth access token for the resolved credentials.