Documentation
¶
Index ¶
Constants ¶
View Source
const DefaultAuthProviderName string = "dockerConfig"
View Source
const DefaultDockerAuthTTL = 1 * time.Hour
Variables ¶
This section is empty.
Functions ¶
func GetRegistryHostName ¶
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 `json:"-"` // Provider is not serialized
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{} //nolint:revive // ignore linter to have unique type name
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
Source Files
¶
Click to show internal directories.
Click to hide internal directories.