Package cloud.google.com/go/auth/oauth2adapt (v0.2.2)

Package oauth2adapt helps converts types used in cloud.google.com/go/auth and golang.org/x/oauth2.

Functions

func AddRetrieveErrorToAuthError

func AddRetrieveErrorToAuthError(err *auth.Error) *auth.Error

AddRetrieveErrorToAuthError returns the same error provided and adds a [golang.org/x/oauth2.RetrieveError] to the error chain by setting the Err field on the [cloud.google.com/go/auth.Error].

func AuthCredentialsFromOauth2Credentials

func AuthCredentialsFromOauth2Credentials(creds *google.Credentials) *auth.Credentials

AuthCredentialsFromOauth2Credentials converts a [golang.org/x/oauth2/google.Credentials] to a [cloud.google.com/go/auth.Credentials].

func AuthErrorFromRetrieveError

func AuthErrorFromRetrieveError(err *oauth2.RetrieveError) *auth.Error

AuthErrorFromRetrieveError returns an [cloud.google.com/go/auth.Error] that wraps the provided [golang.org/x/oauth2.RetrieveError].

func Oauth2CredentialsFromAuthCredentials

func Oauth2CredentialsFromAuthCredentials(creds *auth.Credentials) *google.Credentials

Oauth2CredentialsFromAuthCredentials converts a [cloud.google.com/go/auth.Credentials] to a [golang.org/x/oauth2/google.Credentials].

func TokenProviderFromTokenSource

func TokenProviderFromTokenSource(ts oauth2.TokenSource) auth.TokenProvider

TokenProviderFromTokenSource converts any [golang.org/x/oauth2.TokenSource] into a [cloud.google.com/go/auth.TokenProvider].

func TokenSourceFromTokenProvider

func TokenSourceFromTokenProvider(tp auth.TokenProvider) oauth2.TokenSource

TokenSourceFromTokenProvider converts any [cloud.google.com/go/auth.TokenProvider] into a [golang.org/x/oauth2.TokenSource].