Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"@iconscout/react-unicons": "^1.1.6",
"@internxt/css-config": "1.0.3",
"@internxt/lib": "1.3.1",
"@internxt/sdk": "1.10.9",
"@internxt/sdk": "1.10.10",
"@internxt/ui": "0.0.25",
"@phosphor-icons/react": "^2.1.7",
"@popperjs/core": "^2.11.6",
Expand Down Expand Up @@ -178,4 +178,4 @@
"prettier --write"
]
}
}
}
14 changes: 11 additions & 3 deletions src/app/auth/services/auth.service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -678,12 +678,14 @@ describe('updateCredentialsWithToken', () => {
await authService.updateCredentialsWithToken(mockToken, mockNewPassword, mockMnemonic);

expect(mockChangePasswordWithLink).toHaveBeenCalled();
const [token, encryptedPassword, encryptedSalt, encryptedMnemonic, keys] = mockChangePasswordWithLink.mock.calls[0];
const [token, encryptedPassword, encryptedSalt, encryptedMnemonic, uuid, keys] =
mockChangePasswordWithLink.mock.calls[0];

expect(token).toBe(mockToken);
expect(encryptedPassword).toBeDefined();
expect(encryptedSalt).toBeDefined();
expect(encryptedMnemonic).toBeDefined();
expect(uuid).toBeUndefined();
expect(keys).toBeUndefined();
});

