fix: New-TssSecretPermission uses camelCase JSON body keys (#326) - #472
Merged
Conversation
POST /secret-permissions was failing with:
API_GenericException: The server was unable to determine which
SecretAccessRole to use. Please provide a valid SecretAccessRoleName
if using REST. Otherwise, make sure your request has a valid
SecretAccessRoleID.
The cmdlet was sending PascalCase JSON keys (SecretAccessRoleName,
SecretId, Username, GroupName) but Secret Server's REST API expects
camelCase, matching what Update-TssSecretPermission (the sibling at
PUT /secret-permissions/{id}) and New-TssFolderPermission (the parallel
working cmdlet) already use. The drift looks like a missed update when
-AccessRole was converted to an enum.
Four key renames in the [ordered] body and the switch block:
SecretAccessRoleName -> secretAccessRoleName
SecretId -> secretId
Username -> username
GroupName -> groupName
No PowerShell parameter names change; the cmdlet's public surface is
unchanged. Lab-verified against Secret Server 12.x via both grant
paths (group -> Edit, user -> View). Search-TssSecretPermission
confirms both roles round-trip correctly after the grant.
Closes #326.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
POST /secret-permissionswas failing with:The cmdlet was sending PascalCase JSON keys (
SecretAccessRoleName,SecretId,Username,GroupName) but Secret Server's REST API expects camelCase.Update-TssSecretPermission(the sibling atPUT /secret-permissions/{id}) andNew-TssFolderPermission(the parallel working cmdlet) already use camelCase. The drift looks like a missed update when-AccessRolewas converted to an enum.Four key renames in the
[ordered]body and the switch block:SecretAccessRoleNamesecretAccessRoleNameSecretIdsecretIdUsernameusernameGroupNamegroupNameNo PowerShell parameter names change. The cmdlet's public surface is unchanged.
Closes #326.
Lab verification
Against Secret Server 12.x. Two paths exercised, both pass:
Search-TssSecretPermissionround-trips both roles correctly.Release
Targets v0.62.1 (on the 0.62.1 milestone). Bug-fix-only change, no API surface change.
🤖 Generated with Claude Code