azure

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AADResource = "https://containerregistry.azure.net/.default"
)
View Source
const GrantTypeAccessToken = "access_token"

Variables

This section is empty.

Functions

This section is empty.

Types

type AADAccessTokenGetter added in v1.4.0

type AADAccessTokenGetter interface {
	GetAADAccessToken(ctx context.Context, tenantID, clientID, resource string) (confidential.AuthResult, error)
}

AADAccessTokenGetter defines an interface for getting an AAD access token.

type AuthClient added in v1.4.0

define the interface for authentication operations. It includes the method for exchanging an AAD access token for an ACR refresh token.

type AuthClientFactory added in v1.4.0

type AuthClientFactory interface {
	CreateAuthClient(serverURL string, options *azcontainerregistry.AuthenticationClientOptions) (AuthClient, error)
}

AuthClientFactory defines an interface for creating an authentication client.

type AuthenticationClientInterface added in v1.4.0

Define the interface for azcontainerregistry.AuthenticationClient methods used

type AuthenticationClientWrapper added in v1.4.0

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

Define the wrapper for AuthenticationClientInterface

func (*AuthenticationClientWrapper) ExchangeAADAccessTokenForACRRefreshToken added in v1.4.0

A wrapper method that calls the underlying AuthenticationClientInterface's method. Exchanges an AAD access token for an ACR refresh token.

type AzureWIProviderFactory

type AzureWIProviderFactory struct{} //nolint:revive // ignore linter to have unique type name

func (*AzureWIProviderFactory) Create

Create returns an AzureWIAuthProvider

type MIAuthProvider added in v1.4.0

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

func (*MIAuthProvider) Enabled added in v1.4.0

func (d *MIAuthProvider) Enabled(_ context.Context) bool

Enabled checks for non empty tenant ID and AAD access token

func (*MIAuthProvider) Provide added in v1.4.0

func (d *MIAuthProvider) Provide(ctx context.Context, artifact string) (provider.AuthConfig, error)

Provide returns the credentials for a specified artifact. Uses Managed Identity to retrieve an AAD access token which can be exchanged for a valid ACR refresh token for login.

type ManagedIdentityTokenGetter added in v1.4.0

type ManagedIdentityTokenGetter interface {
	GetManagedIdentityToken(ctx context.Context, clientID string) (azcore.AccessToken, error)
}

ManagedIdentityTokenGetter defines an interface for getting a managed identity token.

type MetricsReporter added in v1.4.0

type MetricsReporter interface {
	ReportMetrics(ctx context.Context, duration int64, artifactHostName string)
}

MetricsReporter defines an interface for reporting metrics.

type RegistryHostGetter added in v1.4.0

type RegistryHostGetter interface {
	GetRegistryHost(artifact string) (string, error)
}

RegistryHostGetter defines an interface for getting the registry host.

type WIAuthProvider added in v1.4.0

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

func (*WIAuthProvider) Enabled added in v1.4.0

func (d *WIAuthProvider) Enabled(_ context.Context) bool

Enabled checks for non empty tenant ID and AAD access token

func (*WIAuthProvider) Provide added in v1.4.0

func (d *WIAuthProvider) Provide(ctx context.Context, artifact string) (provider.AuthConfig, error)

Provide returns the credentials for a specified artifact. Uses Azure Workload Identity to retrieve an AAD access token which can be exchanged for a valid ACR refresh token for login.

Jump to

Keyboard shortcuts

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