Complete first iteration of CRUD secrets operations by name

This commit is contained in:
Tuan Dang
2023-04-17 11:09:45 +03:00
parent d9afe90885
commit df83e8ceb9
29 changed files with 1231 additions and 229 deletions
+6 -16
View File
@@ -1,20 +1,15 @@
import { Schema, model, Types } from 'mongoose';
import {
WORKSPACE_ENCRYPTION_MODE_E2EE,
WORKSPACE_ENCRYPTION_MODE_BLIND_INDEXED_E2EE,
WORKSPACE_ENCRYPTION_MODE_NOT_E2EE
} from '../variables';
export interface IWorkspace {
_id: Types.ObjectId;
name: string;
encryptionMode: string;
organization: Types.ObjectId;
environments: Array<{
name: string;
slug: string;
}>;
autoCapitalization: boolean;
isBlindedIndicesEnabled: boolean;
}
const workspaceSchema = new Schema<IWorkspace>({
@@ -22,19 +17,14 @@ const workspaceSchema = new Schema<IWorkspace>({
type: String,
required: true
},
encryptionMode: {
type: String,
default: 'e2ee',
enum: [
WORKSPACE_ENCRYPTION_MODE_E2EE,
WORKSPACE_ENCRYPTION_MODE_BLIND_INDEXED_E2EE,
WORKSPACE_ENCRYPTION_MODE_NOT_E2EE
]
},
autoCapitalization: {
type: Boolean,
default: true,
},
isBlindedIndicesEnabled: {
type: Boolean,
required: true
},
organization: {
type: Schema.Types.ObjectId,
ref: 'Organization',
@@ -70,4 +60,4 @@ const workspaceSchema = new Schema<IWorkspace>({
const Workspace = model<IWorkspace>('Workspace', workspaceSchema);
export default Workspace;
export default Workspace;