token

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 5 Imported by: 3

Documentation

Index

Constants

View Source
const (
	ServicePrincipalLogin = token.ServicePrincipalLogin
	MSILogin              = token.MSILogin
	WorkloadIdentityLogin = token.WorkloadIdentityLogin
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessToken added in v0.1.0

type AccessToken = azcore.AccessToken

AccessToken represents an Azure service bearer access token with expiry information.

type Options

type Options struct {
	LoginMethod string

	Environment string
	TenantID    string
	ServerID    string
	ClientID    string

	ClientSecret       string
	ClientCert         string
	ClientCertPassword string
	IsPoPTokenEnabled  bool
	PoPTokenClaims     string

	IdentityResourceID string

	AuthorityHost      string
	FederatedTokenFile string
}

Options defines the options for getting token. This struct is a subset of internal/token.Options where its values are copied to internal type. See internal/token/options.go for details

func OptionsWithEnv added in v0.1.0

func OptionsWithEnv() *Options

OptionsWithEnv loads options from environment variables.

type TokenProvider

type TokenProvider interface {
	// GetAccessToken returns an access token from given settings.
	GetAccessToken(ctx context.Context) (AccessToken, error)
}

TokenProvider provides access to tokens.

func GetTokenProvider added in v0.1.0

func GetTokenProvider(options *Options) (TokenProvider, error)

GetTokenProvider returns a token provider based on the given options.

Jump to

Keyboard shortcuts

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