Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(E2EE): Async E2EE keys exchange #32197

Merged
merged 75 commits into from
Jun 22, 2024
Merged

feat(E2EE): Async E2EE keys exchange #32197

merged 75 commits into from
Jun 22, 2024

Conversation

yash-rajpal
Copy link
Member

@yash-rajpal yash-rajpal commented Apr 12, 2024

Proposed changes (including videos or screenshots)

Async key distribution process for E2EE rooms. Earlier users needed to be online to receive and share and verify the group keys which caused a bottleneck in the process. Made this process async so that users now no longer need to be online at the same time.

Keys will be generated even when the users are offline and they can receive it when they come online.

Issue(s)

Steps to test or reproduce

  • Add a few users in an E2EE room
  • reset the E2EE for few users
  • Log back in with those users (just to create their public keys)
  • When the main users comes online in the E2EE room, it will generate the keys for all the users waiting in queue.
  • When users come online they receive keys and E2EE rooms messages are decrypted.

Further comments

E2EE-13

Copy link

changeset-bot bot commented Apr 12, 2024

🦋 Changeset detected

Latest commit: dcd8fe9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 32 packages
Name Type
@rocket.chat/model-typings Minor
@rocket.chat/core-typings Minor
@rocket.chat/rest-typings Minor
@rocket.chat/meteor Minor
@rocket.chat/apps Patch
@rocket.chat/models Patch
@rocket.chat/account-service Patch
@rocket.chat/authorization-service Patch
@rocket.chat/ddp-streamer Patch
@rocket.chat/omnichannel-transcript Patch
@rocket.chat/presence-service Patch
@rocket.chat/queue-worker Patch
@rocket.chat/stream-hub-service Patch
@rocket.chat/omnichannel-services Patch
rocketchat-services Patch
@rocket.chat/core-services Patch
@rocket.chat/cron Patch
@rocket.chat/fuselage-ui-kit Major
@rocket.chat/gazzodown Major
@rocket.chat/livechat Patch
@rocket.chat/ui-contexts Major
@rocket.chat/api-client Patch
@rocket.chat/license Patch
@rocket.chat/pdf-worker Patch
@rocket.chat/presence Patch
@rocket.chat/ddp-client Patch
@rocket.chat/instance-status Patch
@rocket.chat/uikit-playground Patch
@rocket.chat/ui-avatar Major
@rocket.chat/ui-client Major
@rocket.chat/ui-video-conf Major
@rocket.chat/web-ui-registration Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

dionisio-bot bot commented Apr 12, 2024

Looks like this PR is ready to merge! 🎉
If you have any trouble, please check the PR guidelines

Copy link

codecov bot commented Apr 12, 2024

Codecov Report

Attention: Patch coverage is 59.55882% with 55 lines in your changes missing coverage. Please review.

Project coverage is 56.71%. Comparing base (1240c87) to head (dcd8fe9).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #32197      +/-   ##
===========================================
- Coverage    56.74%   56.71%   -0.03%     
===========================================
  Files         2495     2496       +1     
  Lines        55237    55360     +123     
  Branches     11434    11455      +21     
===========================================
+ Hits         31345    31400      +55     
- Misses       21196    21255      +59     
- Partials      2696     2705       +9     
Flag Coverage Δ
e2e 56.45% <59.55%> (-0.06%) ⬇️
unit 71.86% <ø> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

@yash-rajpal yash-rajpal marked this pull request as ready for review April 15, 2024 19:39
@yash-rajpal yash-rajpal requested review from a team as code owners April 15, 2024 19:39
Copy link
Member

@MarcosSpessatto MarcosSpessatto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still have some general comments:

  • Let's improve the PR description.
  • We need to add a changeset.
  • We can have some API tests to test at least half of the workflow, we can call the provideUsersGroupKeys endpoint with arbitrary values for keys, and see if the keys were set to the subscriptions. Of course, the test will not be fully complete, and test it using an UI test could potentially create a slow test, since the process is completely async.

apps/meteor/app/api/server/v1/e2e.ts Outdated Show resolved Hide resolved
apps/meteor/app/api/server/v1/e2e.ts Outdated Show resolved Hide resolved
apps/meteor/app/e2e/client/rocketchat.e2e.room.js Outdated Show resolved Hide resolved
apps/meteor/app/e2e/client/rocketchat.e2e.ts Outdated Show resolved Hide resolved
apps/meteor/app/e2e/client/rocketchat.e2e.room.js Outdated Show resolved Hide resolved
apps/meteor/server/lib/resetUserE2EKey.ts Outdated Show resolved Hide resolved
apps/meteor/server/models/raw/Rooms.ts Outdated Show resolved Hide resolved
apps/meteor/app/e2e/client/rocketchat.e2e.ts Outdated Show resolved Hide resolved
apps/meteor/app/api/server/v1/e2e.ts Show resolved Hide resolved
apps/meteor/app/lib/server/functions/addUserToRoom.ts Outdated Show resolved Hide resolved
@MarcosSpessatto MarcosSpessatto changed the title feat: Async E2E keys exchange feat(E2EE): Async E2EE keys exchange Apr 23, 2024
apps/meteor/app/e2e/client/rocketchat.e2e.room.js Outdated Show resolved Hide resolved
apps/meteor/server/lib/resetUserE2EKey.ts Outdated Show resolved Hide resolved
packages/core-typings/src/IRoom.ts Outdated Show resolved Hide resolved
apps/meteor/server/models/raw/Rooms.ts Show resolved Hide resolved
apps/meteor/app/api/server/v1/e2e.ts Outdated Show resolved Hide resolved
packages/rest-typings/src/v1/e2e.ts Show resolved Hide resolved
apps/meteor/server/models/raw/Rooms.ts Outdated Show resolved Hide resolved
apps/meteor/server/models/raw/Rooms.ts Outdated Show resolved Hide resolved
apps/meteor/server/lib/resetUserE2EKey.ts Outdated Show resolved Hide resolved
apps/meteor/server/models/raw/Rooms.ts Show resolved Hide resolved
@dionisio-bot dionisio-bot bot removed the stat: ready to merge PR tested and approved waiting for merge label Jun 20, 2024
@rodrigok rodrigok removed their request for review June 20, 2024 20:42
@rodrigok rodrigok dismissed their stale review June 20, 2024 20:42

Dismissed

KevLehman
KevLehman previously approved these changes Jun 20, 2024
hugocostadev
hugocostadev previously approved these changes Jun 21, 2024
@yash-rajpal yash-rajpal added the stat: ready to merge PR tested and approved waiting for merge label Jun 21, 2024
@ggazzo ggazzo merged commit f75a2cb into develop Jun 22, 2024
46 of 48 checks passed
@ggazzo ggazzo deleted the e2e-async-key-exchange branch June 22, 2024 18:08
This was referenced Jun 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stat: QA assured Means it has been tested and approved by a company insider stat: ready to merge PR tested and approved waiting for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants