This repository has been archived by the owner on Sep 11, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 833
Add .well-known config option to force disable encryption on room creation #11120
Merged
Merged
Changes from 12 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
bd55602
force disable encryption on room creation
04cf8ca
test allowChangingEncryption
498b21d
move into utils/room directory
49f1410
tests
8774797
unit test CreateRoomDialog
2118a02
remove debug
308b747
Merge branch 'kerry/test-createroom' into kerry/wk-force-e2ee-create
0404ca5
wait for constructor promises to settle
bc3fd48
Merge branch 'kerry/test-createroom' into kerry/wk-force-e2ee-create
b2c9f3c
test case for force_disable
829ed88
comment
31fb12c
set forced value after resolving checkUserIsAllowedToChangeEncryption
31e874b
tidy and comments
3dad488
use label text in test
dfbf2a3
Merge branch 'develop' into kerry/wk-force-e2ee-create
d4b073e
Merge branch 'develop' into kerry/wk-force-e2ee-create
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
Copyright 2023 The Matrix.org Foundation C.I.C. | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
import { MatrixClient } from "matrix-js-sdk/src/matrix"; | ||
|
||
import { getE2EEWellKnown } from "../WellKnownUtils"; | ||
|
||
/** | ||
* Check e2ee io.element.e2ee setting | ||
* Returns true when .well-known e2ee config force_disable is TRUE | ||
* When true all new rooms should be created with encryption disabled | ||
* Can be overriden by synapse option encryption_enabled_by_default_for_room_type ( :/ ) | ||
* https://matrix-org.github.io/synapse/latest/usage/configuration/config_documentation.html#encryption_enabled_by_default_for_room_type | ||
* | ||
* @param client | ||
* @returns whether encryption can be enabled for any room | ||
*/ | ||
export function shouldForceDisableEncryption(client: MatrixClient): boolean { | ||
const e2eeWellKnown = getE2EEWellKnown(client); | ||
|
||
if (e2eeWellKnown) { | ||
const shouldForceDisable = e2eeWellKnown["force_disable"] === true; | ||
return shouldForceDisable; | ||
} | ||
return false; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replaced by
forcedValue
above