Documentation ¶
Index ¶
Constants ¶
const XRegistryAuthHeader = "X-Registry-Auth"
XRegistryAuthHeader is the key to the encoded registry authentication configuration in an http-request header.
Variables ¶
This section is empty.
Functions ¶
func GetCredentials ¶
GetCredentials extracts one or more DockerAuthConfigs from the request's header. The header could specify a single-auth config in which case the first return value is set. In case of a multi-auth header, the contents are stored in a temporary auth file (2nd return value). Note that the auth file should be removed after usage.
func Header ¶
func Header(sys *types.SystemContext, authfile, username, password string) (map[string]string, error)
Header returns a map with the XRegistryAuthHeader set which can conveniently be used in the http stack.
func RemoveAuthfile ¶
func RemoveAuthfile(authfile string)
RemoveAuthfile is a convenience function that is meant to be called in a deferred statement. If non-empty, it removes the specified authfile and log errors. It's meant to reduce boilerplate code at call sites of `GetCredentials`.
Types ¶
This section is empty.