misc: add delete protection for projects on create

This commit is contained in:
Sheen Capadngan
2025-11-11 01:52:48 +08:00
parent 5534924f54
commit d546335345
4 changed files with 14 additions and 6 deletions
@@ -252,7 +252,8 @@ export const projectServiceFactory = ({
tx: trx,
createDefaultEnvs = true,
template = InfisicalProjectTemplate.Default,
type = ProjectType.SecretManager
type = ProjectType.SecretManager,
hasDeleteProtection
}: TCreateProjectDTO) => {
const organization = await orgDAL.findOne({ id: actorOrgId });
const { permission } = await permissionService.getOrgPermission({
@@ -325,7 +326,8 @@ export const projectServiceFactory = ({
slug,
kmsSecretManagerKeyId: kmsKeyId,
version: ProjectVersion.V3,
pitVersionLimit: 10
pitVersionLimit: 10,
hasDeleteProtection
},
tx
);
@@ -587,6 +589,7 @@ export const projectServiceFactory = ({
actorOrgId,
actionProjectType: ActionProjectType.Any
});
return project;
};
@@ -51,6 +51,7 @@ export type TCreateProjectDTO = {
pitVersionLimit?: number;
tx?: Knex;
type?: ProjectType;
hasDeleteProtection?: boolean;
};
export type TDeleteProjectBySlugDTO = {