summary refs log tree commit diff
path: root/synapse/rest/client/v2_alpha/keys.py
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2016-07-27 16:41:06 +0100
committerRichard van der Hoff <richard@matrix.org>2016-07-27 16:41:06 +0100
commitccec25e2c6270c1cae916b8ca8a775a166ea7e7f (patch)
tree5b27acf6ab5a5b8c65bd76785eaeefc8d26f502c /synapse/rest/client/v2_alpha/keys.py
parentSQL syntax fix (diff)
downloadsynapse-ccec25e2c6270c1cae916b8ca8a775a166ea7e7f.tar.xz
key upload tweaks
1. Add v2_alpha URL back in, since things seem to be using it.

2. Don't reject the request if the device_id in the upload request fails to
   match that in the access_token.
Diffstat (limited to 'synapse/rest/client/v2_alpha/keys.py')
-rw-r--r--synapse/rest/client/v2_alpha/keys.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/synapse/rest/client/v2_alpha/keys.py b/synapse/rest/client/v2_alpha/keys.py
index 4629f4bfde..dc1d4d8fc6 100644
--- a/synapse/rest/client/v2_alpha/keys.py
+++ b/synapse/rest/client/v2_alpha/keys.py
@@ -55,7 +55,7 @@ class KeyUploadServlet(RestServlet):
     }
     """
     PATTERNS = client_v2_patterns("/keys/upload(/(?P<device_id>[^/]+))?$",
-                                  releases=(), v2_alpha=False)
+                                  releases=())
 
     def __init__(self, hs):
         """
@@ -78,14 +78,12 @@ class KeyUploadServlet(RestServlet):
 
         if device_id is not None:
             # passing the device_id here is deprecated; however, we allow it
-            # for now for compatibility with older clients. But if a device_id
-            # was given here and in the auth, they must match.
-
+            # for now for compatibility with older clients.
             if (requester.device_id is not None and
                     device_id != requester.device_id):
-                raise synapse.api.errors.SynapseError(
-                    400, "Can only upload keys for current device"
-                )
+                logger.warning("Client uploading keys for a different device "
+                               "(logged in as %s, uploading for %s)",
+                               requester.device_id, device_id)
         else:
             device_id = requester.device_id