auth

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthProvider

type AuthProvider struct{}

AuthProvider is a simple factory for Azure credentials

func NewAuthProvider

func NewAuthProvider() *AuthProvider

NewAuthProvider creates a new authentication provider

func (*AuthProvider) ArcCredential

func (a *AuthProvider) ArcCredential() (azcore.TokenCredential, error)

ArcCredential returns Azure Arc managed identity credential

func (*AuthProvider) CheckCLIAuthStatus

func (a *AuthProvider) CheckCLIAuthStatus(ctx context.Context) error

CheckCLIAuthStatus checks if user is logged in to Azure CLI and if the token is valid

func (*AuthProvider) EnsureAuthenticated

func (a *AuthProvider) EnsureAuthenticated(ctx context.Context, tenantID string) error

EnsureAuthenticated checks if user is authenticated and prompts for login if needed

func (*AuthProvider) GetAccessToken

func (a *AuthProvider) GetAccessToken(ctx context.Context, cred azcore.TokenCredential) (string, error)

GetAccessToken retrieves access token for given credential with default ARM scope

func (*AuthProvider) GetAccessTokenForResource

func (a *AuthProvider) GetAccessTokenForResource(ctx context.Context, cred azcore.TokenCredential, resource string) (string, error)

GetAccessTokenForResource retrieves access token for given credential and resource

func (*AuthProvider) InteractiveAzLogin

func (a *AuthProvider) InteractiveAzLogin(ctx context.Context, tenantID string) error

InteractiveAzLogin performs interactive Azure CLI login with tenant ID and proper console tunneling

func (*AuthProvider) UserCredential

func (a *AuthProvider) UserCredential(cfg *config.Config) (azcore.TokenCredential, error)

UserCredential returns credential based on config (service principal, MSI, or CLI fallback)

Jump to

Keyboard shortcuts

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