Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Bug Fixes

* `Search-TssSecret` - fix `Cannot convert "System.Object[]" to type Thycotic.PowerShell.Secrets.Summary` when assigning the result to a typed receiver against folders with multiple secrets. The cmdlet now uses the unary comma operator to preserve the typed array across PowerShell's pipeline unrolling. Fixes #459.
* `New-TssSecretPermission` - fix `API_GenericException: The server was unable to determine which SecretAccessRole to use` when granting any access to a secret. The cmdlet was building the JSON body with PascalCase keys (`SecretAccessRoleName`, `SecretId`, `Username`, `GroupName`) while Secret Server's REST API expects camelCase (matching what `Update-TssSecretPermission` and `New-TssFolderPermission` already use). All four keys lowered, both user-grant and group-grant paths now succeed. Fixes #326.

### General Updates

Expand Down
8 changes: 4 additions & 4 deletions src/functions/secret-permissions/New-TssSecretPermission.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,13 @@ function New-TssSecretPermission {
$invokeParams.Method = 'POST'

$newBody = [ordered]@{
SecretAccessRoleName = [string]$AccessRole
SecretId = $secret
secretAccessRoleName = [string]$AccessRole
secretId = $secret
}
switch ($tssNewParams.Keys) {
'DomainName' { $newBody.Add('domainName', $DomainName) }
'Username' { $newBody.Add('Username', $Username) }
'GroupName' { $newBody.Add('GroupName', $GroupName) }
'Username' { $newBody.Add('username', $Username) }
'GroupName' { $newBody.Add('groupName', $GroupName) }
}
$invokeParams.Body = ($newBody | ConvertTo-Json)

Expand Down
Loading