auth

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2020 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildEnvVar

func BuildEnvVar(keychain authn.Keychain, images ...string) (string, error)

BuildEnvVar creates the contents to use for authentication environment variable.

Complementary to `ReadEnvVar`.

func NewKeychain added in v0.7.5

func NewKeychain(envVar string) authn.Keychain

NewKeychain returns either a EnvKeychain or a authn.DefaultKeychain depending on whether the provided environment variable is set

func ReadEnvVar

func ReadEnvVar(envVar string) (map[string]string, error)

ReadEnvVar parses an environment variable to produce a map of 'registry url' to 'authorization header'.

Complementary to `BuildEnvVar`.

Example Input:

{"gcr.io": "Bearer asdf=", "docker.io": "Basic qwerty="}

Example Output:

gcr.io -> Bearer asdf=
docker.io -> Basic qwerty=

func ReferenceForRepoName

func ReferenceForRepoName(keychain authn.Keychain, ref string) (name.Reference, authn.Authenticator, error)

Types

type EnvKeychain

type EnvKeychain struct {
	EnvVar string
}

EnvKeychain uses the contents of an environment variable to resolve auth for a registry

func (*EnvKeychain) Resolve added in v0.7.5

func (k *EnvKeychain) Resolve(resource authn.Resource) (authn.Authenticator, error)

Jump to

Keyboard shortcuts

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