auth

package
v0.13.12 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 34 Imported by: 7

Documentation

Index

Constants

View Source
const DefaultImageServiceAddress = "/run/containerd/containerd.sock"

Variables

View Source
var Credentials []resolver.Credential = make([]resolver.Credential, 0, 8)

Should be concurrency safe

Functions

func AddImageProxy added in v0.5.0

func AddImageProxy(ctx context.Context, rpc *grpc.Server, imageServiceAddress string)

from stargz-snapshotter/cmd/containerd-stargz-grpc/main.go#main

func InitKubeSecretListener added in v0.3.0

func InitKubeSecretListener(ctx context.Context, kubeconfigPath string) error

Types

type KubeSecretListener added in v0.3.0

type KubeSecretListener struct {
	// contains filtered or unexported fields
}

func (*KubeSecretListener) GetCredentialsStore added in v0.3.0

func (kubelistener *KubeSecretListener) GetCredentialsStore(host string) *PassKeyChain

func (*KubeSecretListener) SyncKubeSecrets added in v0.3.0

func (kubelistener *KubeSecretListener) SyncKubeSecrets(ctx context.Context, clientset *kubernetes.Clientset) error

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 FromCRI added in v0.5.0

func FromCRI(host, ref string) (*PassKeyChain, error)

func FromDockerConfig

func FromDockerConfig(host string) *PassKeyChain

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

func FromKubeSecretDockerConfig added in v0.3.0

func FromKubeSecretDockerConfig(host string) *PassKeyChain

func FromLabels

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

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

func GetKeyChainByRef added in v0.3.0

func GetKeyChainByRef(ref string, labels map[string]string) (*PassKeyChain, error)

func GetRegistryKeyChain

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

GetRegistryKeyChain get image pull keychain from (ordered): 1. username and secrets labels 2. cri request 3. docker config 4. k8s docker config secret

func (PassKeyChain) Resolve

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