File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change
1
+ # Proposal to include device IDs in ` /account/whoami `
2
+
3
+ There are some use cases (namely using
4
+ [ Pantalaimon with bots] ( https://github.com/matrix-org/pantalaimon/issues/14 ) )
5
+ which could benefit from knowing the ` device_id ` associated with a token.
6
+
7
+
8
+ ## Proposal
9
+
10
+ The ` /account/whoami ` endpoint receives an additional response field for the ` device_id `
11
+ associated with the access token. The field is optional because appservice users may not
12
+ have a real device associated with them. Non-appservice users should always have a device
13
+ associated with them.
14
+
15
+ Access tokens are already associated with at most 1 device, and devices are associated with
16
+ exactly 1 access token. Because of this, we do not need to worry about multiple devices
17
+ causing problems. For more information, see
18
+ https://matrix.org/docs/spec/client_server/r0.4.0.html#relationship-between-access-tokens-and-devices
19
+
20
+ * Note* : Pantalaimon would likely require a ` device_id ` be returned and error requests
21
+ otherwise. This should be considered expected behaviour by Pantalaimon in the MSC author's
22
+ opinion.
23
+
24
+
25
+ ## Tradeoffs
26
+
27
+ We could introduce a ` /device/whoami ` endpoint, however that is a less superior option. Most
28
+ calls to ` /device/whoami ` would additionally need to call ` /account/whoami ` to determine the
29
+ user ID of the account. We had might as well bundle the two pieces of information into the
30
+ same request.
You can’t perform that action at this time.
0 commit comments