Procházet zdrojové kódy

Disable `m.3pid_changes` capability when MSC3861 is enabled. (#16134)

tags/v1.91.0rc1
Mathieu Velten před 9 měsíci
committed by GitHub
rodič
revize
0ba17777be
V databázi nebyl nalezen žádný známý klíč pro tento podpis ID GPG klíče: 4AEE18F83AFDEB23
5 změnil soubory, kde provedl 23 přidání a 2 odebrání
  1. +1
    -1
      changelog.d/16127.bugfix
  2. +1
    -0
      changelog.d/16134.bugfix
  3. +6
    -0
      synapse/config/experimental.py
  4. +10
    -1
      synapse/config/registration.py
  5. +5
    -0
      tests/config/test_oauth_delegation.py

+ 1
- 1
changelog.d/16127.bugfix Zobrazit soubor

@@ -1 +1 @@
User consent features cannot be enabled when using experimental MSC3861.
User constent and 3-PID changes capability cannot be enabled when using experimental [MSC3861](https://github.com/matrix-org/matrix-spec-proposals/pull/3861) support.

+ 1
- 0
changelog.d/16134.bugfix Zobrazit soubor

@@ -0,0 +1 @@
User constent and 3-PID changes capability cannot be enabled when using experimental [MSC3861](https://github.com/matrix-org/matrix-spec-proposals/pull/3861) support.

+ 6
- 0
synapse/config/experimental.py Zobrazit soubor

@@ -223,6 +223,12 @@ class MSC3861:
("session_lifetime",),
)

if root.registration.enable_3pid_changes:
raise ConfigError(
"enable_3pid_changes cannot be enabled when OAuth delegation is enabled",
("enable_3pid_changes",),
)


@attr.s(auto_attribs=True, frozen=True, slots=True)
class MSC3866Config:


+ 10
- 1
synapse/config/registration.py Zobrazit soubor

@@ -133,7 +133,16 @@ class RegistrationConfig(Config):

self.enable_set_displayname = config.get("enable_set_displayname", True)
self.enable_set_avatar_url = config.get("enable_set_avatar_url", True)
self.enable_3pid_changes = config.get("enable_3pid_changes", True)

# The default value of enable_3pid_changes is True, unless msc3861 is enabled.
msc3861_enabled = (
(config.get("experimental_features") or {})
.get("msc3861", {})
.get("enabled", False)
)
self.enable_3pid_changes = config.get(
"enable_3pid_changes", not msc3861_enabled
)

self.disable_msisdn_registration = config.get(
"disable_msisdn_registration", False


+ 5
- 0
tests/config/test_oauth_delegation.py Zobrazit soubor

@@ -271,3 +271,8 @@ class MSC3861OAuthDelegation(TestCase):
self.config_dict["session_lifetime"] = "24h"
with self.assertRaises(ConfigError):
self.parse_config()

def test_enable_3pid_changes_cannot_be_enabled(self) -> None:
self.config_dict["enable_3pid_changes"] = True
with self.assertRaises(ConfigError):
self.parse_config()

Načítá se…
Zrušit
Uložit