Add non-e2ee option for getSecret, getSecrets, start createSecret

This commit is contained in:
Tuan Dang
2023-06-09 21:20:12 +01:00
parent 00fae0023a
commit 0187d3012b
8 changed files with 202 additions and 35 deletions
+19 -1
View File
@@ -2,13 +2,31 @@ import { Types } from 'mongoose';
import {
getSecretsBotHelper,
encryptSymmetricHelper,
decryptSymmetricHelper
decryptSymmetricHelper,
getKey,
getIsWorkspaceE2EEHelper
} from '../helpers/bot';
// rename the functions here
// refactor the interface situation here
/**
* Class to handle bot actions
*/
class BotService {
static async getIsWorkspaceE2EE(workspaceId: Types.ObjectId) {
return await getIsWorkspaceE2EEHelper(workspaceId);
}
static async getWorkspaceKeyWithBot({
workspaceId
}: {
workspaceId: Types.ObjectId;
}) {
return await getKey({
workspaceId
});
}
/**
* Return decrypted secrets for workspace with id [workspaceId] and
-3
View File
@@ -1,7 +1,4 @@
import { Types } from 'mongoose';
import {
ISecret
} from '../models';
import {
CreateSecretParams,
GetSecretsParams,