Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
Make the device id on e2e key upload optional #956
Conversation
richvdh
added some commits
Jul 26, 2016
|
matrixbot: retest this please |
richvdh
assigned
NegativeMjark
Jul 27, 2016
richvdh
referenced this pull request
in matrix-org/sytest
Jul 27, 2016
Merged
Update sytests to match e2e key upload changes #271
NegativeMjark
and 1 other
commented on an outdated diff
Jul 27, 2016
| @@ -51,23 +54,47 @@ class KeyUploadServlet(RestServlet): | ||
| }, | ||
| } | ||
| """ | ||
| - PATTERNS = client_v2_patterns("/keys/upload/(?P<device_id>[^/]*)", releases=()) | ||
| + PATTERNS = client_v2_patterns("/keys/upload(/(?P<device_id>[^/]+))?$", | ||
| + releases=(), v2_alpha=False) |
NegativeMjark
Contributor
|
|
matrixbot: retest this please |
NegativeMjark
and 1 other
commented on an outdated diff
Jul 27, 2016
| body = parse_json_object_from_request(request) | ||
| + 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. |
NegativeMjark
Contributor
|
|
LGTM |
richvdh commentedJul 27, 2016
We should now be able to get our device_id from the access_token, so the device_id on the upload request is optional. Where it is supplied, we should check that it matches.
Also make sure that the device_id is registered in the devices table, for both new e2e keys and those already in the database.
Finally, delete e2e keys from the database when we delete a device.