Documentation
¶
Overview ¶
Package authn provides authentication support for registry operations. This replaces go-containerregistry's authn package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Anonymous ¶
type Anonymous struct{}
Anonymous implements Authenticator for anonymous access.
func (*Anonymous) Authorization ¶
func (a *Anonymous) Authorization() (*AuthConfig, error)
Authorization returns empty credentials for anonymous access.
type AuthConfig ¶
type AuthConfig struct {
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
Auth string `json:"auth,omitempty"`
IdentityToken string `json:"identitytoken,omitempty"`
RegistryToken string `json:"registrytoken,omitempty"`
}
AuthConfig contains authentication credentials.
type Authenticator ¶
type Authenticator interface {
// Authorization returns the authentication credentials.
Authorization() (*AuthConfig, error)
}
Authenticator provides authentication credentials for registry operations.
func FromConfig ¶
func FromConfig(cfg AuthConfig) Authenticator
FromConfig creates an Authenticator from an AuthConfig.
type Basic ¶
Basic implements Authenticator for basic username/password authentication.
func (*Basic) Authorization ¶
func (b *Basic) Authorization() (*AuthConfig, error)
Authorization returns the basic auth credentials.
type Bearer ¶
type Bearer struct {
Token string
}
Bearer implements Authenticator for bearer token authentication.
func (*Bearer) Authorization ¶
func (b *Bearer) Authorization() (*AuthConfig, error)
Authorization returns the bearer token credentials.
type Keychain ¶
type Keychain interface {
// Resolve returns an Authenticator for the given resource.
Resolve(Resource) (Authenticator, error)
}
Keychain provides a way to resolve credentials for registries.
var DefaultKeychain Keychain = &defaultKeychain{}
DefaultKeychain is the default keychain that reads from ~/.docker/config.json.
type Resource ¶
type Resource interface {
// RegistryStr returns the registry hostname.
RegistryStr() string
}
Resource represents a registry resource that can be resolved for authentication.
func NewResource ¶
NewResource creates a Resource from a reference.