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

Method Get

cli/config/credentials/file_store.go:43–57  ·  view source on GitHub ↗

Get retrieves credentials for a specific server from the file store.

(serverAddress string)

Source from the content-addressed store, hash-verified

41
42// Get retrieves credentials for a specific server from the file store.
43func (c *fileStore) Get(serverAddress string) (types.AuthConfig, error) {
44 authConfig, ok := c.file.GetAuthConfigs()[serverAddress]
45 if !ok {
46 // Maybe they have a legacy config file, we will iterate the keys converting
47 // them to the new format and testing
48 for r, ac := range c.file.GetAuthConfigs() {
49 if serverAddress == ConvertToHostname(r) {
50 return ac, nil
51 }
52 }
53
54 authConfig = types.AuthConfig{}
55 }
56 return authConfig, nil
57}
58
59func (c *fileStore) GetAll() (map[string]types.AuthConfig, error) {
60 return c.file.GetAuthConfigs(), nil

Callers

nothing calls this directly

Calls 2

ConvertToHostnameFunction · 0.85
GetAuthConfigsMethod · 0.65

Tested by

no test coverage detected