auth

package
v3.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2021 License: Apache-2.0 Imports: 12 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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

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

func (h HeaderAuthName) String() string

Jump to

Keyboard shortcuts

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