summary refs log tree commit diff
path: root/synapse/rest
diff options
context:
space:
mode:
authorShay <hillerys@element.io>2023-05-24 13:23:26 -0700
committerGitHub <noreply@github.com>2023-05-24 13:23:26 -0700
commit8839b6c2f8b07d5d122a15e79b1ebdbdd5f3e26b (patch)
tree3174b7cc3ef73376e94ca4911ca21e777b378997 /synapse/rest
parentAdd type hints to test_descriptors. (#15659) (diff)
downloadsynapse-8839b6c2f8b07d5d122a15e79b1ebdbdd5f3e26b.tar.xz
Add requesting user id parameter to key claim methods in `TransportLayerClient` (#15663)
Diffstat (limited to 'synapse/rest')
-rw-r--r--synapse/rest/client/keys.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/synapse/rest/client/keys.py b/synapse/rest/client/keys.py
index 9bbab5e624..413edd8a4d 100644
--- a/synapse/rest/client/keys.py
+++ b/synapse/rest/client/keys.py
@@ -287,7 +287,7 @@ class OneTimeKeyServlet(RestServlet):
         self.e2e_keys_handler = hs.get_e2e_keys_handler()
 
     async def on_POST(self, request: SynapseRequest) -> Tuple[int, JsonDict]:
-        await self.auth.get_user_by_req(request, allow_guest=True)
+        requester = await self.auth.get_user_by_req(request, allow_guest=True)
         timeout = parse_integer(request, "timeout", 10 * 1000)
         body = parse_json_object_from_request(request)
 
@@ -298,7 +298,7 @@ class OneTimeKeyServlet(RestServlet):
                 query.setdefault(user_id, {})[device_id] = {algorithm: 1}
 
         result = await self.e2e_keys_handler.claim_one_time_keys(
-            query, timeout, always_include_fallback_keys=False
+            query, requester.user, timeout, always_include_fallback_keys=False
         )
         return 200, result
 
@@ -335,7 +335,7 @@ class UnstableOneTimeKeyServlet(RestServlet):
         self.e2e_keys_handler = hs.get_e2e_keys_handler()
 
     async def on_POST(self, request: SynapseRequest) -> Tuple[int, JsonDict]:
-        await self.auth.get_user_by_req(request, allow_guest=True)
+        requester = await self.auth.get_user_by_req(request, allow_guest=True)
         timeout = parse_integer(request, "timeout", 10 * 1000)
         body = parse_json_object_from_request(request)
 
@@ -346,7 +346,7 @@ class UnstableOneTimeKeyServlet(RestServlet):
                 query.setdefault(user_id, {})[device_id] = Counter(algorithms)
 
         result = await self.e2e_keys_handler.claim_one_time_keys(
-            query, timeout, always_include_fallback_keys=True
+            query, requester.user, timeout, always_include_fallback_keys=True
         )
         return 200, result