aztokenprovider

package
v0.0.0-test Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2021 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyAuth

func ApplyAuth(tokenProvider AzureTokenProvider, scopes []string, next http.RoundTripper) http.RoundTripper

func AuthMiddleware

func AuthMiddleware(tokenProvider AzureTokenProvider, scopes []string) httpclient.Middleware

Types

type AccessToken

type AccessToken struct {
	Token     string
	ExpiresOn time.Time
}

type AzureTokenProvider

type AzureTokenProvider interface {
	GetAccessToken(ctx context.Context, scopes []string) (string, error)
}

func NewAzureAccessTokenProvider

func NewAzureAccessTokenProvider(cfg *setting.Cfg, credentials azcredentials.AzureCredentials) (AzureTokenProvider, error)

type ConcurrentTokenCache

type ConcurrentTokenCache interface {
	GetAccessToken(ctx context.Context, tokenRetriever TokenRetriever, scopes []string) (string, error)
}

func NewConcurrentTokenCache

func NewConcurrentTokenCache() ConcurrentTokenCache

type TokenRetriever

type TokenRetriever interface {
	GetCacheKey() string
	Init() error
	GetAccessToken(ctx context.Context, scopes []string) (*AccessToken, error)
}

Jump to

Keyboard shortcuts

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