mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-02-11 12:04:24 +01:00
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:
parent
18d019d8b3
commit
94d32906f1
11 changed files with 343 additions and 189 deletions
|
|
@ -483,14 +483,17 @@ export const tMessageSchema = z.object({
|
|||
thread_id: z.string().optional(),
|
||||
/* frontend components */
|
||||
iconURL: z.string().nullable().optional(),
|
||||
iv: z.string().nullable().optional(),
|
||||
authTag: z.string().nullable().optional(),
|
||||
encryptedKey: z.string().nullable().optional(),
|
||||
});
|
||||
|
||||
export type TAttachmentMetadata = { messageId: string; toolCallId: string };
|
||||
export type TAttachment =
|
||||
| (TFile & TAttachmentMetadata)
|
||||
| (Pick<TFile, 'filename' | 'filepath' | 'conversationId'> & {
|
||||
expiresAt: number;
|
||||
} & TAttachmentMetadata);
|
||||
expiresAt: number;
|
||||
} & TAttachmentMetadata);
|
||||
|
||||
export type TMessage = z.input<typeof tMessageSchema> & {
|
||||
children?: TMessage[];
|
||||
|
|
@ -780,11 +783,11 @@ export const googleSchema = tConversationSchema
|
|||
}));
|
||||
|
||||
/**
|
||||
* TODO: Map the following fields:
|
||||
- presence_penalty -> presencePenalty
|
||||
- frequency_penalty -> frequencyPenalty
|
||||
- stop -> stopSequences
|
||||
*/
|
||||
* TODO: Map the following fields:
|
||||
- presence_penalty -> presencePenalty
|
||||
- frequency_penalty -> frequencyPenalty
|
||||
- stop -> stopSequences
|
||||
*/
|
||||
export const googleGenConfigSchema = z
|
||||
.object({
|
||||
maxOutputTokens: coerceNumber.optional(),
|
||||
|
|
|
|||
|
|
@ -41,11 +41,11 @@ export type TEndpointOption = {
|
|||
|
||||
export type TPayload = Partial<TMessage> &
|
||||
Partial<TEndpointOption> & {
|
||||
isContinued: boolean;
|
||||
conversationId: string | null;
|
||||
messages?: TMessages;
|
||||
isTemporary: boolean;
|
||||
};
|
||||
isContinued: boolean;
|
||||
conversationId: string | null;
|
||||
messages?: TMessages;
|
||||
isTemporary: boolean;
|
||||
};
|
||||
|
||||
export type TSubmission = {
|
||||
artifacts?: string;
|
||||
|
|
@ -111,10 +111,6 @@ export type TUser = {
|
|||
plugins?: string[];
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
encryptionPublicKey?: string;
|
||||
encryptedPrivateKey?: string; // Encrypted as a Base64 string
|
||||
encryptionSalt?: string; // Base64 encoded salt used for PBKDF2
|
||||
encryptionIV?: string; // Base64 encoded IV for AES-GCM
|
||||
};
|
||||
|
||||
export type TGetConversationsResponse = {
|
||||
|
|
@ -482,10 +478,10 @@ export type TBannerResponse = TBanner | null;
|
|||
* Request type for updating user encryption keys.
|
||||
*/
|
||||
export type UpdateUserEncryptionRequest = {
|
||||
encryptionPublicKey: string;
|
||||
encryptedPrivateKey: string;
|
||||
encryptionSalt: string;
|
||||
encryptionIV: string;
|
||||
encryptionPublicKey: string | null;
|
||||
encryptedPrivateKey: string | null;
|
||||
encryptionSalt: string | null;
|
||||
encryptionIV: string | null;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue