summary refs log tree commit diff
path: root/tests/config/test_load.py
diff options
context:
space:
mode:
authorShay <hillerys@element.io>2021-11-18 10:56:32 -0800
committerGitHub <noreply@github.com>2021-11-18 10:56:32 -0800
commit92b75388f520cfec412bf2ff57bcdbfa22d8c01d (patch)
tree0fb39071646e6a5e62a0d410f6532320cde5f1c1 /tests/config/test_load.py
parentAdd dedicated admin API for blocking a room (#11324) (diff)
downloadsynapse-92b75388f520cfec412bf2ff57bcdbfa22d8c01d.tar.xz
Remove legacy code related to deprecated `trust_identity_server_for_password_resets` config flag (#11333)
* remove code legacy code related to deprecated config flag "trust_identity_server_for_password_resets" from synapse/config/emailconfig.py

* remove legacy code supporting depreciated config flag "trust_identity_server_for_password_resets" from synapse/config/registration.py

* remove legacy code supporting depreciated config flag "trust_identity_server_for_password_resets" from synapse/handlers/identity.py

* add tests to ensure config error is thrown and synapse refuses to start when depreciated config flag is found

* add changelog

* slightly change behavior to only check for deprecated flag if set to 'true'

* Update changelog.d/11333.misc

Co-authored-by: reivilibre <oliverw@matrix.org>

Co-authored-by: reivilibre <oliverw@matrix.org>
Diffstat (limited to '')
-rw-r--r--tests/config/test_load.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/config/test_load.py b/tests/config/test_load.py
index 765258c47a..d8668d56b2 100644
--- a/tests/config/test_load.py
+++ b/tests/config/test_load.py
@@ -94,3 +94,12 @@ class ConfigLoadingFileTestCase(ConfigFileTestCase):
         # The default Metrics Flags are off by default.
         config = HomeServerConfig.load_config("", ["-c", self.config_file])
         self.assertFalse(config.metrics.metrics_flags.known_servers)
+
+    def test_depreciated_identity_server_flag_throws_error(self):
+        self.generate_config()
+        # Needed to ensure that actual key/value pair added below don't end up on a line with a comment
+        self.add_lines_to_config([" "])
+        # Check that presence of "trust_identity_server_for_password" throws config error
+        self.add_lines_to_config(["trust_identity_server_for_password_resets: true"])
+        with self.assertRaises(ConfigError):
+            HomeServerConfig.load_config("", ["-c", self.config_file])