auth

package
v0.0.0-...-3cab0da Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PassKeyChain

type PassKeyChain struct {
	Username string
	Password string
}

PassKeyChain is user/password based key chain

func FromBase64

func FromBase64(str string) (PassKeyChain, error)

func FromDockerConfig

func FromDockerConfig(host string) *PassKeyChain

FromDockerConfig finds auth for a given host in docker's config.json settings.

func FromLabels

func FromLabels(labels map[string]string) *PassKeyChain

FromLabels finds image pull username and secret from snapshot labels. Returned `nil` means no validated username and secrect are passed, it should not override input nydusd configuration.

func GetRegistryKeyChain

func GetRegistryKeyChain(host string, labels map[string]string) *PassKeyChain

GetRegistryKeyChain get image pull kaychain from (ordered): 1. username and secrets labels 2. docker config

func (PassKeyChain) Resolve

func (kc PassKeyChain) Resolve(target authn.Resource) (authn.Authenticator, error)

func (PassKeyChain) ToBase64

func (kc PassKeyChain) ToBase64() string

func (PassKeyChain) TokenBase

func (kc PassKeyChain) TokenBase() bool

TokenBase check if PassKeyChain is token based, when username is empty and password is not empty then password is registry token

Jump to

Keyboard shortcuts

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