mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-07-24 04:30:35 -04:00
Support MSC2033: Device ID on whoami (#9918)
* Fix no-access-token bug in deactivation tests * Support MSC2033: Device ID on whoami * Test for appservices too MSC: https://github.com/matrix-org/matrix-doc/pull/2033 The MSC has passed FCP, which means stable endpoints can be used.
This commit is contained in:
parent
b7186c6e8d
commit
b3a757eb3b
3 changed files with 51 additions and 2 deletions
|
@ -884,7 +884,14 @@ class WhoamiRestServlet(RestServlet):
|
|||
async def on_GET(self, request):
|
||||
requester = await self.auth.get_user_by_req(request)
|
||||
|
||||
return 200, {"user_id": requester.user.to_string()}
|
||||
response = {"user_id": requester.user.to_string()}
|
||||
|
||||
# Appservices and similar accounts do not have device IDs
|
||||
# that we can report on, so exclude them for compliance.
|
||||
if requester.device_id is not None:
|
||||
response["device_id"] = requester.device_id
|
||||
|
||||
return 200, response
|
||||
|
||||
|
||||
def register_servlets(hs, http_server):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue