summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-08-10 13:22:20 +0100
committerErik Johnston <erik@matrix.org>2016-08-10 13:22:20 +0100
commit7f41bcbeec64da874c10a70f8a0b8e3f9f0626d8 (patch)
treee2d3c0e56607448482f83e3538b12e7a67545ba2
parentOnly resign our own events (diff)
downloadsynapse-7f41bcbeec64da874c10a70f8a0b8e3f9f0626d8.tar.xz
Correctly auth /event/ requests
-rw-r--r--synapse/handlers/federation.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/synapse/handlers/federation.py b/synapse/handlers/federation.py
index 55d11122ba..2f8959db92 100644
--- a/synapse/handlers/federation.py
+++ b/synapse/handlers/federation.py
@@ -249,7 +249,7 @@ class FederationHandler(BaseHandler):
                         if ev.type != EventTypes.Member:
                             continue
                         try:
-                            domain = UserID.from_string(ev.state_key).domain
+                            domain = get_domain_from_id(ev.state_key)
                         except:
                             continue
 
@@ -1106,13 +1106,14 @@ class FederationHandler(BaseHandler):
                 )
 
             if do_auth:
-                in_room = yield self.auth.check_host_in_room(
-                    event.room_id,
-                    origin
+                events = yield self._filter_events_for_server(
+                    origin, event.room_id, [event]
                 )
-                if not in_room:
+                if not events:
                     raise AuthError(403, "Host not in room.")
 
+                event = events[0]
+
             defer.returnValue(event)
         else:
             defer.returnValue(None)