MCPcopy Create free account
hub / github.com/docker/cli / ResolveAuthConfig

Function ResolveAuthConfig

cli/command/registry.go:43–60  ·  view source on GitHub ↗

ResolveAuthConfig returns auth-config for the given registry from the credential-store. It returns an empty AuthConfig if no credentials were found. Deprecated: this function is no longer used, and will be removed in the next release.

(cfg *configfile.ConfigFile, index *registrytypes.IndexInfo)

Source from the content-addressed store, hash-verified

41//
42// Deprecated: this function is no longer used, and will be removed in the next release.
43func ResolveAuthConfig(cfg *configfile.ConfigFile, index *registrytypes.IndexInfo) registrytypes.AuthConfig {
44 configKey := index.Name
45 if index.Official {
46 configKey = authConfigKey
47 }
48
49 a, _ := cfg.GetAuthConfig(configKey)
50 return registrytypes.AuthConfig{
51 Username: a.Username,
52 Password: a.Password,
53 ServerAddress: a.ServerAddress,
54
55 // TODO(thaJeztah): Are these expected to be included?
56 Auth: a.Auth,
57 IdentityToken: a.IdentityToken,
58 RegistryToken: a.RegistryToken,
59 }
60}
61
62// GetDefaultAuthConfig gets the default auth config given a serverAddress
63// If credentials for given serverAddress exists in the credential store, the configuration will be populated with values in it

Callers

nothing calls this directly

Calls 1

GetAuthConfigMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…