Help us shape the future of Go! Take the 2026 Go Developer Survey

azure

package
v0.66.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: Apache-2.0 Imports: 22 Imported by: 3

Documentation

Index

Constants

View Source
const ProviderName = "azure"

ProviderName is the name of the Azure authentication provider.

Variables

This section is empty.

Functions

func NewTokenCredential added in v0.11.0

func NewTokenCredential(ctx context.Context, opts ...auth.Option) azcore.TokenCredential

NewTokenCredential creates a new token credential for the given options.

Types

type AKSClient added in v0.21.0

AKSClient provides the required methods of the AKS client.

type AccessToken added in v0.64.0

type AccessToken struct{ azcore.AccessToken }

AccessToken is the Azure access token.

func (*AccessToken) GetDuration added in v0.64.0

func (t *AccessToken) GetDuration() time.Duration

GetDuration implements auth.Credential.

type Implementation added in v0.11.0

type Implementation interface {
	NewDefaultAzureCredential(options *azidentity.DefaultAzureCredentialOptions) (azcore.TokenCredential, error)
	NewDefaultAzureCredentialWithoutShellOut(options *azidentity.DefaultAzureCredentialOptions) (azcore.TokenCredential, error)
	NewClientAssertionCredential(tenantID string, clientID string, getAssertion func(context.Context) (string, error), options *azidentity.ClientAssertionCredentialOptions) (azcore.TokenCredential, error)
	ExchangeAADAccessTokenForACRRefreshToken(ctx context.Context, client *azcontainerregistry.AuthenticationClient, grantType azcontainerregistry.PostContentSchemaGrantType, service string, options *azcontainerregistry.AuthenticationClientExchangeAADAccessTokenForACRRefreshTokenOptions) (azcontainerregistry.AuthenticationClientExchangeAADAccessTokenForACRRefreshTokenResponse, error)
	NewManagedClustersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (AKSClient, error)
}

Implementation provides the required methods of the Azure libraries.

type Provider added in v0.11.0

type Provider struct{ Implementation }

Provider implements the auth.Provider interface for Azure authentication.

func (Provider) GetAccessCredentialOptionsForArtifactRepository added in v0.64.0

func (p Provider) GetAccessCredentialOptionsForArtifactRepository(artifactRepository string,
	_ ...auth.Option) ([]auth.Option, error)

GetAccessCredentialOptionsForArtifactRepository implements auth.Provider.

func (Provider) GetAccessCredentialOptionsForCluster added in v0.64.0

func (Provider) GetAccessCredentialOptionsForCluster(opts ...auth.Option) ([][]auth.Option, error)

GetAccessCredentialOptionsForCluster implements auth.Provider.

func (Provider) GetAccessCredentialOptionsForGitRepository added in v0.64.0

func (Provider) GetAccessCredentialOptionsForGitRepository(*url.URL) ([]auth.Option, error)

GetAccessCredentialOptionsForGitRepository implements auth.GitCredentialsProvider. Azure DevOps requires the DevOps scope for obtaining an access credential that can be used as a bearer token against Azure Repos.

func (Provider) GetAudiences added in v0.21.0

func (Provider) GetAudiences(_ context.Context, opts ...auth.Option) ([]string, error)

GetAudiences implements auth.Provider.

func (Provider) GetIdentity added in v0.11.0

func (Provider) GetIdentity(opts ...auth.Option) (string, error)

GetIdentity implements auth.Provider.

func (Provider) GetName added in v0.11.0

func (Provider) GetName() string

GetName implements auth.Provider.

func (Provider) NewAccessCredentialForIdentity added in v0.64.0

func (p Provider) NewAccessCredentialForIdentity(ctx context.Context, identity auth.Credential,
	opts ...auth.Option) (auth.Credential, error)

NewAccessCredentialForIdentity implements auth.Provider.

func (Provider) NewArtifactRegistryCredentials added in v0.12.0

func (p Provider) NewArtifactRegistryCredentials(ctx context.Context, registry string,
	accessCredential auth.Credential, opts ...auth.Option) (*auth.ArtifactRegistryCredentials, error)

NewArtifactRegistryCredentials implements auth.Provider.

func (Provider) NewControllerToken added in v0.12.0

func (p Provider) NewControllerToken(ctx context.Context, opts ...auth.Option) (auth.Credential, error)

NewControllerToken implements auth.Provider.

func (Provider) NewGitCredentials added in v0.42.0

func (Provider) NewGitCredentials(_ context.Context, _ string,
	accessCredential auth.Credential, _ ...auth.Option) (*auth.GitCredentials, error)

NewGitCredentials implements auth.GitCredentialsProvider.

func (Provider) NewRESTConfig added in v0.21.0

func (p Provider) NewRESTConfig(ctx context.Context, accessCredentials []auth.Credential,
	opts ...auth.Option) (*auth.RESTConfig, error)

NewRESTConfig implements auth.Provider.

func (Provider) ParseArtifactRepository added in v0.12.0

func (Provider) ParseArtifactRepository(artifactRepository string) (string, error)

ParseArtifactRepository implements auth.Provider. ParseArtifactRepository returns the ACR registry host.

func (Provider) ParseGitRepository added in v0.42.0

func (Provider) ParseGitRepository(*url.URL) (string, error)

ParseGitRepository implements auth.GitCredentialsProvider. Azure DevOps access credentials are not bound to the Git repository URL, so this returns a constant input that does not affect the cache key.

Jump to

Keyboard shortcuts

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