authprovider

package
v1.0.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultAuthProviderName string = "dockerConfig"

Variables

View Source
var ErrorNoMatchingCredential = errors.New("no matching credential found for k8 secret")

Functions

func GetRegistryHostName

func GetRegistryHostName(artifact string) (string, error)

func Register

func Register(name string, factory AuthProviderFactory)

Register adds the factory to the built in providers map

Types

type AuthConfig

type AuthConfig struct {
	Username      string
	Password      string
	IdentityToken string
	Email         string
	Provider      AuthProvider
	ExpiresOn     time.Time
}

This config represents the credentials that should be used when pulling artifacts from specific repositories.

type AuthProvider

type AuthProvider interface {
	// Enabled returns true if the config provider is properly enabled
	// It will verify necessary values provided in config file to
	// create the AuthProvider
	Enabled(ctx context.Context) bool
	// Provide returns AuthConfig for registry.
	Provide(ctx context.Context, artifact string) (AuthConfig, error)
}

func CreateAuthProviderFromConfig

func CreateAuthProviderFromConfig(authProviderConfig AuthProviderConfig) (AuthProvider, error)

CreateAuthProvidersFromConfig creates the AuthProvider from the provided configuration. If the AuthProviderConfig isn't specified, use the default auth provider

type AuthProviderConfig

type AuthProviderConfig map[string]interface{}

AuthProviderConfig represents the configuration of an AuthProvider

type AuthProviderFactory

type AuthProviderFactory interface {
	Create(authProviderConfig AuthProviderConfig) (AuthProvider, error)
}

AuthProviderFactory is an interface that defines methods to create an AuthProvider

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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