mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-16 05:13:43 +00:00
Complete first iteration of CRUD secrets operations by name
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Schema, model, Types, Document } from 'mongoose';
|
||||
import { Schema, model, Types } from 'mongoose';
|
||||
import {
|
||||
SECRET_SHARED,
|
||||
SECRET_PERSONAL,
|
||||
@@ -59,7 +59,8 @@ const secretSchema = new Schema<ISecret>(
|
||||
required: true
|
||||
},
|
||||
secretBlindIndex: {
|
||||
type: String
|
||||
type: String,
|
||||
select: false
|
||||
},
|
||||
secretKeyCiphertext: {
|
||||
type: String,
|
||||
|
||||
@@ -3,7 +3,9 @@ import { Schema, model, Types, Document } from 'mongoose';
|
||||
export interface ISecretBlindIndexData {
|
||||
_id: Types.ObjectId;
|
||||
workspace: Types.ObjectId;
|
||||
encryptedSalt: string;
|
||||
encryptedSaltCiphertext: string;
|
||||
saltIV: string;
|
||||
saltTag: string;
|
||||
}
|
||||
|
||||
const secretBlindIndexDataSchema = new Schema<ISecretBlindIndexData>(
|
||||
@@ -13,7 +15,15 @@ const secretBlindIndexDataSchema = new Schema<ISecretBlindIndexData>(
|
||||
ref: 'Workspace',
|
||||
required: true
|
||||
},
|
||||
encryptedSalt: {
|
||||
encryptedSaltCiphertext: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
saltIV: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
saltTag: {
|
||||
type: String,
|
||||
required: true
|
||||
}
|
||||
|
||||
@@ -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