mirror of
https://github.com/element-hq/synapse.git
synced 2025-03-14 09:45:51 +00:00
Merge 60875dcf1c
into 59a15da433
This commit is contained in:
commit
fce0d0942e
7 changed files with 1 additions and 39 deletions
1
changelog.d/17640.removal
Normal file
1
changelog.d/17640.removal
Normal file
|
@ -0,0 +1 @@
|
|||
Remove experimental support for MSC 3852.
|
|
@ -952,7 +952,6 @@ A response body like the following is returned:
|
|||
"device_id": "QBUAZIFURK",
|
||||
"display_name": "android",
|
||||
"last_seen_ip": "1.2.3.4",
|
||||
"last_seen_user_agent": "Mozilla/5.0 (X11; Linux x86_64; rv:103.0) Gecko/20100101 Firefox/103.0",
|
||||
"last_seen_ts": 1474491775024,
|
||||
"user_id": "<user_id>"
|
||||
},
|
||||
|
@ -960,7 +959,6 @@ A response body like the following is returned:
|
|||
"device_id": "AUIECTSRND",
|
||||
"display_name": "ios",
|
||||
"last_seen_ip": "1.2.3.5",
|
||||
"last_seen_user_agent": "Mozilla/5.0 (X11; Linux x86_64; rv:103.0) Gecko/20100101 Firefox/103.0",
|
||||
"last_seen_ts": 1474491775025,
|
||||
"user_id": "<user_id>"
|
||||
}
|
||||
|
@ -987,8 +985,6 @@ The following fields are returned in the JSON response body:
|
|||
Absent if no name has been set.
|
||||
- `last_seen_ip` - The IP address where this device was last seen.
|
||||
(May be a few minutes out of date, for efficiency reasons).
|
||||
- `last_seen_user_agent` - The user agent of the device when it was last seen.
|
||||
(May be a few minutes out of date, for efficiency reasons).
|
||||
- `last_seen_ts` - The timestamp (in milliseconds since the unix epoch) when this
|
||||
devices was last seen. (May be a few minutes out of date, for efficiency reasons).
|
||||
- `user_id` - Owner of device.
|
||||
|
@ -1067,7 +1063,6 @@ A response body like the following is returned:
|
|||
"device_id": "<device_id>",
|
||||
"display_name": "android",
|
||||
"last_seen_ip": "1.2.3.4",
|
||||
"last_seen_user_agent": "Mozilla/5.0 (X11; Linux x86_64; rv:103.0) Gecko/20100101 Firefox/103.0",
|
||||
"last_seen_ts": 1474491775024,
|
||||
"user_id": "<user_id>"
|
||||
}
|
||||
|
@ -1089,8 +1084,6 @@ The following fields are returned in the JSON response body:
|
|||
Absent if no name has been set.
|
||||
- `last_seen_ip` - The IP address where this device was last seen.
|
||||
(May be a few minutes out of date, for efficiency reasons).
|
||||
- `last_seen_user_agent` - The user agent of the device when it was last seen.
|
||||
(May be a few minutes out of date, for efficiency reasons).
|
||||
- `last_seen_ts` - The timestamp (in milliseconds since the unix epoch) when this
|
||||
devices was last seen. (May be a few minutes out of date, for efficiency reasons).
|
||||
- `user_id` - Owner of device.
|
||||
|
|
|
@ -463,9 +463,6 @@ class ExperimentalConfig(Config):
|
|||
# MSC3848: Introduce errcodes for specific event sending failures
|
||||
self.msc3848_enabled: bool = experimental.get("msc3848_enabled", False)
|
||||
|
||||
# MSC3852: Expose last seen user agent field on /_matrix/client/v3/devices.
|
||||
self.msc3852_enabled: bool = experimental.get("msc3852_enabled", False)
|
||||
|
||||
# MSC3866: M_USER_AWAITING_APPROVAL error code
|
||||
raw_msc3866_config = experimental.get("msc3866", {})
|
||||
self.msc3866 = MSC3866Config(**raw_msc3866_config)
|
||||
|
|
|
@ -97,7 +97,6 @@ class DeviceWorkerHandler:
|
|||
self._auth_handler = hs.get_auth_handler()
|
||||
self._event_sources = hs.get_event_sources()
|
||||
self.server_name = hs.hostname
|
||||
self._msc3852_enabled = hs.config.experimental.msc3852_enabled
|
||||
self._query_appservices_for_keys = (
|
||||
hs.config.experimental.msc3984_appservice_key_query
|
||||
)
|
||||
|
@ -1166,7 +1165,6 @@ def _update_device_from_client_ips(
|
|||
ip = client_ips.get((device["user_id"], device["device_id"]))
|
||||
device.update(
|
||||
{
|
||||
"last_seen_user_agent": ip.user_agent if ip else None,
|
||||
"last_seen_ts": ip.last_seen if ip else None,
|
||||
"last_seen_ip": ip.ip if ip else None,
|
||||
}
|
||||
|
|
|
@ -55,7 +55,6 @@ class DevicesRestServlet(RestServlet):
|
|||
self.hs = hs
|
||||
self.auth = hs.get_auth()
|
||||
self.device_handler = hs.get_device_handler()
|
||||
self._msc3852_enabled = hs.config.experimental.msc3852_enabled
|
||||
|
||||
async def on_GET(self, request: SynapseRequest) -> Tuple[int, JsonDict]:
|
||||
requester = await self.auth.get_user_by_req(request, allow_guest=True)
|
||||
|
@ -63,18 +62,6 @@ class DevicesRestServlet(RestServlet):
|
|||
requester.user.to_string()
|
||||
)
|
||||
|
||||
# If MSC3852 is disabled, then the "last_seen_user_agent" field will be
|
||||
# removed from each device. If it is enabled, then the field name will
|
||||
# be replaced by the unstable identifier.
|
||||
#
|
||||
# When MSC3852 is accepted, this block of code can just be removed to
|
||||
# expose "last_seen_user_agent" to clients.
|
||||
for device in devices:
|
||||
last_seen_user_agent = device["last_seen_user_agent"]
|
||||
del device["last_seen_user_agent"]
|
||||
if self._msc3852_enabled:
|
||||
device["org.matrix.msc3852.last_seen_user_agent"] = last_seen_user_agent
|
||||
|
||||
return 200, {"devices": devices}
|
||||
|
||||
|
||||
|
@ -146,7 +133,6 @@ class DeviceRestServlet(RestServlet):
|
|||
assert isinstance(handler, DeviceHandler)
|
||||
self.device_handler = handler
|
||||
self.auth_handler = hs.get_auth_handler()
|
||||
self._msc3852_enabled = hs.config.experimental.msc3852_enabled
|
||||
self._msc3861_oauth_delegation_enabled = hs.config.experimental.msc3861.enabled
|
||||
|
||||
async def on_GET(
|
||||
|
@ -159,17 +145,6 @@ class DeviceRestServlet(RestServlet):
|
|||
if device is None:
|
||||
raise NotFoundError("No device found")
|
||||
|
||||
# If MSC3852 is disabled, then the "last_seen_user_agent" field will be
|
||||
# removed from each device. If it is enabled, then the field name will
|
||||
# be replaced by the unstable identifier.
|
||||
#
|
||||
# When MSC3852 is accepted, this block of code can just be removed to
|
||||
# expose "last_seen_user_agent" to clients.
|
||||
last_seen_user_agent = device["last_seen_user_agent"]
|
||||
del device["last_seen_user_agent"]
|
||||
if self._msc3852_enabled:
|
||||
device["org.matrix.msc3852.last_seen_user_agent"] = last_seen_user_agent
|
||||
|
||||
return 200, device
|
||||
|
||||
class DeleteBody(RequestBodyModel):
|
||||
|
|
|
@ -278,7 +278,6 @@ class ExfiltrateData(unittest.HomeserverTestCase):
|
|||
self.assertEqual(args[0][0]["user_id"], self.user2)
|
||||
self.assertIn("device_id", args[0][0])
|
||||
self.assertIsNone(args[0][0]["display_name"])
|
||||
self.assertIsNone(args[0][0]["last_seen_user_agent"])
|
||||
self.assertIsNone(args[0][0]["last_seen_ts"])
|
||||
self.assertIsNone(args[0][0]["last_seen_ip"])
|
||||
|
||||
|
|
|
@ -1385,7 +1385,6 @@ class UserDevicesTestCase(unittest.HomeserverTestCase):
|
|||
self.assertEqual(response["device_id"], self.other_user_device_id)
|
||||
self.assertEqual(response["display_name"], self.other_user_device_display_name)
|
||||
self.assertEqual(response["last_seen_ip"], self.other_user_client_ip)
|
||||
self.assertEqual(response["last_seen_user_agent"], self.other_user_user_agent)
|
||||
self.assertIsInstance(response["last_seen_ts"], int)
|
||||
self.assertGreater(response["last_seen_ts"], 0)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue