Skip to content

Commit 26e0765

Browse files
authored
Add guest changes to spec: MSC3069 and MSC3419 (#3605)
* Add MSC3069 support #3069 * Add MSC3419 support #3419 * Normalize and fix guest access endpoints list * Changelogs
1 parent 00169ab commit 26e0765

File tree

5 files changed

+45
-20
lines changed

5 files changed

+45
-20
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add `is_guest` to `/account/whoami` as per [MSC3069](https://github.com/matrix-org/matrix-doc/pull/3069).
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Expand guest access to sending any room event and state event as per [MSC3419](https://github.com/matrix-org/matrix-doc/pull/3419).

content/client-server-api/modules/guest_access.md

Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -38,38 +38,43 @@ rather than allowing all homeservers to enforce the rules on each other.
3838
The following API endpoints are allowed to be accessed by guest accounts
3939
for retrieving events:
4040

41-
- [GET /rooms/:room\_id/state](#get_matrixclientv3roomsroomidstate)
42-
- [GET /rooms/:room\_id/context/:event\_id](#get_matrixclientv3roomsroomidcontexteventid)
43-
- [GET /rooms/:room\_id/event/:event\_id](#get_matrixclientv3roomsroomideventeventid)
44-
- [GET /rooms/:room\_id/state/:event\_type/:state\_key](#get_matrixclientv3roomsroomidstateeventtypestatekey)
45-
- [GET /rooms/:room\_id/messages](#get_matrixclientv3roomsroomidmessages)
46-
- {{% added-in v="1.1" %}} [GET /rooms/:room\_id/members](#get_matrixclientv3roomsroomidmembers)
47-
- [GET /rooms/:room\_id/initialSync](#get_matrixclientv3roomsroomidinitialsync)
48-
- [GET /sync](#get_matrixclientv3sync)
49-
- [GET /events](#get_matrixclientv3events) as used for room previews.
41+
* [GET /rooms/{roomId}/state](#get_matrixclientv3roomsroomidstate)
42+
* [GET /rooms/{roomId}/context/{eventId}](#get_matrixclientv3roomsroomidcontexteventid)
43+
* [GET /rooms/{roomId}/event/{eventId}](#get_matrixclientv3roomsroomideventeventid)
44+
* [GET /rooms/{roomId}/state/{eventType}/{stateKey}](#get_matrixclientv3roomsroomidstateeventtypestatekey)
45+
* [GET /rooms/{roomId}/messages](#get_matrixclientv3roomsroomidmessages)
46+
* {{< added-in v="1.1" >}} [GET /rooms/{roomId}/members](#get_matrixclientv3roomsroomidmembers)
47+
* [GET /rooms/{roomId}/initialSync](#get_matrixclientv3roomsroomidinitialsync)
48+
* [GET /sync](#get_matrixclientv3sync)
49+
* [GET /events](#get_matrixclientv3events) as used for room previews.
5050

5151
The following API endpoints are allowed to be accessed by guest accounts
5252
for sending events:
5353

54-
- [POST /rooms/:room\_id/join](#post_matrixclientv3roomsroomidjoin)
55-
- [POST /rooms/:room\_id/leave](#post_matrixclientv3roomsroomidleave)
56-
- [PUT /rooms/:room\_id/send/m.room.message/:txn\_id](#put_matrixclientv3roomsroomidsendeventtypetxnid)
57-
- [PUT /sendToDevice/{eventType}/{txnId}](#put_matrixclientv3sendtodeviceeventtypetxnid)
54+
* [POST /rooms/{roomId}/join](#post_matrixclientv3roomsroomidjoin)
55+
* [POST /rooms/{roomId}/leave](#post_matrixclientv3roomsroomidleave)
56+
* [PUT /rooms/{roomId}/send/{eventType}/{txnId}](#put_matrixclientv3roomsroomidsendeventtypetxnid)
57+
58+
* {{< changed-in v="1.2" >}} Guests can now send *any* event type rather than just `m.room.message` events.
59+
60+
* {{< added-in v="1.2" >}} [PUT /rooms/{roomId}/state/{eventType}/{stateKey}](#put_matrixclientv3roomsroomidstateeventtypestatekey)
61+
* [PUT /sendToDevice/{eventType}/{txnId}](#put_matrixclientv3sendtodeviceeventtypetxnid)
5862

5963
The following API endpoints are allowed to be accessed by guest accounts
6064
for their own account maintenance:
6165

62-
- [PUT /profile/:user\_id/displayname](#put_matrixclientv3profileuseriddisplayname)
63-
- [GET /devices](#get_matrixclientv3devices)
64-
- [GET /devices/{deviceId}](#get_matrixclientv3devicesdeviceid)
65-
- [PUT /devices/{deviceId}](#put_matrixclientv3devicesdeviceid)
66+
* [PUT /profile/{userId}/displayname](#put_matrixclientv3profileuseriddisplayname)
67+
* [GET /devices](#get_matrixclientv3devices)
68+
* [GET /devices/{deviceId}](#get_matrixclientv3devicesdeviceid)
69+
* [PUT /devices/{deviceId}](#put_matrixclientv3devicesdeviceid)
70+
* {{< added-in v="1.2" >}} [GET /account/whoami](#get_matrixclientv3accountwhoami)
6671

6772
The following API endpoints are allowed to be accessed by guest accounts
6873
for end-to-end encryption:
6974

70-
- [POST /keys/upload](#post_matrixclientv3keysupload)
71-
- [POST /keys/query](#post_matrixclientv3keysquery)
72-
- [POST /keys/claim](#post_matrixclientv3keysclaim)
75+
* [POST /keys/upload](#post_matrixclientv3keysupload)
76+
* [POST /keys/query](#post_matrixclientv3keysquery)
77+
* [POST /keys/claim](#post_matrixclientv3keysclaim)
7378

7479
#### Server behaviour
7580

@@ -88,3 +93,6 @@ properly enforce the permissions outlined in this section.
8893

8994
Homeservers may want to enable protections such as captchas for guest
9095
registration to prevent spam, denial of service, and similar attacks.
96+
97+
Homeservers may want to put stricter rate limits on guest accounts,
98+
particularly for sending state events.

data/api/client-server/whoami.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,13 @@ paths:
6565
is associated with the access token (such as in the case
6666
of application services) then this field can be omitted.
6767
Otherwise this is required.
68+
is_guest:
69+
x-addedInMatrixVersion: "1.2"
70+
type: boolean
71+
description: |-
72+
When `true`, the user is a [Guest User](#guest-access). When
73+
not present or `false`, the user is presumed to be a non-guest
74+
user.
6875
401:
6976
description:
7077
The token is not recognised

layouts/shortcodes/changed-in.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{{ $ver := .Params.v }}
2+
{{ $this := .Params.this }}
3+
4+
{{ if $this }}
5+
<span>**[Changed in this version]**</span>
6+
{{ else }}
7+
<span>**[Changed in `v{{ $ver }}`]**</span>
8+
{{ end }} {{/* Do not leave an empty line at the end of this file otherwise the inline behaviour breaks. */}}

0 commit comments

Comments
 (0)