Documentation
¶
Overview ¶
Package oauth2adapt helps converts types used in cloud.google.com/go/auth and golang.org/x/oauth2.
Index ¶
- func AddRetrieveErrorToAuthError(err *auth.Error) *auth.Error
- func AuthCredentialsFromOauth2Credentials(creds *google.Credentials) *auth.Credentials
- func AuthErrorFromRetrieveError(err *oauth2.RetrieveError) *auth.Error
- func Oauth2CredentialsFromAuthCredentials(creds *auth.Credentials) *google.Credentials
- func TokenProviderFromTokenSource(ts oauth2.TokenSource) auth.TokenProvider
- func TokenSourceFromTokenProvider(tp auth.TokenProvider) oauth2.TokenSource
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddRetrieveErrorToAuthError ¶
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 ¶ added in v0.2.0
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 ¶ added in v0.2.0
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.
Types ¶
This section is empty.