summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthew Hodgson <matthew@matrix.org>2018-04-13 15:41:52 +0100
committerMatthew Hodgson <matthew@matrix.org>2018-04-13 15:41:52 +0100
commitf8d46cad3c3b4318a6b63c55fe63f07d1ae91695 (patch)
tree6db670fc0e9c29f14b6c880060d07ac9323271ce
parentMerge branch 'master' of https://github.com/matrix-org/synapse into develop (diff)
downloadsynapse-f8d46cad3c3b4318a6b63c55fe63f07d1ae91695.tar.xz
correctly auth inbound federation_domain_whitelist reqs
-rw-r--r--synapse/federation/transport/server.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/synapse/federation/transport/server.py b/synapse/federation/transport/server.py
index 4c94d5a36c..d2a57d08d7 100644
--- a/synapse/federation/transport/server.py
+++ b/synapse/federation/transport/server.py
@@ -94,12 +94,6 @@ class Authenticator(object):
             "signatures": {},
         }
 
-        if (
-            self.federation_domain_whitelist is not None and
-            self.server_name not in self.federation_domain_whitelist
-        ):
-            raise FederationDeniedError(self.server_name)
-
         if content is not None:
             json_request["content"] = content
 
@@ -138,6 +132,12 @@ class Authenticator(object):
                 json_request["origin"] = origin
                 json_request["signatures"].setdefault(origin, {})[key] = sig
 
+        if (
+            self.federation_domain_whitelist is not None and
+            origin not in self.federation_domain_whitelist
+        ):
+            raise FederationDeniedError(self.server_name)
+
         if not json_request["signatures"]:
             raise NoAuthenticationError(
                 401, "Missing Authorization headers", Codes.UNAUTHORIZED,