feat: force End-to-End Encryption (E2EE) on private rooms#41095
feat: force End-to-End Encryption (E2EE) on private rooms#41095milton-rucks wants to merge 1 commit into
Conversation
Add a workspace setting `E2E_Force_Encryption_For_Private_Rooms` that lets administrators in regulated/high-security environments enforce E2EE on every newly created private room. When enabled, users can no longer opt out: - the encryption toggle in the create-room modal is locked on for private rooms (and shows "Enforced by workspace security policy"); - the server forces `encrypted: true` and rejects any attempt to create a private room with `encrypted: false` (e.g. via `groups.create`) with the error `error-encrypted-private-rooms-enforced`. Public rooms are unaffected, and when the setting is off the existing legacy behavior (respecting `E2E_Enabled_Default_PrivateRooms` and user choice) is retained. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Looks like this PR is not ready to merge, because of the following issues:
Please fix the issues and try again If you have any trouble, please check the PR guidelines |
🦋 Changeset detectedLatest commit: b4b0bb8 The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
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 |
|
Milton Rucks seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #41095 +/- ##
===========================================
- Coverage 70.20% 70.14% -0.06%
===========================================
Files 3368 3368
Lines 130022 130039 +17
Branches 22570 22536 -34
===========================================
- Hits 91284 91221 -63
- Misses 35425 35507 +82
+ Partials 3313 3311 -2
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Proposed changes (including videos or screenshots)
Adds a workspace setting that lets administrators in regulated / high-security environments enforce E2EE on every newly created private room, so users can no longer opt out or accidentally create an unencrypted private room.
New setting —
E2E_Force_Encryption_For_Private_Rooms(Admin → Settings → End-to-End Encryption)false, public, gated byenableQuery: E2E_Enable = trueForce_Encryption_For_Private_Rooms("Force End-to-End Encryption (E2EE) on Private Rooms")Force_Encryption_For_Private_Rooms_DescriptionBehavior when enabled
CreateChannelModal): for a private room the Encrypted toggle is forced on and disabled, with the hint "Enforced by workspace security policy."; public rooms keep the toggle off + disabled.prepareCreateRoomCallbackinapp/e2e/server/beforeCreateRoom.ts): for private rooms (type === 'p') it forcesencrypted: true, and rejects any request that explicitly passesencrypted: false(e.g.groups.create) with error codeerror-encrypted-private-rooms-enforced("Workspace policy requires all private rooms to be encrypted.").When disabled, the existing legacy behavior is fully retained (respects
E2E_Enabled_Default_PrivateRoomsand the user choice). Public rooms are never affected.Files
apps/meteor/server/settings/e2e.ts— register the settingapps/meteor/app/e2e/server/beforeCreateRoom.ts— server-side force + rejectapps/meteor/client/navbar/NavBarPagesGroup/actions/CreateChannelModal.tsx— modal state matrix (forced on / disabled)apps/meteor/client/navbar/NavBarPagesGroup/actions/useEncryptedRoomDescription.ts— enforced hint textpackages/i18n/src/locales/en.i18n.json— 4 new keys (sorted;i18n checkpasses)Issue(s)
Steps to test or reproduce
POST /api/v1/groups.createwithextraData.encrypted = false→ rejected witherror-encrypted-private-rooms-enforced. Withencrypted: trueor omitted → created encrypted.POST /api/v1/channels.create(public) is unaffected.Verified end-to-end against a local server + MongoDB:
groups.createwithencrypted:falseis rejected,encrypted:true/omitted creates an encrypted room, and public channel creation is unaffected.Further comments
Enforcement is placed in the shared
prepareCreateRoomCallbackso it covers all private-room creation paths (RESTgroups.create, thecreatePrivateGroupmethod, teams) from a single point, rather than only the REST endpoint.The client modal logic compiles cleanly but was not visually driven in a browser during development; the server enforcement, setting registration, and i18n were verified live.
🤖 Generated with Claude Code