auth

package
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2020 License: Apache-2.0 Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
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

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

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(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.

Jump to

Keyboard shortcuts

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