Skip to content
Open
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 @@ -29,6 +29,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* `New-TssSession` - `OtpCode` parameter is now `[string]` instead of `[int]`. OTP codes with leading zeros (e.g. `012345`) were being truncated by the integer coercion before reaching the API. Existing scripts that pass a numeric literal continue to work via PowerShell's implicit conversion. Fixes #316.
* `Get-TssConfiguration` - fix `Cannot convert value ... to type Thycotic.PowerShell.Configuration.General` cast failure on SS 12.0. The outer `[General]` cast was applied to a response whose nested sub-objects (e.g. `email`, `applicationSettings`) still contained SS 12.0 fields not modeled by the C# classes. The cmdlet now constructs the `General` result by drilling into each known sub-object and running `FilterTssResponse` against it before assignment, so unknown nested fields are stripped instead of breaking the cast. Also handles the SS 12.0 rename of the `emailSettings` response property to `email`. Fixes #432.
* `New-TssSession` - authentication failures that return no error detail (e.g. TLS certificate rejection) now surface a descriptive message. When the certificate is likely the cause, the error text explicitly suggests adding `-SkipCertificateCheck`. Fixes #442.
* `Get-TssRpcPasswordType` - fix `Cannot convert value ... to type Thycotic.PowerShell.Rpc.PasswordTypeField` cast failure on SS 12.0. The outer `[PasswordType]` cast left the nested `fields` array as untyped `PSCustomObject` elements, which PowerShell could not coerce. The cmdlet now pre-coerces each `fields` element through `FilterTssResponse` before the outer cast. Fixes #440.

### New Stuff

Expand Down
10 changes: 10 additions & 0 deletions src/functions/remote-password-changing/Get-TssRpcPasswordType.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,16 @@ function Get-TssRpcPasswordType {
}

if ($restResponse) {
# Pre-coerce each element of the nested Fields array so SS 12.0's wider PasswordTypeField
# shape doesn't break the outer [PasswordType] cast. FilterTssResponse only filters the
# outer object's properties; nested array element coercion needs to happen explicitly.
if ($restResponse.fields) {
$restResponse.fields = @(
$restResponse.fields | ForEach-Object {
[Thycotic.PowerShell.Rpc.PasswordTypeField](. $FilterTssResponse $_ ([Thycotic.PowerShell.Rpc.PasswordTypeField]))
}
)
}
[Thycotic.PowerShell.Rpc.PasswordType](. $FilterTssResponse $restResponse ([Thycotic.PowerShell.Rpc.PasswordType]))
}
}
Expand Down
Loading