Skip to content

Commit c53239b

Browse files
authored
Merge pull request #25 from joshcorr/development
2.0.0 Release
2 parents 2784015 + d6b17a1 commit c53239b

9 files changed

+252
-244
lines changed

.github/linters/.powershell-psscriptanalyzer.psd1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
ExcludeRules = @(
1212
'PSUseShouldProcessForStateChangingFunctions',
1313
'PSAvoidUsingConvertToSecureStringWithPlainText',
14-
'PSUseDeclaredVarsMoreThanAssignments'
14+
'PSUseDeclaredVarsMoreThanAssignments',
15+
'PSUseLiteralInitializerForHashtable'
1516

1617
)
1718
#IncludeRules = @(

CHANGELOG.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,23 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/)
66
and this project adheres to [Semantic Versioning](http://semver.org/).
77

8+
## [2.0.0] - 2021-11-11
9+
10+
*Powershell 5.1 is no longer a supported version for this extension.
11+
version 1.1.1-Preview is the last 5.1 compatible version*
12+
13+
Major re-write of the token management to make it compatible with [Constrained Language Mode](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_language_modes?view=powershell-7.1#constrained-language-constrained-language)
14+
Fixes issues with `Unlock-SecretVault` [#24](https://github.com/joshcorr/SecretManagement.Hashicorp.Vault.KV/issues/24)
15+
Fixes issue using extension from Terminal [#22](https://github.com/joshcorr/SecretManagement.Hashicorp.Vault.KV/issues/22)
16+
Updated documentation
17+
818
## [1.2.0] - 2021-11-07
919

10-
Adds `Unlock-SecretVault` [#21](https://github.com/joshcorr/SecretManagement.Hashicorp.Vault.KV/issues/21)
11-
Adds support for checking tokens lifespan and renewing when they are close to expiring or have already expired. [#11](https://github.com/joshcorr/SecretManagement.Hashicorp.Vault.KV/issues/11)
12-
Increase verbose messages and fix formatting
13-
Add Byte as supported data type
14-
Fix pester tests
20+
Adds `Unlock-SecretVault` [#21](https://github.com/joshcorr/SecretManagement.Hashicorp.Vault.KV/issues/21)
21+
Adds support for checking tokens lifespan and renewing when they are close to expiring or have already expired. [#11](https://github.com/joshcorr/SecretManagement.Hashicorp.Vault.KV/issues/11)
22+
Increase verbose messages and fix formatting
23+
Add Byte as supported data type
24+
Fix pester tests s
1525

1626
## [1.1.1] - 2021-08-25
1727

README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22

33
[![GitHubSuper-Linter][]][GitHubSuper-LinterLink]
44
[![PSGallery][]][PSGalleryLink]
5+
[![SupportBadge][]][SupportBadge]
56

6-
A PowerShell SecretManagement extension for Hashicorp Vault Key Value (KV) Engine. This supports version 1, version2, and cubbyhole (similar to v1). It does not currently support all of the version 2 features like versioned secrets.
7+
A PowerShell SecretManagement extension for Hashicorp Vault Key Value (KV) Engine. This supports version 1, version2, and cubbyhole (similar to v1). It does not currently support all of the version 2 features like versioned secrets. This extension only supports PowerShell 6+
78

8-
> **NOTE: This project is not a maintained by Hashicorp.**
9+
> **NOTE: This project is not maintained by Hashicorp.**
910
> **I work on this in my free time because I use Vault.**
1011
> If Hashicorp would like to adopt this module please reach out.
1112
@@ -17,15 +18,15 @@ When registering a vault you need to provide at least these options:
1718
Register-SecretVault -ModuleName SecretManagement.Hashicorp.Vault.KV -Name PowerShellTest -VaultParameters @{ VaultServer = 'http://vault.domain.local:8200'; VaultAuthType = 'Token'}
1819
```
1920

20-
The vault name should match exactly as Hashicorp vault is case sensitive. If no VaultParameters are provided the functions will prompt you on the first execution in your session. Additionally you may provide which version of KV you are using when registering. It defaults to version 2 of KV.
21+
The vault name should match exactly, as Hashicorp vault is case sensitive. If no VaultParameters are provided the functions will prompt you on the first execution in your session. Additionally you may provide which version of KV you are using when registering. It defaults to version 2 of KV.
2122

2223
```PowerShell
2324
$VaultParameters = @{ VaultServer = 'https://vault-cluster.domain.local'
2425
VaultToken=$(Read-Host -AsSecureString | ConvertFrom-SecureString)
2526
KVVersion = 'v1'}
2627
```
2728

28-
If you stored your secrets in a flat structure (i.e. no slashes in your path).
29+
If you stored your secrets in a flat structure (i.e. no slashes in your path),
2930
You may want to return all secrets as a PSCredential. You can do this by providing the following:
3031

3132
```powershell
@@ -41,12 +42,13 @@ You may provide either a single text string or a hashtable to the `-Secret` para
4142
## KV Version 2 distinctions
4243

4344
- Get-Secret only retrieves the newest secret
44-
- Get-SecretInfo retrieves the Hashicorp Metadata.
45+
- Get-SecretInfo retrieves the Hashicorp Metadata
4546
- Set-Secret Adds/Updates without CheckAndSet. Althought it can be passed with `-Metadata @{cas=<versionNumber>}`
46-
- Remove-Secret Completely Removes the secret and all versions
47+
- Remove-Secret Removes the latest version of a secret
4748

4849
[GitHubSuper-Linter]: https://github.com/joshcorr/SecretManagement.Hashicorp.Vault.KV/workflows/ci/badge.svg
4950
[GitHubSuper-LinterLink]: https://github.com/marketplace/actions/super-linter
5051

51-
[PSGallery]: https://img.shields.io/powershellgallery/v/SecretManagement.Hashicorp.Vault.KV?label=Powershell+Gallery+Latest
52-
[PSGalleryLink]: https://www.powershellgallery.com/packages/SecretManagement.Hashicorp.Vault.KV
52+
[PSGallery]: https://img.shields.io/powershellgallery/v/SecretManagement.Hashicorp.Vault.KV?include_prereleases
53+
[PSGalleryLink]: https://www.powershellgallery.com/packages/SecretManagement.Hashicorp.Vault.KV
54+
[SupportBadge]: https://img.shields.io/powershellgallery/p/SecretManagement.Hashicorp.Vault.KV?label=6.0%2B&logo=powershell

SecretManagement.Hashicorp.Vault.KV.build.ps1

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,11 @@ task copy {
1212
Copy-Item -Path $Source -Destination $Destination -Force -Recurse -Verbose
1313
}
1414

15+
task remove {
16+
$Version = (Test-ModuleManifest -Path "$PSScriptRoot\$ModuleName\$ModuleName.psd1").Version
17+
$UserModulePath = [Environment]::GetEnvironmentVariable('PSModulePath') -split [IO.Path]::PathSeparator | Where-Object {$PSItem -notmatch [Environment]::UserName} | Select-Object -First 1
18+
$Destination = $UserModulePath, $ModuleName, $Version -join [io.path]::DirectorySeparatorChar
19+
Remove-Item -Path $Destination -Force -Recurse -Verbose
20+
}
21+
1522
task . copy
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@{
2-
ModuleVersion = '1.2.0'
2+
ModuleVersion = '2.0.0'
33
RootModule = 'SecretManagement.Hashicorp.Vault.KV.Extension.psm1'
44
FunctionsToExport = @('Set-Secret', 'Get-Secret', 'Remove-Secret', 'Get-SecretInfo', 'Test-SecretVault', 'Unlock-SecretVault', 'Unregister-SecretVault')
55
}

0 commit comments

Comments
 (0)