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

View File

@@ -761,11 +761,7 @@ export const secretApprovalRequestServiceFactory = ({
secretDAL,
secretVersionDAL,
secretTagDAL,
secretVersionTagDAL,
actor: {
type: actor,
actorId
}
secretVersionTagDAL
})
: [];
const updatedSecrets = secretUpdationCommits.length
@@ -811,11 +807,7 @@ export const secretApprovalRequestServiceFactory = ({
secretDAL,
secretVersionDAL,
secretTagDAL,
secretVersionTagDAL,
actor: {
type: actor,
actorId
}
secretVersionTagDAL
})
: [];
const deletedSecret = secretDeletionCommits.length

View File

@@ -710,10 +710,6 @@ export const secretReplicationServiceFactory = ({
tx,
secretTagDAL,
secretVersionTagDAL,
actor: {
type: actor,
actorId
},
inputSecrets: locallyCreatedSecrets.map((doc) => {
return {
keyEncoding: doc.keyEncoding,
@@ -745,10 +741,6 @@ export const secretReplicationServiceFactory = ({
tx,
secretTagDAL,
secretVersionTagDAL,
actor: {
type: actor,
actorId
},
inputSecrets: locallyUpdatedSecrets.map((doc) => {
return {
filter: {

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

View File

@@ -284,10 +284,6 @@ export const secretServiceFactory = ({
secretVersionDAL,
secretTagDAL,
secretVersionTagDAL,
actor: {
type: actor,
actorId
},
tx
})
);
@@ -433,10 +429,6 @@ export const secretServiceFactory = ({
secretVersionDAL,
secretTagDAL,
secretVersionTagDAL,
actor: {
type: actor,
actorId
},
tx
})
);
@@ -830,10 +822,6 @@ export const secretServiceFactory = ({
secretVersionDAL,
secretTagDAL,
secretVersionTagDAL,
actor: {
type: actor,
actorId
},
tx
})
);
@@ -943,11 +931,7 @@ export const secretServiceFactory = ({
secretDAL,
secretVersionDAL,
secretTagDAL,
secretVersionTagDAL,
actor: {
type: actor,
actorId
}
secretVersionTagDAL
})
);
@@ -2420,10 +2404,6 @@ export const secretServiceFactory = ({
secretVersionDAL,
secretTagDAL,
secretVersionTagDAL,
actor: {
type: actor,
actorId
},
tx
})
);
@@ -2534,10 +2514,6 @@ export const secretServiceFactory = ({
secretVersionDAL,
secretTagDAL,
secretVersionTagDAL,
actor: {
type: actor,
actorId
},
tx
})
);
@@ -2872,10 +2848,6 @@ export const secretServiceFactory = ({
secretDAL,
tx,
secretTagDAL,
actor: {
type: actor,
actorId
},
secretVersionTagDAL,
inputSecrets: locallyCreatedSecrets.map((doc) => {
return {
@@ -2907,10 +2879,6 @@ export const secretServiceFactory = ({
tx,
secretTagDAL,
secretVersionTagDAL,
actor: {
type: actor,
actorId
},
inputSecrets: locallyUpdatedSecrets.map((doc) => {
return {
filter: {

View File

@@ -322,10 +322,6 @@ export type TFnSecretBulkInsert = {
secretVersionDAL: Pick<TSecretVersionDALFactory, "insertMany">;
secretTagDAL: Pick<TSecretTagDALFactory, "saveTagsToSecret">;
secretVersionTagDAL: Pick<TSecretVersionTagDALFactory, "insertMany">;
actor?: {
type?: string;
actorId?: string;
};
};
export type TFnSecretBulkUpdate = {
@@ -340,10 +336,6 @@ export type TFnSecretBulkUpdate = {
secretTagDAL: Pick<TSecretTagDALFactory, "saveTagsToSecret" | "deleteTagsManySecret">;
secretVersionTagDAL: Pick<TSecretVersionTagDALFactory, "insertMany">;
tx?: Knex;
actor?: {
type?: string;
actorId?: string;
};
};
export type TAttachSecretTagsDTO = {