credentials

package
v0.62.0 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2025 License: Apache-2.0 Imports: 2 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CredentialsProvider

type CredentialsProvider interface {
	// SetHeaders sets the credential in the request's headers.
	SetHeaders(r *http.Request) error
}

CredentialsProvider represents anything that can set credentials, such as a token, in the headers of a request.

func NewCredentialsProvider

func NewCredentialsProvider(f func(r *http.Request) error) CredentialsProvider

NewCredentialsProvider returns a new CredentialsProvider that uses the provided function to set headers on the request.

type OAuthCredentialsProvider

type OAuthCredentialsProvider interface {
	CredentialsProvider
	// Token returns the OAuth token generated by the provider.
	Token() (*oauth2.Token, error)
}

OAuthCredentialsProvider is a specialized CredentialsProvider uses and provides an OAuth token.

func NewOAuthCredentialsProvider

func NewOAuthCredentialsProvider(visitor func(r *http.Request) error, tokenProvider func() (*oauth2.Token, error)) OAuthCredentialsProvider

Jump to

Keyboard shortcuts

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