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

Function resolveAuthConfig

cmd/docker-trust/trust/common.go:194–211  ·  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. It is similar to [registry.ResolveAuthConfig], but uses the credentials- store, instead of looking up credentials from a map. [registry.ResolveAuthCo

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

Source from the content-addressed store, hash-verified

192//
193// [registry.ResolveAuthConfig]: https://pkg.go.dev/github.com/docker/docker@v28.3.3+incompatible/registry#ResolveAuthConfig
194func resolveAuthConfig(cfg *configfile.ConfigFile, index *registrytypes.IndexInfo) registrytypes.AuthConfig {
195 configKey := index.Name
196 if index.Official {
197 configKey = authConfigKey
198 }
199
200 a, _ := cfg.GetAuthConfig(configKey)
201 return registrytypes.AuthConfig{
202 Username: a.Username,
203 Password: a.Password,
204 ServerAddress: a.ServerAddress,
205
206 // TODO(thaJeztah): Are these expected to be included?
207 Auth: a.Auth,
208 IdentityToken: a.IdentityToken,
209 RegistryToken: a.RegistryToken,
210 }
211}

Callers 2

runSignImageFunction · 0.85
authResolverFunction · 0.85

Calls 1

GetAuthConfigMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…