diff options
author | Erik Johnston <erik@matrix.org> | 2014-11-07 15:35:53 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2014-11-07 15:35:53 +0000 |
commit | 02c3b1c9e2afa27753e9ce898e5455b6489541b4 (patch) | |
tree | 48bda5021f9fce4d52aa0b70fe47ee6a1bc2be56 /synapse/federation/transport.py | |
parent | Implement invite part of invite join dance (diff) | |
download | synapse-02c3b1c9e2afa27753e9ce898e5455b6489541b4.tar.xz |
Add '/event_auth/' federation api
Diffstat (limited to 'synapse/federation/transport.py')
-rw-r--r-- | synapse/federation/transport.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/synapse/federation/transport.py b/synapse/federation/transport.py index b9f7d54c71..babe8447eb 100644 --- a/synapse/federation/transport.py +++ b/synapse/federation/transport.py @@ -257,6 +257,21 @@ class TransportLayer(object): defer.returnValue(json.loads(content)) @defer.inlineCallbacks + @log_function + def get_event_auth(self, destination, context, event_id): + path = PREFIX + "/event_auth/%s/%s" % ( + context, + event_id, + ) + + response = yield self.client.get_json( + destination=destination, + path=path, + ) + + defer.returnValue(response) + + @defer.inlineCallbacks def _authenticate_request(self, request): json_request = { "method": request.method, @@ -427,6 +442,17 @@ class TransportLayer(object): ) self.server.register_path( + "GET", + re.compile("^" + PREFIX + "/event_auth/([^/]*)/([^/]*)$"), + self._with_authentication( + lambda origin, content, query, context, event_id: + handler.on_event_auth( + origin, context, event_id, + ) + ) + ) + + self.server.register_path( "PUT", re.compile("^" + PREFIX + "/send_join/([^/]*)/([^/]*)$"), self._with_authentication( |