Allow homeserver to disable encryption in Element Pro (#7198)

* Allow HS to disable encryption in Element Pro

Add `force_disable_e2ee` support in the Element well known retriever and cache to allow a homeserver to disable encrypted room creation and enabling encryption in an existing room in Element Pro clients

* Bump enterprise repo back to `main` branch
This commit is contained in:
Jorge Martin Espinosa
2026-07-15 13:29:16 +02:00
committed by GitHub
parent 03f3e8b3e0
commit 62cc7e0505
19 changed files with 97 additions and 9 deletions
@@ -46,6 +46,8 @@ data class InternalElementWellKnown(
val customRecoveryPassphrase: InternalCustomRecoveryPassphrase? = null,
@SerialName("content_scanner_url")
val contentScannerUrl: String? = null,
@SerialName("force_disable_e2ee")
val forceDisableE2EE: Boolean? = null,
)
@Serializable
@@ -31,6 +31,7 @@ fun InternalElementWellKnown.map() = ElementWellKnown(
identityProviderAppScheme = identityProviderAppScheme,
customRecoveryPassphrase = customRecoveryPassphrase?.toPublic(),
contentScannerUrl = contentScannerUrl,
forceDisableE2EE = forceDisableE2EE,
)
private fun InternalCustomRecoveryPassphrase.toPublic(): CustomRecoveryPassphrase {
@@ -50,6 +50,7 @@ class DefaultSessionWellknownRetrieverTest {
identityProviderAppScheme = null,
customRecoveryPassphrase = null,
contentScannerUrl = null,
forceDisableE2EE = null,
)
)
)
@@ -77,6 +78,7 @@ class DefaultSessionWellknownRetrieverTest {
identityProviderAppScheme = "an_app_scheme",
customRecoveryPassphrase = null,
contentScannerUrl = "https://content-scanner.example.com",
forceDisableE2EE = false,
)
)
)
@@ -108,6 +110,7 @@ class DefaultSessionWellknownRetrieverTest {
identityProviderAppScheme = null,
contentScannerUrl = null,
customRecoveryPassphrase = null,
forceDisableE2EE = null,
)
)
)
@@ -255,6 +258,7 @@ class DefaultSessionWellknownRetrieverTest {
identityProviderAppScheme = "an_app_scheme",
customRecoveryPassphrase = null,
contentScannerUrl = "https://content-scanner.example.com",
forceDisableE2EE = false,
)
)
)
@@ -303,6 +307,7 @@ class DefaultSessionWellknownRetrieverTest {
identityProviderAppScheme = "an_app_scheme",
customRecoveryPassphrase = null,
contentScannerUrl = "https://content-scanner.example.com",
forceDisableE2EE = false,
)
)
)
@@ -340,7 +345,8 @@ class DefaultSessionWellknownRetrieverTest {
"brand_color": "#FF0000",
"notification_sound": "a_notification_sound.flac",
"idp_app_scheme": "an_app_scheme",
"content_scanner_url": "https://content-scanner.example.com"
"content_scanner_url": "https://content-scanner.example.com",
"force_disable_e2ee": false,
}"""
}
}
@@ -50,6 +50,7 @@ class DefaultWellknownRetrieverTest {
identityProviderAppScheme = null,
customRecoveryPassphrase = null,
contentScannerUrl = null,
forceDisableE2EE = null,
)
)
)
@@ -72,6 +73,7 @@ class DefaultWellknownRetrieverTest {
identityProviderAppScheme = "an_app_scheme",
customRecoveryPassphrase = null,
contentScannerUrl = "https://content-scanner.example.com",
forceDisableE2EE = false,
)
)
)
@@ -101,6 +103,7 @@ class DefaultWellknownRetrieverTest {
identityProviderAppScheme = null,
contentScannerUrl = null,
customRecoveryPassphrase = null,
forceDisableE2EE = null,
)
)
)
@@ -266,7 +269,8 @@ class DefaultWellknownRetrieverTest {
"brand_color": "#FF0000",
"notification_sound": "a_notification_sound.flac",
"idp_app_scheme": "an_app_scheme",
"content_scanner_url": "https://content-scanner.example.com"
"content_scanner_url": "https://content-scanner.example.com",
"force_disable_e2ee": false
}"""
}
}