From e1214a1d2b72249d3ed62b8d081c4f4e7736ed86 Mon Sep 17 00:00:00 2001 From: x032205 Date: Thu, 16 Oct 2025 19:27:53 -0400 Subject: [PATCH] greptile reviews --- .../ee/services/pam-resource/pam-resource-service.ts | 12 +++++++----- .../pam-resource/shared/sql/sql-resource-schemas.ts | 4 ++-- .../pam-account-rotation-queue.ts | 2 +- .../components/PamAccountForm/PamAccountForm.tsx | 2 -- .../PamAccountForm/RotateAccountFields.tsx | 2 +- .../PamAccountForm/shared/sql-account-schemas.ts | 8 ++++++-- 6 files changed, 17 insertions(+), 13 deletions(-) diff --git a/backend/src/ee/services/pam-resource/pam-resource-service.ts b/backend/src/ee/services/pam-resource/pam-resource-service.ts index 1cc3ca135..1c5ead252 100644 --- a/backend/src/ee/services/pam-resource/pam-resource-service.ts +++ b/backend/src/ee/services/pam-resource/pam-resource-service.ts @@ -177,11 +177,13 @@ export const pamResourceServiceFactory = ({ updateDoc.encryptedRotationAccountCredentials = null; if (rotationAccountCredentials) { - const decryptedConnectionDetails = await decryptResourceConnectionDetails({ - encryptedConnectionDetails: resource.encryptedConnectionDetails, - projectId: resource.projectId, - kmsService - }); + const decryptedConnectionDetails = + connectionDetails ?? + (await decryptResourceConnectionDetails({ + encryptedConnectionDetails: resource.encryptedConnectionDetails, + projectId: resource.projectId, + kmsService + })); const factory = PAM_RESOURCE_FACTORY_MAP[resource.resourceType as PamResource]( resource.resourceType as PamResource, diff --git a/backend/src/ee/services/pam-resource/shared/sql/sql-resource-schemas.ts b/backend/src/ee/services/pam-resource/shared/sql/sql-resource-schemas.ts index cb3abf109..96b6a6a24 100644 --- a/backend/src/ee/services/pam-resource/shared/sql/sql-resource-schemas.ts +++ b/backend/src/ee/services/pam-resource/shared/sql/sql-resource-schemas.ts @@ -16,6 +16,6 @@ export const BaseSqlResourceConnectionDetailsSchema = z.object({ // Accounts export const BaseSqlAccountCredentialsSchema = z.object({ - username: z.string().trim().min(1), - password: z.string().trim().min(1) + username: z.string().trim().min(1).max(63), + password: z.string().trim().min(1).max(256) }); diff --git a/backend/src/services/pam-account-rotation/pam-account-rotation-queue.ts b/backend/src/services/pam-account-rotation/pam-account-rotation-queue.ts index fb265ac56..6ed78f665 100644 --- a/backend/src/services/pam-account-rotation/pam-account-rotation-queue.ts +++ b/backend/src/services/pam-account-rotation/pam-account-rotation-queue.ts @@ -43,7 +43,7 @@ export const pamAccountRotationServiceFactory = ({ { batchSize: 1, workerCount: 1, - pollingIntervalSeconds: 1 // 5 * 60 + pollingIntervalSeconds: 5 * 60 } ); diff --git a/frontend/src/pages/pam/PamAccountsPage/components/PamAccountForm/PamAccountForm.tsx b/frontend/src/pages/pam/PamAccountsPage/components/PamAccountForm/PamAccountForm.tsx index bb64e33c0..de23d243f 100644 --- a/frontend/src/pages/pam/PamAccountsPage/components/PamAccountForm/PamAccountForm.tsx +++ b/frontend/src/pages/pam/PamAccountsPage/components/PamAccountForm/PamAccountForm.tsx @@ -34,8 +34,6 @@ const CreateForm = ({ }: CreateFormProps) => { const createPamAccount = useCreatePamAccount(); - console.log({ folderId }); - const onSubmit = async ( formData: DiscriminativePick< TPamAccount, diff --git a/frontend/src/pages/pam/PamAccountsPage/components/PamAccountForm/RotateAccountFields.tsx b/frontend/src/pages/pam/PamAccountsPage/components/PamAccountForm/RotateAccountFields.tsx index f319cf899..b8972ab31 100644 --- a/frontend/src/pages/pam/PamAccountsPage/components/PamAccountForm/RotateAccountFields.tsx +++ b/frontend/src/pages/pam/PamAccountsPage/components/PamAccountForm/RotateAccountFields.tsx @@ -26,7 +26,7 @@ export const RotateAccountFields = () => {