-
Notifications
You must be signed in to change notification settings - Fork 9
Description
Summary
The ArkPCloudPlatformsService.platform() method in ark-sdk-python v2.0.14 fails with Pydantic validation errors when calling the Platform Details API endpoint (GET /PasswordVault/API/Platforms/{platformId}). The SDK attempts to validate the API response against ArkPCloudPlatform or ArkPCloudTargetPlatform models, but these models expect a nested structure that doesn't match the actual flat API response format.
Steps to Reproduce
- Install ark-sdk-python v2.0.14
- Authenticate to CyberArk Privilege Cloud using
ArkISPAuth - Create
ArkPCloudPlatformsServiceinstance - Call
platforms_service.platform(platform_id="any_platform_id") - See Pydantic validation error
from ark_sdk_python.auth import ArkISPAuth
from ark_sdk_python.services.pcloud.platforms import ArkPCloudPlatformsService
auth = ArkISPAuth()
auth.authenticate(...) # with valid credentials
service = ArkPCloudPlatformsService(auth)
result = service.platform("SwsExample") # Fails with validation errorExpected Results
The SDK should successfully parse the Platform Details API response and return a properly validated platform object containing the detailed configuration fields (PasswordLength, AllowedSafes, PolicyType, etc.).
Actual Results
Pydantic validation fails because the API returns:
{
"Active": true,
"Details": {
"ActionTimout": "10",
"AllowManualChange": "Yes",
"AllowedSafes": ".*",
"BrowserPath": "C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe",
"ChangeNotificationPeriod": "-1",
"ChangeURL": "https://test",
"DaysNotifyPriorExpiration": "7",
"DllName": "CyberArk.Extensions.Plugin.WebApp.dll",
"DriverFolder": "C:\\Program Files (x86)\\CyberArk\\Password Manager\\bin",
"EnforceCertificate": "Yes",
"EnforcePasswordPolicyOnManualChange": "No",
"ExeName": "CANetPluginInvoker.exe",
"ExpirationPeriod": "30",
"FromHour": "-1",
"HeadStartInterval": "5",
"ImmediateInterval": "5"
.............
},
"PlatformID": "SwsExample"
}But the SDK models expect nested structure like:
{
"general": {...},
"properties": {...},
"credentialsManagement": {...}
}Reproducible
- Always
- Sometimes
- Non-Reproducible
Version/Tag number
- ark-sdk-python: 2.0.14
- API: CyberArk Privilege Cloud REST API v14+
- Python: 3.10+
- Pydantic: 2.x (dependency of ark-sdk-python)
Environment setup
- Environment: CyberArk Privilege Cloud (SaaS)
- Runtime: Local development environment, Linux/WSL2
- Authentication: Identity authentication method with service account credentials
- API Endpoint:
https://{tenant}.privilegecloud.cyberark.cloud/PasswordVault/API/Platforms/{platformId}
Additional Information
While all responses will (should!) include the PlatformID, Active and Details objects, different platforms can have different keys in the Details object of the response.