summary refs log tree commit diff
path: root/tests/config/test_oauth_delegation.py
diff options
context:
space:
mode:
authorHugh Nimmo-Smith <hughns@users.noreply.github.com>2023-08-22 12:42:08 +0100
committerGitHub <noreply@github.com>2023-08-22 07:42:08 -0400
commit7dbac123f98a2d59d09a63efe4543ee850a8d630 (patch)
tree465085760bdc53e7d79322d44618c31d207de1a3 /tests/config/test_oauth_delegation.py
parentAdd `client_secret_path` as alternative for `client_secret` for OIDC config (... (diff)
downloadsynapse-7dbac123f98a2d59d09a63efe4543ee850a8d630.tar.xz
Disallow user_consent where experimental MSC3861 is enabled (#16127)
Diffstat (limited to 'tests/config/test_oauth_delegation.py')
-rw-r--r--tests/config/test_oauth_delegation.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/config/test_oauth_delegation.py b/tests/config/test_oauth_delegation.py
index f57c813a58..35f7b85dc7 100644
--- a/tests/config/test_oauth_delegation.py
+++ b/tests/config/test_oauth_delegation.py
@@ -12,6 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+import os
 from unittest.mock import Mock
 
 from synapse.config import ConfigError
@@ -167,6 +168,21 @@ class MSC3861OAuthDelegation(TestCase):
         with self.assertRaises(ConfigError):
             self.parse_config()
 
+    def test_user_consent_cannot_be_enabled(self) -> None:
+        tmpdir = self.mktemp()
+        os.mkdir(tmpdir)
+        self.config_dict["user_consent"] = {
+            "require_at_registration": True,
+            "version": "1",
+            "template_dir": tmpdir,
+            "server_notice_content": {
+                "msgtype": "m.text",
+                "body": "foo",
+            },
+        }
+        with self.assertRaises(ConfigError):
+            self.parse_config()
+
     def test_password_config_cannot_be_enabled(self) -> None:
         self.config_dict["password_config"] = {"enabled": True}
         with self.assertRaises(ConfigError):