authutils

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2025 License: Apache-2.0 Imports: 7 Imported by: 3

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

View Source
var ErrProviderDoesNotSupportRegistry = errors.New("provider does not support registry authentication")

ErrProviderDoesNotSupportRegistry is returned when the provider does not support registry authentication.

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

func ProviderByName(name string) auth.Provider

ProviderByName looks up the implemented providers by name.

Types

type GitCredentials added in v0.14.0

type GitCredentials struct {
	BearerToken string
	Username    string
	Password    string
}

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.

Jump to

Keyboard shortcuts

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