Get retrieves credentials for a specific server from the file store.
(serverAddress string)
| 41 | |
| 42 | // Get retrieves credentials for a specific server from the file store. |
| 43 | func (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 | |
| 59 | func (c *fileStore) GetAll() (map[string]types.AuthConfig, error) { |
| 60 | return c.file.GetAuthConfigs(), nil |
nothing calls this directly
no test coverage detected