From 1f17cbd84fedbc840c3b162637af09f4e0b08c11 Mon Sep 17 00:00:00 2001 From: Fang-Pen Lin Date: Fri, 24 Oct 2025 10:51:57 -0700 Subject: [PATCH] Remove pwd rotation stuff for now --- .../pam-resource/mysql/mysql-resource-schemas.ts | 12 ++++++++++-- .../components/PamAccountForm/MySQLAccountForm.tsx | 3 +-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/backend/src/ee/services/pam-resource/mysql/mysql-resource-schemas.ts b/backend/src/ee/services/pam-resource/mysql/mysql-resource-schemas.ts index 8d3589a8a..91ffa61ea 100644 --- a/backend/src/ee/services/pam-resource/mysql/mysql-resource-schemas.ts +++ b/backend/src/ee/services/pam-resource/mysql/mysql-resource-schemas.ts @@ -58,11 +58,19 @@ export const MySQLAccountSchema = BasePamAccountSchema.extend({ credentials: MySQLAccountCredentialsSchema }); -export const CreateMySQLAccountSchema = BaseCreatePamAccountSchema.extend({ +export const CreateMySQLAccountSchema = BaseCreatePamAccountSchema.omit({ + // We don't support pwd rotation for mysql yet + rotationEnabled: true, + rotationIntervalSeconds: true +}).extend({ credentials: MySQLAccountCredentialsSchema }); -export const UpdateMySQLAccountSchema = BaseUpdatePamAccountSchema.extend({ +export const UpdateMySQLAccountSchema = BaseUpdatePamAccountSchema.omit({ + // We don't support pwd rotation for mysql yet + rotationEnabled: true, + rotationIntervalSeconds: true +}).extend({ credentials: MySQLAccountCredentialsSchema.optional() }); diff --git a/frontend/src/pages/pam/PamAccountsPage/components/PamAccountForm/MySQLAccountForm.tsx b/frontend/src/pages/pam/PamAccountsPage/components/PamAccountForm/MySQLAccountForm.tsx index 7dc8648ee..23b05610f 100644 --- a/frontend/src/pages/pam/PamAccountsPage/components/PamAccountForm/MySQLAccountForm.tsx +++ b/frontend/src/pages/pam/PamAccountsPage/components/PamAccountForm/MySQLAccountForm.tsx @@ -7,7 +7,6 @@ import { PamResourceType, TMySQLAccount } from "@app/hooks/api/pam"; import { UNCHANGED_PASSWORD_SENTINEL } from "@app/hooks/api/pam/constants"; import { GenericAccountFields, genericAccountFieldsSchema } from "./GenericAccountFields"; -import { rotateAccountFieldsSchema } from "./RotateAccountFields"; import { BaseSqlAccountSchema } from "./shared/sql-account-schemas"; import { SqlAccountFields } from "./shared/SqlAccountFields"; @@ -18,7 +17,7 @@ type Props = { onSubmit: (formData: FormData) => Promise; }; -const formSchema = genericAccountFieldsSchema.extend(rotateAccountFieldsSchema.shape).extend({ +const formSchema = genericAccountFieldsSchema.extend({ credentials: BaseSqlAccountSchema });