oauth2adapt

package module
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 6 Imported by: 3

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

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 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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL