Remove secret_version_v1 changes

This commit is contained in:
carlosmonastyrski
2025-03-06 11:31:26 -03:00
parent 07e1d1b130
commit efc3b6d474
5 changed files with 4 additions and 76 deletions
+1 -17
View File
@@ -525,7 +525,6 @@ export const fnSecretBulkInsert = async ({
secretVersionDAL,
secretTagDAL,
secretVersionTagDAL,
actor,
tx
}: TFnSecretBulkInsert) => {
const sanitizedInputSecrets = inputSecrets.map(
@@ -581,16 +580,9 @@ export const fnSecretBulkInsert = async ({
}))
);
const userActorId = actor && actor?.type === ActorType.USER ? actor?.actorId : undefined;
const identityActorId = actor && actor?.type !== ActorType.USER ? actor?.actorId : undefined;
const actorType = actor?.type || ActorType.PLATFORM;
const secretVersions = await secretVersionDAL.insertMany(
sanitizedInputSecrets.map((el) => ({
...el,
userActorId,
identityActorId,
actorType,
secretId: newSecretGroupByBlindIndex[el.secretBlindIndex as string][0].id
})),
tx
@@ -623,8 +615,7 @@ export const fnSecretBulkUpdate = async ({
secretDAL,
secretVersionDAL,
secretTagDAL,
secretVersionTagDAL,
actor
secretVersionTagDAL
}: TFnSecretBulkUpdate) => {
const sanitizedInputSecrets = inputSecrets.map(
({
@@ -674,17 +665,10 @@ export const fnSecretBulkUpdate = async ({
})
);
const userActorId = actor && actor?.type === ActorType.USER ? actor?.actorId : undefined;
const identityActorId = actor && actor?.type !== ActorType.USER ? actor?.actorId : undefined;
const actorType = actor?.type || ActorType.PLATFORM;
const newSecrets = await secretDAL.bulkUpdate(sanitizedInputSecrets, tx);
const secretVersions = await secretVersionDAL.insertMany(
newSecrets.map(({ id, createdAt, updatedAt, ...el }) => ({
...el,
userActorId,
identityActorId,
actorType,
secretId: id
})),
tx