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

Function storeCredentials

cli/command/registry/login.go:322–338  ·  view source on GitHub ↗
(cfg *configfile.ConfigFile, authConfig registrytypes.AuthConfig)

Source from the content-addressed store, hash-verified

320}
321
322func storeCredentials(cfg *configfile.ConfigFile, authConfig registrytypes.AuthConfig) error {
323 creds := cfg.GetCredentialsStore(authConfig.ServerAddress)
324 if err := creds.Store(configtypes.AuthConfig{
325 Username: authConfig.Username,
326 Password: authConfig.Password,
327 ServerAddress: authConfig.ServerAddress,
328
329 // TODO(thaJeztah): Are these expected to be included?
330 Auth: authConfig.Auth,
331 IdentityToken: authConfig.IdentityToken,
332 RegistryToken: authConfig.RegistryToken,
333 }); err != nil {
334 return fmt.Errorf("error saving credentials: %v", err)
335 }
336
337 return nil
338}
339
340func loginWithRegistry(ctx context.Context, apiClient client.SystemAPIClient, options client.RegistryLoginOptions) (client.RegistryLoginResult, error) {
341 res, err := apiClient.RegistryLogin(ctx, options)

Callers 3

loginWithDeviceCodeFlowFunction · 0.85

Calls 2

GetCredentialsStoreMethod · 0.80
StoreMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…