auth

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2026 License: Apache-2.0, Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetUserAgentExtension

func GetUserAgentExtension() string

func IsPublic added in v1.6.2

func IsPublic(env cloud.Configuration) bool

IsPublic returns if the specified configuration is public. This takes the track2 format rather than being a method on Environment because usage in api/sdk contexts use the track2 format and may not have access to the auth.Environment struct.

func NewTokenWrapper added in v0.5.1

func NewTokenWrapper(cred azcore.TokenCredential) azcore.TokenCredential

func TokenScope added in v1.6.2

func TokenScope(cloudCfg cloud.Configuration) string

TokenScope returns the token scope for the Azure environment, such as "https://management.azure.com/.default" (for public cloud)

Types

type AuxiliaryTokenPolicy added in v1.4.0

type AuxiliaryTokenPolicy struct {
	Token azcore.AccessToken
	// contains filtered or unexported fields
}

AuxiliaryTokenPolicy provides a custom policy used to authenticate with shared node image galleries.

func NewAuxiliaryTokenPolicy added in v1.4.0

func NewAuxiliaryTokenPolicy(client AuxiliaryTokenServer, url string, scope string) *AuxiliaryTokenPolicy

func (*AuxiliaryTokenPolicy) Do added in v1.4.0

func (*AuxiliaryTokenPolicy) GetAuxiliaryToken added in v1.5.0

func (p *AuxiliaryTokenPolicy) GetAuxiliaryToken() error

type AuxiliaryTokenServer added in v1.5.0

type AuxiliaryTokenServer interface {
	Do(req *http.Request) (*http.Response, error)
}

type ClientConfig

type ClientConfig struct {
	CloudName               string
	Location                string
	SubscriptionID          string
	ResourceManagerEndpoint string
	Authorizer              autorest.Authorizer
	UserAgent               string
}

ClientConfig contains all essential information to create an Azure client.

type Config

type Config struct {
	Cloud                    string `json:"cloud" yaml:"cloud"`
	Location                 string `json:"location" yaml:"location"`
	TenantID                 string `json:"tenantId" yaml:"tenantId"`
	SubscriptionID           string `json:"subscriptionId" yaml:"subscriptionId"`
	ResourceGroup            string `json:"resourceGroup" yaml:"resourceGroup"`
	AzureEnvironmentFilepath string `json:"azureEnvironmentFilepath" yaml:"azureEnvironmentFilepath"`
}

Config holds the configuration parsed from the --cloud-config flag

func BuildAzureConfig

func BuildAzureConfig() (*Config, error)

BuildAzureConfig returns a Config object for the Azure clients

func (*Config) Build added in v0.6.0

func (cfg *Config) Build() error

func (*Config) Default added in v0.6.0

func (cfg *Config) Default() error

func (*Config) String added in v1.6.2

func (cfg *Config) String() string

func (*Config) Validate added in v0.6.0

func (cfg *Config) Validate() error

type Environment added in v1.6.2

type Environment struct {
	// Environment is the track 1 representation of the Azure environment
	Environment *azclient.Environment
	// Cloud is the track 2 representation of the Azure environment
	Cloud cloud.Configuration
}

func EnvironmentFromName added in v1.6.2

func EnvironmentFromName(cloudName string) (*Environment, error)

func ResolveCloudEnvironment added in v1.6.2

func ResolveCloudEnvironment(cfg *Config) (*Environment, error)

ResolveCloudEnvironment resolves the cloud environment using the following precedence: 1. File-based environment (AZURE_ENVIRONMENT_FILEPATH) 2. Known cloud names (ARM_CLOUD) 3. Default (Azure Public Cloud)

Jump to

Keyboard shortcuts

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