Expand All @@ -695,6 +697,7 @@ describe('updateCredentialsWithToken', () => {
const mockBackupData: BackupData = {
privateKey: 'test-private-key',
mnemonic: '',
userUuid: 'test-user-uuid',
keys: {
ecc: '',
kyber: '',
Expand All @@ -715,12 +718,14 @@ describe('updateCredentialsWithToken', () => {
await authService.updateCredentialsWithToken(mockToken, mockNewPassword, mockMnemonic, mockBackupData);

expect(mockChangePasswordWithLink).toHaveBeenCalled();
const [token, encryptedPassword, encryptedSalt, encryptedMnemonic, keys] = mockChangePasswordWithLink.mock.calls[0];
const [token, encryptedPassword, encryptedSalt, encryptedMnemonic, uuid, keys] =
mockChangePasswordWithLink.mock.calls[0];

expect(token).toBe(mockToken);
expect(encryptedPassword).toBeDefined();
expect(encryptedSalt).toBeDefined();
expect(encryptedMnemonic).toBeDefined();
expect(uuid).toBe('test-user-uuid');
expect(keys).toBeDefined();

expect(keys.ecc).toBe('mock-encrypted-data');
Expand All @@ -735,6 +740,7 @@ describe('updateCredentialsWithToken', () => {
const mockBackupData: BackupData = {
privateKey: '',
mnemonic: '',
userUuid: 'test-user-uuid',
keys: {
ecc: 'test-ecc-private-key',
kyber: 'test-kyber-private-key',
Expand All @@ -755,12 +761,14 @@ describe('updateCredentialsWithToken', () => {
await authService.updateCredentialsWithToken(mockToken, mockNewPassword, mockMnemonic, mockBackupData);

expect(mockChangePasswordWithLink).toHaveBeenCalled();
const [token, encryptedPassword, encryptedSalt, encryptedMnemonic, keys] = mockChangePasswordWithLink.mock.calls[0];
const [token, encryptedPassword, encryptedSalt, encryptedMnemonic, uuid, keys] =
mockChangePasswordWithLink.mock.calls[0];

expect(token).toBe(mockToken);
expect(encryptedPassword).toBeDefined();
expect(encryptedSalt).toBeDefined();
expect(encryptedMnemonic).toBeDefined();
expect(uuid).toBe('test-user-uuid');
expect(keys).toBeDefined();

expect(keys.ecc).toBe('mock-encrypted-data');
Expand Down
1 change: 1 addition & 0 deletions src/app/auth/services/auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ export const updateCredentialsWithToken = async (
encryptedHashedNewPassword,
encryptedHashedNewPasswordSalt,
encryptedMnemonic,
backupData?.userUuid || undefined,
keys,
);
};
Expand Down
6 changes: 5 additions & 1 deletion src/app/share/views/ShareView/ShareFolderView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ import sizeService from 'app/drive/services/size.service';
import { useTranslationContext } from 'app/i18n/provider/TranslationProvider';
import { loadWritableStreamPonyfill } from 'app/network/download';
import notificationsService, { ToastType } from 'app/notifications/services/notifications.service';
import shareService, { downloadPublicSharedFolder, getPublicSharingMeta, decodeSharingId } from 'app/share/services/share.service';
import shareService, {
downloadPublicSharedFolder,
getPublicSharingMeta,
decodeSharingId,
} from 'app/share/services/share.service';
import { TaskProgress } from 'app/tasks/types';
import { useEffect, useState } from 'react';
import { match } from 'react-router';
Expand Down
4 changes: 3 additions & 1 deletion src/app/utils/backupKeyUtils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ describe('backupKeyUtils', () => {
const mockBackupData: BackupData = {
mnemonic: 'test mnemonic',
privateKey: 'test-private-key',
userUuid: 'test-user-uuid',
keys: {
ecc: 'test-ecc-key',
kyber: 'test-kyber-key',
Expand Down Expand Up @@ -301,6 +302,7 @@ describe('backupKeyUtils', () => {
publicKey: 'test-kyber-public-key',
privateKeyEncrypted: 'test-kyber-private-key-encrypted',
},
userUuid: 'test-user-uuid',
};
vi.mocked(getKeys).mockResolvedValue(mockGeneratedKeys);

Expand Down Expand Up @@ -335,7 +337,7 @@ describe('backupKeyUtils', () => {
encryptedPassword: 'encrypted-test-hash',
encryptedSalt: 'encrypted-test-salt',
encryptedMnemonic: 'encrypted-with-key-' + mockMnemonic,
eccEncryptedMnemonic: 'ecc-encrypted-mnemonic',
eccEncryptedMnemonic: 'ZWNjLWVuY3J5cHRlZC1tbmVtb25pYw==',
kyberEncryptedMnemonic: 'hybrid-encrypted-mnemonic',
keys: {
ecc: {
Expand Down
3 changes: 3 additions & 0 deletions src/app/utils/backupKeyUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { encryptMessageWithPublicKey, hybridEncryptMessageWithPublicKey } from '
export interface BackupData {
mnemonic: string;
privateKey: string;
userUuid?: string;
keys: {
ecc: string;
kyber: string;
Expand All @@ -45,6 +46,7 @@ export function handleExportBackupKey(translate) {
const backupData: BackupData = {
mnemonic,
privateKey: user.privateKey,
userUuid: user.uuid,
keys: {
ecc: user.keys?.ecc?.privateKey || user.privateKey,
kyber: user.keys?.kyber?.privateKey || '',
Expand Down Expand Up @@ -87,6 +89,7 @@ export const detectBackupKeyFormat = (
const backupData: BackupData = {
mnemonic: parsedData.mnemonic,
privateKey: parsedData.privateKey,
userUuid: parsedData.userUuid || undefined,
keys: {
ecc: parsedData.keys.ecc,
kyber: parsedData.keys.kyber,
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1905,10 +1905,10 @@
version "1.0.2"
resolved "https://codeload.github.com/internxt/prettier-config/tar.gz/9fa74e9a2805e1538b50c3809324f1c9d0f3e4f9"

"@internxt/[email protected].9":
version "1.10.9"
resolved "https://registry.yarnpkg.com/@internxt/sdk/-/sdk-1.10.9.tgz#6a6d3f4148e4c4b108cc7384ebefd9f7fd957813"
integrity sha512-xqRCkFPQ/EOM8eS3+AZoAVTH9hYoSUwkorJ1Ic0wXEET2M265GVapqZXoF5TixhpMZycAF4ubnTo+IQNkaFxwQ==
"@internxt/[email protected].10":
version "1.10.10"
resolved "https://registry.yarnpkg.com/@internxt/sdk/-/sdk-1.10.10.tgz#dbf38b4a637042d2abf36349990e364e05c4beff"
integrity sha512-FtZOJkZDMBxHf0uX5D8MlxNbEGC6PEE0hZJwBrSyzryUyTiuqDL9EnnImlQzxnE0vhLN+88+oGdhnJJ6nlPQyA==
dependencies:
axios "1.10.0"
uuid "11.1.0"
Expand Down
Loading