-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* first cut, secrets mgmt * readme update * help, bugfixes * minor help updates * remove clientid param from access token vault * help update * new function * code cleanup * release prep * release prep * more release prep
- Loading branch information
Showing
8 changed files
with
348 additions
and
58 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,2 @@ | ||
- Add support for token refresh to `New-VenafiSession` and `New-TppToken`. Auto-refresh $VenafiSession when token expires and we have a refresh token. [#33](https://github.com/gdbarron/VenafiPS/issues/33) | ||
- Fix invalid grant details in `Test-TppToken`, [#32](https://github.com/gdbarron/VenafiPS/issues/32) | ||
- Update Version in VenafiSession object, from `Get-TppVersion`, to be of type Version. Drop Revision from version so now only 3 octets. This assists in performing version validation. | ||
- Update `New-TppToken` to account for a bug in pre 21.3 which expected the client_id to be lowercase | ||
- Update `Test-TppToken` to validate the tpp version is supported | ||
- Add support for local token/key storage with [PowerShell SecretManagement](https://devblogs.microsoft.com/powershell/secretmanagement-and-secretstore-are-generally-available/). Store your access or refresh token securely and have VenafiPS use it to create a new session. | ||
- Add `Get-TppClassAttribute` to list all attributes for a specific class. Helpful for attribute validation and getting values for all attributes. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<# | ||
.SYNOPSIS | ||
List all attributes for a specified class | ||
.DESCRIPTION | ||
List all attributes for a specified class, helpful for validation or to pass to Get-TppAttribute | ||
.EXAMPLE | ||
Get-TppClassAttribute -ClassName 'X509 Server Certificate' | ||
Get all attributes for the specified class | ||
.INPUTS | ||
ClassName | ||
.OUTPUTS | ||
PSCustomObject | ||
#> | ||
function Get-TppClassAttribute { | ||
[CmdletBinding()] | ||
param ( | ||
[Parameter(Mandatory, ValueFromPipeline)] | ||
[string] $ClassName, | ||
|
||
[Parameter()] | ||
[VenafiSession] $VenafiSession = $script:VenafiSession | ||
) | ||
|
||
begin { | ||
$allAttributes = [System.Collections.Generic.List[object]]::new() | ||
} | ||
|
||
process { | ||
|
||
Write-Verbose "Processing $ClassName" | ||
|
||
$params = @{ | ||
VenafiSession = $VenafiSession | ||
Method = 'Post' | ||
UriLeaf = 'configschema/class' | ||
Body = @{ | ||
'Class' = $ClassName | ||
} | ||
} | ||
$classDetails = Invoke-VenafiRestMethod @params | Select-Object -ExpandProperty 'ClassDefinition' | ||
|
||
if ($ClassName -ne 'Top') { | ||
$recurseAttribs = $classDetails.SuperClassNames | Get-TppClassAttribute | ||
foreach ($item in $recurseAttribs) { | ||
$allAttributes.Add($item) | ||
} | ||
} | ||
|
||
foreach ($item in ($classDetails.OptionalNames)) { | ||
$allAttributes.Add( | ||
[pscustomobject] @{ | ||
'Name' = $item | ||
'Class' = $classDetails.Name | ||
} | ||
) | ||
} | ||
} | ||
|
||
end { | ||
$allAttributes | Sort-Object -Property 'Name', 'Class' -Unique | ||
} | ||
} |
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
Oops, something went wrong.