Documentation
¶
Index ¶
Constants ¶
const (
AADResource = "https://containerregistry.azure.net/.default"
)
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
type AuthClient interface {
ExchangeAADAccessTokenForACRRefreshToken(ctx context.Context, grantType azcontainerregistry.PostContentSchemaGrantType, service string, options *azcontainerregistry.AuthenticationClientExchangeAADAccessTokenForACRRefreshTokenOptions) (azcontainerregistry.AuthenticationClientExchangeAADAccessTokenForACRRefreshTokenResponse, error)
}
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
type AuthenticationClientInterface interface {
ExchangeAADAccessTokenForACRRefreshToken(ctx context.Context, grantType azcontainerregistry.PostContentSchemaGrantType, service string, options *azcontainerregistry.AuthenticationClientExchangeAADAccessTokenForACRRefreshTokenOptions) (azcontainerregistry.AuthenticationClientExchangeAADAccessTokenForACRRefreshTokenResponse, error)
}
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
func (w *AuthenticationClientWrapper) ExchangeAADAccessTokenForACRRefreshToken(ctx context.Context, grantType azcontainerregistry.PostContentSchemaGrantType, service string, options *azcontainerregistry.AuthenticationClientExchangeAADAccessTokenForACRRefreshTokenOptions) (azcontainerregistry.AuthenticationClientExchangeAADAccessTokenForACRRefreshTokenResponse, error)
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 ¶
func (s *AzureWIProviderFactory) Create(authProviderConfig provider.AuthProviderConfig) (provider.AuthProvider, error)
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
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.