refactor: fully working E2EE

small issue to fix. when full response is received it replaces the text with the text from the DB. and then the decryption is not yet implement.
This commit is contained in:
Ruben Talstra 2025-02-15 23:04:26 +01:00
parent 18d019d8b3
commit 94d32906f1
No known key found for this signature in database
GPG key ID: 2A5A7174A60F3BEA
11 changed files with 343 additions and 189 deletions

View file

@ -54,11 +54,6 @@ const messageSchema = mongoose.Schema(
type: String,
meiliIndex: true,
},
// If the message is encrypted (and stored in 'text'),
// then this field should hold the IV used during encryption.
messageEncryptionIV: {
type: String,
},
summary: {
type: String,
},
@ -142,6 +137,18 @@ const messageSchema = mongoose.Schema(
expiredAt: {
type: Date,
},
iv: {
type: String,
default: null,
},
authTag: {
type: String,
default: null,
},
encryptedKey: {
type: String,
default: null,
},
},
{ timestamps: true },
);