ociauth

package
v0.90.0 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var UserPasswordKeyChain authn.Keychain = &Credentials{}

Functions

func NewCredentials

func NewCredentials(repoURI, username, password string) (authn.Keychain, error)

Get and validate OCI credentials by providing a repository URL

func NewCredentialsFromRegistry added in v0.65.0

func NewCredentialsFromRegistry(repoURI, username, password string) (authn.Keychain, error)

Get and validate OCI credentials by providing a registry URL (no path)

Types

type Credentials

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

func (*Credentials) Authorization

func (repo *Credentials) Authorization() (*authn.AuthConfig, error)

Authorization implements an authn.Authenticator

See https://pkg.go.dev/github.com/google/go-containerregistry/pkg/authn#Authenticator

Returns an authn.AuthConfig with a user / password pair to be used for authentication

func (*Credentials) Resolve

func (repo *Credentials) Resolve(resource authn.Resource) (authn.Authenticator, error)

Resolve implements an authn.KeyChain

See https://pkg.go.dev/github.com/google/go-containerregistry/pkg/authn#Keychain

Returns a custom credentials authn.Authenticator if the given resource RegistryStr() matches the Repository, otherwise it returns annonymous access

Jump to

Keyboard shortcuts

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