Rename StorePrivateKeys config option to UnlockAll

This commit is contained in:
chris-j-h 2019-08-16 10:33:02 +01:00
parent 16d286042d
commit 3880653d9c
3 changed files with 14 additions and 14 deletions

View File

@ -12,13 +12,13 @@ type HashicorpWalletConfig struct {
}
type HashicorpClientConfig struct {
Url string `toml:",omitempty"`
Approle string `toml:",omitempty"`
CaCert string `toml:",omitempty"`
ClientCert string `toml:",omitempty"`
ClientKey string `toml:",omitempty"`
StorePrivateKeys bool `toml:",omitempty"`
VaultPollingIntervalMillis int `toml:",omitempty"`
Url string `toml:",omitempty"`
Approle string `toml:",omitempty"`
CaCert string `toml:",omitempty"`
ClientCert string `toml:",omitempty"`
ClientKey string `toml:",omitempty"`
UnlockAll bool `toml:",omitempty"`
VaultPollingIntervalMillis int `toml:",omitempty"`
}
type HashicorpSecretConfig struct {

View File

@ -190,7 +190,7 @@ func (h *hashicorpService) open() error {
go h.accountRetrievalLoop(time.NewTicker(d))
if h.config.StorePrivateKeys {
if h.config.UnlockAll {
go h.privateKeyRetrievalLoop(time.NewTicker(d))
}

View File

@ -912,9 +912,9 @@ func TestVaultWallet_Open_Hashicorp_PrivateKeysRetrievedIndefinitelyWhenEnabled(
t.Run(name, func(t *testing.T) {
wltConfig := HashicorpWalletConfig{
Client: HashicorpClientConfig{
Url: vaultServer.URL,
Url: vaultServer.URL,
VaultPollingIntervalMillis: 1,
StorePrivateKeys: true,
UnlockAll: true,
},
Secrets: tt.secrets,
}
@ -1029,9 +1029,9 @@ func TestVaultWallet_Open_Hashicorp_PrivateKeysRetrievedWhenEnabledAndVaultAvail
// use an incorrect vault url to simulate an inaccessible vault
wltConfig := HashicorpWalletConfig{
Client: HashicorpClientConfig{
Url: "http://incorrecturl:1",
Url: "http://incorrecturl:1",
VaultPollingIntervalMillis: 1,
StorePrivateKeys: tt.storePrivateKeys,
UnlockAll: tt.storePrivateKeys,
},
Secrets: []HashicorpSecretConfig{
{PrivateKeySecret: "sec1", PrivateKeySecretVersion: 1, SecretEngine: "kv"},
@ -1140,9 +1140,9 @@ func TestVaultWallet_Open_Hashicorp_RetrievalLoopsStopWhenAllSecretsRetrieved(t
wltConfig := HashicorpWalletConfig{
Client: HashicorpClientConfig{
Url: vaultServer.URL,
Url: vaultServer.URL,
VaultPollingIntervalMillis: 1,
StorePrivateKeys: true,
UnlockAll: true,
},
Secrets: []HashicorpSecretConfig{makeSecret(addrName, keyName)},
}