Get retrieves credentials for a specific server from the native store.
(serverAddress string)
| 41 | |
| 42 | // Get retrieves credentials for a specific server from the native store. |
| 43 | func (c *nativeStore) Get(serverAddress string) (types.AuthConfig, error) { |
| 44 | // load user email if it exist or an empty auth config. |
| 45 | auth, _ := c.fileStore.Get(serverAddress) |
| 46 | |
| 47 | creds, err := c.getCredentialsFromStore(serverAddress) |
| 48 | if err != nil { |
| 49 | return auth, err |
| 50 | } |
| 51 | auth.Username = creds.Username |
| 52 | auth.IdentityToken = creds.IdentityToken |
| 53 | auth.Password = creds.Password |
| 54 | auth.ServerAddress = creds.ServerAddress |
| 55 | |
| 56 | return auth, nil |
| 57 | } |
| 58 | |
| 59 | // GetAll retrieves all the credentials from the native store. |
| 60 | func (c *nativeStore) GetAll() (map[string]types.AuthConfig, error) { |