credentials

package
v29.5.0-rc.1+incompatible Latest Latest
Warning

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

Go to latest
Published: May 11, 2026 License: Apache-2.0 Imports: 10 Imported by: 481

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertToHostname

func ConvertToHostname(maybeURL string) string

ConvertToHostname normalizes a registry URL which has http|https prepended to just its hostname. It is used to match credentials, which may be either stored as hostname or as hostname including scheme (in legacy configuration files).

It's the equivalent to registry.ConvertToHostname in the daemon.

func DetectDefaultStore

func DetectDefaultStore(customStore string) string

DetectDefaultStore returns the credentials store to use if no user-defined custom helper is passed.

Some platforms define a preferred helper, in which case it attempts to look up the helper binary before falling back to the platform's default.

If no user-defined helper is passed, and no helper is found, it returns an empty string, which means credentials are stored unencrypted in the CLI's config-file without the use of a credentials store.

Types

type Store

type Store interface {
	// Erase removes credentials from the store for a given server.
	Erase(serverAddress string) error
	// Get retrieves credentials from the store for a given server.
	Get(serverAddress string) (types.AuthConfig, error)
	// GetAll retrieves all the credentials from the store.
	GetAll() (map[string]types.AuthConfig, error)
	// Store saves credentials in the store.
	Store(authConfig types.AuthConfig) error
}

Store is the interface that any credentials store must implement.

func NewFileStore

func NewFileStore(file store) Store

NewFileStore creates a new file credentials store.

func NewNativeStore

func NewNativeStore(file store, helperSuffix string) Store

NewNativeStore creates a new native store that uses a remote helper program to manage credentials.

Jump to

Keyboard shortcuts

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