CredentialsTokenSource extracts the token source from GCP credentials.
(creds *google.Credentials)
| 100 | |
| 101 | // CredentialsTokenSource extracts the token source from GCP credentials. |
| 102 | func CredentialsTokenSource(creds *google.Credentials) TokenSource { |
| 103 | if creds == nil { |
| 104 | return nil |
| 105 | } |
| 106 | return TokenSource(creds.TokenSource) |
| 107 | } |
| 108 | |
| 109 | // DefaultProjectID obtains the project ID from the default GCP credentials. |
| 110 | func DefaultProjectID(creds *google.Credentials) (ProjectID, error) { |