Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Header ¶
func Header(sys *types.SystemContext, headerName HeaderAuthName, authfile, username, password string) (map[string]string, error)
Header builds the requested Authentication Header
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 ¶
type HeaderAuthName ¶ added in v2.2.0
type HeaderAuthName string
const XRegistryAuthHeader HeaderAuthName = "X-Registry-Auth"
XRegistryAuthHeader is the key to the encoded registry authentication configuration in an http-request header. This header supports one registry per header occurrence. To support N registries provided N headers, one per registry. As of Docker API 1.40 and Libpod API 1.0.0, this header is supported by all endpoints.
const XRegistryConfigHeader HeaderAuthName = "X-Registry-Config"
XRegistryConfigHeader is the key to the encoded registry authentication configuration in an http-request header. This header supports N registries in one header via a Base64 encoded, JSON map. As of Docker API 1.40 and Libpod API 2.0.0, this header is supported by build endpoints.
func GetCredentials ¶
func GetCredentials(r *http.Request) (*types.DockerAuthConfig, string, HeaderAuthName, error)
GetCredentials queries the http.Request for X-Registry-.* headers and extracts the necessary authentication information for libpod operations
func (HeaderAuthName) String ¶ added in v2.2.0
func (h HeaderAuthName) String() string