ociauth

package
v1.135.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: Apache-2.0 Imports: 4 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

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