auth

package
v1.38.0 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrProviderNotSet  = errors.New("auth provider not set, please login")
	ErrProviderUnknown = errors.New("auth provider is unknown, please login")

	RadixAPIScopes = []string{"6dae42f8-4368-4678-94ff-3960e28e3630/.default"}
)

Functions

This section is empty.

Types

type AccessToken

type AccessToken struct {
	// Token is the access token
	Token string
	// ExpiresOn indicates when the token expires
	ExpiresOn time.Time
}

type Auth

type Auth struct {
	// contains filtered or unexported fields
}

func New

func New() (*Auth, error)

New creates a new Provider

func (*Auth) GetAccessToken

func (a *Auth) GetAccessToken(ctx context.Context, scopes []string) (AccessToken, error)

func (*Auth) Login

func (a *Auth) Login(ctx context.Context, useInteractiveLogin, useDeviceCode, useGithubCredentials bool, azureClientId, federatedTokenFile, azureClientSecret string) error

Login allows the plugin to initialize its configuration. It must not require direct user interaction.

func (*Auth) Logout

func (a *Auth) Logout() error

Logout removes all cached accounts with tokens

type AzureClientSecret

type AzureClientSecret struct {
	Authority string
	// contains filtered or unexported fields
}

func NewAzureClientSecret

func NewAzureClientSecret(cache cache.Cache, authority string) *AzureClientSecret

func (*AzureClientSecret) Authenticate

func (p *AzureClientSecret) Authenticate(ctx context.Context, azureClientId, azureClientSecret string, scopes []string) (AccessToken, error)

func (*AzureClientSecret) GetAccessToken

func (p *AzureClientSecret) GetAccessToken(ctx context.Context, scopes []string) (AccessToken, error)

type AzureFederatedCredentials

type AzureFederatedCredentials struct {
	// contains filtered or unexported fields
}

func NewAzureFederatedCredentials

func NewAzureFederatedCredentials(cache cache.Cache) *AzureFederatedCredentials

func (*AzureFederatedCredentials) Authenticate

func (p *AzureFederatedCredentials) Authenticate(ctx context.Context, azureClientId, federatedTokenFile string, scopes []string) (AccessToken, error)

func (*AzureFederatedCredentials) GetAccessToken

func (p *AzureFederatedCredentials) GetAccessToken(ctx context.Context, scopes []string) (AccessToken, error)

type AzureGithub

type AzureGithub struct {
	// contains filtered or unexported fields
}

func NewAzureGithub

func NewAzureGithub(cache cache.Cache, authority string) *AzureGithub

func (*AzureGithub) Authenticate

func (p *AzureGithub) Authenticate(ctx context.Context, azureClientId string, scopes []string) (AccessToken, error)

func (*AzureGithub) GetAccessToken

func (p *AzureGithub) GetAccessToken(ctx context.Context, scopes []string) (AccessToken, error)

type GetAccessTokener

type GetAccessTokener interface {
	// GetAccessToken returns a valid token
	GetAccessToken(ctx context.Context, scopes []string) (AccessToken, error)
}

type MsalDeviceCode

type MsalDeviceCode struct {
	// contains filtered or unexported fields
}

func NewMsalDeviceCode

func NewMsalDeviceCode(cache msalcache.ExportReplace, authority string) *MsalDeviceCode

func (*MsalDeviceCode) Authenticate

func (p *MsalDeviceCode) Authenticate(ctx context.Context, scopes []string) (AccessToken, error)

func (*MsalDeviceCode) GetAccessToken

func (p *MsalDeviceCode) GetAccessToken(ctx context.Context, scopes []string) (AccessToken, error)

type MsalInteractive

type MsalInteractive struct {
	// contains filtered or unexported fields
}

func NewMsalInteractive

func NewMsalInteractive(cache msalcache.ExportReplace, authority string) *MsalInteractive

func (*MsalInteractive) Authenticate

func (p *MsalInteractive) Authenticate(ctx context.Context, scopes []string) (AccessToken, error)

func (*MsalInteractive) GetAccessToken

func (p *MsalInteractive) GetAccessToken(ctx context.Context, scopes []string) (AccessToken, error)

type MsalTokenCache

type MsalTokenCache struct {
	// contains filtered or unexported fields
}

MsalTokenCache is a token azurecache

func NewMsalTokenCache

func NewMsalTokenCache(cache cache.Cache, key string) *MsalTokenCache

NewMsalTokenCache creates a new token azurecache

func (*MsalTokenCache) Export

Export writes the binary representation of the cache (cache.Marshal()) to external storage. This is considered opaque. RadixCluster cancellations should be honored as in Replace.

func (*MsalTokenCache) Replace

Replace replaces the cache with what is in external storage. Implementors should honor RadixCluster cancellations and return context.Canceled or context.DeadlineExceeded in those cases.

type Provider

type Provider interface {
	GetAccessTokener
	Login(ctx context.Context, useInteractiveLogin, useDeviceCode, useGithubCredentials bool, azureClientId, federatedTokenFile, azureClientSecret string) error
	Logout() error
}

Provider is an Provider that uses MSAL

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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