authn

package
v0.0.0-...-30fe120 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package authn implements the logic for authentication with OCI registries.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Login

func Login(hostname, user, token string) error

Login to remote registry. For now, only support login with token.

func Logout

func Logout(hostname string) error

Logout from remote registry.

func NewClient

func NewClient(cred auth.Credential) *auth.Client

NewClient creates a new authenticated client to interact with a remote registry.

Types

type Store

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

Store provides credential CRUD operations.

func NewStore

func NewStore(configPaths ...string) (*Store, error)

NewStore generates a store based on the passed in config file path.

func (*Store) Credential

func (s *Store) Credential(ctx context.Context, registry string) (auth.Credential, error)

Credential iterates all the config files, returns the first non-empty credential in a best-effort way.

func (*Store) Erase

func (s *Store) Erase(registry string) error

Erase erases a credential for a given registry.

func (*Store) Store

func (s *Store) Store(registry string, cred auth.Credential) error

Store stores a credential for a given registry.

Jump to

Keyboard shortcuts

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