feat: added kms deletion on project deletion and removed e2ee blind index upgrade banner

This commit is contained in:
=
2024-07-30 23:19:08 +05:30
parent e210a6a24f
commit 6e7997b1bd
6 changed files with 15 additions and 43 deletions
+8
View File
@@ -102,6 +102,13 @@ export const kmsServiceFactory = ({
return doc;
};
const deleteInternalKms = async (kmsId: string, orgId: string, tx?: Knex) => {
const kms = await kmsDAL.findByIdWithAssociatedKms(kmsId, tx);
if (kms.isExternal) return;
if (kms.orgId !== orgId) throw new BadRequestError({ message: "KMS doesn't belong to organization" });
return kmsDAL.deleteById(kmsId, tx);
};
/*
* Simple encryption service function to do all the encryption tasks in infisical
* This can be even later exposed directly as api for encryption as function
@@ -794,6 +801,7 @@ export const kmsServiceFactory = ({
return {
startService,
generateKmsKey,
deleteInternalKms,
encryptWithKmsKey,
decryptWithKmsKey,
encryptWithInputKey,