Skip to content

[BUG] A variable with name 'VaultToken' already exists. #35

@alxandr-elvia

Description

@alxandr-elvia

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
image

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions