credentialprovider

package
v0.0.0-alpha.0....-6b8e30c Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultDockerConfigJSONPaths

func DefaultDockerConfigJSONPaths() []string

DefaultDockerConfigJSONPaths returns default search paths of .docker/config.json

func DefaultDockercfgPaths

func DefaultDockercfgPaths() []string

DefaultDockercfgPaths returns default search paths of .dockercfg

func GetPreferredDockercfgPath

func GetPreferredDockercfgPath() string

GetPreferredDockercfgPath get preferred docker config path

func ReadURL

func ReadURL(url string, client *http.Client, header *http.Header) (body []byte, err error)

ReadURL read contents from given url

func SetPreferredDockercfgPath

func SetPreferredDockercfgPath(path string)

SetPreferredDockercfgPath set preferred docker config path

Types

type DockerConfig

type DockerConfig map[string]DockerConfigEntry

DockerConfig represents the config file used by the docker CLI. This config that represents the credentials that should be used when pulling images from specific image repositories.

func ReadDockerConfigFile

func ReadDockerConfigFile() (cfg DockerConfig, err error)

ReadDockerConfigFile read a docker config file from default path

func ReadDockerConfigFileFromURL

func ReadDockerConfigFileFromURL(url string, client *http.Client, header *http.Header) (cfg DockerConfig, err error)

ReadDockerConfigFileFromURL read a docker config file from the given url

func ReadDockerConfigJSONFile

func ReadDockerConfigJSONFile(searchPaths []string) (cfg DockerConfig, err error)

ReadDockerConfigJSONFile attempts to read a docker config.json file from the given paths. if searchPaths is empty, the default paths are used.

func ReadDockercfgFile

func ReadDockercfgFile(searchPaths []string) (cfg DockerConfig, err error)

ReadDockercfgFile attempts to read a legacy dockercfg file from the given paths. if searchPaths is empty, the default paths are used.

func ReadSpecificDockerConfigJSONFile

func ReadSpecificDockerConfigJSONFile(filePath string) (cfg DockerConfig, err error)

ReadSpecificDockerConfigJSONFile attempts to read docker configJSON from a given file path.

type DockerConfigEntry

type DockerConfigEntry struct {
	Username      string
	Password      string
	Email         string
	IdentityToken string
}

DockerConfigEntry wraps a docker config as a entry

func (DockerConfigEntry) MarshalJSON

func (ident DockerConfigEntry) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface.

func (*DockerConfigEntry) UnmarshalJSON

func (ident *DockerConfigEntry) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface.

type DockerConfigJSON

type DockerConfigJSON struct {
	Auths DockerConfig `json:"auths"`
	// +optional
	HTTPHeaders map[string]string `json:"HttpHeaders,omitempty"`
}

DockerConfigJSON represents ~/.docker/config.json file info see https://github.com/docker/docker/pull/12009

type HTTPError

type HTTPError struct {
	StatusCode int
	URL        string
}

HTTPError wraps a non-StatusOK error code as an error.

func (*HTTPError) Error

func (he *HTTPError) Error() string

Error implements error

Jump to

Keyboard shortcuts

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