summary refs log tree commit diff
path: root/synapse/config
diff options
context:
space:
mode:
authorPaul Evans <leonerd@leonerd.org.uk>2016-08-18 20:52:50 +0100
committerGitHub <noreply@github.com>2016-08-18 20:52:50 +0100
commit5674ea3e6c51b26c828fc8a78bc82832d72c50d4 (patch)
tree26f0e424dbe3ec3a1ecb5074ed32b8e55c9abbaa /synapse/config
parentMerge pull request #1027 from matrix-org/erikj/appservice_stream (diff)
parentMove validation logic for AS 3PE query response into ApplicationServiceApi cl... (diff)
downloadsynapse-5674ea3e6c51b26c828fc8a78bc82832d72c50d4.tar.xz
Merge pull request #1026 from matrix-org/paul/thirdpartylookup
3rd party entity lookup
Diffstat (limited to 'synapse/config')
-rw-r--r--synapse/config/appservice.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/synapse/config/appservice.py b/synapse/config/appservice.py
index 70d28892c6..dfe43b0b4c 100644
--- a/synapse/config/appservice.py
+++ b/synapse/config/appservice.py
@@ -123,6 +123,15 @@ def _load_appservice(hostname, as_info, config_filename):
                     raise ValueError(
                         "Missing/bad type 'exclusive' key in %s", regex_obj
                     )
+    # protocols check
+    protocols = as_info.get("protocols")
+    if protocols:
+        # Because strings are lists in python
+        if isinstance(protocols, str) or not isinstance(protocols, list):
+            raise KeyError("Optional 'protocols' must be a list if present.")
+        for p in protocols:
+            if not isinstance(p, str):
+                raise KeyError("Bad value for 'protocols' item")
     return ApplicationService(
         token=as_info["as_token"],
         url=as_info["url"],
@@ -130,4 +139,5 @@ def _load_appservice(hostname, as_info, config_filename):
         hs_token=as_info["hs_token"],
         sender=user_id,
         id=as_info["id"],
+        protocols=protocols,
     )