Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
fix(secret-approval): resolved update failure in secret approval mode and number not increasing on frontend
Akhil Mohan8e82222fc5ad
diff --git a/backend/src/validation/secrets.ts b/backend/src/validation/secrets.tsindex f769fcfe25..7c0f2d69f1 100644--- a/backend/src/validation/secrets.ts+++ b/backend/src/validation/secrets.ts@@ -429,6 +429,9 @@ export const UpdateSecretByNameBatchV3 = z.object({secretValueCiphertext: z.string().trim(),secretValueIV: z.string().trim(),secretValueTag: z.string().trim(),+ secretKeyCiphertext: z.string().trim(),+ secretKeyIV: z.string().trim(),+ secretKeyTag: z.string().trim(),secretCommentCiphertext: z.string().trim().optional(),secretCommentIV: z.string().trim().optional(),secretCommentTag: z.string().trim().optional(),diff --git a/frontend/src/views/SecretMainPage/components/SecretDropzone/SecretDropzone.tsx b/frontend/src/views/SecretMainPage/components/SecretDropzone/SecretDropzone.tsxindex 3a33c26881..3fe0d19e35 100644--- a/frontend/src/views/SecretMainPage/components/SecretDropzone/SecretDropzone.tsx+++ b/frontend/src/views/SecretMainPage/components/SecretDropzone/SecretDropzone.tsx@@ -14,6 +14,7 @@ import { Button, Modal, ModalContent } from "@app/components/v2";import { ProjectPermissionActions, ProjectPermissionSub } from "@app/context";import { usePopUp, useToggle } from "@app/hooks";import { useCreateSecretBatch, useUpdateSecretBatch } from "@app/hooks/api";+import { secretApprovalRequestKeys } from "@app/hooks/api/secretApprovalRequest/queries";import { secretKeys } from "@app/hooks/api/secrets/queries";import { DecryptedSecret, UserWsKeyPair } from "@app/hooks/api/types";@@ -194,6 +195,7 @@ export const SecretDropzone = ({queryClient.invalidateQueries(secretKeys.getProjectSecret({ workspaceId, environment, secretPath }));+ queryClient.invalidateQueries(secretApprovalRequestKeys.count({ workspaceId }));handlePopUpClose("overlapKeyWarning");createNotification({type: "success",@@ -222,9 +224,9 @@ export const SecretDropzone = ({onDragOver={handleDrag}onDrop={handleDrop}className={twMerge(- "relative mx-0.5 mb-4 mt-4 flex cursor-pointer items-center justify-center rounded-md bg-mineshaft-900 py-4 text-sm px-2 text-mineshaft-200 opacity-60 outline-dashed outline-2 outline-chicago-600 duration-200 hover:opacity-100",+ "relative mx-0.5 mb-4 mt-4 flex cursor-pointer items-center justify-center rounded-md bg-mineshaft-900 py-4 px-2 text-sm text-mineshaft-200 opacity-60 outline-dashed outline-2 outline-chicago-600 duration-200 hover:opacity-100",isDragActive && "opacity-100",- !isSmaller && "w-full max-w-3xl flex-col space-y-4 py-20 mx-auto",+ !isSmaller && "mx-auto w-full max-w-3xl flex-col space-y-4 py-20",isLoading && "bg-bunker-800")}>@@ -238,7 +240,7 @@ export const SecretDropzone = ({/></div>) : (- <div className="flex items-center justify-cente flex-col space-y-2">+ <div className="justify-cente flex flex-col items-center space-y-2"><div><FontAwesomeIcon icon={faUpload} size={isSmaller ? "2x" : "5x"} /></div>diff --git a/frontend/src/views/SecretMainPage/components/SecretListView/SecretListView.tsx b/frontend/src/views/SecretMainPage/components/SecretListView/SecretListView.tsxindex 7db6037fd6..2a52329304 100644--- a/frontend/src/views/SecretMainPage/components/SecretListView/SecretListView.tsx+++ b/frontend/src/views/SecretMainPage/components/SecretListView/SecretListView.tsx@@ -7,6 +7,7 @@ import { CreateTagModal } from "@app/components/tags/CreateTagModal";import { DeleteActionModal } from "@app/components/v2";import { usePopUp } from "@app/hooks";import { useCreateSecretV3, useDeleteSecretV3, useUpdateSecretV3 } from "@app/hooks/api";+import { secretApprovalRequestKeys } from "@app/hooks/api/secretApprovalRequest/queries";import { secretKeys } from "@app/hooks/api/secrets/queries";import { DecryptedSecret } from "@app/hooks/api/secrets/types";import { secretSnapshotKeys } from "@app/hooks/api/secretSnapshots/queries";@@ -262,6 +263,7 @@ export const SecretListView = ({queryClient.invalidateQueries(secretSnapshotKeys.count({ workspaceId, environment, directory: secretPath }));+ queryClient.invalidateQueries(secretApprovalRequestKeys.count({ workspaceId }));handlePopUpClose("secretDetail");createNotification({type: "success",@@ -284,6 +286,7 @@ export const SecretListView = ({const { key, _id: secretId } = popUp.deleteSecret?.data as DecryptedSecret;try {await handleSecretOperation("delete", "shared", key, { secretId });+ // wrap this in another function and then reusequeryClient.invalidateQueries(secretKeys.getProjectSecret({ workspaceId, environment, secretPath }));@@ -293,6 +296,7 @@ export const SecretListView = ({queryClient.invalidateQueries(secretSnapshotKeys.count({ workspaceId, environment, directory: secretPath }));+ queryClient.invalidateQueries(secretApprovalRequestKeys.count({ workspaceId }));handlePopUpClose("deleteSecret");handlePopUpClose("secretDetail");createNotification({