Documentation ¶
Index ¶
- Variables
- type AuthConfig
- type Config
- func (cfg *Config) CredentialsStore() string
- func (cfg *Config) DeleteCredential(serverAddress string) error
- func (cfg *Config) GetCredential(serverAddress string) (auth.Credential, error)
- func (cfg *Config) GetCredentialHelper(serverAddress string) string
- func (cfg *Config) IsAuthConfigured() bool
- func (cfg *Config) Path() string
- func (cfg *Config) PutCredential(serverAddress string, cred auth.Credential) error
- func (cfg *Config) SetCredentialsStore(credsStore string) error
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidConfigFormat = errors.New("invalid config format")
ErrInvalidConfigFormat is returned when the config format is invalid.
Functions ¶
This section is empty.
Types ¶
type AuthConfig ¶
type AuthConfig struct { // Auth is a base64-encoded string of "{username}:{password}". Auth string `json:"auth,omitempty"` // IdentityToken is used to authenticate the user and get an access token // for the registry. IdentityToken string `json:"identitytoken,omitempty"` // RegistryToken is a bearer token to be sent to a registry. RegistryToken string `json:"registrytoken,omitempty"` Username string `json:"username,omitempty"` // legacy field for compatibility Password string `json:"password,omitempty"` // legacy field for compatibility }
AuthConfig contains authorization information for connecting to a Registry. References:
- https://github.com/docker/cli/blob/v24.0.0-beta.2/cli/config/configfile/file.go#L17-L45
- https://github.com/docker/cli/blob/v24.0.0-beta.2/cli/config/types/authconfig.go#L3-L22
func NewAuthConfig ¶
func NewAuthConfig(cred auth.Credential) AuthConfig
NewAuthConfig creates an authConfig based on cred.
func (AuthConfig) Credential ¶
func (ac AuthConfig) Credential() (auth.Credential, error)
Credential returns an auth.Credential based on ac.
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config represents a docker configuration file. References:
- https://docs.docker.com/engine/reference/commandline/cli/#docker-cli-configuration-file-configjson-properties
- https://github.com/docker/cli/blob/v24.0.0-beta.2/cli/config/configfile/file.go#L17-L44
func (*Config) CredentialsStore ¶
CredentialsStore returns the configured credentials store.
func (*Config) DeleteCredential ¶
DeleteAuthConfig deletes the corresponding credential for serverAddress.
func (*Config) GetCredential ¶
func (cfg *Config) GetCredential(serverAddress string) (auth.Credential, error)
GetAuthConfig returns an auth.Credential for serverAddress.
func (*Config) GetCredentialHelper ¶
GetCredentialHelper returns the credential helpers for serverAddress.
func (*Config) IsAuthConfigured ¶
IsAuthConfigured returns whether there is authentication configured in this config file or not.
func (*Config) PutCredential ¶
func (cfg *Config) PutCredential(serverAddress string, cred auth.Credential) error
PutAuthConfig puts cred for serverAddress.
func (*Config) SetCredentialsStore ¶
SetCredentialsStore puts the configured credentials store.