Skip to content

Commit ec0b9ba

Browse files
committed
Merge remote-tracking branch 'origin/master' into cross-signing-spec
2 parents 67edc3e + 3fc5540 commit ec0b9ba

File tree

70 files changed

+1748
-298
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+1748
-298
lines changed

api/client-server/admin.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ paths:
8282
devices:
8383
type: object
8484
description: |-
85-
Each key is an identitfier for one of the user's devices.
85+
Each key is an identifier for one of the user's devices.
8686
additionalProperties:
8787
type: object
8888
title: DeviceInfo

api/client-server/create_room.yaml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,20 +38,26 @@ paths:
3838
the new room, including checking power levels for each event. It MUST
3939
apply the events implied by the request in the following order:
4040
41-
0. A default ``m.room.power_levels`` event, giving the room creator
41+
1. The ``m.room.create`` event itself. Must be the first event in the
42+
room.
43+
44+
2. An ``m.room.member`` event for the creator to join the room. This is
45+
needed so the remaining events can be sent.
46+
47+
3. A default ``m.room.power_levels`` event, giving the room creator
4248
(and not other members) permission to send state events. Overridden
4349
by the ``power_level_content_override`` parameter.
4450
45-
1. Events set by the ``preset``. Currently these are the ``m.room.join_rules``,
51+
4. Events set by the ``preset``. Currently these are the ``m.room.join_rules``,
4652
``m.room.history_visibility``, and ``m.room.guest_access`` state events.
4753
48-
2. Events listed in ``initial_state``, in the order that they are
54+
5. Events listed in ``initial_state``, in the order that they are
4955
listed.
5056
51-
3. Events implied by ``name`` and ``topic`` (``m.room.name`` and ``m.room.topic``
57+
6. Events implied by ``name`` and ``topic`` (``m.room.name`` and ``m.room.topic``
5258
state events).
5359
54-
4. Invite events implied by ``invite`` and ``invite_3pid`` (``m.room.member`` with
60+
7. Invite events implied by ``invite`` and ``invite_3pid`` (``m.room.member`` with
5561
``membership: invite`` and ``m.room.third_party_invite``).
5662
5763
The available presets do the following with respect to room state:

api/client-server/definitions/device_keys.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ properties:
4747
"ed25519:JLAFKJWSCS": "lEuiRJBit0IG6nUf5pUzWTUEsRVVe/HJkoKuEww9ULI"
4848
signatures:
4949
type: object
50+
title: Signatures
5051
description: |-
5152
Signatures for the device key object. A map from user ID, to a map from
5253
``<algorithm>:<device_id>`` to the signature.

api/client-server/definitions/third_party_signed.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ properties:
3333
type: object
3434
description: A signatures object containing a signature of the entire signed object.
3535
title: Signatures
36+
additionalProperties:
37+
type: object
38+
additionalProperties:
39+
type: string
3640
example: {
3741
"example.org": {
3842
"ed25519:0": "some9signature"

api/client-server/directory.yaml

Lines changed: 79 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ host: localhost:8008
1919
schemes:
2020
- https
2121
- http
22-
basePath: /_matrix/client/%CLIENT_MAJOR_VERSION%/directory
22+
basePath: /_matrix/client/%CLIENT_MAJOR_VERSION%
2323
consumes:
2424
- application/json
2525
produces:
2626
- application/json
2727
securityDefinitions:
2828
$ref: definitions/security.yaml
2929
paths:
30-
"/room/{roomAlias}":
30+
"/directory/room/{roomAlias}":
3131
put:
3232
summary: Create a new mapping from room alias to room ID.
3333
operationId: setRoomAlias
@@ -129,7 +129,16 @@ paths:
129129
description: |-
130130
Remove a mapping of room alias to room ID.
131131
132-
Servers may choose to implement additional access control checks here, for instance that room aliases can only be deleted by their creator or a server administrator.
132+
Servers may choose to implement additional access control checks here, for instance that
133+
room aliases can only be deleted by their creator or a server administrator.
134+
135+
.. Note::
136+
Servers may choose to update the ``alt_aliases`` for the ``m.room.canonical_alias``
137+
state event in the room when an alias is removed. Servers which choose to update the
138+
canonical alias event are recommended to, in addition to their other relevant permission
139+
checks, delete the alias and return a successful response even if the user does not
140+
have permission to update the ``m.room.canonical_alias`` event.
141+
133142
operationId: deleteRoomAlias
134143
security:
135144
- accessToken: []
@@ -159,3 +168,70 @@ paths:
159168
"$ref": "definitions/errors/error.yaml"
160169
tags:
161170
- Room directory
171+
"/rooms/{roomId}/aliases":
172+
get:
173+
summary: Get a list of local aliases on a given room.
174+
description: |-
175+
Get a list of aliases maintained by the local server for the
176+
given room.
177+
178+
This endpoint can be called by users who are in the room (external
179+
users receive an ``M_FORBIDDEN`` error response). If the room's
180+
``m.room.history_visibility`` maps to ``world_readable``, any
181+
user can call this endpoint.
182+
183+
Servers may choose to implement additional access control checks here,
184+
such as allowing server administrators to view aliases regardless of
185+
membership.
186+
187+
.. Note::
188+
Clients are recommended not to display this list of aliases prominently
189+
as they are not curated, unlike those listed in the ``m.room.canonical_alias``
190+
state event.
191+
192+
operationId: getLocalAliases
193+
security:
194+
- accessToken: []
195+
parameters:
196+
- in: path
197+
type: string
198+
name: roomId
199+
description: The room ID to find local aliases of.
200+
required: true
201+
x-example: "!abc123:example.org"
202+
responses:
203+
200:
204+
description: |-
205+
The list of local aliases for the room.
206+
examples:
207+
application/json: {
208+
"aliases": [
209+
"#somewhere:example.com",
210+
"#another:example.com",
211+
"#hat_trick:example.com"
212+
]
213+
}
214+
schema:
215+
type: object
216+
properties:
217+
aliases:
218+
type: array
219+
description: The server's local aliases on the room. Can be empty.
220+
items:
221+
type: string
222+
required: ['aliases']
223+
403:
224+
description: The user is not permitted to retrieve the list of local aliases for the room.
225+
examples:
226+
application/json: {
227+
"errcode": "M_FORBIDDEN",
228+
"error": "You are not a member of the room."
229+
}
230+
schema:
231+
"$ref": "definitions/errors/error.yaml"
232+
429:
233+
description: This request was rate-limited.
234+
schema:
235+
"$ref": "definitions/errors/rate_limited.yaml"
236+
tags:
237+
- Room directory

api/client-server/keys.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ paths:
102102
responses:
103103
200:
104104
description:
105-
The provided keys were sucessfully uploaded.
105+
The provided keys were successfully uploaded.
106106
schema:
107107
type: object
108108
properties:

api/client-server/registration.yaml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,8 +328,8 @@ paths:
328328
329329
The homeserver may change the flows available depending on whether a
330330
valid access token is provided. The homeserver SHOULD NOT revoke the
331-
access token provided in the request, however all other access tokens
332-
for the user should be revoked if the request succeeds.
331+
access token provided in the request. Whether other access tokens for
332+
the user are revoked depends on the request parameters.
333333
security:
334334
- accessToken: []
335335
operationId: changePassword
@@ -343,6 +343,15 @@ paths:
343343
type: string
344344
description: The new password for the account.
345345
example: "ihatebananas"
346+
logout_devices:
347+
type: boolean
348+
description: |-
349+
Whether the user's other access tokens, and their associated devices, should be
350+
revoked if the request succeeds. Defaults to true.
351+
352+
When ``false``, the server can still take advantage of `the soft logout method <#soft-logout>`_
353+
for the user's remaining devices.
354+
example: true
346355
auth:
347356
description: |-
348357
Additional authentication information for the user-interactive authentication API.

api/client-server/room_send.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,5 +85,7 @@ paths:
8585
type: string
8686
description: |-
8787
A unique identifier for the event.
88+
required:
89+
- event_id
8890
tags:
8991
- Room participation

api/client-server/room_state.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@ paths:
4545
The body of the request should be the content object of the event; the
4646
fields in this object will vary depending on the type of event. See
4747
`Room Events`_ for the ``m.`` event specification.
48+
49+
If the event type being sent is ``m.room.canonical_alias`` servers
50+
SHOULD ensure that any new aliases being listed in the event are valid
51+
per their grammar/syntax and that they point to the room ID where the
52+
state event is to be sent. Servers do not validate aliases which are
53+
being removed or are already present in the state event.
4854
operationId: setRoomStateWithKey
4955
security:
5056
- accessToken: []
@@ -92,6 +98,8 @@ paths:
9298
type: string
9399
description: |-
94100
A unique identifier for the event.
101+
required:
102+
- event_id
95103
403:
96104
description: |-
97105
The sender doesn't have permission to send the event into the room.
@@ -102,5 +110,23 @@ paths:
102110
"errcode": "M_FORBIDDEN",
103111
"error": "You do not have permission to send the event."
104112
}
113+
400:
114+
description: |-
115+
The sender's request is malformed.
116+
117+
Some example error codes include:
118+
119+
* ``M_INVALID_PARAMETER``: One or more aliases within the ``m.room.canonical_alias``
120+
event have invalid syntax.
121+
122+
* ``M_BAD_ALIAS``: One or more aliases within the ``m.room.canonical_alias`` event
123+
do not point to the room ID for which the state event is to be sent to.
124+
schema:
125+
$ref: "definitions/errors/error.yaml"
126+
examples:
127+
application/json: {
128+
"errcode": "M_BAD_ALIAS",
129+
"error": "The alias '#hello:example.org' does not point to this room."
130+
}
105131
tags:
106132
- Room participation

api/openapi_extensions.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,11 @@ doesn't work, as in the following example:
4343
properties:
4444
...
4545
```
46+
47+
## OpenAPI 3's "2xx" format for response codes
48+
49+
<!-- TODO: Remove this section after upgrading to OpenAPI v3 -->
50+
51+
In some cases, the schema will have HTTP response code definitions like
52+
`2xx`, `3xx`, and `4xx`. These indicate that a response code within those
53+
ranges (`2xx` = `200` to `299`) is valid for the schema.

0 commit comments

Comments
 (0)