From 07bfe4c2a1c17c842b36d7f0cff77259ae448ccd Mon Sep 17 00:00:00 2001 From: Paul Chobert Date: Mon, 7 Sep 2026 16:44:28 +0200 Subject: [PATCH] Remove the unstable `org.matrix.msc3202.device_id` masquerading alias (#20192) Part of: https://github.com/element-hq/synapse/issues/19415 Follow-up to #19033 TLDR: date to drop support for prefixed `org.matrix.msc3202.device_id` parameter was 2026-01-01. This PR removes the prefixed param. Synapse has accepted the stable `device_id` parameter since v1.141.0 (#19033). Before: ``` GET /_matrix/client/v3/account/whoami?user_id=@alice:test&org.matrix.msc3202.device_id=DEVICEID # appservice token 200 {"user_id": "@alice:test", "is_guest": false, "device_id": "DEVICEID"} ``` After: ``` GET /_matrix/client/v3/account/whoami?user_id=@alice:test&org.matrix.msc3202.device_id=DEVICEID # appservice token 200 {"user_id": "@alice:test", "is_guest": false} ``` ### Pull Request Checklist * [x] Pull request is based on the develop branch * [x] Pull request includes a [changelog file](https://element-hq.github.io/synapse/latest/development/contributing_guide.html#changelog). The entry should: - Be a short description of your change which makes sense to users. "Fixed a bug that prevented receiving messages from other servers." instead of "Moved X method from `EventStore` to `EventWorkerStore`.". - Use markdown where necessary, mostly for `code blocks`. - End with either a period (.) or an exclamation mark (!). - Start with a capital letter. - Feel free to credit yourself, by adding a sentence "Contributed by @github_username." or "Contributed by [Your Name]." to the end of the entry. * [x] [Code style](https://element-hq.github.io/synapse/latest/code_style.html) is correct (run the [linters](https://element-hq.github.io/synapse/latest/development/contributing_guide.html#run-the-linters)) --- changelog.d/20192.removal | 1 + synapse/api/auth/base.py | 7 +------ 2 files changed, 2 insertions(+), 6 deletions(-) create mode 100644 changelog.d/20192.removal diff --git a/changelog.d/20192.removal b/changelog.d/20192.removal new file mode 100644 index 0000000000..b1de7efa95 --- /dev/null +++ b/changelog.d/20192.removal @@ -0,0 +1 @@ +Remove support for the unstable `org.matrix.msc3202.device_id` query parameter for application service device masquerading. diff --git a/synapse/api/auth/base.py b/synapse/api/auth/base.py index 0b10640b50..7b8214fabb 100644 --- a/synapse/api/auth/base.py +++ b/synapse/api/auth/base.py @@ -317,9 +317,6 @@ class BaseAuth: - The returned device ID, if present, has been checked to be a valid device ID for the returned user ID. """ - # TODO: We can drop unstable support after 2026-01-01 (couple months after stable support) - UNSTABLE_DEVICE_ID_ARG_NAME = b"org.matrix.msc3202.device_id" - app_service = self.store.get_app_service_by_token(access_token) if app_service is None: return None @@ -340,9 +337,7 @@ class BaseAuth: else: effective_user_id = app_service.sender - effective_device_id_args = request.args.get( - b"device_id", request.args.get(UNSTABLE_DEVICE_ID_ARG_NAME) - ) + effective_device_id_args = request.args.get(b"device_id") if effective_device_id_args: effective_device_id = effective_device_id_args[0].decode("utf8") # We only just set this so it can't be None!