Documentation
¶
Overview ¶
Package auth provides Azure authentication token acquisition and caching.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DetectScope ¶
DetectScope analyzes a URL and returns the appropriate Azure OAuth scope. Returns empty string when the hostname does not match a known Azure service.
func GetAzureToken ¶
GetAzureToken acquires a bearer token for the supplied scope using the shared provider instance (cached credential and token reuse).
func IsAzureHost ¶
IsAzureHost checks if a hostname appears to be an Azure service
Types ¶
type AzureTokenProvider ¶
type AzureTokenProvider struct {
// contains filtered or unexported fields
}
AzureTokenProvider implements TokenProvider using azd-core's credential chain (DefaultAzureCredential-equivalent) with in-memory token reuse.
func NewAzureTokenProvider ¶
func NewAzureTokenProvider() (*AzureTokenProvider, error)
NewAzureTokenProvider creates a provider backed by DefaultAzureCredential. The provider caches tokens per scope until close to expiration.
type MockTokenProvider ¶
MockTokenProvider is a mock implementation for testing