mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-02-12 12:34:24 +01:00
feat: started with proper E2EE ;)
This commit is contained in:
parent
e3b5c59949
commit
18d019d8b3
13 changed files with 380 additions and 1 deletions
|
|
@ -237,3 +237,5 @@ export const addTagToConversation = (conversationId: string) =>
|
|||
export const userTerms = () => '/api/user/terms';
|
||||
export const acceptUserTerms = () => '/api/user/terms/accept';
|
||||
export const banner = () => '/api/banner';
|
||||
|
||||
export const encryption = () => '/api/user/encryption';
|
||||
|
|
|
|||
|
|
@ -774,3 +774,9 @@ export function acceptTerms(): Promise<t.TAcceptTermsResponse> {
|
|||
export function getBanner(): Promise<t.TBannerResponse> {
|
||||
return request.get(endpoints.banner());
|
||||
}
|
||||
|
||||
export const updateUserEncryption = (
|
||||
payload: t.UpdateUserEncryptionRequest,
|
||||
): Promise<t.UpdateUserEncryptionResponse> => {
|
||||
return request.put(endpoints.encryption(), payload);
|
||||
};
|
||||
|
|
@ -67,4 +67,5 @@ export enum MutationKeys {
|
|||
deleteAgentAction = 'deleteAgentAction',
|
||||
deleteUser = 'deleteUser',
|
||||
updateRole = 'updateRole',
|
||||
updateUserEncryption = 'updateUserEncryption',
|
||||
}
|
||||
|
|
|
|||
|
|
@ -111,6 +111,10 @@ 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 = {
|
||||
|
|
@ -473,3 +477,21 @@ export type TAcceptTermsResponse = {
|
|||
};
|
||||
|
||||
export type TBannerResponse = TBanner | null;
|
||||
|
||||
/**
|
||||
* Request type for updating user encryption keys.
|
||||
*/
|
||||
export type UpdateUserEncryptionRequest = {
|
||||
encryptionPublicKey: string;
|
||||
encryptedPrivateKey: string;
|
||||
encryptionSalt: string;
|
||||
encryptionIV: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* Response type for updating user encryption keys.
|
||||
*/
|
||||
export type UpdateUserEncryptionResponse = {
|
||||
success: boolean;
|
||||
message?: string;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue