auth

package
v5.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 10, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCredentials

func GetCredentials(r *http.Request) (*types.DockerAuthConfig, string, error)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL