pub fn default_credentials() -> Result<Arc<dyn Credentials>, Error>Expand description
The first credentials found, in this order:
ORIGINCLOUD_ACCESS_TOKEN: an access token, sent as it is.ORIGINCLOUD_CREDENTIALS_FILE: the path of a service account key’s credentials file (ServiceAccount), whose assertions are exchanged for access tokens as they expire. A file that can’t be read is an error, not passed over.- A CI job’s OIDC token, exchanged at the security token service
(
Federated): from the fileORIGINCLOUD_OIDC_TOKEN_FILEnames, or else fromORIGINCLOUD_OIDC_TOKEN, which holds the token itself (as GitLab CI’sid_tokensset it), or else from an HCP Terraform run’s workload identity token,TFC_WORKLOAD_IDENTITY_TOKEN, orTFC_WORKLOAD_IDENTITY_TOKEN_<TAG>whenORIGINCLOUD_TFC_WORKLOAD_IDENTITY_TAGnames the tag of a tagged audience, or else from GitHub Actions, in a job grantedpermissions: id-token: write. Once found, its errors are returned, not passed over.ORIGINCLOUD_OIDC_DISABLED=trueleaves this step out;ORIGINCLOUD_STS_ENDPOINTasks another address thanSTS_ENDPOINT, andORIGINCLOUD_OIDC_AUDIENCErequests GitHub’s token for another audience thanOIDC_AUDIENCE. - The session the
originCLI stored at its last login (origin id login). - The instance’s metadata service, on an instance that runs as a
service account (
InstanceMetadata). Nothing is requested until a token is; off an instance, that fails withError::NoCredentialswithin about two seconds.ORIGINCLOUD_METADATA_DISABLED=trueleaves this step out;ORIGINCLOUD_METADATA_ENDPOINTasks another address thanMETADATA_ENDPOINT.
It fails with Error::NoCredentials when the metadata service is
left out and there are no others.