armauth

package
v0.33.0 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UCPCredentialAuth    = "UCPCredential"
	ServicePrincipalAuth = "ServicePrincipal"
	ManagedIdentityAuth  = "ManagedIdentity"
	CliAuth              = "CLI"
)

Authentication methods

Variables

This section is empty.

Functions

func GetAuthMethod

func GetAuthMethod() string

GetAuthMethod returns the authentication method to use based on environment variables.

func IsServicePrincipalConfigured

func IsServicePrincipalConfigured() (bool, error)

IsServicePrincipalConfigured checks if ServicePrincipalAuth is the authentication method configured.

func NewARMCredential

func NewARMCredential(opt *Options) (azcore.TokenCredential, error)

NewARMCredential evaluates the authentication method and returns the appropriate credential.

Types

type ArmConfig

type ArmConfig struct {
	// ClientOptions is the client options for Azure SDK client.
	ClientOptions clientv2.Options
}

ArmConfig is the configuration we use for managing ARM resources

func NewArmConfig

func NewArmConfig(opt *Options) (*ArmConfig, error)

NewArmConfig creates a new ArmConfig instance with the given options, or default options if none are provided, and returns it or an error if one occurs.

type Options

type Options struct {
	// CredentialProvider is an UCP credential client for Azure service principal.
	CredentialProvider sdk_cred.CredentialProvider[sdk_cred.AzureCredential]
}

Options represents the options of ArmConfig.

Jump to

Keyboard shortcuts

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