azidentityext

package module
v0.0.0-...-0f1e6ba Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2023 License: MIT Imports: 7 Imported by: 0

README

azidentityext

This is a extension module for https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity, for my personal needs.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultAzureCredential

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

DefaultAzureCredential is a default credential chain for applications that will deploy to Azure. It combines credentials suitable for deployment with credentials suitable for local development. It attempts to authenticate with each of these credential types, in the following order, stopping when one provides a token:

  • [EnvironmentCredential]
  • [WorkloadIdentityCredential], if environment variable configuration is set by the Azure workload identity webhook. Use [WorkloadIdentityCredential] directly when not using the webhook or needing more control over its configuration.
  • [ManagedIdentityCredential]
  • [AzureCLICredential]

Consult the documentation for these credential types for more information on how they authenticate. Once a credential has successfully authenticated, DefaultAzureCredential will use that credential for every subsequent authentication.

func NewDefaultAzureCredential

func NewDefaultAzureCredential(options *DefaultAzureCredentialOptions) (cred *DefaultAzureCredential, credErrors []error, err error)

NewDefaultAzureCredential creates a DefaultAzureCredential. Pass nil for options to accept defaults. Some credentials builder function might return error, which will be returned in the `credErrors`, in which case that failed credential will not be included as part of the returned `cred`. If all the possible creds are all failed to build, non nil `err` will be returned.

func (*DefaultAzureCredential) GetToken

GetToken requests an access token from Azure Active Directory. This method is called automatically by Azure SDK clients.

type DefaultAzureCredentialOptions

type DefaultAzureCredentialOptions struct {
	azcore.ClientOptions

	// Toggles to disabling the specified auth method
	DisableEnvironmentCred      bool
	DisableWorkloadIdentityCred bool
	DisableManagedIdentityCred  bool
	DisableAzureCLICred         bool

	// DisableInstanceDiscovery should be true for applications authenticating in disconnected or private clouds.
	// This skips a metadata request that will fail for such applications.
	DisableInstanceDiscovery bool
	// TenantID identifies the tenant the Azure CLI should authenticate in.
	// Defaults to the CLI's default tenant, which is typically the home tenant of the user logged in to the CLI.
	TenantID string
}

DefaultAzureCredentialOptions contains optional parameters for DefaultAzureCredential. These options may not apply to all credentials in the chain.

Jump to

Keyboard shortcuts

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