Checkpoint argon2id test to generate blind index

This commit is contained in:
Tuan Dang
2023-04-15 15:21:44 +03:00
parent 3eb810b979
commit fcb677d990
8 changed files with 104 additions and 14 deletions
+3
View File
@@ -9,6 +9,7 @@ import Membership, { IMembership } from './membership';
import MembershipOrg, { IMembershipOrg } from './membershipOrg';
import Organization, { IOrganization } from './organization';
import Secret, { ISecret } from './secret';
import SecretBlindIndexData, { ISecretBlindIndexData } from './secretBlindIndexData';
import ServiceToken, { IServiceToken } from './serviceToken';
import ServiceAccount, { IServiceAccount } from './serviceAccount'; // new
import ServiceAccountKey, { IServiceAccountKey } from './serviceAccountKey'; // new
@@ -45,6 +46,8 @@ export {
IOrganization,
Secret,
ISecret,
SecretBlindIndexData,
ISecretBlindIndexData,
ServiceToken,
IServiceToken,
ServiceAccount,
+5 -1
View File
@@ -1,4 +1,4 @@
import { Schema, model, Types } from 'mongoose';
import { Schema, model, Types, Document } from 'mongoose';
import {
SECRET_SHARED,
SECRET_PERSONAL,
@@ -11,6 +11,7 @@ export interface ISecret {
type: string;
user: Types.ObjectId;
environment: string;
secretBlindIndex?: string;
secretKeyCiphertext: string;
secretKeyIV: string;
secretKeyTag: string;
@@ -57,6 +58,9 @@ const secretSchema = new Schema<ISecret>(
type: String,
required: true
},
secretBlindIndex: {
type: String
},
secretKeyCiphertext: {
type: String,
required: true
@@ -0,0 +1,25 @@
import { Schema, model, Types, Document } from 'mongoose';
export interface ISecretBlindIndexData {
_id: Types.ObjectId;
workspace: Types.ObjectId;
encryptedSalt: string;
}
const secretBlindIndexDataSchema = new Schema<ISecretBlindIndexData>(
{
workspace: {
type: Schema.Types.ObjectId,
ref: 'Workspace',
required: true
},
encryptedSalt: {
type: String,
required: true
}
}
);
const SecretBlindIndexData = model<ISecretBlindIndexData>('SecretBlindIndexData', secretBlindIndexDataSchema);
export default SecretBlindIndexData;