Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddToRequest ¶
AddToRequest adds a token as a Bearer Authorization of a request
func ChallengeHeader ¶
func ChallengeHeader( ref reference.Named, repoInfo dregistry.RepositoryInfo, endpoint dregistry.APIEndpoint, creds Credentials, ) (auth string, err error)
ChallengeHeader requests the challenge header from the auth server
Types ¶
type Authenticator ¶
Authenticator produces a Bearer token to authenticate with the HTTP API
func NewAuthenticator ¶
func NewAuthenticator(client *http.Client, credentials Credentials) Authenticator
NewAuthenticator creates a new Authenticator
type Challenge ¶
type Challenge struct {
// contains filtered or unexported fields
}
Challenge from a auth server
func ParseChallengeHeader ¶
ParseChallengeHeader parses the challenge header and extract the relevant parts
type Credentials ¶
Credentials represents a username password pair
func NewCreds ¶
func NewCreds(username, password string) Credentials
NewCreds creates a struct that satisfies Credentials from a username and password (typically entered at the command like)
func NewDefaultCreds ¶
func NewDefaultCreds(repoInfo *dregistry.RepositoryInfo) (Credentials, error)
NewDefaultCreds create a credentials struct from the credentials in the default conf file, typically ~/.docker/config.json. the struct is lazy, i.e. the file is only read if the username or password is accessed