-
-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: No extension vaults registered when adding secret #1180
Comments
I wouldn't worry too much about Unlock.Enabled and AutoImported, those are just properties Pode sets to know if the module needs unlocking or if it was automatically imported. From what you've said it looks like it should be working, as you're correct, Pode will create/register the vault for you 🤔 Do you have a fuller script I could look at, and I'll test on my side to see what happens. Thanks |
For sure, it's just a few lines. In server.ps1: Import-Module -Name Microsoft.PowerShell.SecretManagement -Scope Global
Import-Module -Name Microsoft.PowerShell.SecretStore -Scope Global And I start Pode via Register-PodeSecretVault -Name 'MyVault' -ModuleName 'Microsoft.PowerShell.SecretStore'
Set-PodeSecret -Key 'db/masterKey' -Vault 'MyVault' -InputObject 'test123!'
$secret:MyVault.'db/masterKey' (still not sure the correct way to access secrets so that could be wrong, since I haven't been able to successfully store them yet) :) I am running PowerShell 7.3.9 on Ubuntu: |
The "Vault not found" is something I need to look into, but for the way to create/access secrets you're looking at a combo of creating a secret and then mounting a secret. In your case, you'll want to create the secret in a vault first ( Set-PodeSecret -Key 'db/masterKey' -Vault 'MyVault' -InputObject 'test123!'
Mount-PodeSecret -Name 'SomeSecretName' -Vault 'MyVault' -Key 'db/masterKey'
$secret:SomeSecretName |
…ore better with inbuilt defaults, write docs for SecretStore
I've added in some better default parameter handling when using SecretStore, but the crux of the issue was that a Password for the vault needed to be supplied, and then unlocked periodically. I've put together some documentation on how to use SecretStore, but ultimately the Register-PodeSecretVault -Name 'MyVault' -ModuleName 'Microsoft.PowerShell.SecretStore' -UnlockSecret 'My$ecret!' Setting, Mounting, and using |
Thanks @Badgerati ! |
Describe the Bug
Hey @Badgerati . Maybe it's late and I'm just missing something, or maybe this is a bug. I am trying to use Pode's secret functions but am hitting an error. I've installed Microsoft.PowerShell.SecretManagement and Microsoft.PowerShell.SecretStore and they are imported. I ran
Register-PodeSecretVault -Name 'MyVault' -ModuleName 'Microsoft.PowerShell.SecretStore'
to register the vault, and which ostensibly worked without error, but when I runGet-PodeSecretVault -Name 'MyVault'
I see a number of things that make me question if it succeeded and is fully ready to use but I'm not sure, maybe it is OK that these values are false:When I run
Test-PodeSecretVault -Name 'MyVault'
it says 'True' so it seems like it should be ready to go, but then when I run `Set-PodeSecret -Key 'path/to/key' -Vault 'MyVault' -InputObject 'test' I get this:So in spite of registering and testing the Vault, and in the docs seeing this I'm confused 🤷♂️. Have I done something wrong or missed a step?
Thank you!
The text was updated successfully, but these errors were encountered: