Skip to content

fix: New-TssSecretPermission uses camelCase JSON body keys (#326) - #472

Merged
jagger merged 1 commit into
devfrom
jagger/fix-326-secretpermission-camelcase
Jun 30, 2026
Merged

fix: New-TssSecretPermission uses camelCase JSON body keys (#326)#472
jagger merged 1 commit into
devfrom
jagger/fix-326-secretpermission-camelcase

Conversation

@jagger

@jagger jagger commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Summary

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. Update-TssSecretPermission (the sibling at PUT /secret-permissions/{id}) and New-TssFolderPermission (the parallel working cmdlet) already use camelCase. 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:

Before (PascalCase) After (camelCase)
SecretAccessRoleName secretAccessRoleName
SecretId secretId
Username username
GroupName groupName

No 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:

=== Path 1: group-based grant (Edit to team_executive) ===
  group grant:
    grant call returned: id=180014, role=Edit
    Search-TssSecretPermission shows role 'Edit' present: PASS

=== Path 2: user-based grant (View to local claude) ===
  user grant:
    grant call returned: id=180013, role=View
    Search-TssSecretPermission shows role 'View' present: PASS

Search-TssSecretPermission round-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

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>
@jagger
jagger merged commit 8637f8b into dev Jun 30, 2026
4 checks passed
@jagger
jagger deleted the jagger/fix-326-secretpermission-camelcase branch June 30, 2026 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New-TSSSecretPermission unable to determine which SecretAccessRole to use

1 participant