-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from joshcorr/bump-secretmanagement
Bump secretmanagement to 1.1.0
- Loading branch information
Showing
12 changed files
with
101 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...agement.Hashicorp.Vault.KV.Extension.psd1 → ...agement.Hashicorp.Vault.KV.Extension.psd1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
@{ | ||
ModuleVersion = '1.0.2' | ||
ModuleVersion = '1.1.0' | ||
RootModule = 'SecretManagement.Hashicorp.Vault.KV.Extension.psm1' | ||
FunctionsToExport = @('Set-Secret', 'Get-Secret', 'Remove-Secret', 'Get-SecretInfo', 'Test-SecretVault', 'Unregister-SecretVault') | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
23 changes: 23 additions & 0 deletions
23
tests/SecretManagement.Hashicorp.Vault.KV.Extension.Tests.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
BeforeDiscovery { | ||
$s = [io.path]::DirectorySeparatorChar | ||
$ModulePath = $PSScriptRoot, '..' -join $s | ||
$Folder = (Get-Item $ModulePath).FullName | ||
$File = ($PSCommandPath).Replace('.Tests.ps1', '.psd1').Split($s)[-1] | ||
$ModuleName = ($PSCommandPath).Replace('.Tests.ps1', '').Split($s)[-1] | ||
$Path = $Folder, $ModuleName, $File -join $s | ||
$Extension = Get-ChildItem -Path . -Include *.psm1 -Recurse | ||
Import-Module $Extension.FullName | ||
$commands = Get-Command -Module $Extension.BaseName | ||
} | ||
AfterAll { | ||
$Extension = Get-ChildItem -Path . -Include *.psm1 -Recurse | ||
Remove-Module -Name $Extension.BaseName -Force -ErrorAction SilentlyContinue | ||
} | ||
describe "Extension loading" { | ||
It "Should load the Extension $ModuleName" { | ||
Get-Module -Name 'SecretManagement.Hashicorp.Vault.KV.Extension' | Should -Not -Be $null | ||
} | ||
It "Should have <_> function loaded" -foreach $Commands { | ||
(Get-Command -Name $PSItem).Name | Should -Be "$PSItem" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
BeforeDiscovery { | ||
$s = [io.path]::DirectorySeparatorChar | ||
$ModuleName = ($PSCommandPath).Replace('.Tests.ps1', '').Split($s)[-1] | ||
} | ||
|
||
describe "SecretManagement Usage with $ModuleName" { | ||
beforeall { | ||
mock -CommandName Read-Host -MockWith {"yes"} | ||
} | ||
It "Should register the vault 'pester'" { | ||
$VaultParameters = @{ VaultServer = 'http://127.0.0.1:8200'; VaultToken = $(ConvertTo-SecureString -AsPlainText -Force -String 'root'| ConvertFrom-SecureString); VaultAuthType = 'Token'; KVVersion = 'v2'} | ||
{Register-SecretVault -ModuleName SecretManagement.Hashicorp.Vault.KV -Name pester -VaultParameters $VaultParameters} | Should -Not -Throw | ||
} | ||
It "Should fail to unregister the vault 'pester'" { | ||
{Unregister-SecretVault -Name pester -ErrorAction Stop} | Should -Throw | ||
} | ||
} |