Documentation ¶
Index ¶
- func GetCredentials(r *http.Request) (*types.DockerAuthConfig, string, error)
- func MakeXRegistryAuthHeader(sys *types.SystemContext, username, password string) (http.Header, error)
- func MakeXRegistryConfigHeader(sys *types.SystemContext, username, password string) (http.Header, error)
- func RemoveAuthfile(authfile string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCredentials ¶
GetCredentials queries the http.Request for X-Registry-.* headers and extracts the necessary authentication information for libpod operations, possibly creating a config file. If that is the case, the caller must call RemoveAuthFile.
func MakeXRegistryAuthHeader ¶
func MakeXRegistryAuthHeader(sys *types.SystemContext, username, password string) (http.Header, error)
MakeXRegistryAuthHeader returns a map with the "X-Registry-Auth" header set, which can conveniently be used in the http stack.
func MakeXRegistryConfigHeader ¶
func MakeXRegistryConfigHeader(sys *types.SystemContext, username, password string) (http.Header, error)
MakeXRegistryConfigHeader returns a map with the "X-Registry-Config" header 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.