auth

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2024 License: Apache-2.0, Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetUserAgentExtension

func GetUserAgentExtension() string

func NewAuthorizer

func NewAuthorizer(config *Config, env *azure.Environment) (autorest.Authorizer, error)

func NewCredential

func NewCredential(cfg *Config, authorizer autorest.Authorizer) (azcore.TokenCredential, error)

NewCredential provides a token credential for msi and service principal auth

Types

type ClientAssertionCredential

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

ClientAssertionCredential authenticates an application with assertions provided by a callback function.

func (*ClientAssertionCredential) GetToken

GetToken implements the TokenCredential interface

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 {
	Location       string `json:"location" yaml:"location"`
	TenantID       string `json:"tenantId" yaml:"tenantId"`
	SubscriptionID string `json:"subscriptionId" yaml:"subscriptionId"`
	ResourceGroup  string `json:"resourceGroup" yaml:"resourceGroup"`

	UserAssignedIdentityID string `json:"userAssignedIdentityID" yaml:"userAssignedIdentityID"`

	//Configs only for AKS
	ClusterName string `json:"clusterName" yaml:"clusterName"`
	//Config only for AKS
	NodeResourceGroup string `json:"nodeResourceGroup" yaml:"nodeResourceGroup"`

	// enableDynamicSKUCache defines whether to enable dynamic instance workflow for instance information check
	EnableDynamicSKUCache bool `json:"enableDynamicSKUCache,omitempty" yaml:"enableDynamicSKUCache,omitempty"`
	// EnableDetailedCSEMessage defines whether to emit error messages in the CSE error body info
	EnableDetailedCSEMessage bool `json:"enableDetailedCSEMessage,omitempty" yaml:"enableDetailedCSEMessage,omitempty"`

	// EnableForceDelete defines whether to enable force deletion on the APIs
	EnableForceDelete bool `json:"enableForceDelete,omitempty" yaml:"enableForceDelete,omitempty"`

	// EnableGetVmss defines whether to enable making a call to GET VMSS to fetch fresh capacity info
	// The TTL for this cache is controlled by the GetVmssSizeRefreshPeriod interval
	EnableGetVmss bool `json:"enableGetVmss,omitempty" yaml:"enableGetVmss,omitempty"`

	// GetVmssSizeRefreshPeriod defines how frequently to call GET VMSS API to fetch VMSS info per nodegroup instance
	GetVmssSizeRefreshPeriod time.Duration `json:"getVmssSizeRefreshPeriod,omitempty" yaml:"getVmssSizeRefreshPeriod,omitempty"`

	// EnablePartialScaling defines whether to enable partial scaling based on quota limits
	EnablePartialScaling bool `json:"enablePartialScaling,omitempty" yaml:"enablePartialScaling,omitempty"`
}

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 nolint: gocyclo

func (*Config) BaseVars

func (cfg *Config) BaseVars()

func (*Config) GetAzureClientConfig

func (cfg *Config) GetAzureClientConfig(authorizer autorest.Authorizer, env *azure.Environment) *ClientConfig

func (*Config) TrimSpace

func (cfg *Config) TrimSpace()

TrimSpace removes all leading and trailing white spaces.

Jump to

Keyboard shortcuts

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