Ratelimit cross-user key sharing requests. (#8957)

This commit is contained in:
Patrick Cloke 2021-02-19 13:20:34 -05:00 committed by GitHub
parent 179c0953ff
commit fc8b3d8809
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 67 additions and 17 deletions

View file

@ -56,10 +56,8 @@ class SendToDeviceRestServlet(servlet.RestServlet):
content = parse_json_object_from_request(request)
assert_params_in_dict(content, ("messages",))
sender_user_id = requester.user.to_string()
await self.device_message_handler.send_device_message(
sender_user_id, message_type, content["messages"]
requester, message_type, content["messages"]
)
response = (200, {}) # type: Tuple[int, dict]