Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

fix: add the id to the required signature

Tre Dubravabd82cc9fb1cd
diff --git a/backend/src/services/secret-v2-bridge/secret-v2-bridge-dal.ts b/backend/src/services/secret-v2-bridge/secret-v2-bridge-dal.ts
index 72adb7637e..94502cd8c8 100644
--- a/backend/src/services/secret-v2-bridge/secret-v2-bridge-dal.ts
+++ b/backend/src/services/secret-v2-bridge/secret-v2-bridge-dal.ts
@@ -240,24 +240,21 @@ export const secretV2BridgeDALFactory = ({ db, keyStore }: TSecretV2DalArg) => {
};
const bulkUpdate = async (
- data: Array<{ filter: Partial<TSecretsV2>; data: TSecretsV2Update }>,
+ data: Array<{ filter: Pick<TSecretsV2, "id"> & Partial<TSecretsV2>; data: TSecretsV2Update }>,
tx?: Knex
) => {
try {
if (data.length === 0) return [];
- const ids = data.map(({ filter }) => {
- if (!filter.id) throw new BadRequestError({ message: "bulkUpdate requires id in filter" });
- return filter.id;
- });
+ const ids = data.map(({ filter }) => filter.id);
const existingSecrets = await (tx || db)(TableName.SecretV2).whereIn("id", ids).select("*");
const existingById = new Map(existingSecrets.map((s) => [s.id, s]));
const rowsToUpsert = data.map(({ filter, data: updateData }) => {
- const existing = existingById.get(filter.id!);
+ const existing = existingById.get(filter.id);
if (!existing) throw new BadRequestError({ message: "Failed to update document" });
return {
diff --git a/backend/src/services/secret-v2-bridge/secret-v2-bridge-types.ts b/backend/src/services/secret-v2-bridge/secret-v2-bridge-types.ts
index d0274556bc..8d95d9dc6a 100644
--- a/backend/src/services/secret-v2-bridge/secret-v2-bridge-types.ts
+++ b/backend/src/services/secret-v2-bridge/secret-v2-bridge-types.ts
@@ -207,7 +207,7 @@ export type TFnSecretBulkUpdate = {
folderId: string;
orgId: string;
inputSecrets: {
- filter: Partial<TSecretsV2>;
+ filter: Pick<TSecretsV2, "id"> & Partial<TSecretsV2>;
data: TRequireReferenceIfValue & {
tags?: string[];
secretMetadata?: { key: string; value?: string | null; encryptedValue?: Buffer | null }[];