diff options
author | H. Shay <hillerys@element.io> | 2023-03-28 14:49:36 -0700 |
---|---|---|
committer | H. Shay <hillerys@element.io> | 2023-05-01 21:01:28 -0700 |
commit | 0d61d3d3bd8083d9fb41893f9500ac867eccb8c5 (patch) | |
tree | aa9349398c77343bc5a3d5c0b7ed05c3ce4bdb76 | |
parent | move experimental feature msc3026 (busy presence) to per-user flag (diff) | |
download | synapse-0d61d3d3bd8083d9fb41893f9500ac867eccb8c5.tar.xz |
move msc3967 (Do not require UIA when first uploading cross signing keys) from config to per-user flag
-rw-r--r-- | synapse/config/experimental.py | 3 | ||||
-rw-r--r-- | synapse/rest/client/keys.py | 2 | ||||
-rw-r--r-- | tests/rest/client/test_keys.py | 8 |
3 files changed, 8 insertions, 5 deletions
diff --git a/synapse/config/experimental.py b/synapse/config/experimental.py index 7b77352bbb..43f544c34e 100644 --- a/synapse/config/experimental.py +++ b/synapse/config/experimental.py @@ -183,9 +183,6 @@ class ExperimentalConfig(Config): "msc3958_supress_edit_notifs", False ) - # MSC3967: Do not require UIA when first uploading cross signing keys - self.msc3967_enabled = experimental.get("msc3967_enabled", False) - # MSC2659: Application service ping endpoint self.msc2659_enabled = experimental.get("msc2659_enabled", False) diff --git a/synapse/rest/client/keys.py b/synapse/rest/client/keys.py index 9bbab5e624..2f3058d3fb 100644 --- a/synapse/rest/client/keys.py +++ b/synapse/rest/client/keys.py @@ -375,7 +375,7 @@ class SigningKeyUploadServlet(RestServlet): user_id = requester.user.to_string() body = parse_json_object_from_request(request) - if self.hs.config.experimental.msc3967_enabled: + if await self.hs.get_datastores().main.get_feature_enabled(user_id, "msc3967"): if await self.e2e_keys_handler.is_cross_signing_set_up_for_user(user_id): # If we already have a master key then cross signing is set up and we require UIA to reset await self.auth_handler.validate_user_via_ui_auth( diff --git a/tests/rest/client/test_keys.py b/tests/rest/client/test_keys.py index 8ee5489057..713c7abec3 100644 --- a/tests/rest/client/test_keys.py +++ b/tests/rest/client/test_keys.py @@ -205,7 +205,6 @@ class KeyQueryTestCase(unittest.HomeserverTestCase): @override_config( { - "experimental_features": {"msc3967_enabled": True}, "ui_auth": {"session_timeout": "15s"}, } ) @@ -216,6 +215,13 @@ class KeyQueryTestCase(unittest.HomeserverTestCase): alice_id = self.register_user("alice", password) alice_token = self.login("alice", password, device_id=device_id) + # enable msc3967 in db + self.get_success( + self.hs.get_datastores().main.set_feature_for_user( + alice_id, "msc3967", True + ) + ) + keys1 = self.make_device_keys(alice_id, device_id) # Initial request should succeed as no existing keys are present. |