storeCredentialsInStore executes the command to store the credentials in the native store.
(config types.AuthConfig)
| 101 | |
| 102 | // storeCredentialsInStore executes the command to store the credentials in the native store. |
| 103 | func (c *nativeStore) storeCredentialsInStore(config types.AuthConfig) error { |
| 104 | creds := &credentials.Credentials{ |
| 105 | ServerURL: config.ServerAddress, |
| 106 | Username: config.Username, |
| 107 | Secret: config.Password, |
| 108 | } |
| 109 | |
| 110 | if config.IdentityToken != "" { |
| 111 | creds.Username = tokenUsername |
| 112 | creds.Secret = config.IdentityToken |
| 113 | } |
| 114 | |
| 115 | return client.Store(c.programFunc, creds) |
| 116 | } |
| 117 | |
| 118 | // getCredentialsFromStore executes the command to get the credentials from the native store. |
| 119 | func (c *nativeStore) getCredentialsFromStore(serverAddress string) (types.AuthConfig, error) { |