mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-16 19:28:35 +00:00
Complete first iteration of CRUD secrets operations by name
This commit is contained in:
@@ -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;
|
||||
Reference in New Issue
Block a user