Documentation
¶
Overview ¶
authutils contains small utility functions without much logic wrapping the major APIs of the core auth package for ease of use in the controllers. These functions also import the provider packages to wrap switch-case choice of provider implementations. Because of that, these functions cannot be placed in the core package as they would cause a cyclic dependency given that the provider packages also import the core package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrProviderDoesNotSupportRegistry = errors.New("provider does not support registry authentication")
ErrProviderDoesNotSupportRegistry is returned when the provider does not support registry authentication.
var ErrUnsupportedProvider = errors.New("unsupported provider")
ErrUnsupportedProvider is returned when the provider is not supported.
Functions ¶
func GetArtifactRegistryCredentials ¶
func GetArtifactRegistryCredentials(ctx context.Context, providerName, artifactRepository string, opts ...auth.Option) (authn.Authenticator, error)
GetArtifactRegistryCredentials retrieves the credentials for the specified artifact repository using the specified provider. It returns an authn.Authenticator that can be used to authenticate with the registry.
func ProviderByName ¶
ProviderByName looks up the implemented providers by name.
Types ¶
type GitCredentials ¶ added in v0.14.0
GitCredentials contains authentication data needed in order to access a Git repository.
func GetGitCredentials ¶ added in v0.14.0
func GetGitCredentials(ctx context.Context, providerName string, opts ...auth.Option) (*GitCredentials, error)
GetGitCredentials looks up by the implemented providers that support Git and returns the credentials for the provider.