diff --git a/.changeset/fair-dryers-behave.md b/.changeset/fair-dryers-behave.md new file mode 100644 index 0000000000000..a9c57c42042e3 --- /dev/null +++ b/.changeset/fair-dryers-behave.md @@ -0,0 +1,6 @@ +--- +'@rocket.chat/rest-typings': major +'@rocket.chat/meteor': major +--- + +Removes ecdh functionality and related settings diff --git a/apps/meteor/.meteor/packages b/apps/meteor/.meteor/packages index 0dce43f784ee4..4242b98f6bed3 100644 --- a/apps/meteor/.meteor/packages +++ b/apps/meteor/.meteor/packages @@ -3,7 +3,6 @@ # 'meteor add' and 'meteor remove' will edit this file for you, # but you can also edit it by hand. -rocketchat:ddp rocketchat:mongo-config rocketchat:livechat rocketchat:streamer diff --git a/apps/meteor/.meteor/versions b/apps/meteor/.meteor/versions index 04d79cb550212..04fcb4d920bdd 100644 --- a/apps/meteor/.meteor/versions +++ b/apps/meteor/.meteor/versions @@ -70,7 +70,6 @@ reactive-dict@1.3.2 reactive-var@1.0.13 reload@1.3.2 retry@1.1.1 -rocketchat:ddp@0.0.1 rocketchat:livechat@0.0.1 rocketchat:mongo-config@0.0.1 rocketchat:streamer@1.1.0 diff --git a/apps/meteor/app/api/server/default/info.ts b/apps/meteor/app/api/server/default/info.ts index 8297f90fffd98..9f2a9d79e4a54 100644 --- a/apps/meteor/app/api/server/default/info.ts +++ b/apps/meteor/app/api/server/default/info.ts @@ -12,19 +12,3 @@ API.default.addRoute( }, }, ); - -API.default.addRoute( - 'ecdh_proxy/initEncryptedSession', - { authRequired: false }, - { - post() { - return { - statusCode: 200, - body: { - success: false, - error: 'Not Acceptable', - }, - }; - }, - }, -); diff --git a/apps/meteor/app/ecdh/Session.ts b/apps/meteor/app/ecdh/Session.ts deleted file mode 100644 index 47728667b9071..0000000000000 --- a/apps/meteor/app/ecdh/Session.ts +++ /dev/null @@ -1,69 +0,0 @@ -import type { X25519SecretKey, CryptographyKey } from 'sodium-plus'; -import { SodiumPlus, X25519PublicKey } from 'sodium-plus'; - -export class Session { - // Encoding for the key exchange, no requirements to be small - protected readonly stringFormatKey: BufferEncoding = 'base64'; - - // Encoding for the transfer of encrypted data, should be smaller as possible - protected readonly stringFormatEncryptedData: BufferEncoding = 'base64'; - - // Encoding before the encryption to keep unicode chars - protected readonly stringFormatRawData: BufferEncoding = 'base64'; - - protected decryptKey: CryptographyKey; - - protected encryptKey: CryptographyKey; - - protected secretKey: X25519SecretKey; - - public publicKey: X25519PublicKey; - - private static sodium: SodiumPlus | undefined; - - async sodium(): Promise { - if (!Session.sodium) { - Session.sodium = await SodiumPlus.auto(); - } - - return Session.sodium; - } - - get publicKeyString(): string { - return this.publicKey.toString(this.stringFormatKey); - } - - publicKeyFromString(text: string): X25519PublicKey { - return new X25519PublicKey(Buffer.from(text, this.stringFormatKey)); - } - - async encryptToBuffer(plaintext: string | Buffer): Promise { - const sodium = await this.sodium(); - const nonce = await sodium.randombytes_buf(24); - - const buffer = Buffer.isBuffer(plaintext) ? plaintext : Buffer.from(plaintext); - - const ciphertext = await sodium.crypto_secretbox(Buffer.from(buffer).toString(this.stringFormatRawData), nonce, this.encryptKey); - - return Buffer.concat([nonce, ciphertext]); - } - - async encrypt(plaintext: string | Buffer): Promise { - const buffer = await this.encryptToBuffer(plaintext); - return buffer.toString(this.stringFormatEncryptedData); - } - - async decryptToBuffer(data: string | Buffer): Promise { - const sodium = await this.sodium(); - const buffer = Buffer.from(Buffer.isBuffer(data) ? data.toString() : data, this.stringFormatEncryptedData); - - const decrypted = await sodium.crypto_secretbox_open(buffer.slice(24), buffer.slice(0, 24), this.decryptKey); - - return Buffer.from(decrypted.toString(), this.stringFormatRawData); - } - - async decrypt(data: string | Buffer): Promise { - const buffer = await this.decryptToBuffer(data); - return buffer.toString(); - } -} diff --git a/apps/meteor/app/ecdh/client/ClientSession.ts b/apps/meteor/app/ecdh/client/ClientSession.ts deleted file mode 100644 index 6e87cbae6b139..0000000000000 --- a/apps/meteor/app/ecdh/client/ClientSession.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { Session } from '../Session'; - -export class ClientSession extends Session { - async init(): Promise { - const sodium = await this.sodium(); - - const clientKeypair = await sodium.crypto_box_keypair(); - this.secretKey = await sodium.crypto_box_secretkey(clientKeypair); - this.publicKey = await sodium.crypto_box_publickey(clientKeypair); - - return this.publicKey.toString(this.stringFormatKey); - } - - async setServerKey(serverPublic: string): Promise { - const sodium = await this.sodium(); - - const [decryptKey, encryptKey] = await sodium.crypto_kx_client_session_keys( - this.publicKey, - this.secretKey, - this.publicKeyFromString(serverPublic), - ); - - this.decryptKey = decryptKey; - this.encryptKey = encryptKey; - } -} diff --git a/apps/meteor/app/ui-master/server/scripts.ts b/apps/meteor/app/ui-master/server/scripts.ts index 8a1a45d5a9ce6..b7e423b51d655 100644 --- a/apps/meteor/app/ui-master/server/scripts.ts +++ b/apps/meteor/app/ui-master/server/scripts.ts @@ -16,7 +16,6 @@ window.addEventListener('load', function() { ${process.env.DISABLE_ANIMATION ? 'window.DISABLE_ANIMATION = true;\n' : ''} -${settings.get('ECDH_Enabled') ? 'window.ECDH_Enabled = true;\n' : ''} // Custom_Script_Logged_Out window.addEventListener('Custom_Script_Logged_Out', function() { ${settings.get('Custom_Script_Logged_Out')} @@ -52,13 +51,7 @@ window.addEventListener('load', function() { }`; settings.watchMultiple( - [ - 'Custom_Script_Logged_Out', - 'Custom_Script_Logged_In', - 'Custom_Script_On_Logout', - 'Accounts_ForgetUserSessionOnWindowClose', - 'ECDH_Enabled', - ], + ['Custom_Script_Logged_Out', 'Custom_Script_Logged_In', 'Custom_Script_On_Logout', 'Accounts_ForgetUserSessionOnWindowClose'], () => { const content = getContent(); addScript('scripts', content); diff --git a/apps/meteor/client/ecdh.ts b/apps/meteor/client/ecdh.ts deleted file mode 100644 index 1e49f887e62b4..0000000000000 --- a/apps/meteor/client/ecdh.ts +++ /dev/null @@ -1,78 +0,0 @@ -import { Meteor } from 'meteor/meteor'; - -import type { ClientSession } from '../app/ecdh/client/ClientSession'; -import { sdk } from '../app/utils/client/lib/SDKClient'; - -let resolveSession: (value: ClientSession | void) => void; -const sessionPromise = new Promise((resolve) => { - resolveSession = resolve; -}); - -function init(session: ClientSession): void { - Meteor.connection._stream.allowConnection(); - - const _didMessage = Meteor.connection._stream.socket._didMessage.bind(Meteor.connection._stream.socket); - const send = Meteor.connection._stream.socket.send.bind(Meteor.connection._stream.socket); - - Meteor.connection._stream.socket._didMessage = async (data): Promise => { - const decryptedData = await session.decrypt(data); - decryptedData.split('\n').forEach((d) => _didMessage(d)); - }; - - Meteor.connection._stream.socket.send = async (data): Promise => { - send(await session.encrypt(data)); - }; -} - -async function initEncryptedSession(): Promise { - if (!window.ECDH_Enabled) { - Meteor.connection._stream.allowConnection(); - return resolveSession(); - } - const { ClientSession } = await import('../app/ecdh/client/ClientSession'); - const session = new ClientSession(); - const clientPublicKey = await session.init(); - - try { - const response = await fetch('/api/ecdh_proxy/initEncryptedSession', { - method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, - body: JSON.stringify({ clientPublicKey }), - }); - - if (response.status !== 200) { - resolveSession(); - return Meteor.connection._stream.allowConnection(); - } - - const data = await response.json(); - - if (data.success === false) { - resolveSession(); - return Meteor.connection._stream.allowConnection(); - } - - await session.setServerKey(data.publicKeyString); - resolveSession(session); - init(session); - } catch (e) { - console.log(e); - resolveSession(); - Meteor.connection._stream.allowConnection(); - } -} - -initEncryptedSession(); -sdk.rest.use(async (request, next) => { - const session = await sessionPromise; - - if (!session) { - return next(...request); - } - const result = await (await next(...request)).text(); - const decrypted = await session.decrypt(result); - const parsed = JSON.parse(decrypted); - return parsed; -}); diff --git a/apps/meteor/client/main.ts b/apps/meteor/client/main.ts index bbc9c124050a6..08d11bb14b734 100644 --- a/apps/meteor/client/main.ts +++ b/apps/meteor/client/main.ts @@ -3,7 +3,6 @@ import './meteor/startup'; import './serviceWorker'; import('./meteor/login') - .then(() => import('./ecdh')) .then(() => import('./importPackages')) .then(() => import('./startup')) .then(() => diff --git a/apps/meteor/definition/externals/global.d.ts b/apps/meteor/definition/externals/global.d.ts index 7b1dc296e638e..d9c45be89d90f 100644 --- a/apps/meteor/definition/externals/global.d.ts +++ b/apps/meteor/definition/externals/global.d.ts @@ -19,7 +19,6 @@ declare global { lastMessageWindow?: Record; lastMessageWindowHistory?: Record; favico?: any; - ECDH_Enabled?: boolean; __meteor_runtime_config__: { ROOT_URL_PATH_PREFIX: string; ROOT_URL: string; diff --git a/apps/meteor/definition/externals/meteor/meteor.d.ts b/apps/meteor/definition/externals/meteor/meteor.d.ts index cab110392c12c..74699e569483b 100644 --- a/apps/meteor/definition/externals/meteor/meteor.d.ts +++ b/apps/meteor/definition/externals/meteor/meteor.d.ts @@ -79,7 +79,6 @@ declare module 'meteor/meteor' { send: (data: string) => void; }; _launchConnectionAsync: () => void; - allowConnection: () => void; on: (key: 'message', callback: (data: string) => void) => void; }; diff --git a/apps/meteor/ee/app/ecdh/server/ServerSession.ts b/apps/meteor/ee/app/ecdh/server/ServerSession.ts deleted file mode 100644 index d7d67fdeba968..0000000000000 --- a/apps/meteor/ee/app/ecdh/server/ServerSession.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { Session } from '../../../../app/ecdh/Session'; - -export class ServerSession extends Session { - async init(clientPublic: string): Promise { - const sodium = await this.sodium(); - - const staticSeed = process.env.STATIC_SEED; - - if (!staticSeed?.trim()) { - console.error('STATIC_SEED environment variable is required'); - process.exit(1); - } - - const serverKeypair = await sodium.crypto_kx_seed_keypair(staticSeed + clientPublic); - this.secretKey = await sodium.crypto_box_secretkey(serverKeypair); - this.publicKey = await sodium.crypto_box_publickey(serverKeypair); - - const [decryptKey, encryptKey] = await sodium.crypto_kx_server_session_keys( - this.publicKey, - this.secretKey, - this.publicKeyFromString(clientPublic), - ); - - this.decryptKey = decryptKey; - this.encryptKey = encryptKey; - } -} diff --git a/apps/meteor/ee/server/services/ecdh-proxy/ECDHProxy.ts b/apps/meteor/ee/server/services/ecdh-proxy/ECDHProxy.ts deleted file mode 100644 index 7a065d3d00c9e..0000000000000 --- a/apps/meteor/ee/server/services/ecdh-proxy/ECDHProxy.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { ServiceClass } from '@rocket.chat/core-services'; - -import './lib/server'; - -export class ECDHProxy extends ServiceClass { - protected name = 'ecdh-proxy'; -} diff --git a/apps/meteor/ee/server/services/ecdh-proxy/README.md b/apps/meteor/ee/server/services/ecdh-proxy/README.md deleted file mode 100644 index e8b6c78a452f5..0000000000000 --- a/apps/meteor/ee/server/services/ecdh-proxy/README.md +++ /dev/null @@ -1,12 +0,0 @@ -# ECDH Proxy (alpha) - -This services aims to be in front of the HTTP and Webscoket services and provide a second layer of encryption based on [ECDH](https://en.wikipedia.org/wiki/Elliptic-curve_Diffie%E2%80%93Hellman) algorithm. - -## Configuration - -All the configuration for this service is done via environment variables: - -- **STATIC_SEED**: The static seed to compose the encryption. **Required** -- **PORT**: The port this service will expose the HTTP server. Default: `4000` -- **PROXY_HOST**: The host this service will proxy the requests to after decoding. Default `localhost` -- **PROXY_PORT**: The port this service will proxy the requests to after decoding. Default `3000` diff --git a/apps/meteor/ee/server/services/ecdh-proxy/lib/server.ts b/apps/meteor/ee/server/services/ecdh-proxy/lib/server.ts deleted file mode 100644 index ccf159f48ff45..0000000000000 --- a/apps/meteor/ee/server/services/ecdh-proxy/lib/server.ts +++ /dev/null @@ -1,259 +0,0 @@ -import type { RequestOptions } from 'http'; -import http from 'http'; -import type { Readable } from 'stream'; -import url from 'url'; - -import cookie from 'cookie'; -import cookieParser from 'cookie-parser'; -import type { Request, Response } from 'express'; -import express from 'express'; -import he from 'he'; -import mem from 'mem'; -import WebSocket from 'ws'; - -import { ServerSession } from '../../../../app/ecdh/server/ServerSession'; - -const app = express(); -app.use(cookieParser()); - -const port = process.env.PORT || 4000; - -function streamToBuffer(stream: Readable): Promise { - return new Promise((resolve) => { - const buffers: any[] = []; - stream.on('data', (d) => buffers.push(d)); - stream.on('end', () => { - resolve(Buffer.concat(buffers)); - }); - stream.resume(); - }); -} - -async function getSession(clientPublicKey: string): Promise { - const serverSession = new ServerSession(); - await serverSession.init(clientPublicKey); - return serverSession; -} - -const getSessionCached = mem(getSession, { maxAge: 1000 }); - -const _processRequest = async (session: ServerSession, requestData: Buffer): Promise => session.decrypt(requestData); -const _processResponse = async (session: ServerSession, responseData: Buffer): Promise => session.encrypt(responseData); - -const proxyHostname = process.env.PROXY_HOST || 'localhost'; -const proxyPort = process.env.PROXY_PORT || 3000; - -const proxy = async function ( - req: Request, - res: Response, - session?: ServerSession, - processRequest = _processRequest, - processResponse = _processResponse, -): Promise { - req.pause(); - const options: RequestOptions = url.parse(req.originalUrl || ''); - options.headers = req.headers; - options.method = req.method; - options.agent = false; - options.hostname = proxyHostname; - options.port = proxyPort; - if (session) { - // Required to not receive gzipped data - delete options.headers['accept-encoding']; - // Required since we don't know the new length - delete options.headers['content-length']; - } - - const connector = http.request(options, async (serverResponse) => { - serverResponse.pause(); - if (serverResponse.statusCode) { - res.writeHead(serverResponse.statusCode, serverResponse.headers); - } - if (session) { - const responseData = await streamToBuffer(serverResponse); - if (responseData.length) { - res.write(await processResponse(session, responseData)); - } - res.end(); - // session.encryptStream(serverResponse, processInput, processOutput).pipe(res); - } else { - serverResponse.pipe(res); - } - serverResponse.resume(); - }); - - connector.on('error', (error) => console.error(error)); - - if (session) { - const requestData = await streamToBuffer(req); - if (requestData.length) { - connector.write(await processRequest(session, requestData)); - } - connector.end(); - } else { - req.pipe(connector); - } - req.resume(); -}; - -app.use('/api/ecdh_proxy', express.json()); -app.post('/api/ecdh_proxy/initEncryptedSession', async (req, res) => { - try { - const session = await getSessionCached(req.body.clientPublicKey); - - res.cookie('ecdhSession', req.body.clientPublicKey); - res.send({ - success: true, - publicKeyString: session.publicKeyString, - }); - } catch (e) { - res.status(400).send(e instanceof Error ? he.escape(e.message) : he.escape(String(e))); - } -}); - -app.post('/api/ecdh_proxy/echo', async (req, res) => { - if (!req.cookies.ecdhSession) { - return res.status(401).send(); - } - - const session = await getSessionCached(req.cookies.ecdhSession); - - if (!session) { - return res.status(401).send(); - } - - try { - const result = await session.decrypt(req.body.text); - res.send(await session.encrypt(result)); - } catch (e) { - console.error(e); - const errorMessage = e instanceof Error ? e.message : String(e); - res.status(400).send(he.encode(errorMessage)); - } -}); - -const httpServer = app.listen(port, () => { - console.log(`Proxy listening at http://localhost:${port}`); -}); - -const wss = new WebSocket.Server({ server: httpServer }); - -wss.on('error', (error) => { - console.error(error); -}); - -wss.on('connection', async (ws, req) => { - if (!req.url) { - return; - } - - const cookies = cookie.parse(req.headers.cookie || ''); - - if (!cookies.ecdhSession) { - ws.close(); - return; - } - - const session = await getSessionCached(cookies.ecdhSession); - - const proxy = new WebSocket(`ws://${proxyHostname}:${proxyPort}${req.url}` /* , { agent: req.agent } */); - - ws.on('message', async (data: string) => { - const decrypted = JSON.stringify([await session.decrypt(data.replace('["', '').replace('"]', ''))]); - proxy.send(decrypted); - }); - - proxy.on('message', async (data: string) => { - ws.send(await session.encrypt(data.toString())); - }); - - proxy.on('error', (error) => { - console.error(error); - }); - - ws.on('error', (error) => { - console.error(error); - }); - - ws.on('close', (code, reason) => { - try { - proxy.close(code, reason); - } catch (e) { - // - } - }); - // proxy.on('close', (code, reason) => ws.close(code, reason)); -}); - -app.use('/api/*', async (req, res) => { - res.setHeader('Access-Control-Allow-Origin', '*'); - - const session = await getSessionCached(req.cookies.ecdhSession); - - if (!session) { - return res.status(401).send(); - } - - try { - void proxy(req, res, session); - } catch (e) { - res.status(400).send(e instanceof Error ? e.message : String(e)); - } -}); - -const xhrDataRequestProcess: typeof _processRequest = async (session, requestData) => { - const data: string[] = JSON.parse(requestData.toString()); - - for await (const [index, item] of data.entries()) { - data[index] = await session.decrypt(item); - } - - return JSON.stringify(data); -}; - -const xhrDataResponseProcess: typeof _processResponse = async (session, responseData) => { - const data = responseData.toString().replace(/\n$/, '').split('\n'); - - for await (const [index, item] of data.entries()) { - data[index] = await session.encrypt(item); - } - - return `${data.join('\n')}\n`; -}; - -app.use('/sockjs/:id1/:id2/xhr_send', async (req, res) => { - res.setHeader('Access-Control-Allow-Origin', '*'); - - const session = await getSessionCached(req.cookies.ecdhSession); - - if (!session) { - return res.status(401).send(); - } - - try { - void proxy(req, res, session, xhrDataRequestProcess, xhrDataResponseProcess); - } catch (e) { - res.status(400).send(e instanceof Error ? e.message : String(e)); - } -}); - -app.use('/sockjs/:id1/:id2/xhr', async (req, res) => { - res.setHeader('Access-Control-Allow-Origin', '*'); - - const session = await getSessionCached(req.cookies.ecdhSession); - - if (!session) { - return res.status(401).send(); - } - - try { - void proxy(req, res, session, undefined, xhrDataResponseProcess); - } catch (e) { - res.status(400).send(e instanceof Error ? e.message : String(e)); - } -}); - -app.use((req, res) => { - res.setHeader('Access-Control-Allow-Origin', '*'); - void proxy(req, res); -}); diff --git a/apps/meteor/ee/server/services/ecdh-proxy/service.ts b/apps/meteor/ee/server/services/ecdh-proxy/service.ts deleted file mode 100755 index a795f157c9a5f..0000000000000 --- a/apps/meteor/ee/server/services/ecdh-proxy/service.ts +++ /dev/null @@ -1,6 +0,0 @@ -import '@rocket.chat/network-broker'; -import { api } from '@rocket.chat/core-services'; - -import { ECDHProxy } from './ECDHProxy'; - -api.registerService(new ECDHProxy()); diff --git a/apps/meteor/packages/rocketchat-ddp/client/index.js b/apps/meteor/packages/rocketchat-ddp/client/index.js deleted file mode 100644 index 4d6597e810a7d..0000000000000 --- a/apps/meteor/packages/rocketchat-ddp/client/index.js +++ /dev/null @@ -1,9 +0,0 @@ -import { ClientStream } from 'meteor/socket-stream-client'; - -const { _launchConnection } = ClientStream.prototype; -ClientStream.prototype.allowConnection = function () { - _launchConnection.call(this); - ClientStream.prototype._launchConnection = _launchConnection; -}; - -ClientStream.prototype._launchConnection = function () {}; diff --git a/apps/meteor/packages/rocketchat-ddp/package.js b/apps/meteor/packages/rocketchat-ddp/package.js deleted file mode 100644 index 0c0ef3a8d1c6f..0000000000000 --- a/apps/meteor/packages/rocketchat-ddp/package.js +++ /dev/null @@ -1,12 +0,0 @@ -Package.describe({ - name: 'rocketchat:ddp', - version: '0.0.1', - summary: '', - git: '', -}); - -Package.onUse(function (api) { - api.use(['ecmascript', 'socket-stream-client']); - - api.mainModule('client/index.js', 'client'); -}); diff --git a/apps/meteor/server/settings/general.ts b/apps/meteor/server/settings/general.ts index 0a68cbf12df1c..d27fdf94f33b0 100644 --- a/apps/meteor/server/settings/general.ts +++ b/apps/meteor/server/settings/general.ts @@ -260,10 +260,6 @@ export const createGeneralSettings = () => ], public: true, }); - await this.add('ECDH_Enabled', false, { - type: 'boolean', - alert: 'This_feature_is_currently_in_alpha', - }); await this.section('UTF8', async function () { await this.add('UTF8_User_Names_Validation', '[0-9a-zA-Z-_.]+', { type: 'string', diff --git a/apps/meteor/server/startup/migrations/index.ts b/apps/meteor/server/startup/migrations/index.ts index 4c35e12fd342f..c28efd9122145 100644 --- a/apps/meteor/server/startup/migrations/index.ts +++ b/apps/meteor/server/startup/migrations/index.ts @@ -35,5 +35,6 @@ import './v326'; import './v327'; import './v328'; import './v329'; +import './v330'; export * from './xrun'; diff --git a/apps/meteor/server/startup/migrations/v330.ts b/apps/meteor/server/startup/migrations/v330.ts new file mode 100644 index 0000000000000..4956ad4006908 --- /dev/null +++ b/apps/meteor/server/startup/migrations/v330.ts @@ -0,0 +1,11 @@ +import { Settings } from '@rocket.chat/models'; + +import { addMigration } from '../../lib/migrations'; + +addMigration({ + version: 330, + name: 'Remove ECDH setting', + async up() { + await Settings.deleteOne({ _id: 'ECDH_Enabled' }); + }, +}); diff --git a/apps/meteor/tests/e2e/e2e-encryption/e2ee-key-reset.spec.ts b/apps/meteor/tests/e2e/e2e-encryption/e2ee-key-reset.spec.ts index fab641ba6021c..12bb19f1f0d9f 100644 --- a/apps/meteor/tests/e2e/e2e-encryption/e2ee-key-reset.spec.ts +++ b/apps/meteor/tests/e2e/e2e-encryption/e2ee-key-reset.spec.ts @@ -1,6 +1,7 @@ import type { Page } from '@playwright/test'; import { createAuxContext } from '../fixtures/createAuxContext'; +import injectInitialData from '../fixtures/inject-initial-data'; import { Users } from '../fixtures/userStates'; import { AccountProfile } from '../page-objects'; import { preserveSettings } from '../utils/preserveSettings'; @@ -35,6 +36,7 @@ test.describe('E2EE Key Reset', () => { test.afterEach(async () => { await anotherClientPage.close(); + await injectInitialData(); }); test('expect force logout on e2e keys reset', async ({ page }) => { diff --git a/apps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.ts b/apps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.ts index fcd3c11010fc1..4d0ea1a3478ed 100644 --- a/apps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.ts +++ b/apps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.ts @@ -2,8 +2,7 @@ import { faker } from '@faker-js/faker'; import type { APIRequestContext } from '@playwright/test'; import { BASE_API_URL } from '../config/constants'; -import injectInitialData from '../fixtures/inject-initial-data'; -import { Users, restoreState } from '../fixtures/userStates'; +import { Users } from '../fixtures/userStates'; import { HomeChannel } from '../page-objects'; import { preserveSettings } from '../utils/preserveSettings'; import { test, expect } from '../utils/test'; @@ -54,9 +53,6 @@ test.describe('E2EE Legacy Format', () => { test('legacy expect create a private channel encrypted and send an encrypted message', async ({ page, request }) => { const channelName = faker.string.uuid(); - await injectInitialData(); - await restoreState(page, Users.userE2EE, { except: ['private_key', 'public_key', 'e2e.randomPassword'] }); - await poHomeChannel.sidenav.createEncryptedChannel(channelName); await expect(page).toHaveURL(`/group/${channelName}`); diff --git a/packages/rest-typings/src/default/index.ts b/packages/rest-typings/src/default/index.ts index e34ac6dbbbc92..c15b3a3786ff0 100644 --- a/packages/rest-typings/src/default/index.ts +++ b/packages/rest-typings/src/default/index.ts @@ -54,9 +54,6 @@ export interface DefaultEndpoints { version: string | undefined; }; }; - '/ecdh_proxy/initEncryptedSession': { - POST: () => void; - }; '/docs/json': { GET: (params: OpenAPIJSONEndpoint) => { openapi: string;