auth

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cloud

type Cloud string
const (
	CloudPublic  Cloud = "public"
	CloudChina   Cloud = "china"
	CloudUSGov   Cloud = "usgov"
	CloudGermany Cloud = "germany"
)

func (Cloud) ActiveDirectoryEndpoint

func (c Cloud) ActiveDirectoryEndpoint() string

func (Cloud) ResourceManagerEndpoint

func (c Cloud) ResourceManagerEndpoint() string

type Credential

type Credential struct {
	ClientID       string
	ClientSecret   string
	TenantID       string
	SubscriptionID string
	Cloud          Cloud
}

Credential is the provider-local Azure credential shape used by the lightweight ARM client. SubscriptionID is optional; when empty the provider enumerates all visible subscriptions first.

func FromOptions

func FromOptions(options schema.Options) (Credential, error)

func New

func New(clientID, clientSecret, tenantID, subscriptionID string, cloud Cloud) Credential

func (Credential) Validate

func (c Credential) Validate() error

type Token

type Token struct {
	AccessToken string
	ExpiresAt   time.Time
}

Token is a cached bearer token.

type TokenSource

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

TokenSource fetches and caches OAuth2 client credentials tokens.

func NewTokenSource

func NewTokenSource(cred Credential, httpClient *http.Client) *TokenSource

func (*TokenSource) Token

func (s *TokenSource) Token(ctx context.Context) (Token, error)

Jump to

Keyboard shortcuts

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