SecretManagement.Hashicorp.Vault.KV
SecretManagement.Hashicorp.Vault.KV copied to clipboard
[BUG] A variable with name 'VaultToken' already exists.
Describe the bug With a vault-token in the configuration for the vault, all commands fail when trying to create a variable that already exist.
To Reproduce Steps to reproduce the behavior:
# register vault
[hashtable]$VaultParameters = @{
VaultServer = $Address
VaultToken = ($Token | ConvertTo-SecureString -AsPlainText -Force | ConvertFrom-SecureString)
VaultAuthType = 'RenewToken'
}
Register-SecretVault -AllowClobber -ModuleName SecretManagement.Hashicorp.Vault.KV -Name $Name -VaultParameters $VaultParameters
# test vault
Get-SecretVault -Name $Name | Test-SecretVault
Expected behavior It should not crash.
Screenshots
Desktop (please complete the following information):
PSVersion 7.2.1
PSEdition Core
GitCommitId 7.2.1
OS Linux 5.16.11-arch1-1 #1 SMP PREEMPT Thu, 24 Feb 2022 02:18:20 +0000
Platform Unix
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
- OS: arch linux
- PowerShell Version: see above
- Microsoft.PowerShell.SecretManagement Version: 1.1.2
- SecretManagement.Hashicorp.Vault.KV Version: 2.0.0
- Hashicorp Vault Version: 1.7.4 (I think, that's what it says on the bottom of the website)
Additional context Add any other context about the problem here.
Also, just setting the VaultToken
doesn't work, as in Invoke-VaultToken
, it get's deleted if TokenExpireTime
is before now (which it is, as it defaults to year 1600).