feat: enhance PAM account handling with type safety and improved response structure

- Introduced type inference for sanitized accounts to ensure consistent data handling.
- Updated account response structure to explicitly cast accounts to the sanitized type.
- Refined the decryption function to omit sensitive fields from the returned account object.
- Improved error handling in SQL resource factory by enforcing required gateway ID validation.
This commit is contained in:
Victor Santos
2025-12-05 00:56:33 -03:00
parent aac84e3952
commit ac5c185f76
9 changed files with 39 additions and 20 deletions
@@ -73,7 +73,11 @@ const CreateForm = ({
);
case PamResourceType.AwsIam:
return (
<AwsIamAccountForm onSubmit={onSubmit} resourceId={resourceId} resourceType={resourceType} />
<AwsIamAccountForm
onSubmit={onSubmit}
resourceId={resourceId}
resourceType={resourceType}
/>
);
default:
throw new Error(`Unhandled resource: ${resourceType}`);
@@ -103,7 +103,7 @@ export const PamAccountRow = ({
</span>
</Badge>
)}
{account.lastRotatedAt && (
{"lastRotatedAt" in account && account.lastRotatedAt && (
<Tooltip
className="max-w-sm text-center"
isDisabled={!account.lastRotationMessage}