From 05ca6c7392d2b8cc1a1ff58d9c7c6215846f2046 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> Date: Thu, 10 Aug 2023 10:19:53 +0100 Subject: [PATCH 001/268] Remove mention of default port with SRV records (#1615) --- .../newsfragments/1615.clarification | 1 + content/server-server-api.md | 15 +++++++-------- 2 files changed, 8 insertions(+), 8 deletions(-) create mode 100644 changelogs/server_server/newsfragments/1615.clarification diff --git a/changelogs/server_server/newsfragments/1615.clarification b/changelogs/server_server/newsfragments/1615.clarification new file mode 100644 index 00000000..1f95cf69 --- /dev/null +++ b/changelogs/server_server/newsfragments/1615.clarification @@ -0,0 +1 @@ +Remove spurious mention of a "default port" with respect to SRV record lookup. diff --git a/content/server-server-api.md b/content/server-server-api.md index 2dc80da5..c2b31118 100644 --- a/content/server-server-api.md +++ b/content/server-server-api.md @@ -110,7 +110,7 @@ to send. The process overall is as follows: given. The target server must present a valid certificate for the IP address. The `Host` header in the request should be set to the server name, including the port if the server name included one. - + 2. If the hostname is not an IP literal, and the server name includes an explicit port, resolve the hostname to an IP address using CNAME, AAAA or A records. @@ -162,13 +162,12 @@ to send. The process overall is as follows: ``. The target server must present a valid certificate for ``. -4. If the `/.well-known` request resulted in an error response, a - server is found by resolving an SRV record for - `_matrix._tcp.`. This may result in a hostname (to be - resolved using AAAA or A records) and port. Requests are made to the - resolved IP address and port, using 8448 as a default port, with a - `Host` header of ``. The target server must present a - valid certificate for ``. +4. If the `/.well-known` request resulted in an error response, a server is + found by resolving an SRV record for `_matrix._tcp.`. This may + result in a hostname (to be resolved using AAAA or A records) and + port. Requests are made to the resolved IP address and port, with a `Host` + header of ``. The target server must present a valid certificate + for ``. 5. If the `/.well-known` request returned an error response, and the SRV record was not found, an IP address is resolved using CNAME, AAAA and A From 1b69e03793207b13de00eb8a0124aeafcc6e2a04 Mon Sep 17 00:00:00 2001 From: Will Hunt Date: Tue, 15 Aug 2023 07:18:06 +0100 Subject: [PATCH 002/268] Add spec for MSC2449: Require users to have visibility on an event when submitting reports (#1517) * Add MSC2249 support * changelog * Add a line on verification * Changes based on review feedback * Apply suggestions from code review Co-authored-by: Travis Ralston * move tags field to the bottom of report_content.yaml * fix duplicated content now how did that happen * fix up the 404 response schema it wasn't displaying correctly in the rendered spec otherwise * remove erroneous schema reference * 1.7 -> 1.8 Co-authored-by: Travis Ralston --------- Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> Co-authored-by: Travis Ralston Co-authored-by: Andrew Morgan --- .../client_server/newsfragments/1517.feature | 1 + .../modules/report_content.md | 4 +++ data/api/client-server/report_content.yaml | 31 +++++++++++++++++-- 3 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 changelogs/client_server/newsfragments/1517.feature diff --git a/changelogs/client_server/newsfragments/1517.feature b/changelogs/client_server/newsfragments/1517.feature new file mode 100644 index 00000000..0d49f4eb --- /dev/null +++ b/changelogs/client_server/newsfragments/1517.feature @@ -0,0 +1 @@ +Require callers to be joined to the room to report its events, as per [MSC2249](https://github.com/matrix-org/matrix-spec-proposals/pull/2249). diff --git a/content/client-server-api/modules/report_content.md b/content/client-server-api/modules/report_content.md index 02ef002a..c482fbbc 100644 --- a/content/client-server-api/modules/report_content.md +++ b/content/client-server-api/modules/report_content.md @@ -18,3 +18,7 @@ Servers are free to handle the reported content however they desire. This may be a dedicated room to alert server administrators to the reported content or some other mechanism for notifying the appropriate people. + +{{< changed-in v="1.8" >}} The server MUST verify that the user +reporting the event is currently joined to the room the event is +in before accepting a report. diff --git a/data/api/client-server/report_content.yaml b/data/api/client-server/report_content.yaml index 5ea7b634..9241705a 100644 --- a/data/api/client-server/report_content.yaml +++ b/data/api/client-server/report_content.yaml @@ -18,10 +18,17 @@ info: paths: "/rooms/{roomId}/report/{eventId}": post: - summary: Reports an event as inappropriate. + summary: Report an event in a joined room as inappropriate. description: |- Reports an event as inappropriate to the server, which may then notify - the appropriate people. + the appropriate people. The caller must be joined to the room to report + it. + + It might be possible for clients to deduce whether an event exists by + timing the response, as only a report for an event that does exist + will require the homeserver to check whether a user is joined to + the room. To combat this, homeserver implementations should add + a random delay when generating a response. operationId: reportContent parameters: - in: path @@ -59,6 +66,9 @@ paths: required: true security: - accessToken: [] + x-changedInMatrixVersion: + 1.8: | + This endpoint now requires the user to be joined to the room. responses: "200": description: The event has been reported successfully. @@ -69,6 +79,23 @@ paths: examples: response: value: {} + "404": + description: |- + The event was not found or you are not joined to the room where the + event resides. + + Homeserver implementations can additionally return this error if the + reported event has been redacted. + content: + application/json: + schema: + $ref: definitions/errors/error.yaml + examples: + response: + value: { + "errcode": "M_NOT_FOUND", + "error": "The event was not found or you are not joined to the room." + } tags: - Reporting content servers: From 4abea9a6ca03b4438af26ef30afcee434dd07541 Mon Sep 17 00:00:00 2001 From: Patrick Cloke Date: Tue, 15 Aug 2023 02:18:45 -0400 Subject: [PATCH 003/268] Add room version 11 (#1604) * Remove duplicate words. * Add information on room version 11. * Note some event changes. * Newsfragment * Fix-up event schema. * Apply suggestions from code review Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> * Fix 'new in this version'. * Clarify creator field. * Fix-up event format & examples. * Move the Redactions section to the client section. * Reference the sender instead of the creator. * More links * Even more links. * Fix order of headers. * Fix typos. Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> * Clarify description of creator. Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> * Clean-up intro paragraphs for redactions. * Clean-up examples and language. * Review comments. * FIx-up markup tags. --------- Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> --- .../room_versions/newsfragments/1604.feature | 1 + content/rooms/_index.md | 14 +- content/rooms/fragments/v1-redactions.md | 18 +- content/rooms/fragments/v11-event-format.md | 4 + content/rooms/fragments/v11-redactions.md | 30 ++ content/rooms/fragments/v6-redactions.md | 16 +- content/rooms/fragments/v9-redactions.md | 39 +-- content/rooms/v11.md | 284 ++++++++++++++++++ content/rooms/v6.md | 2 +- content/rooms/v9.md | 21 ++ data/api/server-server/definitions/pdu.yaml | 4 + .../server-server/definitions/pdu_v11.yaml | 81 +++++ .../definitions/unsigned_pdu_base.yaml | 4 - data/api/server-server/examples/pdu_v11.json | 19 ++ .../event-schemas/examples/m.room.create.yaml | 3 +- .../examples/m.room.redaction.yaml | 2 +- data/event-schemas/schema/m.room.create.yaml | 6 +- .../schema/m.room.redaction.yaml | 7 +- 18 files changed, 491 insertions(+), 64 deletions(-) create mode 100644 changelogs/room_versions/newsfragments/1604.feature create mode 100644 content/rooms/fragments/v11-event-format.md create mode 100644 content/rooms/fragments/v11-redactions.md create mode 100644 content/rooms/v11.md create mode 100644 data/api/server-server/definitions/pdu_v11.yaml create mode 100644 data/api/server-server/examples/pdu_v11.json diff --git a/changelogs/room_versions/newsfragments/1604.feature b/changelogs/room_versions/newsfragments/1604.feature new file mode 100644 index 00000000..8408797d --- /dev/null +++ b/changelogs/room_versions/newsfragments/1604.feature @@ -0,0 +1 @@ +Add room version 11 as per [MSC3820](https://github.com/matrix-org/matrix-spec-proposals/pull/3820). diff --git a/content/rooms/_index.md b/content/rooms/_index.md index e75fbb13..9334c3a1 100644 --- a/content/rooms/_index.md +++ b/content/rooms/_index.md @@ -36,11 +36,11 @@ Alternatively, consider flipping the column/row organization to be features up top and versions on the left. --> -| Feature \ Version | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -|-------------------|---|---|---|---|---|---|---|---|---|----| -| **Knocking** | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ✔ | ✔ | ✔ | ✔ | -| **Restricted join rules** | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ✔ | ✔ | ✔ | -| **`knock_restricted` join rule** | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ✔ | +| Feature \ Version | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | +|-------------------|---|---|---|---|---|---|---|---|---|----|----| +| **Knocking** | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ✔ | ✔ | ✔ | ✔ | ✔ | +| **Restricted join rules** | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ✔ | ✔ | ✔ | ✔ | +| **`knock_restricted` join rule** | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ✔ | ✔ | ## Complete list of room versions @@ -57,8 +57,7 @@ the default room version when creating new rooms. The available room versions are: -- [Version 1](/rooms/v1) - **Stable**. The current version of most - rooms. +- [Version 1](/rooms/v1) - **Stable**. The initial room version. - [Version 2](/rooms/v2) - **Stable**. Implements State Resolution Version 2. - [Version 3](/rooms/v3) - **Stable**. Introduces events whose IDs @@ -76,6 +75,7 @@ The available room versions are: redacting some membership events. - [Version 10](/rooms/v10) - **Stable**. Enforces integer-only power levels and adds `knock_restricted` join rule. +- [Version 11](/rooms/v11) - **Stable**. Clarifies the redaction algorithm. ## Room version grammar diff --git a/content/rooms/fragments/v1-redactions.md b/content/rooms/fragments/v1-redactions.md index f38c85f3..4731dbab 100644 --- a/content/rooms/fragments/v1-redactions.md +++ b/content/rooms/fragments/v1-redactions.md @@ -19,12 +19,14 @@ not in the following list: - `membership` The content object must also be stripped of all keys, unless it is one -of one of the following event types: +of the following event types: -- `m.room.member` allows key `membership`. -- `m.room.create` allows key `creator`. -- `m.room.join_rules` allows key `join_rule`. -- `m.room.power_levels` allows keys `ban`, `events`, `events_default`, - `kick`, `redact`, `state_default`, `users`, `users_default`. -- `m.room.aliases` allows key `aliases`. -- `m.room.history_visibility` allows key `history_visibility`. +- [`m.room.member`](/client-server-api#mroommember) allows key `membership`. +- [`m.room.create`](/client-server-api#mroomcreate) allows key `creator`. +- [`m.room.join_rules`](/client-server-api#mroomjoin_rules) allows key `join_rule`. +- [`m.room.power_levels`](/client-server-api#mroompower_levels) allows keys + `ban`, `events`, `events_default`, `kick`, `redact`, `state_default`, `users`, + `users_default`. +- [`m.room.aliases`](/client-server-api#historical-events) allows key `aliases`. +- [`m.room.history_visibility`](/client-server-api#mroomhistory_visibility) allows + key `history_visibility`. diff --git a/content/rooms/fragments/v11-event-format.md b/content/rooms/fragments/v11-event-format.md new file mode 100644 index 00000000..a4da710d --- /dev/null +++ b/content/rooms/fragments/v11-event-format.md @@ -0,0 +1,4 @@ + +Events in rooms of this version have the following structure: + +{{% definition path="api/server-server/definitions/pdu_v11" %}} diff --git a/content/rooms/fragments/v11-redactions.md b/content/rooms/fragments/v11-redactions.md new file mode 100644 index 00000000..3bde94ba --- /dev/null +++ b/content/rooms/fragments/v11-redactions.md @@ -0,0 +1,30 @@ + +Upon receipt of a redaction event, the server must strip off any keys +not in the following list: + +- `event_id` +- `type` +- `room_id` +- `sender` +- `state_key` +- `content` +- `hashes` +- `signatures` +- `depth` +- `prev_events` +- `auth_events` +- `origin_server_ts` + +The content object must also be stripped of all keys, unless it is one +of the following event types: + +- [`m.room.member`](/client-server-api#mroommember) allows keys `membership`, `join_authorised_via_users_server`. + Additionally, it allows the `signed` key of the `third_party_invite` key. +- [`m.room.create`](/client-server-api#mroomcreate) allows all keys. +- [`m.room.join_rules`](/client-server-api#mroomjoin_rules) allows keys `join_rule`, `allow`. +- [`m.room.power_levels`](/client-server-api#mroompower_levels) allows keys + `ban`, `events`, `events_default`, `invite`, `kick`, `redact`, `state_default`, + `users`, `users_default`. +- [`m.room.history_visibility`](/client-server-api#mroomhistory_visibility) + allows key `history_visibility`. +- [`m.room.redaction`](/client-server-api#mroomredaction) allows key `redacts`. \ No newline at end of file diff --git a/content/rooms/fragments/v6-redactions.md b/content/rooms/fragments/v6-redactions.md index 71ecf854..47b024a2 100644 --- a/content/rooms/fragments/v6-redactions.md +++ b/content/rooms/fragments/v6-redactions.md @@ -19,11 +19,13 @@ not in the following list: - `membership` The content object must also be stripped of all keys, unless it is one -of one of the following event types: +of the following event types: -- `m.room.member` allows key `membership`. -- `m.room.create` allows key `creator`. -- `m.room.join_rules` allows key `join_rule`. -- `m.room.power_levels` allows keys `ban`, `events`, `events_default`, - `kick`, `redact`, `state_default`, `users`, `users_default`. -- `m.room.history_visibility` allows key `history_visibility`. +- [`m.room.member`](/client-server-api#mroommember) allows key `membership`. +- [`m.room.create`](/client-server-api#mroomcreate) allows key `creator`. +- [`m.room.join_rules`](/client-server-api#mroomjoin_rules) allows key `join_rule`. +- [`m.room.power_levels`](/client-server-api#mroompower_levels) allows keys + `ban`, `events`, `events_default`, `kick`, `redact`, `state_default`, `users`, + `users_default`. +- [`m.room.history_visibility`](/client-server-api#mroomhistory_visibility) allows + key `history_visibility`. diff --git a/content/rooms/fragments/v9-redactions.md b/content/rooms/fragments/v9-redactions.md index 18c100a5..27cd97f0 100644 --- a/content/rooms/fragments/v9-redactions.md +++ b/content/rooms/fragments/v9-redactions.md @@ -1,24 +1,3 @@ ---- ---- - -{{% added-in this=true %}} `m.room.member` events now keep `join_authorised_via_users_server` -in addition to other keys in `content` when being redacted. - -{{% boxes/rationale %}} -Without the `join_authorised_via_users_server` property, redacted join events -can become invalid when verifying the auth chain of a given event, thus creating -a split-brain scenario where the user is able to speak from one server's -perspective but most others will continually reject their events. - -This can theoretically be worked around with a rejoin to the room, being careful -not to use the faulty events as `prev_events`, though instead it is encouraged -to use v9 rooms over v8 rooms to outright avoid the situation. - -[Issue #3373](https://github.com/matrix-org/matrix-doc/issues/3373) has further -information. -{{% /boxes/rationale %}} - -The full redaction algorithm follows. Upon receipt of a redaction event, the server must strip off any keys not in the following list: @@ -40,11 +19,15 @@ not in the following list: - `membership` The content object must also be stripped of all keys, unless it is one -of one of the following event types: +of the following event types: -- `m.room.member` allows keys `membership`, `join_authorised_via_users_server`. -- `m.room.create` allows key `creator`. -- `m.room.join_rules` allows keys `join_rule`, `allow`. -- `m.room.power_levels` allows keys `ban`, `events`, `events_default`, - `kick`, `redact`, `state_default`, `users`, `users_default`. -- `m.room.history_visibility` allows key `history_visibility`. \ No newline at end of file +- [`m.room.member`](/client-server-api#mroommember) allows keys `membership`, + `join_authorised_via_users_server`. +- [`m.room.create`](/client-server-api#mroomcreate) allows key `creator`. +- [`m.room.join_rules`](/client-server-api#mroomjoin_rules) allows keys `join_rule`, + `allow`. +- [`m.room.power_levels`](/client-server-api#mroompower_levels) allows keys + `ban`, `events`, `events_default`, `kick`, `redact`, `state_default`, `users`, + `users_default`. +- [`m.room.history_visibility`](/client-server-api#mroomhistory_visibility) + allows key `history_visibility`. \ No newline at end of file diff --git a/content/rooms/v11.md b/content/rooms/v11.md new file mode 100644 index 00000000..d0aa4b45 --- /dev/null +++ b/content/rooms/v11.md @@ -0,0 +1,284 @@ +--- +title: Room Version 11 +type: docs +weight: 100 +--- + +This room version builds on [version 10](/rooms/v10) while clarifying redaction +rules. + +## Client considerations + +### Redactions + +{{< added-in this=true >}} The top-level `origin`, `membership`, and `prev_state` properties +are no longer protected from redaction. The [`m.room.create`](/client-server-api#mroomcreate) +event now keeps the entire `content` property. The [`m.room.redaction`](/client-server-api#mroomredaction) +event keeps the `redacts` property under `content`. The +[`m.room.power_levels`](/client-server-api#mroompower_levels) event keeps the +`invite` property under `content`. + +The full redaction algorithm follows. + +{{% rver-fragment name="v11-redactions" withVersioning="true" %}} + +### Event format + +Clients should no longer depend on the `creator` property in the `content` of +[`m.room.create`](/client-server-api#mroomcreate) events. In all room versions, +clients can rely on `sender` instead to determine a room creator. + +The format of [`m.room.redaction`](/client-server-api#mroomredaction) +events has been modified. Client should look for the `redacts` key under `content` +instead of a top-level event property. + +The `third_party_invite` key of [`m.room.member`](/client-server-api#mroommember) +events is no longer redacted, *but* will only contain the `signed` key after redaction. + +## Server implementation components + +{{% boxes/warning %}} +The information contained in this section is strictly for server +implementors. Applications which use the Client-Server API are generally +unaffected by the intricacies contained here. The section above +regarding client considerations is the resource that Client-Server API +use cases should reference. +{{% /boxes/warning %}} + +This room version updates the redaction algorithm and modifies how servers should +create `m.room.create` and `m.room.redaction` events. + +Room version 11 is based upon room version 10 with the following considerations. + +### Redactions + +[See above](#redactions). + +### Event format + +The core event format is the same as [room version 10](/rooms/v10#event-format). +However, this room version changes some properties of some event types. + +{{% rver-fragment name="v11-event-format" %}} + +#### Remove the `creator` property of `m.room.create` events + +The `content` of a `m.room.create` event no longer has a `creator` property, +which previously was always equivalent to the `sender` of the event. + +#### Moving the `redacts` property of `m.room.redaction` events to a `content` property + +The `redacts` property of `m.room.redaction` events is moved from a top-level +event property to a property under the event `content`. + +For backwards-compatibility with older clients, servers should add a `redacts` property +to the top level of `m.room.redaction` events in when serving such events over the +Client-Server API. + +For improved compatibility with newer clients, servers should add a `redacts` property +to the `content` of `m.room.redaction` events in *older* room versions when serving +such events over the Client-Server API. + +### Authorization rules + +Events must be signed by the server denoted by the `sender` property. + +`m.room.redaction` events are not explicitly part of the auth rules. +They are still subject to the minimum power level rules, but should always +fall into "10. Otherwise, allow". Instead of being authorized at the time +of receipt, they are authorized at a later stage: see the +[Redactions](#redactions) section below for more information. + +The types of state events that affect authorization are: + +- [`m.room.create`](/client-server-api#mroomcreate) +- [`m.room.member`](/client-server-api#mroommember) +- [`m.room.join_rules`](/client-server-api#mroomjoin_rules) +- [`m.room.power_levels`](/client-server-api#mroompower_levels) +- [`m.room.third_party_invite`](/client-server-api#mroomthird_party_invite) + +{{% boxes/note %}} +Power levels are inferred from defaults when not explicitly supplied. +For example, mentions of the `sender`'s power level can also refer to +the default power level for users in the room. +{{% /boxes/note %}} + +The rules are as follows: + +1. {{< changed-in this="true" >}} + If type is `m.room.create`: + 1. If it has any `prev_events`, reject. + 2. If the domain of the `room_id` does not match the domain of the + `sender`, reject. + 3. If `content.room_version` is present and is not a recognised + version, reject. + 4. Otherwise, allow. +2. Considering the event's `auth_events`: + 1. If there are duplicate entries for a given `type` and `state_key` pair, + reject. + 2. If there are entries whose `type` and `state_key` don't match those + specified by the [auth events + selection](/server-server-api#auth-events-selection) + algorithm described in the server specification, reject. + 3. If there are entries which were themselves rejected under the [checks + performed on receipt of a + PDU](/server-server-api/#checks-performed-on-receipt-of-a-pdu), reject. + 4. If there is no `m.room.create` event among the entries, reject. +3. If the `content` of the `m.room.create` event in the room state has the + property `m.federate` set to `false`, and the `sender` domain of the event + does not match the `sender` domain of the create event, reject. +4. If type is `m.room.member`: + 1. If there is no `state_key` property, or no `membership` property in + `content`, reject. + 2. If `content` has a `join_authorised_via_users_server` + key: + 1. If the event is not validly signed by the homeserver of the user ID denoted + by the key, reject. + 3. If `membership` is `join`: + 1. {{< changed-in this="true" >}} + If the only previous event is an `m.room.create` and the + `state_key` is the sender, allow. + 2. If the `sender` does not match `state_key`, reject. + 3. If the `sender` is banned, reject. + 4. If the `join_rule` is `invite` or `knock` then allow if + membership state is `invite` or `join`. + 5. If the `join_rule` is `restricted` or `knock_restricted`: + 1. If membership state is `join` or `invite`, allow. + 2. If the `join_authorised_via_users_server` key in `content` + is not a user with sufficient permission to invite other + users, reject. + 3. Otherwise, allow. + 6. If the `join_rule` is `public`, allow. + 7. Otherwise, reject. + 4. If `membership` is `invite`: + 1. If `content` has a `third_party_invite` property: + 1. If *target user* is banned, reject. + 2. If `content.third_party_invite` does not have a `signed` + property, reject. + 3. If `signed` does not have `mxid` and `token` properties, + reject. + 4. If `mxid` does not match `state_key`, reject. + 5. If there is no `m.room.third_party_invite` event in the + current room state with `state_key` matching `token`, + reject. + 6. If `sender` does not match `sender` of the + `m.room.third_party_invite`, reject. + 7. If any signature in `signed` matches any public key in + the `m.room.third_party_invite` event, allow. The public + keys are in `content` of `m.room.third_party_invite` as: + 1. A single public key in the `public_key` property. + 2. A list of public keys in the `public_keys` property. + 8. Otherwise, reject. + 2. If the `sender`'s current membership state is not `join`, + reject. + 3. If *target user*'s current membership state is `join` or + `ban`, reject. + 4. If the `sender`'s power level is greater than or equal to + the *invite level*, allow. + 5. Otherwise, reject. + 5. If `membership` is `leave`: + 1. If the `sender` matches `state_key`, allow if and only if + that user's current membership state is `invite`, `join`, + or `knock`. + 2. If the `sender`'s current membership state is not `join`, + reject. + 3. If the *target user*'s current membership state is `ban`, + and the `sender`'s power level is less than the *ban level*, + reject. + 4. If the `sender`'s power level is greater than or equal to + the *kick level*, and the *target user*'s power level is + less than the `sender`'s power level, allow. + 5. Otherwise, reject. + 6. If `membership` is `ban`: + 1. If the `sender`'s current membership state is not `join`, + reject. + 2. If the `sender`'s power level is greater than or equal to + the *ban level*, and the *target user*'s power level is less + than the `sender`'s power level, allow. + 3. Otherwise, reject. + 7. If `membership` is `knock`: + 1. If the `join_rule` is anything other than `knock` or + `knock_restricted`, reject. + 2. If `sender` does not match `state_key`, reject. + 3. If the `sender`'s current membership is not `ban` or `join`, allow. + 4. Otherwise, reject. + 8. Otherwise, the membership is unknown. Reject. +5. If the `sender`'s current membership state is not `join`, reject. +6. If type is `m.room.third_party_invite`: + 1. Allow if and only if `sender`'s current power level is greater + than or equal to the *invite level*. +7. If the event type's *required power level* is greater than the + `sender`'s power level, reject. +8. If the event has a `state_key` that starts with an `@` and does not + match the `sender`, reject. +9. If type is `m.room.power_levels`: + 1. If any of the properties `users_default`, `events_default`, `state_default`, + `ban`, `redact`, `kick`, or `invite` in `content` are present and + not an integer, reject. + 2. If either of the properties `events` or `notifications` in `content` + are present and not an object with values that are integers, + reject. + 3. If the `users` property in `content` is not an obiect with keys that + are valid user IDs with values that are integers, reject. + 4. If there is no previous `m.room.power_levels` event in the room, + allow. + 5. For the properties `users_default`, `events_default`, `state_default`, + `ban`, `redact`, `kick`, `invite` check if they were added, + changed or removed. For each found alteration: + 1. If the current value is higher than the `sender`'s current + power level, reject. + 2. If the new value is higher than the `sender`'s current power + level, reject. + 6. For each entry being changed in, or removed from, the `events` or + `notifications` properties: + 1. If the current value is greater than the `sender`'s current + power level, reject. + 7. For each entry being added to, or changed in, the `events` or + `notifications` properties: + 1. If the new value is greater than the `sender`'s current power + level, reject. + 8. For each entry being changed in, or removed from, the `users` property, + other than the `sender`'s own entry: + 1. If the current value is greater than or equal to the `sender`'s + current power level, reject. + 9. For each entry being added to, or changed in, the `users` property: + 1. If the new value is greater than the `sender`'s current power + level, reject. + 10. Otherwise, allow. +10. Otherwise, allow. + +{{% boxes/note %}} +Some consequences of these rules: + +- Unless you are a member of the room, the only permitted operations + (apart from the initial create/join) are: joining a public room; + accepting or rejecting an invitation to a room. +- To unban somebody, you must have power level greater than or equal + to both the kick *and* ban levels, *and* greater than the target + user's power level. +{{% /boxes/note %}} + +## Unchanged from v10 + +The following sections have not been modified since v10, but are included for +completeness. + +### Handling redactions + +{{% rver-fragment name="v3-handling-redactions" %}} + +### Event IDs + +{{% rver-fragment name="v4-event-ids" %}} + +### State resolution + +{{% rver-fragment name="v2-state-res" %}} + +### Canonical JSON + +{{% rver-fragment name="v6-canonical-json" %}} + +### Signing key validity period + +{{% rver-fragment name="v5-signing-requirements" %}} diff --git a/content/rooms/v6.md b/content/rooms/v6.md index 977f5479..b0309254 100644 --- a/content/rooms/v6.md +++ b/content/rooms/v6.md @@ -15,7 +15,7 @@ which implement the redaction algorithm locally should refer to the ### Redactions -{{% added-in this=true %}} All significant meaning for `m.room.aliases` +{{< added-in this=true >}} All significant meaning for `m.room.aliases` has been removed from the redaction algorithm. The remaining rules are the same as past room versions. diff --git a/content/rooms/v9.md b/content/rooms/v9.md index f6735415..cef269c6 100644 --- a/content/rooms/v9.md +++ b/content/rooms/v9.md @@ -17,6 +17,27 @@ Clients which implement the redaction algorithm locally should refer to the ### Redactions +{{< added-in this=true >}} [`m.room.member`](/client-server-api#mroommember) events +now keep `join_authorised_via_users_server` in addition to other keys in `content` +when being redacted. + +{{% boxes/rationale %}} +Without the `join_authorised_via_users_server` property, redacted join events +can become invalid when verifying the auth chain of a given event, thus creating +a split-brain scenario where the user is able to speak from one server's +perspective but most others will continually reject their events. + +This can theoretically be worked around with a rejoin to the room, being careful +not to use the faulty events as `prev_events`, though instead it is encouraged +to use v9 rooms over v8 rooms to outright avoid the situation. + +[Issue #3373](https://github.com/matrix-org/matrix-doc/issues/3373) has further +information. +{{% /boxes/rationale %}} + +The full redaction algorithm follows. + + {{% rver-fragment name="v9-redactions" withVersioning="true" %}} ## Server implementation components diff --git a/data/api/server-server/definitions/pdu.yaml b/data/api/server-server/definitions/pdu.yaml index d87db1a3..5903f80e 100644 --- a/data/api/server-server/definitions/pdu.yaml +++ b/data/api/server-server/definitions/pdu.yaml @@ -20,6 +20,10 @@ allOf: - $ref: "unsigned_pdu.yaml" - type: object properties: + redacts: + type: string + description: For redaction events, the ID of the event being redacted. + example: "$def456:matrix.org" hashes: type: object title: Event Hash diff --git a/data/api/server-server/definitions/pdu_v11.yaml b/data/api/server-server/definitions/pdu_v11.yaml new file mode 100644 index 00000000..3edfb6c8 --- /dev/null +++ b/data/api/server-server/definitions/pdu_v11.yaml @@ -0,0 +1,81 @@ +# Copyright 2019-2023 The Matrix.org Foundation C.I.C. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +type: object +title: Persistent Data Unit +description: A persistent data unit (event) for room version 11 and beyond. +example: + $ref: "../examples/pdu_v11.json" +allOf: + # v11 is the v4 event, but without redacts. Copy the auth_events/prev_events + # from pdu_v4.yaml and hashes and signatures from pdu_v3.yaml. + - $ref: "unsigned_pdu_base.yaml" + - type: object + properties: + auth_events: + type: array + items: + type: string + description: Event ID. + description: |- + Event IDs for the authorization events that would + allow this event to be in the room. + + Must contain less than or equal to 10 events. Note that if the relevant + auth event selection rules are used, this restriction should never be + encountered. + example: ["$URLsafe-base64EncodedHash", "$Another_Event"] + prev_events: + type: array + items: + type: string + description: Event ID. + description: |- + Event IDs for the most recent events in the room + that the homeserver was aware of when it made this event. + + Must contain less than or equal to 20 events. + example: ["$URLsafe-base64EncodedHash", "$Another_Event"] + hashes: + type: object + title: Event Hash + description: |- + Content hashes of the PDU, following the algorithm specified in [Signing Events](/server-server-api/#signing-events). + example: { + "sha256": "ThisHashCoversAllFieldsInCaseThisIsRedacted" + } + properties: + sha256: + type: string + description: The hash. + example: ThisHashCoversAllFieldsInCaseThisIsRedacted + required: ['sha256'] + signatures: + type: object + description: |- + Signatures for the PDU, following the algorithm specified in [Signing Events](/server-server-api/#signing-events). + example: { + "example.com": { + "ed25519:key_version:": "86BytesOfSignatureOfTheRedactedEvent" + } + } + additionalProperties: + type: object + title: Server Signatures + additionalProperties: + type: string + required: + - auth_events + - prev_events + - hashes + - signatures diff --git a/data/api/server-server/definitions/unsigned_pdu_base.yaml b/data/api/server-server/definitions/unsigned_pdu_base.yaml index c21149f6..ce42236f 100644 --- a/data/api/server-server/definitions/unsigned_pdu_base.yaml +++ b/data/api/server-server/definitions/unsigned_pdu_base.yaml @@ -107,10 +107,6 @@ properties: description: The event hash. example: Base64EncodedSha256HashesShouldBe43BytesLong required: ['sha256'] - redacts: - type: string - description: For redaction events, the ID of the event being redacted. - example: "$def456:matrix.org" unsigned: type: object title: UnsignedData diff --git a/data/api/server-server/examples/pdu_v11.json b/data/api/server-server/examples/pdu_v11.json new file mode 100644 index 00000000..292f38a0 --- /dev/null +++ b/data/api/server-server/examples/pdu_v11.json @@ -0,0 +1,19 @@ +{ + "$ref": "unsigned_pdu_base.json", + "hashes": { + "sha256": "thishashcoversallfieldsincasethisisredacted" + }, + "signatures": { + "example.com": { + "ed25519:key_version:": "these86bytesofbase64signaturecoveressentialfieldsincludinghashessocancheckredactedpdus" + } + }, + "auth_events": [ + "$urlsafe_base64_encoded_eventid", + "$a-different-event-id" + ], + "prev_events": [ + "$urlsafe_base64_encoded_eventid", + "$a-different-event-id" + ] +} diff --git a/data/event-schemas/examples/m.room.create.yaml b/data/event-schemas/examples/m.room.create.yaml index e33dbc3b..390ea78d 100644 --- a/data/event-schemas/examples/m.room.create.yaml +++ b/data/event-schemas/examples/m.room.create.yaml @@ -3,8 +3,7 @@ "type": "m.room.create", "state_key": "", "content": { - "creator": "@example:example.org", - "room_version": "1", + "room_version": "11", "m.federate": true, "predecessor": { "event_id": "$something:example.org", diff --git a/data/event-schemas/examples/m.room.redaction.yaml b/data/event-schemas/examples/m.room.redaction.yaml index 42bc8411..457b0a37 100644 --- a/data/event-schemas/examples/m.room.redaction.yaml +++ b/data/event-schemas/examples/m.room.redaction.yaml @@ -1,8 +1,8 @@ { "$ref": "core/room_event.json", "type": "m.room.redaction", - "redacts": "$fukweghifu23:localhost", "content": { + "redacts": "$fukweghifu23:localhost", "reason": "Spamming" } } diff --git a/data/event-schemas/schema/m.room.create.yaml b/data/event-schemas/schema/m.room.create.yaml index 44c9c84e..1ca37865 100644 --- a/data/event-schemas/schema/m.room.create.yaml +++ b/data/event-schemas/schema/m.room.create.yaml @@ -6,7 +6,9 @@ properties: content: properties: creator: - description: The `user_id` of the room creator. This is set by the homeserver. + description: |- + The `user_id` of the room creator. **Required** for, and only present in, room versions 1 - 10. Starting with + room version 11 the event `sender` should be used instead. type: string m.federate: description: Whether users on other servers can join this room. Defaults to `true` if key does not exist. @@ -32,8 +34,6 @@ properties: type: string description: The event ID of the last known event in the old room. required: [room_id, event_id] - required: - - creator type: object state_key: description: A zero-length string. diff --git a/data/event-schemas/schema/m.room.redaction.yaml b/data/event-schemas/schema/m.room.redaction.yaml index 143e7eff..8a7edeba 100644 --- a/data/event-schemas/schema/m.room.redaction.yaml +++ b/data/event-schemas/schema/m.room.redaction.yaml @@ -5,18 +5,19 @@ description: 'This event is created by the server to describe which event has be properties: content: properties: + redacts: + description: The event ID that was redacted. Required for, and present starting in, room version 11. + type: string reason: description: 'The reason for the redaction, if any.' type: string type: object redacts: - description: The event ID that was redacted. + description: Required for, and only present in, room versions 1 - 10. The event ID that was redacted. type: string type: enum: - m.room.redaction type: string -required: - - redacts title: Redaction type: object From c0babbfc13dd0ea29a9a00c7e24dfbec692795c6 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Fri, 18 Aug 2023 16:56:55 +0100 Subject: [PATCH 004/268] Create @matrix-org/spec npm package containing sas-emoji.json (#1620) * Create packages/npm @matrix-org/spec npm package containing spec-emoji * Initial workflow script * Add newsfragment * Add docs * npm publish doesn't like symlinks, yarn does :(( --- .github/workflows/release.yaml | 40 +++++++++++++++++++ README.md | 1 + .../internal/newsfragments/1620.feature | 1 + packages/npm/.gitignore | 2 + packages/npm/package.json | 13 ++++++ packages/npm/yarn.lock | 4 ++ 6 files changed, 61 insertions(+) create mode 100644 .github/workflows/release.yaml create mode 100644 changelogs/internal/newsfragments/1620.feature create mode 100644 packages/npm/.gitignore create mode 100644 packages/npm/package.json create mode 100644 packages/npm/yarn.lock diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 00000000..e4f4e536 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,40 @@ +name: Release packages +on: + release: + types: [published] +concurrency: ${{ github.workflow }}-${{ github.ref }} +jobs: + # Releases to npm after bumping the package.json version from 0.0.0 to $TAG.0 as the tags only contain MAJOR.MINOR + npm: + name: Publish to npm + runs-on: ubuntu-latest + if: github.event.release.prerelease == false + defaults: + run: + working-directory: packages/npm + steps: + - name: 🧮 Checkout code + uses: actions/checkout@v3 + + - name: 🔧 Yarn cache + uses: actions/setup-node@v3 + with: + cache: "yarn" + registry-url: "https://registry.npmjs.org" + + - name: 🔨 Install dependencies + run: "yarn install --frozen-lockfile" + + - name: 🎖 Bump package.json version + run: "yarn version $VERSION" + env: + VERSION: ${{ github.event.release.tag_name }}.0 + + - name: 🚀 Publish to npm + id: npm-publish + uses: JS-DevTools/npm-publish@5a85faf05d2ade2d5b6682bfe5359915d5159c6c # v2.2.1 + with: + token: ${{ secrets.NPM_TOKEN }} + package: packages/npm + access: public + ignore-scripts: false diff --git a/README.md b/README.md index 1482fcdd..26d8f5c2 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,7 @@ Additionally, the following directories may be of interest: * `/data-definitions`: Bits of structured data consumable by Matrix implementations. * `/meta`: Documentation relating to the spec's processes that are otherwise untracked (release instructions, etc). * `/scripts`: Various scripts for generating the spec and validating its contents. +* `/packages`: Various packages for shipping spec files like OpenAPI/swagger bindings and data definitions. ## Authoring changes to the spec diff --git a/changelogs/internal/newsfragments/1620.feature b/changelogs/internal/newsfragments/1620.feature new file mode 100644 index 00000000..76f7eee7 --- /dev/null +++ b/changelogs/internal/newsfragments/1620.feature @@ -0,0 +1 @@ +Create @matrix-org/spec npm package to ship the SAS Emoji data definitions & translations. diff --git a/packages/npm/.gitignore b/packages/npm/.gitignore new file mode 100644 index 00000000..133fcabd --- /dev/null +++ b/packages/npm/.gitignore @@ -0,0 +1,2 @@ +node_modules +sas-emoji.json diff --git a/packages/npm/package.json b/packages/npm/package.json new file mode 100644 index 00000000..d305fda9 --- /dev/null +++ b/packages/npm/package.json @@ -0,0 +1,13 @@ +{ + "name": "@matrix-org/spec", + "version": "0.0.0", + "description": "Data definitions for the Matrix Spec", + "author": "matrix.org", + "license": "Apache-2.0", + "files": [ + "sas-emoji.json" + ], + "scripts": { + "prepare": "cp ../../data-definitions/sas-emoji.json ." + } +} diff --git a/packages/npm/yarn.lock b/packages/npm/yarn.lock new file mode 100644 index 00000000..fb57ccd1 --- /dev/null +++ b/packages/npm/yarn.lock @@ -0,0 +1,4 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + From 4f8b8a746c195578b638957f0dd7d70c03cbb903 Mon Sep 17 00:00:00 2001 From: Mohit Kumar Patel <85980940+mohit1523@users.noreply.github.com> Date: Sun, 20 Aug 2023 03:12:59 +0530 Subject: [PATCH 005/268] Switch to ordered list for server name resolution steps (#1623) * Update server-server-api.md I have updated the list of Resolving server names in step 3 from unordered list to ordered list. Because we care about its order * Create 1567.clarification * Delete 1567.clarification * Create 1623.clarification * Update 1623.clarification --- changelogs/server_server/newsfragments/1623.clarification | 1 + content/server-server-api.md | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 changelogs/server_server/newsfragments/1623.clarification diff --git a/changelogs/server_server/newsfragments/1623.clarification b/changelogs/server_server/newsfragments/1623.clarification new file mode 100644 index 00000000..eab6c384 --- /dev/null +++ b/changelogs/server_server/newsfragments/1623.clarification @@ -0,0 +1 @@ +Switch to ordered list for server name resolution steps. diff --git a/content/server-server-api.md b/content/server-server-api.md index c2b31118..d0167e01 100644 --- a/content/server-server-api.md +++ b/content/server-server-api.md @@ -135,20 +135,20 @@ to send. The process overall is as follows: to step 4. If the response is valid, the `m.server` property is parsed as `[:]` and processed as follows: - - If `` is an IP literal, then that IP address + 1. If `` is an IP literal, then that IP address should be used together with the `` or 8448 if no port is provided. The target server must present a valid TLS certificate for the IP address. Requests must be made with a `Host` header containing the IP address, including the port if one was provided. - - If `` is not an IP literal, and + 2. If `` is not an IP literal, and `` is present, an IP address is discovered by looking up CNAME, AAAA or A records for ``. The resulting IP address is used, alongside the ``. Requests must be made with a `Host` header of `:`. The target server must present a valid certificate for ``. - - If `` is not an IP literal and no + 3. If `` is not an IP literal and no `` is present, an SRV record is looked up for `_matrix._tcp.`. This may result in another hostname (to be resolved using AAAA or A records) and port. @@ -156,7 +156,7 @@ to send. The process overall is as follows: a `Host` header containing the ``. The target server must present a valid certificate for ``. - - If no SRV record is found, an IP address is resolved using CNAME, AAAA + 4. If no SRV record is found, an IP address is resolved using CNAME, AAAA or A records. Requests are then made to the resolve IP address and a port of 8448, using a `Host` header of ``. The target server must present a valid From 86ab57ec4f0a7c110cbc655c84bd55405447d5b6 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Tue, 22 Aug 2023 09:50:54 -0600 Subject: [PATCH 006/268] Specify IANA-registered service name (MSC4040) (#1624) * Specify MSC4040 * add changelog * Fix flow of steps 4 and 5 --- .../newsfragments/1624.deprecation | 1 + .../server_server/newsfragments/1624.feature | 1 + content/server-server-api.md | 33 ++++++++++++++++--- 3 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 changelogs/server_server/newsfragments/1624.deprecation create mode 100644 changelogs/server_server/newsfragments/1624.feature diff --git a/changelogs/server_server/newsfragments/1624.deprecation b/changelogs/server_server/newsfragments/1624.deprecation new file mode 100644 index 00000000..4d8c481a --- /dev/null +++ b/changelogs/server_server/newsfragments/1624.deprecation @@ -0,0 +1 @@ +Deprecate `matrix` SRV lookup steps during server discovery, as per [MSC4040](https://github.com/matrix-org/matrix-spec-proposals/pull/4040). \ No newline at end of file diff --git a/changelogs/server_server/newsfragments/1624.feature b/changelogs/server_server/newsfragments/1624.feature new file mode 100644 index 00000000..324bf07f --- /dev/null +++ b/changelogs/server_server/newsfragments/1624.feature @@ -0,0 +1 @@ +Add `matrix-fed` SRV lookup steps to server discovery, as per [MSC4040](https://github.com/matrix-org/matrix-spec-proposals/pull/4040). \ No newline at end of file diff --git a/content/server-server-api.md b/content/server-server-api.md index d0167e01..d658e009 100644 --- a/content/server-server-api.md +++ b/content/server-server-api.md @@ -148,28 +148,45 @@ to send. The process overall is as follows: Requests must be made with a `Host` header of `:`. The target server must present a valid certificate for ``. - 3. If `` is not an IP literal and no + 3. {{< added-in v="1.8" >}} If `` is not an IP literal and no `` is present, an SRV record is looked up for + `_matrix-fed._tcp.`. This may result in another + hostname (to be resolved using AAAA or A records) and port. + Requests should be made to the resolved IP address and port with + a `Host` header containing the ``. The + target server must present a valid certificate for + ``. + 4. **[Deprecated]** If `` is not an IP literal, no + `` is present, and a `_matrix-fed._tcp.` + SRV record was not found, an SRV record is looked up for `_matrix._tcp.`. This may result in another hostname (to be resolved using AAAA or A records) and port. Requests should be made to the resolved IP address and port with a `Host` header containing the ``. The target server must present a valid certificate for ``. - 4. If no SRV record is found, an IP address is resolved using CNAME, AAAA + 5. If no SRV record is found, an IP address is resolved using CNAME, AAAA or A records. Requests are then made to the resolve IP address and a port of 8448, using a `Host` header of ``. The target server must present a valid certificate for ``. -4. If the `/.well-known` request resulted in an error response, a server is +4. {{< added-in v="1.8" >}} If the `/.well-known` request resulted in an error response, a server is + found by resolving an SRV record for `_matrix-fed._tcp.`. This may + result in a hostname (to be resolved using AAAA or A records) and + port. Requests are made to the resolved IP address and port, with a `Host` + header of ``. The target server must present a valid certificate + for ``. + +5. **[Deprecated]** If the `/.well-known` request resulted in an error response, + and a `_matrix-fed._tcp.` SRV record was not found, a server is found by resolving an SRV record for `_matrix._tcp.`. This may result in a hostname (to be resolved using AAAA or A records) and port. Requests are made to the resolved IP address and port, with a `Host` header of ``. The target server must present a valid certificate for ``. -5. If the `/.well-known` request returned an error response, and the +6. If the `/.well-known` request returned an error response, and the SRV record was not found, an IP address is resolved using CNAME, AAAA and A records. Requests are made to the resolved IP address using port 8448 and a `Host` header containing the ``. The target @@ -191,6 +208,14 @@ mandated by [RFC2782](https://www.rfc-editor.org/rfc/rfc2782.html): > the name MUST NOT be an alias (in the sense of RFC 1034 or RFC 2181) {{% /boxes/note %}} +{{% boxes/note %}} +Steps 3.4 and 5 are deprecated because they use a service name not registered by IANA. +They may be removed in a future version of the specification. Server admins are encouraged +to use `.well-known` over any form of SRV records. + +The IANA registration for port 8448 and `matrix-fed` can be found [here](https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml?search=matrix-fed). +{{% /boxes/note %}} + {{% http-api spec="server-server" api="wellknown" %}} ### Server implementation From 06298e4d8d219647f057a45df46c7bc5f05a0fd1 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Tue, 22 Aug 2023 10:05:28 -0600 Subject: [PATCH 007/268] Normalize changelog for Matrix 1.8 See https://github.com/matrix-org/matrix-spec/issues/1614 --- changelogs/appendices/newsfragments/1573.clarification | 2 +- changelogs/appendices/newsfragments/1583.feature | 2 +- changelogs/application_service/newsfragments/1584.clarification | 2 +- changelogs/internal/newsfragments/1551.clarification | 2 +- changelogs/internal/newsfragments/1562.clarification | 2 +- .../newsfragments/1585.clarification | 0 changelogs/internal/newsfragments/1620.feature | 2 +- .../newsfragments/{1604.feature => 1604.feature.1} | 0 changelogs/room_versions/newsfragments/1604.feature.2 | 1 + changelogs/room_versions/newsfragments/1604.feature.3 | 1 + changelogs/room_versions/newsfragments/1604.feature.4 | 1 + changelogs/room_versions/newsfragments/1604.feature.5 | 1 + changelogs/server_server/newsfragments/1559.clarification | 2 +- changelogs/server_server/newsfragments/1560.clarification | 2 +- 14 files changed, 12 insertions(+), 8 deletions(-) rename changelogs/{client_server => internal}/newsfragments/1585.clarification (100%) rename changelogs/room_versions/newsfragments/{1604.feature => 1604.feature.1} (100%) create mode 100644 changelogs/room_versions/newsfragments/1604.feature.2 create mode 100644 changelogs/room_versions/newsfragments/1604.feature.3 create mode 100644 changelogs/room_versions/newsfragments/1604.feature.4 create mode 100644 changelogs/room_versions/newsfragments/1604.feature.5 diff --git a/changelogs/appendices/newsfragments/1573.clarification b/changelogs/appendices/newsfragments/1573.clarification index 7210ae76..0d469652 100644 --- a/changelogs/appendices/newsfragments/1573.clarification +++ b/changelogs/appendices/newsfragments/1573.clarification @@ -1 +1 @@ -Clarify spec re canonical JSON to handle negative-zero; also, give an example of negative-zero and a large power of ten +Clarify spec re canonical JSON to handle negative-zero; also, give an example of negative-zero and a large power of ten. diff --git a/changelogs/appendices/newsfragments/1583.feature b/changelogs/appendices/newsfragments/1583.feature index b24077c6..01f99804 100644 --- a/changelogs/appendices/newsfragments/1583.feature +++ b/changelogs/appendices/newsfragments/1583.feature @@ -1 +1 @@ -Allow `+` in Matrix IDs, per [MSC4009](https://github.com/matrix-org/matrix-spec-proposals/pull/4009). +Allow `+` in Matrix IDs, as per [MSC4009](https://github.com/matrix-org/matrix-spec-proposals/pull/4009). diff --git a/changelogs/application_service/newsfragments/1584.clarification b/changelogs/application_service/newsfragments/1584.clarification index 098c1260..f6837db0 100644 --- a/changelogs/application_service/newsfragments/1584.clarification +++ b/changelogs/application_service/newsfragments/1584.clarification @@ -1 +1 @@ -Fix JSON schema of custom fields in query. +Fix type of custom `fields` in thirdparty lookup queries. diff --git a/changelogs/internal/newsfragments/1551.clarification b/changelogs/internal/newsfragments/1551.clarification index b9f32571..9a2ecca5 100644 --- a/changelogs/internal/newsfragments/1551.clarification +++ b/changelogs/internal/newsfragments/1551.clarification @@ -1 +1 @@ -Fix the sidebar in recent versions of Hugo +Fix the sidebar in recent versions of Hugo. diff --git a/changelogs/internal/newsfragments/1562.clarification b/changelogs/internal/newsfragments/1562.clarification index 6882cad1..26a79ce2 100644 --- a/changelogs/internal/newsfragments/1562.clarification +++ b/changelogs/internal/newsfragments/1562.clarification @@ -1 +1 @@ -Make sure version in x-changedInMatrixVersion is a string. +Make sure version in `x-changedInMatrixVersion` is a string. diff --git a/changelogs/client_server/newsfragments/1585.clarification b/changelogs/internal/newsfragments/1585.clarification similarity index 100% rename from changelogs/client_server/newsfragments/1585.clarification rename to changelogs/internal/newsfragments/1585.clarification diff --git a/changelogs/internal/newsfragments/1620.feature b/changelogs/internal/newsfragments/1620.feature index 76f7eee7..c0b24326 100644 --- a/changelogs/internal/newsfragments/1620.feature +++ b/changelogs/internal/newsfragments/1620.feature @@ -1 +1 @@ -Create @matrix-org/spec npm package to ship the SAS Emoji data definitions & translations. +Create `@matrix-org/spec` npm package to ship the SAS Emoji data definitions & translations. diff --git a/changelogs/room_versions/newsfragments/1604.feature b/changelogs/room_versions/newsfragments/1604.feature.1 similarity index 100% rename from changelogs/room_versions/newsfragments/1604.feature rename to changelogs/room_versions/newsfragments/1604.feature.1 diff --git a/changelogs/room_versions/newsfragments/1604.feature.2 b/changelogs/room_versions/newsfragments/1604.feature.2 new file mode 100644 index 00000000..a941a25d --- /dev/null +++ b/changelogs/room_versions/newsfragments/1604.feature.2 @@ -0,0 +1 @@ +Move `redacts` from top level to `content` on `m.room.redaction` events in room version 11, as per [MSC2174](https://github.com/matrix-org/matrix-spec-proposals/pull/2174). \ No newline at end of file diff --git a/changelogs/room_versions/newsfragments/1604.feature.3 b/changelogs/room_versions/newsfragments/1604.feature.3 new file mode 100644 index 00000000..cffac893 --- /dev/null +++ b/changelogs/room_versions/newsfragments/1604.feature.3 @@ -0,0 +1 @@ +Remove `creator` from `m.room.creator` events in room version 11, as per [MSC2175](https://github.com/matrix-org/matrix-spec-proposals/pull/2175). \ No newline at end of file diff --git a/changelogs/room_versions/newsfragments/1604.feature.4 b/changelogs/room_versions/newsfragments/1604.feature.4 new file mode 100644 index 00000000..47c1057f --- /dev/null +++ b/changelogs/room_versions/newsfragments/1604.feature.4 @@ -0,0 +1 @@ +Remove remaining usage of `origin` from events in room version 11, as per [MSC3989](https://github.com/matrix-org/matrix-spec-proposals/pull/3989). \ No newline at end of file diff --git a/changelogs/room_versions/newsfragments/1604.feature.5 b/changelogs/room_versions/newsfragments/1604.feature.5 new file mode 100644 index 00000000..ba29bf74 --- /dev/null +++ b/changelogs/room_versions/newsfragments/1604.feature.5 @@ -0,0 +1 @@ +Update the redaction rules in room version 11, as per [MSC2176](https://github.com/matrix-org/matrix-spec-proposals/pull/2176) and [MSC3821](https://github.com/matrix-org/matrix-spec-proposals/pull/3821). \ No newline at end of file diff --git a/changelogs/server_server/newsfragments/1559.clarification b/changelogs/server_server/newsfragments/1559.clarification index 401a94e0..4b8b060e 100644 --- a/changelogs/server_server/newsfragments/1559.clarification +++ b/changelogs/server_server/newsfragments/1559.clarification @@ -1 +1 @@ -Fix definition of response of `POST /_matrix/federation/v1/user/keys/claim`. +Fix response definition for `POST /_matrix/federation/v1/user/keys/claim`. diff --git a/changelogs/server_server/newsfragments/1560.clarification b/changelogs/server_server/newsfragments/1560.clarification index e717dda4..8ee2452c 100644 --- a/changelogs/server_server/newsfragments/1560.clarification +++ b/changelogs/server_server/newsfragments/1560.clarification @@ -1 +1 @@ -Fix level of examples in server keys definition. +Fix examples in server keys definition. From f65007476b93ce3be009794e06b473cf5476b194 Mon Sep 17 00:00:00 2001 From: Weblate Date: Tue, 22 Aug 2023 17:53:34 +0000 Subject: [PATCH 008/268] Merge branch 'origin/main' into Weblate. --- data-definitions/sas-emoji-v1-i18n/ar.json | 8 +-- data-definitions/sas-emoji-v1-i18n/cs.json | 2 +- data-definitions/sas-emoji-v1-i18n/es.json | 2 +- data-definitions/sas-emoji-v1-i18n/fa.json | 66 +++++++++++++++++++ data-definitions/sas-emoji-v1-i18n/ja.json | 4 +- data-definitions/sas-emoji-v1-i18n/pt.json | 66 +++++++++++++++++++ data-definitions/sas-emoji-v1-i18n/sk.json | 52 +++++++-------- data-definitions/sas-emoji-v1-i18n/vi.json | 12 ++-- .../sas-emoji-v1-i18n/zh_Hant.json | 66 +++++++++++++++++++ 9 files changed, 238 insertions(+), 40 deletions(-) create mode 100644 data-definitions/sas-emoji-v1-i18n/fa.json create mode 100644 data-definitions/sas-emoji-v1-i18n/pt.json create mode 100644 data-definitions/sas-emoji-v1-i18n/zh_Hant.json diff --git a/data-definitions/sas-emoji-v1-i18n/ar.json b/data-definitions/sas-emoji-v1-i18n/ar.json index 822d6f1c..5935ffd6 100644 --- a/data-definitions/sas-emoji-v1-i18n/ar.json +++ b/data-definitions/sas-emoji-v1-i18n/ar.json @@ -50,17 +50,17 @@ "Flower": "زَهرَة", "Butterfly": "فَرَاشَة", "Octopus": "أُخطُبُوط", - "Fish": "سَمَكَة", + "Fish": "سَمَكة", "Turtle": "سُلحفاة", - "Penguin": "بِطريق", + "Penguin": "بطريق", "Rooster": "دِيك", "Panda": "باندَا", "Rabbit": "أَرنَب", "Elephant": "فِيل", "Pig": "خِنزِير", - "Unicorn": "حِصَانٌ بِقَرن", + "Unicorn": "حصان وحيد القرن", "Horse": "حِصَان", "Lion": "أَسَد", "Cat": "هِرَّة", - "Dog": "كَلب" + "Dog": "كلب" } diff --git a/data-definitions/sas-emoji-v1-i18n/cs.json b/data-definitions/sas-emoji-v1-i18n/cs.json index 66d3a42a..ce5d6ad7 100644 --- a/data-definitions/sas-emoji-v1-i18n/cs.json +++ b/data-definitions/sas-emoji-v1-i18n/cs.json @@ -15,7 +15,7 @@ "Flag": "Vlajka", "Telephone": "Telefon", "Hammer": "Kladivo", - "Key": "Klíč", + "Key": "Klíč ke dveřím", "Lock": "Zámek", "Scissors": "Nůžky", "Paperclip": "Sponka", diff --git a/data-definitions/sas-emoji-v1-i18n/es.json b/data-definitions/sas-emoji-v1-i18n/es.json index 83d75f57..3651aef1 100644 --- a/data-definitions/sas-emoji-v1-i18n/es.json +++ b/data-definitions/sas-emoji-v1-i18n/es.json @@ -11,7 +11,7 @@ "Pencil": "Lápiz", "Key": "Llave", "Hammer": "Martillo", - "Telephone": "Telefono", + "Telephone": "Teléfono", "Train": "Tren", "Bicycle": "Bicicleta", "Ball": "Bola", diff --git a/data-definitions/sas-emoji-v1-i18n/fa.json b/data-definitions/sas-emoji-v1-i18n/fa.json new file mode 100644 index 00000000..621b0fff --- /dev/null +++ b/data-definitions/sas-emoji-v1-i18n/fa.json @@ -0,0 +1,66 @@ +{ + "Pin": "سنجاق", + "Folder": "پوشه", + "Headphones": "هدفون", + "Anchor": "لنگر", + "Bell": "زنگ", + "Trumpet": "شیپور", + "Guitar": "گیتار", + "Ball": "توپ", + "Trophy": "جام", + "Rocket": "موشک", + "Aeroplane": "هواپیما", + "Bicycle": "دوچرخه", + "Train": "قطار", + "Flag": "پرچم", + "Telephone": "تلفن", + "Hammer": "چکش", + "Key": "کلید", + "Lock": "قفل", + "Scissors": "قیچی", + "Paperclip": "گیره کاغذ", + "Pencil": "مداد", + "Book": "کتاب", + "Light Bulb": "لامپ", + "Gift": "هدیه", + "Clock": "ساعت", + "Hourglass": "ساعت شنی", + "Umbrella": "چتر", + "Thumbs Up": "لایک", + "Santa": "بابا نوئل", + "Spanner": "آچار", + "Glasses": "عینک", + "Hat": "کلاه", + "Robot": "ربات", + "Smiley": "خنده", + "Heart": "قلب", + "Cake": "کیک", + "Pizza": "پیتزا", + "Corn": "ذرت", + "Strawberry": "توت فرنگی", + "Apple": "سیب", + "Banana": "موز", + "Fire": "آتش", + "Cloud": "ابر", + "Moon": "ماه", + "Globe": "زمین", + "Mushroom": "قارچ", + "Cactus": "کاکتوس", + "Tree": "درخت", + "Flower": "گل", + "Butterfly": "پروانه", + "Octopus": "اختاپوس", + "Fish": "ماهی", + "Turtle": "لاک‌پشت", + "Penguin": "پنگوئن", + "Rooster": "خروس", + "Panda": "پاندا", + "Rabbit": "خرگوش", + "Elephant": "فیل", + "Pig": "خوک", + "Unicorn": "تک شاخ", + "Horse": "اسب", + "Lion": "شیر", + "Cat": "گربه", + "Dog": "سگ" +} diff --git a/data-definitions/sas-emoji-v1-i18n/ja.json b/data-definitions/sas-emoji-v1-i18n/ja.json index 1ad4cf14..73943c42 100644 --- a/data-definitions/sas-emoji-v1-i18n/ja.json +++ b/data-definitions/sas-emoji-v1-i18n/ja.json @@ -9,14 +9,14 @@ "Moon": "月", "Apple": "リンゴ", "Cake": "ケーキ", - "Robot": "ロボと", + "Robot": "ロボット", "Glasses": "めがね", "Book": "本", "Telephone": "電話機", "Train": "電車", "Bicycle": "自転車", "Pin": "ピン", - "Folder": "フォルダ", + "Folder": "フォルダー", "Headphones": "ヘッドホン", "Anchor": "いかり", "Bell": "ベル", diff --git a/data-definitions/sas-emoji-v1-i18n/pt.json b/data-definitions/sas-emoji-v1-i18n/pt.json new file mode 100644 index 00000000..17cc00d6 --- /dev/null +++ b/data-definitions/sas-emoji-v1-i18n/pt.json @@ -0,0 +1,66 @@ +{ + "Thumbs Up": "Polegar para cima", + "Pin": "Pionés", + "Folder": "Pasta", + "Headphones": "Fones", + "Anchor": "Âncora", + "Bell": "Sino", + "Trumpet": "Trompete", + "Guitar": "Guitarra", + "Ball": "Bola", + "Trophy": "Troféu", + "Rocket": "Foguetão", + "Aeroplane": "Avião", + "Bicycle": "Bicicleta", + "Train": "Comboio", + "Flag": "Bandeira", + "Telephone": "Telefone", + "Hammer": "Martelo", + "Key": "Chave", + "Lock": "Cadeado", + "Scissors": "Tesoura", + "Paperclip": "Clipe", + "Pencil": "Lápis", + "Book": "Livro", + "Light Bulb": "Lâmpada", + "Gift": "Presente", + "Clock": "Relógio", + "Hourglass": "Ampulheta", + "Umbrella": "Guarda-chuva", + "Santa": "Pai Natal", + "Spanner": "Chave inglesa", + "Glasses": "Óculos", + "Hat": "Chapéu", + "Robot": "Robô", + "Smiley": "Sorriso", + "Heart": "Coração", + "Cake": "Bolo", + "Pizza": "Piza", + "Corn": "Milho", + "Strawberry": "Morango", + "Apple": "Maçã", + "Banana": "Banana", + "Fire": "Fogo", + "Cloud": "Nuvem", + "Moon": "Lua", + "Globe": "Globo", + "Mushroom": "Cogumelo", + "Cactus": "Cato", + "Tree": "Árvore", + "Flower": "Flor", + "Butterfly": "Borboleta", + "Octopus": "Polvo", + "Fish": "Peixe", + "Turtle": "Tartaruga", + "Penguin": "Pinguim", + "Rooster": "Galo", + "Panda": "Panda", + "Rabbit": "Coelho", + "Elephant": "Elefante", + "Pig": "Porco", + "Unicorn": "Unicórnio", + "Horse": "Cavalo", + "Lion": "Leão", + "Cat": "Gato", + "Dog": "Cão" +} diff --git a/data-definitions/sas-emoji-v1-i18n/sk.json b/data-definitions/sas-emoji-v1-i18n/sk.json index f0a7176c..f44cb0fc 100644 --- a/data-definitions/sas-emoji-v1-i18n/sk.json +++ b/data-definitions/sas-emoji-v1-i18n/sk.json @@ -1,64 +1,64 @@ { - "Dog": "Hlava psa", - "Cat": "Hlava mačky", - "Lion": "Hlava leva", + "Dog": "Pes", + "Cat": "Mačka", + "Lion": "Lev", "Horse": "Kôň", - "Unicorn": "Hlava jednorožca", - "Pig": "Hlava prasaťa", + "Unicorn": "Jednorožec", + "Pig": "Prasa", "Elephant": "Slon", - "Rabbit": "Hlava zajaca", - "Panda": "Hlava pandy", + "Rabbit": "Zajac", + "Panda": "Panda", "Rooster": "Kohút", "Penguin": "Tučniak", "Turtle": "Korytnačka", "Fish": "Ryba", "Octopus": "Chobotnica", "Butterfly": "Motýľ", - "Flower": "Tulipán", - "Tree": "Listnatý strom", + "Flower": "Kvet", + "Tree": "Strom", "Cactus": "Kaktus", "Mushroom": "Huba", "Globe": "Zemeguľa", - "Moon": "Polmesiac", + "Moon": "Mesiac", "Cloud": "Oblak", "Fire": "Oheň", "Banana": "Banán", - "Apple": "Červené jablko", + "Apple": "Jablko", "Strawberry": "Jahoda", - "Corn": "Kukuričný klas", + "Corn": "Kukurica", "Pizza": "Pizza", - "Cake": "Narodeninová torta", - "Heart": "červené srdce", - "Smiley": "Škeriaca sa tvár", + "Cake": "Torta", + "Heart": "Srdce", + "Smiley": "Smajlík", "Robot": "Robot", - "Hat": "Cilinder", + "Hat": "Klobúk", "Glasses": "Okuliare", - "Spanner": "Francúzsky kľúč", - "Santa": "Santa Claus", + "Spanner": "Vidlicový kľúč", + "Santa": "Mikuláš", "Thumbs Up": "Palec nahor", "Umbrella": "Dáždnik", "Hourglass": "Presýpacie hodiny", "Clock": "Budík", - "Gift": "Zabalený darček", + "Gift": "Darček", "Light Bulb": "Žiarovka", - "Book": "Zatvorená kniha", + "Book": "Kniha", "Pencil": "Ceruzka", - "Paperclip": "Sponka na papier", + "Paperclip": "Kancelárska sponka", "Scissors": "Nožnice", - "Lock": "Zatvorená zámka", + "Lock": "Zámka", "Key": "Kľúč", "Hammer": "Kladivo", "Telephone": "Telefón", - "Flag": "Kockovaná zástava", - "Train": "Rušeň", + "Flag": "Zástava", + "Train": "Vlak", "Bicycle": "Bicykel", "Aeroplane": "Lietadlo", "Rocket": "Raketa", "Trophy": "Trofej", - "Ball": "Futbal", + "Ball": "Lopta", "Guitar": "Gitara", "Trumpet": "Trúbka", - "Bell": "Zvon", + "Bell": "Zvonec", "Anchor": "Kotva", "Headphones": "Slúchadlá", "Folder": "Fascikel", diff --git a/data-definitions/sas-emoji-v1-i18n/vi.json b/data-definitions/sas-emoji-v1-i18n/vi.json index f6e146da..76bb4ff1 100644 --- a/data-definitions/sas-emoji-v1-i18n/vi.json +++ b/data-definitions/sas-emoji-v1-i18n/vi.json @@ -17,20 +17,20 @@ "Hammer": "Búa", "Key": "Chìa khóa", "Lock": "Ổ khóa", - "Scissors": "Cây kéo", + "Scissors": "Cái kéo", "Paperclip": "Kẹp giấy", "Pencil": "Viết chì", "Book": "Sách", "Light Bulb": "Bóng đèn tròn", - "Gift": "Quà", + "Gift": "Quà tặng", "Clock": "Đồng hồ", "Hourglass": "Đồng hồ cát", - "Umbrella": "Cây dù", + "Umbrella": "Cái ô", "Thumbs Up": "Thích", - "Santa": "ông già Noel", + "Santa": "ông già Nô-en", "Spanner": "Cờ-lê", - "Glasses": "Mắt kiếng", - "Hat": "Nón", + "Glasses": "Kính mắt", + "Hat": "Mũ", "Robot": "Rô-bô", "Smiley": "Mặt cười", "Heart": "Tim", diff --git a/data-definitions/sas-emoji-v1-i18n/zh_Hant.json b/data-definitions/sas-emoji-v1-i18n/zh_Hant.json new file mode 100644 index 00000000..45dc1f61 --- /dev/null +++ b/data-definitions/sas-emoji-v1-i18n/zh_Hant.json @@ -0,0 +1,66 @@ +{ + "Pin": "圖釘", + "Folder": "資料夾", + "Headphones": "耳機", + "Anchor": "船錨", + "Bell": "鈴鐺", + "Trumpet": "喇叭", + "Guitar": "吉他", + "Ball": "足球", + "Trophy": "獎盃", + "Rocket": "火箭", + "Aeroplane": "飛機", + "Bicycle": "腳踏車", + "Train": "火車", + "Flag": "旗幟", + "Telephone": "電話", + "Hammer": "鎚子", + "Key": "鑰匙", + "Lock": "鎖頭", + "Scissors": "剪刀", + "Paperclip": "迴紋針", + "Pencil": "鉛筆", + "Book": "書", + "Light Bulb": "燈泡", + "Gift": "禮物", + "Clock": "時鐘", + "Hourglass": "沙漏", + "Umbrella": "雨傘", + "Thumbs Up": "讚", + "Santa": "聖誕老人", + "Spanner": "扳手", + "Glasses": "眼鏡", + "Hat": "帽子", + "Robot": "機器人", + "Smiley": "笑臉", + "Heart": "愛心", + "Cake": "蛋糕", + "Pizza": "披薩", + "Corn": "玉米", + "Strawberry": "草莓", + "Apple": "蘋果", + "Banana": "香蕉", + "Fire": "火", + "Cloud": "雲朵", + "Moon": "月亮", + "Globe": "地球", + "Mushroom": "蘑菇", + "Cactus": "仙人掌", + "Tree": "樹", + "Flower": "花", + "Butterfly": "蝴蝶", + "Octopus": "章魚", + "Fish": "魚", + "Turtle": "烏龜", + "Penguin": "企鵝", + "Rooster": "公雞", + "Panda": "熊貓", + "Rabbit": "兔子", + "Elephant": "大象", + "Pig": "豬", + "Unicorn": "獨角獸", + "Horse": "馬", + "Lion": "獅子", + "Cat": "貓", + "Dog": "狗" +} From 7aaeac07608f97942eff88634a56b630a745ce56 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Tue, 22 Aug 2023 12:04:56 -0600 Subject: [PATCH 009/268] Update data-definitions Following f65007476b93ce3be009794e06b473cf5476b194 --- data-definitions/sas-emoji.json | 400 +++++++++++++++++++++++--------- 1 file changed, 296 insertions(+), 104 deletions(-) diff --git a/data-definitions/sas-emoji.json b/data-definitions/sas-emoji.json index e6bc02bf..88d551f0 100644 --- a/data-definitions/sas-emoji.json +++ b/data-definitions/sas-emoji.json @@ -5,7 +5,7 @@ "description": "Dog", "unicode": "U+1F436", "translated_descriptions": { - "ar": "كَلب", + "ar": "كلب", "bg": "Куче", "ca": "Gos", "cs": "Pes", @@ -13,6 +13,7 @@ "eo": "Hundo", "es": "Perro", "et": "Koer", + "fa": "سگ", "fi": "Koira", "fr": "Chien", "hr": "pas", @@ -22,10 +23,11 @@ "ja": "犬", "nb_NO": "Hund", "nl": "Hond", + "pt": "Cão", "pt_BR": "Cachorro", "ru": "Собака", "si": "බල්ලා", - "sk": "Hlava psa", + "sk": "Pes", "sq": "Qen", "sr": "пас", "sv": "Hund", @@ -33,7 +35,8 @@ "tzm": "Aydi", "uk": "Пес", "vi": "Chó", - "zh_Hans": "狗" + "zh_Hans": "狗", + "zh_Hant": "狗" } }, { @@ -50,6 +53,7 @@ "eo": "Kato", "es": "Gato", "et": "Kass", + "fa": "گربه", "fi": "Kissa", "fr": "Chat", "hr": "mačka", @@ -59,10 +63,11 @@ "ja": "猫", "nb_NO": "Katt", "nl": "Kat", + "pt": "Gato", "pt_BR": "Gato", "ru": "Кошка", "si": "පූසා", - "sk": "Hlava mačky", + "sk": "Mačka", "sq": "Mace", "sr": "мачка", "sv": "Katt", @@ -70,7 +75,8 @@ "tzm": "Amuc", "uk": "Кіт", "vi": "Mèo", - "zh_Hans": "猫" + "zh_Hans": "猫", + "zh_Hant": "貓" } }, { @@ -87,6 +93,7 @@ "eo": "Leono", "es": "León", "et": "Lõvi", + "fa": "شیر", "fi": "Leijona", "fr": "Lion", "hr": "lav", @@ -96,10 +103,11 @@ "ja": "ライオン", "nb_NO": "Løve", "nl": "Leeuw", + "pt": "Leão", "pt_BR": "Leão", "ru": "Лев", "si": "සිංහයා", - "sk": "Hlava leva", + "sk": "Lev", "sq": "Luan", "sr": "лав", "sv": "Lejon", @@ -107,7 +115,8 @@ "tzm": "Izem", "uk": "Лев", "vi": "Sư tử", - "zh_Hans": "狮子" + "zh_Hans": "狮子", + "zh_Hant": "獅子" } }, { @@ -124,6 +133,7 @@ "eo": "Ĉevalo", "es": "Caballo", "et": "Hobune", + "fa": "اسب", "fi": "Hevonen", "fr": "Cheval", "hr": "konj", @@ -133,6 +143,7 @@ "ja": "馬", "nb_NO": "Hest", "nl": "Paard", + "pt": "Cavalo", "pt_BR": "Cavalo", "ru": "Лошадь", "si": "අශ්වයා", @@ -144,7 +155,8 @@ "tzm": "Ayyis", "uk": "Кінь", "vi": "Ngựa", - "zh_Hans": "马" + "zh_Hans": "马", + "zh_Hant": "馬" } }, { @@ -153,7 +165,7 @@ "description": "Unicorn", "unicode": "U+1F984", "translated_descriptions": { - "ar": "حِصَانٌ بِقَرن", + "ar": "حصان وحيد القرن", "bg": "Еднорог", "ca": "Unicorn", "cs": "Jednorožec", @@ -161,6 +173,7 @@ "eo": "Unukorno", "es": "Unicornio", "et": "Ükssarvik", + "fa": "تک شاخ", "fi": "Yksisarvinen", "fr": "Licorne", "hr": "jednorog", @@ -170,10 +183,11 @@ "ja": "ユニコーン", "nb_NO": "Enhjørning", "nl": "Eenhoorn", + "pt": "Unicórnio", "pt_BR": "Unicórnio", "ru": "Единорог", "si": null, - "sk": "Hlava jednorožca", + "sk": "Jednorožec", "sq": "Njëbrirësh", "sr": "једнорог", "sv": "Enhörning", @@ -181,7 +195,8 @@ "tzm": null, "uk": "Єдиноріг", "vi": "Kỳ lân", - "zh_Hans": "独角兽" + "zh_Hans": "独角兽", + "zh_Hant": "獨角獸" } }, { @@ -198,6 +213,7 @@ "eo": "Porko", "es": "Cerdo", "et": "Siga", + "fa": "خوک", "fi": "Sika", "fr": "Cochon", "hr": "svinja", @@ -207,10 +223,11 @@ "ja": "ブタ", "nb_NO": "Gris", "nl": "Varken", + "pt": "Porco", "pt_BR": "Porco", "ru": "Свинья", "si": null, - "sk": "Hlava prasaťa", + "sk": "Prasa", "sq": "Derr", "sr": "прасе", "sv": "Gris", @@ -218,7 +235,8 @@ "tzm": "Ilef", "uk": "Свиня", "vi": "Heo", - "zh_Hans": "猪" + "zh_Hans": "猪", + "zh_Hant": "豬" } }, { @@ -235,6 +253,7 @@ "eo": "Elefanto", "es": "Elefante", "et": "Elevant", + "fa": "فیل", "fi": "Norsu", "fr": "Éléphant", "hr": "slon", @@ -244,6 +263,7 @@ "ja": "ゾウ", "nb_NO": "Elefant", "nl": "Olifant", + "pt": "Elefante", "pt_BR": "Elefante", "ru": "Слон", "si": null, @@ -255,7 +275,8 @@ "tzm": "Ilu", "uk": "Слон", "vi": "Voi", - "zh_Hans": "大象" + "zh_Hans": "大象", + "zh_Hant": "大象" } }, { @@ -272,6 +293,7 @@ "eo": "Kuniklo", "es": "Conejo", "et": "Jänes", + "fa": "خرگوش", "fi": "Kani", "fr": "Lapin", "hr": "zec", @@ -281,10 +303,11 @@ "ja": "うさぎ", "nb_NO": "Kanin", "nl": "Konijn", + "pt": "Coelho", "pt_BR": "Coelho", "ru": "Кролик", "si": null, - "sk": "Hlava zajaca", + "sk": "Zajac", "sq": "Lepur", "sr": "зец", "sv": "Kanin", @@ -292,7 +315,8 @@ "tzm": "Agnin", "uk": "Кріль", "vi": "Thỏ", - "zh_Hans": "兔子" + "zh_Hans": "兔子", + "zh_Hant": "兔子" } }, { @@ -309,6 +333,7 @@ "eo": "Pando", "es": "Panda", "et": "Panda", + "fa": "پاندا", "fi": "Panda", "fr": "Panda", "hr": "panda", @@ -318,10 +343,11 @@ "ja": "パンダ", "nb_NO": "Panda", "nl": "Panda", + "pt": "Panda", "pt_BR": "Panda", "ru": "Панда", "si": null, - "sk": "Hlava pandy", + "sk": "Panda", "sq": "Panda", "sr": "панда", "sv": "Panda", @@ -329,7 +355,8 @@ "tzm": null, "uk": "Панда", "vi": "Gấu trúc", - "zh_Hans": "熊猫" + "zh_Hans": "熊猫", + "zh_Hant": "熊貓" } }, { @@ -346,6 +373,7 @@ "eo": "Virkoko", "es": "Gallo", "et": "Kukk", + "fa": "خروس", "fi": "Kukko", "fr": "Coq", "hr": "kokot", @@ -355,6 +383,7 @@ "ja": "ニワトリ", "nb_NO": "Hane", "nl": "Haan", + "pt": "Galo", "pt_BR": "Galo", "ru": "Петух", "si": null, @@ -366,7 +395,8 @@ "tzm": "Ayaẓiḍ", "uk": "Когут", "vi": "Gà trống", - "zh_Hans": "公鸡" + "zh_Hans": "公鸡", + "zh_Hant": "公雞" } }, { @@ -375,7 +405,7 @@ "description": "Penguin", "unicode": "U+1F427", "translated_descriptions": { - "ar": "بِطريق", + "ar": "بطريق", "bg": "Пингвин", "ca": "Pingüí", "cs": "Tučňák", @@ -383,6 +413,7 @@ "eo": "Pingveno", "es": "Pingüino", "et": "Pingviin", + "fa": "پنگوئن", "fi": "Pingviini", "fr": "Manchot", "hr": "pingvin", @@ -392,6 +423,7 @@ "ja": "ペンギン", "nb_NO": "Pingvin", "nl": "Pinguïn", + "pt": "Pinguim", "pt_BR": "Pinguim", "ru": "Пингвин", "si": null, @@ -403,7 +435,8 @@ "tzm": null, "uk": "Пінгвін", "vi": "Chim cánh cụt", - "zh_Hans": "企鹅" + "zh_Hans": "企鹅", + "zh_Hant": "企鵝" } }, { @@ -420,6 +453,7 @@ "eo": "Testudo", "es": "Tortuga", "et": "Kilpkonn", + "fa": "لاک‌پشت", "fi": "Kilpikonna", "fr": "Tortue", "hr": "kornjača", @@ -429,6 +463,7 @@ "ja": "亀", "nb_NO": "Skilpadde", "nl": "Schildpad", + "pt": "Tartaruga", "pt_BR": "Tartaruga", "ru": "Черепаха", "si": null, @@ -440,7 +475,8 @@ "tzm": "Ifker", "uk": "Черепаха", "vi": "Rùa", - "zh_Hans": "乌龟" + "zh_Hans": "乌龟", + "zh_Hant": "烏龜" } }, { @@ -449,7 +485,7 @@ "description": "Fish", "unicode": "U+1F41F", "translated_descriptions": { - "ar": "سَمَكَة", + "ar": "سَمَكة", "bg": "Риба", "ca": "Peix", "cs": "Ryba", @@ -457,6 +493,7 @@ "eo": "Fiŝo", "es": "Pez", "et": "Kala", + "fa": "ماهی", "fi": "Kala", "fr": "Poisson", "hr": "riba", @@ -466,6 +503,7 @@ "ja": "魚", "nb_NO": "Fisk", "nl": "Vis", + "pt": "Peixe", "pt_BR": "Peixe", "ru": "Рыба", "si": null, @@ -477,7 +515,8 @@ "tzm": "Aselm", "uk": "Риба", "vi": "Cá", - "zh_Hans": "鱼" + "zh_Hans": "鱼", + "zh_Hant": "魚" } }, { @@ -494,6 +533,7 @@ "eo": "Polpo", "es": "Pulpo", "et": "Kaheksajalg", + "fa": "اختاپوس", "fi": "Tursas", "fr": "Poulpe", "hr": "hobotnica", @@ -503,6 +543,7 @@ "ja": "たこ", "nb_NO": "Blekksprut", "nl": "Octopus", + "pt": "Polvo", "pt_BR": "Polvo", "ru": "Осьминог", "si": null, @@ -514,7 +555,8 @@ "tzm": null, "uk": "Восьминіг", "vi": "Bạch tuộc", - "zh_Hans": "章鱼" + "zh_Hans": "章鱼", + "zh_Hant": "章魚" } }, { @@ -531,6 +573,7 @@ "eo": "Papilio", "es": "Mariposa", "et": "Liblikas", + "fa": "پروانه", "fi": "Perhonen", "fr": "Papillon", "hr": "leptir", @@ -540,6 +583,7 @@ "ja": "ちょうちょ", "nb_NO": "Sommerfugl", "nl": "Vlinder", + "pt": "Borboleta", "pt_BR": "Borboleta", "ru": "Бабочка", "si": null, @@ -551,7 +595,8 @@ "tzm": null, "uk": "Метелик", "vi": "Bướm", - "zh_Hans": "蝴蝶" + "zh_Hans": "蝴蝶", + "zh_Hant": "蝴蝶" } }, { @@ -568,6 +613,7 @@ "eo": "Floro", "es": "Flor", "et": "Lill", + "fa": "گل", "fi": "Kukka", "fr": "Fleur", "hr": "svijet", @@ -577,10 +623,11 @@ "ja": "花", "nb_NO": "Blomst", "nl": "Bloem", + "pt": "Flor", "pt_BR": "Flor", "ru": "Цветок", "si": null, - "sk": "Tulipán", + "sk": "Kvet", "sq": "Lule", "sr": "цвет", "sv": "Blomma", @@ -588,7 +635,8 @@ "tzm": null, "uk": "Квітка", "vi": "Hoa", - "zh_Hans": "花" + "zh_Hans": "花", + "zh_Hant": "花" } }, { @@ -605,6 +653,7 @@ "eo": "Arbo", "es": "Árbol", "et": "Puu", + "fa": "درخت", "fi": "Puu", "fr": "Arbre", "hr": "drvo", @@ -614,10 +663,11 @@ "ja": "木", "nb_NO": "Tre", "nl": "Boom", + "pt": "Árvore", "pt_BR": "Árvore", "ru": "Дерево", "si": null, - "sk": "Listnatý strom", + "sk": "Strom", "sq": "Pemë", "sr": "дрво", "sv": "Träd", @@ -625,7 +675,8 @@ "tzm": "Aseklu", "uk": "Дерево", "vi": "Cây", - "zh_Hans": "树" + "zh_Hans": "树", + "zh_Hant": "樹" } }, { @@ -642,6 +693,7 @@ "eo": "Kakto", "es": "Cactus", "et": "Kaktus", + "fa": "کاکتوس", "fi": "Kaktus", "fr": "Cactus", "hr": "kaktus", @@ -651,6 +703,7 @@ "ja": "サボテン", "nb_NO": "Kaktus", "nl": "Cactus", + "pt": "Cato", "pt_BR": "Cacto", "ru": "Кактус", "si": null, @@ -662,7 +715,8 @@ "tzm": null, "uk": "Кактус", "vi": "Xương rồng", - "zh_Hans": "仙人掌" + "zh_Hans": "仙人掌", + "zh_Hant": "仙人掌" } }, { @@ -679,6 +733,7 @@ "eo": "Fungo", "es": "Seta", "et": "Seen", + "fa": "قارچ", "fi": "Sieni", "fr": "Champignon", "hr": "gljiva", @@ -688,6 +743,7 @@ "ja": "きのこ", "nb_NO": "Sopp", "nl": "Paddenstoel", + "pt": "Cogumelo", "pt_BR": "Cogumelo", "ru": "Гриб", "si": null, @@ -699,7 +755,8 @@ "tzm": "Agursel", "uk": "Гриб", "vi": "Nấm", - "zh_Hans": "蘑菇" + "zh_Hans": "蘑菇", + "zh_Hant": "蘑菇" } }, { @@ -716,6 +773,7 @@ "eo": "Globo", "es": "Globo", "et": "Maakera", + "fa": "زمین", "fi": "Maapallo", "fr": "Globe", "hr": "Globus", @@ -725,6 +783,7 @@ "ja": "地球", "nb_NO": "Globus", "nl": "Wereldbol", + "pt": "Globo", "pt_BR": "Globo", "ru": "Глобус", "si": null, @@ -736,7 +795,8 @@ "tzm": null, "uk": "Глобус", "vi": "Địa cầu", - "zh_Hans": "地球" + "zh_Hans": "地球", + "zh_Hant": "地球" } }, { @@ -753,6 +813,7 @@ "eo": "Luno", "es": "Luna", "et": "Kuu", + "fa": "ماه", "fi": "Kuu", "fr": "Lune", "hr": "mjesec", @@ -762,10 +823,11 @@ "ja": "月", "nb_NO": "Måne", "nl": "Maan", + "pt": "Lua", "pt_BR": "Lua", "ru": "Луна", "si": null, - "sk": "Polmesiac", + "sk": "Mesiac", "sq": "Hënë", "sr": "месец", "sv": "Måne", @@ -773,7 +835,8 @@ "tzm": "Ayyur", "uk": "Місяць", "vi": "Mặt trăng", - "zh_Hans": "月亮" + "zh_Hans": "月亮", + "zh_Hant": "月亮" } }, { @@ -790,6 +853,7 @@ "eo": "Nubo", "es": "Nube", "et": "Pilv", + "fa": "ابر", "fi": "Pilvi", "fr": "Nuage", "hr": "oblak", @@ -799,6 +863,7 @@ "ja": "雲", "nb_NO": "Sky", "nl": "Wolk", + "pt": "Nuvem", "pt_BR": "Nuvem", "ru": "Облако", "si": null, @@ -810,7 +875,8 @@ "tzm": null, "uk": "Хмара", "vi": "Mây", - "zh_Hans": "云" + "zh_Hans": "云", + "zh_Hant": "雲朵" } }, { @@ -827,6 +893,7 @@ "eo": "Fajro", "es": "Fuego", "et": "Tuli", + "fa": "آتش", "fi": "Tuli", "fr": "Feu", "hr": "vatra", @@ -836,6 +903,7 @@ "ja": "炎", "nb_NO": "Flamme", "nl": "Vuur", + "pt": "Fogo", "pt_BR": "Fogo", "ru": "Огонь", "si": null, @@ -847,7 +915,8 @@ "tzm": "Timessi", "uk": "Вогонь", "vi": "Lửa", - "zh_Hans": "火" + "zh_Hans": "火", + "zh_Hant": "火" } }, { @@ -864,6 +933,7 @@ "eo": "Banano", "es": "Plátano", "et": "Banaan", + "fa": "موز", "fi": "Banaani", "fr": "Banane", "hr": "banana", @@ -873,6 +943,7 @@ "ja": "バナナ", "nb_NO": "Banan", "nl": "Banaan", + "pt": "Banana", "pt_BR": "Banana", "ru": "Банан", "si": null, @@ -884,7 +955,8 @@ "tzm": "Tabanant", "uk": "Банан", "vi": "Chuối", - "zh_Hans": "香蕉" + "zh_Hans": "香蕉", + "zh_Hant": "香蕉" } }, { @@ -901,6 +973,7 @@ "eo": "Pomo", "es": "Manzana", "et": "Õun", + "fa": "سیب", "fi": "Omena", "fr": "Pomme", "hr": "jabuka", @@ -910,10 +983,11 @@ "ja": "リンゴ", "nb_NO": "Eple", "nl": "Appel", + "pt": "Maçã", "pt_BR": "Maçã", "ru": "Яблоко", "si": null, - "sk": "Červené jablko", + "sk": "Jablko", "sq": "Mollë", "sr": "јабука", "sv": "Äpple", @@ -921,7 +995,8 @@ "tzm": "Tadeffuyt", "uk": "Яблуко", "vi": "Táo", - "zh_Hans": "苹果" + "zh_Hans": "苹果", + "zh_Hant": "蘋果" } }, { @@ -938,6 +1013,7 @@ "eo": "Frago", "es": "Fresa", "et": "Maasikas", + "fa": "توت فرنگی", "fi": "Mansikka", "fr": "Fraise", "hr": "jagoda", @@ -947,6 +1023,7 @@ "ja": "いちご", "nb_NO": "Jordbær", "nl": "Aardbei", + "pt": "Morango", "pt_BR": "Morango", "ru": "Клубника", "si": null, @@ -958,7 +1035,8 @@ "tzm": null, "uk": "Полуниця", "vi": "Dâu tây", - "zh_Hans": "草莓" + "zh_Hans": "草莓", + "zh_Hant": "草莓" } }, { @@ -975,6 +1053,7 @@ "eo": "Maizo", "es": "Maíz", "et": "Mais", + "fa": "ذرت", "fi": "Maissi", "fr": "Maïs", "hr": "kukuruza", @@ -984,10 +1063,11 @@ "ja": "とうもろこし", "nb_NO": "Mais", "nl": "Maïs", + "pt": "Milho", "pt_BR": "Milho", "ru": "Кукуруза", "si": null, - "sk": "Kukuričný klas", + "sk": "Kukurica", "sq": "Misër", "sr": "кукуруз", "sv": "Majs", @@ -995,7 +1075,8 @@ "tzm": null, "uk": "Кукурудза", "vi": "Bắp", - "zh_Hans": "玉米" + "zh_Hans": "玉米", + "zh_Hant": "玉米" } }, { @@ -1012,6 +1093,7 @@ "eo": "Pico", "es": "Pizza", "et": "Pitsa", + "fa": "پیتزا", "fi": "Pizza", "fr": "Pizza", "hr": "pizza", @@ -1021,6 +1103,7 @@ "ja": "ピザ", "nb_NO": "Pizza", "nl": "Pizza", + "pt": "Piza", "pt_BR": "Pizza", "ru": "Пицца", "si": null, @@ -1032,7 +1115,8 @@ "tzm": null, "uk": "Піца", "vi": "Pizza", - "zh_Hans": "披萨" + "zh_Hans": "披萨", + "zh_Hant": "披薩" } }, { @@ -1049,6 +1133,7 @@ "eo": "Torto", "es": "Tarta", "et": "Kook", + "fa": "کیک", "fi": "Kakku", "fr": "Gâteau", "hr": "torta", @@ -1058,10 +1143,11 @@ "ja": "ケーキ", "nb_NO": "Kake", "nl": "Taart", + "pt": "Bolo", "pt_BR": "Bolo", "ru": "Торт", "si": null, - "sk": "Narodeninová torta", + "sk": "Torta", "sq": "Tortë", "sr": "торта", "sv": "Tårta", @@ -1069,7 +1155,8 @@ "tzm": null, "uk": "Пиріг", "vi": "Bánh", - "zh_Hans": "蛋糕" + "zh_Hans": "蛋糕", + "zh_Hant": "蛋糕" } }, { @@ -1086,6 +1173,7 @@ "eo": "Koro", "es": "Corazón", "et": "Süda", + "fa": "قلب", "fi": "Sydän", "fr": "Cœur", "hr": "srca", @@ -1095,10 +1183,11 @@ "ja": "ハート", "nb_NO": "Hjerte", "nl": "Hart", + "pt": "Coração", "pt_BR": "Coração", "ru": "Сердце", "si": null, - "sk": "červené srdce", + "sk": "Srdce", "sq": "Zemër", "sr": "срце", "sv": "Hjärta", @@ -1106,7 +1195,8 @@ "tzm": "Ul", "uk": "Серце", "vi": "Tim", - "zh_Hans": "心" + "zh_Hans": "心", + "zh_Hant": "愛心" } }, { @@ -1123,6 +1213,7 @@ "eo": "Rideto", "es": "Emoticono", "et": "Smaili", + "fa": "خنده", "fi": "Hymynaama", "fr": "Sourire", "hr": "smajlića", @@ -1132,10 +1223,11 @@ "ja": "スマイル", "nb_NO": "Smilefjes", "nl": "Smiley", + "pt": "Sorriso", "pt_BR": "Sorriso", "ru": "Улыбка", "si": null, - "sk": "Škeriaca sa tvár", + "sk": "Smajlík", "sq": "Emotikon", "sr": "смајли", "sv": "Smiley", @@ -1143,7 +1235,8 @@ "tzm": null, "uk": "Посмішка", "vi": "Mặt cười", - "zh_Hans": "笑脸" + "zh_Hans": "笑脸", + "zh_Hant": "笑臉" } }, { @@ -1160,15 +1253,17 @@ "eo": "Roboto", "es": "Robot", "et": "Robot", + "fa": "ربات", "fi": "Robotti", "fr": "Robot", "hr": "robot", "hu": "Robot", "id": "Robot", "it": "Robot", - "ja": "ロボと", + "ja": "ロボット", "nb_NO": "Robot", "nl": "Robot", + "pt": "Robô", "pt_BR": "Robô", "ru": "Робот", "si": null, @@ -1180,7 +1275,8 @@ "tzm": "Aṛubu", "uk": "Робот", "vi": "Rô-bô", - "zh_Hans": "机器人" + "zh_Hans": "机器人", + "zh_Hant": "機器人" } }, { @@ -1197,6 +1293,7 @@ "eo": "Ĉapelo", "es": "Sombrero", "et": "Kübar", + "fa": "کلاه", "fi": "Hattu", "fr": "Chapeau", "hr": "kapa", @@ -1206,18 +1303,20 @@ "ja": "帽子", "nb_NO": "Hatt", "nl": "Hoed", + "pt": "Chapéu", "pt_BR": "Chapéu", "ru": "Шляпа", "si": null, - "sk": "Cilinder", + "sk": "Klobúk", "sq": "Kapë", "sr": "шешир", "sv": "Hatt", "szl": null, "tzm": "Taraza", "uk": "Капелюх", - "vi": "Nón", - "zh_Hans": "帽子" + "vi": "Mũ", + "zh_Hans": "帽子", + "zh_Hant": "帽子" } }, { @@ -1234,6 +1333,7 @@ "eo": "Okulvitroj", "es": "Gafas", "et": "Prillid", + "fa": "عینک", "fi": "Silmälasit", "fr": "Lunettes", "hr": "naočale", @@ -1243,6 +1343,7 @@ "ja": "めがね", "nb_NO": "Briller", "nl": "Bril", + "pt": "Óculos", "pt_BR": "Óculos", "ru": "Очки", "si": null, @@ -1253,8 +1354,9 @@ "szl": null, "tzm": null, "uk": "Окуляри", - "vi": "Mắt kiếng", - "zh_Hans": "眼镜" + "vi": "Kính mắt", + "zh_Hans": "眼镜", + "zh_Hant": "眼鏡" } }, { @@ -1271,6 +1373,7 @@ "eo": "Ŝraŭbŝlosilo", "es": "Llave inglesa", "et": "Mutrivõti", + "fa": "آچار", "fi": "Kiintoavain", "fr": "Clé à molette", "hr": "ključ", @@ -1280,10 +1383,11 @@ "ja": "スパナ", "nb_NO": "Fastnøkkel", "nl": "Moersleutel", + "pt": "Chave inglesa", "pt_BR": "Chave inglesa", "ru": "Ключ", "si": null, - "sk": "Francúzsky kľúč", + "sk": "Vidlicový kľúč", "sq": "Çelës", "sr": "кључ", "sv": "Skruvnyckel", @@ -1291,7 +1395,8 @@ "tzm": null, "uk": "Гайковий ключ", "vi": "Cờ-lê", - "zh_Hans": "扳手" + "zh_Hans": "扳手", + "zh_Hant": "扳手" } }, { @@ -1308,6 +1413,7 @@ "eo": "Kristnaska viro", "es": "Papá Noel", "et": "Jõuluvana", + "fa": "بابا نوئل", "fi": "Joulupukki", "fr": "Père Noël", "hr": "deda Mraz", @@ -1317,18 +1423,20 @@ "ja": "サンタ", "nb_NO": "Julenisse", "nl": "Kerstman", + "pt": "Pai Natal", "pt_BR": "Papai-noel", "ru": "Санта", "si": null, - "sk": "Santa Claus", + "sk": "Mikuláš", "sq": "Babagjyshi i Vitit të Ri", "sr": "деда Мраз", "sv": "Tomte", "szl": null, "tzm": null, "uk": "Санта Клаус", - "vi": "ông già Noel", - "zh_Hans": "圣诞老人" + "vi": "ông già Nô-en", + "zh_Hans": "圣诞老人", + "zh_Hant": "聖誕老人" } }, { @@ -1345,6 +1453,7 @@ "eo": "Dikfingro supren", "es": "Pulgar arriba", "et": "Pöidlad püsti", + "fa": "لایک", "fi": "Peukalo ylös", "fr": "Pouce en l’air", "hr": "palac gore", @@ -1354,6 +1463,7 @@ "ja": "いいね", "nb_NO": "Tommel Opp", "nl": "Duim omhoog", + "pt": "Polegar para cima", "pt_BR": "Joinha", "ru": "Большой палец вверх", "si": null, @@ -1365,7 +1475,8 @@ "tzm": null, "uk": "Великий палець вгору", "vi": "Thích", - "zh_Hans": "赞" + "zh_Hans": "赞", + "zh_Hant": "讚" } }, { @@ -1382,6 +1493,7 @@ "eo": "Ombrelo", "es": "Paraguas", "et": "Vihmavari", + "fa": "چتر", "fi": "Sateenvarjo", "fr": "Parapluie", "hr": "kišobran", @@ -1391,6 +1503,7 @@ "ja": "傘", "nb_NO": "Paraply", "nl": "Paraplu", + "pt": "Guarda-chuva", "pt_BR": "Guarda-chuva", "ru": "Зонт", "si": null, @@ -1401,8 +1514,9 @@ "szl": null, "tzm": null, "uk": "Парасолька", - "vi": "Cây dù", - "zh_Hans": "伞" + "vi": "Cái ô", + "zh_Hans": "伞", + "zh_Hant": "雨傘" } }, { @@ -1419,6 +1533,7 @@ "eo": "Sablohorloĝo", "es": "Reloj de arena", "et": "Liivakell", + "fa": "ساعت شنی", "fi": "Tiimalasi", "fr": "Sablier", "hr": "pješčani sat", @@ -1428,6 +1543,7 @@ "ja": "砂時計", "nb_NO": "Timeglass", "nl": "Zandloper", + "pt": "Ampulheta", "pt_BR": "Ampulheta", "ru": "Песочные часы", "si": null, @@ -1439,7 +1555,8 @@ "tzm": null, "uk": "Пісковий годинник", "vi": "Đồng hồ cát", - "zh_Hans": "沙漏" + "zh_Hans": "沙漏", + "zh_Hant": "沙漏" } }, { @@ -1456,6 +1573,7 @@ "eo": "Horloĝo", "es": "Reloj", "et": "Kell", + "fa": "ساعت", "fi": "Pöytäkello", "fr": "Réveil", "hr": "sat", @@ -1465,6 +1583,7 @@ "ja": "時計", "nb_NO": "Klokke", "nl": "Wekker", + "pt": "Relógio", "pt_BR": "Relógio", "ru": "Часы", "si": null, @@ -1476,7 +1595,8 @@ "tzm": null, "uk": "Годинник", "vi": "Đồng hồ", - "zh_Hans": "时钟" + "zh_Hans": "时钟", + "zh_Hant": "時鐘" } }, { @@ -1493,6 +1613,7 @@ "eo": "Donaco", "es": "Regalo", "et": "Kingitus", + "fa": "هدیه", "fi": "Lahja", "fr": "Cadeau", "hr": "poklon", @@ -1502,18 +1623,20 @@ "ja": "ギフト", "nb_NO": "Gave", "nl": "Geschenk", + "pt": "Presente", "pt_BR": "Presente", "ru": "Подарок", "si": null, - "sk": "Zabalený darček", + "sk": "Darček", "sq": "Dhuratë", "sr": "поклон", "sv": "Present", "szl": null, "tzm": null, "uk": "Подарунок", - "vi": "Quà", - "zh_Hans": "礼物" + "vi": "Quà tặng", + "zh_Hans": "礼物", + "zh_Hant": "禮物" } }, { @@ -1530,6 +1653,7 @@ "eo": "Lampo", "es": "Bombilla", "et": "Lambipirn", + "fa": "لامپ", "fi": "Hehkulamppu", "fr": "Ampoule", "hr": "žarulja", @@ -1539,6 +1663,7 @@ "ja": "電球", "nb_NO": "Lyspære", "nl": "Gloeilamp", + "pt": "Lâmpada", "pt_BR": "Lâmpada", "ru": "Лампочка", "si": null, @@ -1550,7 +1675,8 @@ "tzm": null, "uk": "Лампочка", "vi": "Bóng đèn tròn", - "zh_Hans": "灯泡" + "zh_Hans": "灯泡", + "zh_Hant": "燈泡" } }, { @@ -1567,6 +1693,7 @@ "eo": "Libro", "es": "Libro", "et": "Raamat", + "fa": "کتاب", "fi": "Kirja", "fr": "Livre", "hr": "knjiga", @@ -1576,10 +1703,11 @@ "ja": "本", "nb_NO": "Bok", "nl": "Boek", + "pt": "Livro", "pt_BR": "Livro", "ru": "Книга", "si": null, - "sk": "Zatvorená kniha", + "sk": "Kniha", "sq": "Libër", "sr": "књига", "sv": "Bok", @@ -1587,7 +1715,8 @@ "tzm": "Adlis", "uk": "Книга", "vi": "Sách", - "zh_Hans": "书" + "zh_Hans": "书", + "zh_Hant": "書" } }, { @@ -1604,6 +1733,7 @@ "eo": "Krajono", "es": "Lápiz", "et": "Pliiats", + "fa": "مداد", "fi": "Lyijykynä", "fr": "Crayon", "hr": "olovka", @@ -1613,6 +1743,7 @@ "ja": "鉛筆", "nb_NO": "Blyant", "nl": "Potlood", + "pt": "Lápis", "pt_BR": "Lápis", "ru": "Карандаш", "si": null, @@ -1624,7 +1755,8 @@ "tzm": null, "uk": "Олівець", "vi": "Viết chì", - "zh_Hans": "铅笔" + "zh_Hans": "铅笔", + "zh_Hant": "鉛筆" } }, { @@ -1641,6 +1773,7 @@ "eo": "Paperkuntenilo", "es": "Clip", "et": "Kirjaklamber", + "fa": "گیره کاغذ", "fi": "Paperiliitin", "fr": "Trombone", "hr": "spajalica", @@ -1650,10 +1783,11 @@ "ja": "クリップ", "nb_NO": "BInders", "nl": "Papierklemmetje", + "pt": "Clipe", "pt_BR": "Clipe de papel", "ru": "Скрепка", "si": null, - "sk": "Sponka na papier", + "sk": "Kancelárska sponka", "sq": "Kapëse", "sr": "спајалица", "sv": "Gem", @@ -1661,7 +1795,8 @@ "tzm": null, "uk": "Спиначка", "vi": "Kẹp giấy", - "zh_Hans": "回形针" + "zh_Hans": "回形针", + "zh_Hant": "迴紋針" } }, { @@ -1678,6 +1813,7 @@ "eo": "Tondilo", "es": "Tijeras", "et": "Käärid", + "fa": "قیچی", "fi": "Sakset", "fr": "Ciseaux", "hr": "škare", @@ -1687,6 +1823,7 @@ "ja": "はさみ", "nb_NO": "Saks", "nl": "Schaar", + "pt": "Tesoura", "pt_BR": "Tesoura", "ru": "Ножницы", "si": null, @@ -1697,8 +1834,9 @@ "szl": null, "tzm": null, "uk": "Ножиці", - "vi": "Cây kéo", - "zh_Hans": "剪刀" + "vi": "Cái kéo", + "zh_Hans": "剪刀", + "zh_Hant": "剪刀" } }, { @@ -1715,6 +1853,7 @@ "eo": "Seruro", "es": "Candado", "et": "Lukk", + "fa": "قفل", "fi": "Lukko", "fr": "Cadenas", "hr": "zaključati", @@ -1724,10 +1863,11 @@ "ja": "錠前", "nb_NO": "Lås", "nl": "Slot", + "pt": "Cadeado", "pt_BR": "Cadeado", "ru": "Замок", "si": null, - "sk": "Zatvorená zámka", + "sk": "Zámka", "sq": "Dry", "sr": "катанац", "sv": "Lås", @@ -1735,7 +1875,8 @@ "tzm": null, "uk": "Замок", "vi": "Ổ khóa", - "zh_Hans": "锁" + "zh_Hans": "锁", + "zh_Hant": "鎖頭" } }, { @@ -1747,11 +1888,12 @@ "ar": "مِفتَاح", "bg": "Ключ", "ca": "Clau", - "cs": "Klíč", + "cs": "Klíč ke dveřím", "de": "Schlüssel", "eo": "Ŝlosilo", "es": "Llave", "et": "Võti", + "fa": "کلید", "fi": "Avain", "fr": "Clé", "hr": "ključ", @@ -1761,6 +1903,7 @@ "ja": "鍵", "nb_NO": "Nøkkel", "nl": "Sleutel", + "pt": "Chave", "pt_BR": "Chave", "ru": "Ключ", "si": null, @@ -1772,7 +1915,8 @@ "tzm": "Tasarut", "uk": "Ключ", "vi": "Chìa khóa", - "zh_Hans": "钥匙" + "zh_Hans": "钥匙", + "zh_Hant": "鑰匙" } }, { @@ -1789,6 +1933,7 @@ "eo": "Martelo", "es": "Martillo", "et": "Haamer", + "fa": "چکش", "fi": "Vasara", "fr": "Marteau", "hr": "čekić", @@ -1798,6 +1943,7 @@ "ja": "金槌", "nb_NO": "Hammer", "nl": "Hamer", + "pt": "Martelo", "pt_BR": "Martelo", "ru": "Молоток", "si": null, @@ -1809,7 +1955,8 @@ "tzm": null, "uk": "Молоток", "vi": "Búa", - "zh_Hans": "锤子" + "zh_Hans": "锤子", + "zh_Hant": "鎚子" } }, { @@ -1824,8 +1971,9 @@ "cs": "Telefon", "de": "Telefon", "eo": "Telefono", - "es": "Telefono", + "es": "Teléfono", "et": "Telefon", + "fa": "تلفن", "fi": "Puhelin", "fr": "Téléphone", "hr": "telefon", @@ -1835,6 +1983,7 @@ "ja": "電話機", "nb_NO": "Telefon", "nl": "Telefoon", + "pt": "Telefone", "pt_BR": "Telefone", "ru": "Телефон", "si": null, @@ -1846,7 +1995,8 @@ "tzm": "Atilifun", "uk": "Телефон", "vi": "Điện thoại", - "zh_Hans": "电话" + "zh_Hans": "电话", + "zh_Hant": "電話" } }, { @@ -1863,6 +2013,7 @@ "eo": "Flago", "es": "Bandera", "et": "Lipp", + "fa": "پرچم", "fi": "Lippu", "fr": "Drapeau", "hr": "zastava", @@ -1872,10 +2023,11 @@ "ja": "旗", "nb_NO": "Flagg", "nl": "Vlag", + "pt": "Bandeira", "pt_BR": "Bandeira", "ru": "Флаг", "si": null, - "sk": "Kockovaná zástava", + "sk": "Zástava", "sq": "Flamur", "sr": "застава", "sv": "Flagga", @@ -1883,7 +2035,8 @@ "tzm": "Acenyal", "uk": "Прапор", "vi": "Lá cờ", - "zh_Hans": "旗帜" + "zh_Hans": "旗帜", + "zh_Hant": "旗幟" } }, { @@ -1900,6 +2053,7 @@ "eo": "Vagonaro", "es": "Tren", "et": "Rong", + "fa": "قطار", "fi": "Juna", "fr": "Train", "hr": "vlak", @@ -1909,10 +2063,11 @@ "ja": "電車", "nb_NO": "Tog", "nl": "Trein", + "pt": "Comboio", "pt_BR": "Trem", "ru": "Поезд", "si": null, - "sk": "Rušeň", + "sk": "Vlak", "sq": "Tren", "sr": "воз", "sv": "Tåg", @@ -1920,7 +2075,8 @@ "tzm": null, "uk": "Потяг", "vi": "Xe lửa", - "zh_Hans": "火车" + "zh_Hans": "火车", + "zh_Hant": "火車" } }, { @@ -1937,6 +2093,7 @@ "eo": "Biciklo", "es": "Bicicleta", "et": "Jalgratas", + "fa": "دوچرخه", "fi": "Polkupyörä", "fr": "Vélo", "hr": "bicikl", @@ -1946,6 +2103,7 @@ "ja": "自転車", "nb_NO": "Sykkel", "nl": "Fiets", + "pt": "Bicicleta", "pt_BR": "Bicicleta", "ru": "Велосипед", "si": null, @@ -1957,7 +2115,8 @@ "tzm": null, "uk": "Велосипед", "vi": "Xe đạp", - "zh_Hans": "自行车" + "zh_Hans": "自行车", + "zh_Hant": "腳踏車" } }, { @@ -1974,6 +2133,7 @@ "eo": "Aviadilo", "es": "Avión", "et": "Lennuk", + "fa": "هواپیما", "fi": "Lentokone", "fr": "Avion", "hr": "avion", @@ -1983,6 +2143,7 @@ "ja": "飛行機", "nb_NO": "Fly", "nl": "Vliegtuig", + "pt": "Avião", "pt_BR": "Avião", "ru": "Самолет", "si": null, @@ -1994,7 +2155,8 @@ "tzm": null, "uk": "Літак", "vi": "Máy bay", - "zh_Hans": "飞机" + "zh_Hans": "飞机", + "zh_Hant": "飛機" } }, { @@ -2011,6 +2173,7 @@ "eo": "Raketo", "es": "Cohete", "et": "Rakett", + "fa": "موشک", "fi": "Raketti", "fr": "Fusée", "hr": "raketa", @@ -2020,6 +2183,7 @@ "ja": "ロケット", "nb_NO": "Rakett", "nl": "Raket", + "pt": "Foguetão", "pt_BR": "Foguete", "ru": "Ракета", "si": null, @@ -2031,7 +2195,8 @@ "tzm": null, "uk": "Ракета", "vi": "Tên lửa", - "zh_Hans": "火箭" + "zh_Hans": "火箭", + "zh_Hant": "火箭" } }, { @@ -2048,6 +2213,7 @@ "eo": "Trofeo", "es": "Trofeo", "et": "Auhind", + "fa": "جام", "fi": "Palkinto", "fr": "Trophée", "hr": "trofej", @@ -2057,6 +2223,7 @@ "ja": "トロフィー", "nb_NO": "Pokal", "nl": "Trofee", + "pt": "Troféu", "pt_BR": "Troféu", "ru": "Кубок", "si": null, @@ -2068,7 +2235,8 @@ "tzm": null, "uk": "Приз", "vi": "Cúp", - "zh_Hans": "奖杯" + "zh_Hans": "奖杯", + "zh_Hant": "獎盃" } }, { @@ -2085,6 +2253,7 @@ "eo": "Pilko", "es": "Bola", "et": "Pall", + "fa": "توپ", "fi": "Pallo", "fr": "Ballon", "hr": "lopta", @@ -2094,10 +2263,11 @@ "ja": "ボール", "nb_NO": "Ball", "nl": "Bal", + "pt": "Bola", "pt_BR": "Bola", "ru": "Мяч", "si": null, - "sk": "Futbal", + "sk": "Lopta", "sq": "Top", "sr": "лопта", "sv": "Boll", @@ -2105,7 +2275,8 @@ "tzm": "Tcama", "uk": "М'яч", "vi": "Banh", - "zh_Hans": "球" + "zh_Hans": "球", + "zh_Hant": "足球" } }, { @@ -2122,6 +2293,7 @@ "eo": "Gitaro", "es": "Guitarra", "et": "Kitarr", + "fa": "گیتار", "fi": "Kitara", "fr": "Guitare", "hr": "gitara", @@ -2131,6 +2303,7 @@ "ja": "ギター", "nb_NO": "Gitar", "nl": "Gitaar", + "pt": "Guitarra", "pt_BR": "Guitarra", "ru": "Гитара", "si": null, @@ -2142,7 +2315,8 @@ "tzm": "Agiṭaṛ", "uk": "Гітара", "vi": "Ghi-ta", - "zh_Hans": "吉他" + "zh_Hans": "吉他", + "zh_Hant": "吉他" } }, { @@ -2159,6 +2333,7 @@ "eo": "Trumpeto", "es": "Trompeta", "et": "Trompet", + "fa": "شیپور", "fi": "Trumpetti", "fr": "Trompette", "hr": "truba", @@ -2168,6 +2343,7 @@ "ja": "トランペット", "nb_NO": "Trompet", "nl": "Trompet", + "pt": "Trompete", "pt_BR": "Trombeta", "ru": "Труба", "si": null, @@ -2179,7 +2355,8 @@ "tzm": null, "uk": "Труба", "vi": "Kèn", - "zh_Hans": "喇叭" + "zh_Hans": "喇叭", + "zh_Hant": "喇叭" } }, { @@ -2196,6 +2373,7 @@ "eo": "Sonorilo", "es": "Campana", "et": "Kelluke", + "fa": "زنگ", "fi": "Soittokello", "fr": "Cloche", "hr": "zvono", @@ -2205,10 +2383,11 @@ "ja": "ベル", "nb_NO": "Bjelle", "nl": "Bel", + "pt": "Sino", "pt_BR": "Sino", "ru": "Колокол", "si": null, - "sk": "Zvon", + "sk": "Zvonec", "sq": "Kambanë", "sr": "звоно", "sv": "Bjällra", @@ -2216,7 +2395,8 @@ "tzm": null, "uk": "Дзвін", "vi": "Chuông", - "zh_Hans": "铃铛" + "zh_Hans": "铃铛", + "zh_Hant": "鈴鐺" } }, { @@ -2233,6 +2413,7 @@ "eo": "Ankro", "es": "Ancla", "et": "Ankur", + "fa": "لنگر", "fi": "Ankkuri", "fr": "Ancre", "hr": "sidro", @@ -2242,6 +2423,7 @@ "ja": "いかり", "nb_NO": "Anker", "nl": "Anker", + "pt": "Âncora", "pt_BR": "Âncora", "ru": "Якорь", "si": null, @@ -2253,7 +2435,8 @@ "tzm": null, "uk": "Якір", "vi": "Mỏ neo", - "zh_Hans": "锚" + "zh_Hans": "锚", + "zh_Hant": "船錨" } }, { @@ -2270,6 +2453,7 @@ "eo": "Kapaŭdilo", "es": "Cascos", "et": "Kõrvaklapid", + "fa": "هدفون", "fi": "Kuulokkeet", "fr": "Casque audio", "hr": "slušalice", @@ -2279,6 +2463,7 @@ "ja": "ヘッドホン", "nb_NO": "Hodetelefoner", "nl": "Koptelefoon", + "pt": "Fones", "pt_BR": "Fones de ouvido", "ru": "Наушники", "si": null, @@ -2290,7 +2475,8 @@ "tzm": null, "uk": "Навушники", "vi": "Tai nghe", - "zh_Hans": "耳机" + "zh_Hans": "耳机", + "zh_Hant": "耳機" } }, { @@ -2307,15 +2493,17 @@ "eo": "Dosierujo", "es": "Carpeta", "et": "Kaust", + "fa": "پوشه", "fi": "Kansio", "fr": "Dossier", "hr": "mapu", "hu": "Mappa", "id": "Map", "it": "Cartella", - "ja": "フォルダ", + "ja": "フォルダー", "nb_NO": "Mappe", "nl": "Map", + "pt": "Pasta", "pt_BR": "Pasta", "ru": "Папка", "si": null, @@ -2327,7 +2515,8 @@ "tzm": "Asdaw", "uk": "Тека", "vi": "Thư mục", - "zh_Hans": "文件夹" + "zh_Hans": "文件夹", + "zh_Hant": "資料夾" } }, { @@ -2344,6 +2533,7 @@ "eo": "Pinglo", "es": "Alfiler", "et": "Nööpnõel", + "fa": "سنجاق", "fi": "Nuppineula", "fr": "Punaise", "hr": "pribadača", @@ -2353,6 +2543,7 @@ "ja": "ピン", "nb_NO": "Tegnestift", "nl": "Duimspijker", + "pt": "Pionés", "pt_BR": "Alfinete", "ru": "Булавка", "si": null, @@ -2364,7 +2555,8 @@ "tzm": null, "uk": "Кнопка", "vi": "Ghim", - "zh_Hans": "图钉" + "zh_Hans": "图钉", + "zh_Hant": "圖釘" } } ] \ No newline at end of file From 7f8606eb6c0d92f13b1a91a9702026e8a17a6bdf Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Wed, 23 Aug 2023 09:23:14 -0600 Subject: [PATCH 010/268] Matrix 1.8 --- config.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config.toml b/config.toml index c6f1bd45..6da94b09 100644 --- a/config.toml +++ b/config.toml @@ -47,14 +47,14 @@ privacy_policy = "https://matrix.org/legal/privacy-notice" [params.version] # must be one of "unstable", "current", "historical" # this is used to decide whether to show a banner pointing to the current release -status = "unstable" +status = "stable" # A URL pointing to the latest, stable release of the spec. To be shown in the unstable version warning banner. current_version_url = "https://spec.matrix.org/latest" # The following is used when status = "stable", and is displayed in various UI elements on a released version # of the spec. CI will set these values here automatically when a release git tag (i.e `v1.5`) is created. -# major = "1" -# minor = "7" -# release_date = "May 25, 2023" +major = "1" +minor = "8" +release_date = "August 23, 2023" # User interface configuration [params.ui] From 529cbf4ffcf8c45c0d679a7c6b9bc533a57ec9cc Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Wed, 23 Aug 2023 09:24:08 -0600 Subject: [PATCH 011/268] Matrix 1.8 changelog --- .../newsfragments/1573.clarification | 1 - .../appendices/newsfragments/1583.feature | 1 - .../newsfragments/1584.clarification | 1 - .../client_server/newsfragments/1517.feature | 1 - .../newsfragments/1552.clarification | 1 - .../newsfragments/1563.clarification | 1 - .../newsfragments/1564.clarification | 1 - .../newsfragments/1578.clarification | 1 - .../newsfragments/1579.clarification | 1 - .../newsfragments/1590.clarification | 1 - .../newsfragments/1593.clarification | 1 - .../newsfragments/1597.clarification | 1 - .../newsfragments/1563.clarification | 1 - .../internal/newsfragments/1310.feature | 1 - .../internal/newsfragments/1542.clarification | 1 - .../internal/newsfragments/1549.clarification | 1 - .../internal/newsfragments/1551.clarification | 1 - .../internal/newsfragments/1556.clarification | 1 - .../internal/newsfragments/1558.clarification | 1 - .../internal/newsfragments/1561.clarification | 1 - .../internal/newsfragments/1562.clarification | 1 - .../internal/newsfragments/1582.clarification | 1 - .../internal/newsfragments/1585.clarification | 1 - .../internal/newsfragments/1591.clarification | 1 - .../internal/newsfragments/1598.clarification | 1 - .../internal/newsfragments/1601.clarification | 1 - .../internal/newsfragments/1620.feature | 1 - .../newsfragments/1604.feature.1 | 1 - .../newsfragments/1604.feature.2 | 1 - .../newsfragments/1604.feature.3 | 1 - .../newsfragments/1604.feature.4 | 1 - .../newsfragments/1604.feature.5 | 1 - .../newsfragments/1521.clarification | 1 - .../newsfragments/1559.clarification | 1 - .../newsfragments/1560.clarification | 1 - .../newsfragments/1563.clarification | 1 - .../newsfragments/1564.clarification | 1 - .../newsfragments/1578.clarification | 1 - .../newsfragments/1615.clarification | 1 - .../newsfragments/1623.clarification | 1 - .../newsfragments/1624.deprecation | 1 - .../server_server/newsfragments/1624.feature | 1 - content/changelog/v1.8.md | 122 ++++++++++++++++++ 43 files changed, 122 insertions(+), 42 deletions(-) delete mode 100644 changelogs/appendices/newsfragments/1573.clarification delete mode 100644 changelogs/appendices/newsfragments/1583.feature delete mode 100644 changelogs/application_service/newsfragments/1584.clarification delete mode 100644 changelogs/client_server/newsfragments/1517.feature delete mode 100644 changelogs/client_server/newsfragments/1552.clarification delete mode 100644 changelogs/client_server/newsfragments/1563.clarification delete mode 100644 changelogs/client_server/newsfragments/1564.clarification delete mode 100644 changelogs/client_server/newsfragments/1578.clarification delete mode 100644 changelogs/client_server/newsfragments/1579.clarification delete mode 100644 changelogs/client_server/newsfragments/1590.clarification delete mode 100644 changelogs/client_server/newsfragments/1593.clarification delete mode 100644 changelogs/client_server/newsfragments/1597.clarification delete mode 100644 changelogs/identity_service/newsfragments/1563.clarification delete mode 100644 changelogs/internal/newsfragments/1310.feature delete mode 100644 changelogs/internal/newsfragments/1542.clarification delete mode 100644 changelogs/internal/newsfragments/1549.clarification delete mode 100644 changelogs/internal/newsfragments/1551.clarification delete mode 100644 changelogs/internal/newsfragments/1556.clarification delete mode 100644 changelogs/internal/newsfragments/1558.clarification delete mode 100644 changelogs/internal/newsfragments/1561.clarification delete mode 100644 changelogs/internal/newsfragments/1562.clarification delete mode 100644 changelogs/internal/newsfragments/1582.clarification delete mode 100644 changelogs/internal/newsfragments/1585.clarification delete mode 100644 changelogs/internal/newsfragments/1591.clarification delete mode 100644 changelogs/internal/newsfragments/1598.clarification delete mode 100644 changelogs/internal/newsfragments/1601.clarification delete mode 100644 changelogs/internal/newsfragments/1620.feature delete mode 100644 changelogs/room_versions/newsfragments/1604.feature.1 delete mode 100644 changelogs/room_versions/newsfragments/1604.feature.2 delete mode 100644 changelogs/room_versions/newsfragments/1604.feature.3 delete mode 100644 changelogs/room_versions/newsfragments/1604.feature.4 delete mode 100644 changelogs/room_versions/newsfragments/1604.feature.5 delete mode 100644 changelogs/server_server/newsfragments/1521.clarification delete mode 100644 changelogs/server_server/newsfragments/1559.clarification delete mode 100644 changelogs/server_server/newsfragments/1560.clarification delete mode 100644 changelogs/server_server/newsfragments/1563.clarification delete mode 100644 changelogs/server_server/newsfragments/1564.clarification delete mode 100644 changelogs/server_server/newsfragments/1578.clarification delete mode 100644 changelogs/server_server/newsfragments/1615.clarification delete mode 100644 changelogs/server_server/newsfragments/1623.clarification delete mode 100644 changelogs/server_server/newsfragments/1624.deprecation delete mode 100644 changelogs/server_server/newsfragments/1624.feature create mode 100644 content/changelog/v1.8.md diff --git a/changelogs/appendices/newsfragments/1573.clarification b/changelogs/appendices/newsfragments/1573.clarification deleted file mode 100644 index 0d469652..00000000 --- a/changelogs/appendices/newsfragments/1573.clarification +++ /dev/null @@ -1 +0,0 @@ -Clarify spec re canonical JSON to handle negative-zero; also, give an example of negative-zero and a large power of ten. diff --git a/changelogs/appendices/newsfragments/1583.feature b/changelogs/appendices/newsfragments/1583.feature deleted file mode 100644 index 01f99804..00000000 --- a/changelogs/appendices/newsfragments/1583.feature +++ /dev/null @@ -1 +0,0 @@ -Allow `+` in Matrix IDs, as per [MSC4009](https://github.com/matrix-org/matrix-spec-proposals/pull/4009). diff --git a/changelogs/application_service/newsfragments/1584.clarification b/changelogs/application_service/newsfragments/1584.clarification deleted file mode 100644 index f6837db0..00000000 --- a/changelogs/application_service/newsfragments/1584.clarification +++ /dev/null @@ -1 +0,0 @@ -Fix type of custom `fields` in thirdparty lookup queries. diff --git a/changelogs/client_server/newsfragments/1517.feature b/changelogs/client_server/newsfragments/1517.feature deleted file mode 100644 index 0d49f4eb..00000000 --- a/changelogs/client_server/newsfragments/1517.feature +++ /dev/null @@ -1 +0,0 @@ -Require callers to be joined to the room to report its events, as per [MSC2249](https://github.com/matrix-org/matrix-spec-proposals/pull/2249). diff --git a/changelogs/client_server/newsfragments/1552.clarification b/changelogs/client_server/newsfragments/1552.clarification deleted file mode 100644 index 3f8cdbfb..00000000 --- a/changelogs/client_server/newsfragments/1552.clarification +++ /dev/null @@ -1 +0,0 @@ -Fix missing `type` property in the JSON schema definition of the `m.reaction` event. Contributed by @chebureki. diff --git a/changelogs/client_server/newsfragments/1563.clarification b/changelogs/client_server/newsfragments/1563.clarification deleted file mode 100644 index 1d6ef324..00000000 --- a/changelogs/client_server/newsfragments/1563.clarification +++ /dev/null @@ -1 +0,0 @@ -Make sure examples types match schema in definitions. diff --git a/changelogs/client_server/newsfragments/1564.clarification b/changelogs/client_server/newsfragments/1564.clarification deleted file mode 100644 index 59fcf699..00000000 --- a/changelogs/client_server/newsfragments/1564.clarification +++ /dev/null @@ -1 +0,0 @@ -Allow `null` in `room_types` in `POST /publicRooms` endpoints schemas. diff --git a/changelogs/client_server/newsfragments/1578.clarification b/changelogs/client_server/newsfragments/1578.clarification deleted file mode 100644 index 09e9dc70..00000000 --- a/changelogs/client_server/newsfragments/1578.clarification +++ /dev/null @@ -1 +0,0 @@ -Fix broken header formatting. Contributed by @midnightveil. diff --git a/changelogs/client_server/newsfragments/1579.clarification b/changelogs/client_server/newsfragments/1579.clarification deleted file mode 100644 index d53f2352..00000000 --- a/changelogs/client_server/newsfragments/1579.clarification +++ /dev/null @@ -1 +0,0 @@ -Render binary request and response bodies. diff --git a/changelogs/client_server/newsfragments/1590.clarification b/changelogs/client_server/newsfragments/1590.clarification deleted file mode 100644 index 1642357d..00000000 --- a/changelogs/client_server/newsfragments/1590.clarification +++ /dev/null @@ -1 +0,0 @@ -Fix description of MAC calculation in SAS verification. \ No newline at end of file diff --git a/changelogs/client_server/newsfragments/1593.clarification b/changelogs/client_server/newsfragments/1593.clarification deleted file mode 100644 index 2f6cbee6..00000000 --- a/changelogs/client_server/newsfragments/1593.clarification +++ /dev/null @@ -1 +0,0 @@ -Update link to SAS emoji definition data. diff --git a/changelogs/client_server/newsfragments/1597.clarification b/changelogs/client_server/newsfragments/1597.clarification deleted file mode 100644 index 3ccb2333..00000000 --- a/changelogs/client_server/newsfragments/1597.clarification +++ /dev/null @@ -1 +0,0 @@ -Fix various typos throughout the specification. diff --git a/changelogs/identity_service/newsfragments/1563.clarification b/changelogs/identity_service/newsfragments/1563.clarification deleted file mode 100644 index 1d6ef324..00000000 --- a/changelogs/identity_service/newsfragments/1563.clarification +++ /dev/null @@ -1 +0,0 @@ -Make sure examples types match schema in definitions. diff --git a/changelogs/internal/newsfragments/1310.feature b/changelogs/internal/newsfragments/1310.feature deleted file mode 100644 index 9aaa18b6..00000000 --- a/changelogs/internal/newsfragments/1310.feature +++ /dev/null @@ -1 +0,0 @@ -Upgrade Swagger data to OpenAPI 3.1. diff --git a/changelogs/internal/newsfragments/1542.clarification b/changelogs/internal/newsfragments/1542.clarification deleted file mode 100644 index 422a4eef..00000000 --- a/changelogs/internal/newsfragments/1542.clarification +++ /dev/null @@ -1 +0,0 @@ -Update the CI to validate the file extension of changelog entries. \ No newline at end of file diff --git a/changelogs/internal/newsfragments/1549.clarification b/changelogs/internal/newsfragments/1549.clarification deleted file mode 100644 index 67dbd67e..00000000 --- a/changelogs/internal/newsfragments/1549.clarification +++ /dev/null @@ -1 +0,0 @@ -Disclosure sections now only display their title when collapsed. diff --git a/changelogs/internal/newsfragments/1551.clarification b/changelogs/internal/newsfragments/1551.clarification deleted file mode 100644 index 9a2ecca5..00000000 --- a/changelogs/internal/newsfragments/1551.clarification +++ /dev/null @@ -1 +0,0 @@ -Fix the sidebar in recent versions of Hugo. diff --git a/changelogs/internal/newsfragments/1556.clarification b/changelogs/internal/newsfragments/1556.clarification deleted file mode 100644 index 05c5897e..00000000 --- a/changelogs/internal/newsfragments/1556.clarification +++ /dev/null @@ -1 +0,0 @@ -Bump jsonschema to validate JSON Schemas against Draft 2020-12. diff --git a/changelogs/internal/newsfragments/1558.clarification b/changelogs/internal/newsfragments/1558.clarification deleted file mode 100644 index 29e1c1d0..00000000 --- a/changelogs/internal/newsfragments/1558.clarification +++ /dev/null @@ -1 +0,0 @@ -Use Redocly CLI to validate OpenAPI definitions. diff --git a/changelogs/internal/newsfragments/1561.clarification b/changelogs/internal/newsfragments/1561.clarification deleted file mode 100644 index 6381ddf3..00000000 --- a/changelogs/internal/newsfragments/1561.clarification +++ /dev/null @@ -1 +0,0 @@ -Use tag name as the OpenAPI definition version. diff --git a/changelogs/internal/newsfragments/1562.clarification b/changelogs/internal/newsfragments/1562.clarification deleted file mode 100644 index 26a79ce2..00000000 --- a/changelogs/internal/newsfragments/1562.clarification +++ /dev/null @@ -1 +0,0 @@ -Make sure version in `x-changedInMatrixVersion` is a string. diff --git a/changelogs/internal/newsfragments/1582.clarification b/changelogs/internal/newsfragments/1582.clarification deleted file mode 100644 index 2f048a06..00000000 --- a/changelogs/internal/newsfragments/1582.clarification +++ /dev/null @@ -1 +0,0 @@ -Clarify usage of ABNF for grammar in the documentation style guide. diff --git a/changelogs/internal/newsfragments/1585.clarification b/changelogs/internal/newsfragments/1585.clarification deleted file mode 100644 index 5b26ae97..00000000 --- a/changelogs/internal/newsfragments/1585.clarification +++ /dev/null @@ -1 +0,0 @@ -Remove unnecessary `oneOf`s in JSON schemas. diff --git a/changelogs/internal/newsfragments/1591.clarification b/changelogs/internal/newsfragments/1591.clarification deleted file mode 100644 index 3ee889ff..00000000 --- a/changelogs/internal/newsfragments/1591.clarification +++ /dev/null @@ -1 +0,0 @@ -Update the version of Hugo used to render the spec to v0.113.0. diff --git a/changelogs/internal/newsfragments/1598.clarification b/changelogs/internal/newsfragments/1598.clarification deleted file mode 100644 index 1077e83c..00000000 --- a/changelogs/internal/newsfragments/1598.clarification +++ /dev/null @@ -1 +0,0 @@ -Fix rendered changelog with new version of towncrier. diff --git a/changelogs/internal/newsfragments/1601.clarification b/changelogs/internal/newsfragments/1601.clarification deleted file mode 100644 index 7d3b9b12..00000000 --- a/changelogs/internal/newsfragments/1601.clarification +++ /dev/null @@ -1 +0,0 @@ -Improve the layout of tables on desktop displays. Contributed by Martin Fischer. diff --git a/changelogs/internal/newsfragments/1620.feature b/changelogs/internal/newsfragments/1620.feature deleted file mode 100644 index c0b24326..00000000 --- a/changelogs/internal/newsfragments/1620.feature +++ /dev/null @@ -1 +0,0 @@ -Create `@matrix-org/spec` npm package to ship the SAS Emoji data definitions & translations. diff --git a/changelogs/room_versions/newsfragments/1604.feature.1 b/changelogs/room_versions/newsfragments/1604.feature.1 deleted file mode 100644 index 8408797d..00000000 --- a/changelogs/room_versions/newsfragments/1604.feature.1 +++ /dev/null @@ -1 +0,0 @@ -Add room version 11 as per [MSC3820](https://github.com/matrix-org/matrix-spec-proposals/pull/3820). diff --git a/changelogs/room_versions/newsfragments/1604.feature.2 b/changelogs/room_versions/newsfragments/1604.feature.2 deleted file mode 100644 index a941a25d..00000000 --- a/changelogs/room_versions/newsfragments/1604.feature.2 +++ /dev/null @@ -1 +0,0 @@ -Move `redacts` from top level to `content` on `m.room.redaction` events in room version 11, as per [MSC2174](https://github.com/matrix-org/matrix-spec-proposals/pull/2174). \ No newline at end of file diff --git a/changelogs/room_versions/newsfragments/1604.feature.3 b/changelogs/room_versions/newsfragments/1604.feature.3 deleted file mode 100644 index cffac893..00000000 --- a/changelogs/room_versions/newsfragments/1604.feature.3 +++ /dev/null @@ -1 +0,0 @@ -Remove `creator` from `m.room.creator` events in room version 11, as per [MSC2175](https://github.com/matrix-org/matrix-spec-proposals/pull/2175). \ No newline at end of file diff --git a/changelogs/room_versions/newsfragments/1604.feature.4 b/changelogs/room_versions/newsfragments/1604.feature.4 deleted file mode 100644 index 47c1057f..00000000 --- a/changelogs/room_versions/newsfragments/1604.feature.4 +++ /dev/null @@ -1 +0,0 @@ -Remove remaining usage of `origin` from events in room version 11, as per [MSC3989](https://github.com/matrix-org/matrix-spec-proposals/pull/3989). \ No newline at end of file diff --git a/changelogs/room_versions/newsfragments/1604.feature.5 b/changelogs/room_versions/newsfragments/1604.feature.5 deleted file mode 100644 index ba29bf74..00000000 --- a/changelogs/room_versions/newsfragments/1604.feature.5 +++ /dev/null @@ -1 +0,0 @@ -Update the redaction rules in room version 11, as per [MSC2176](https://github.com/matrix-org/matrix-spec-proposals/pull/2176) and [MSC3821](https://github.com/matrix-org/matrix-spec-proposals/pull/3821). \ No newline at end of file diff --git a/changelogs/server_server/newsfragments/1521.clarification b/changelogs/server_server/newsfragments/1521.clarification deleted file mode 100644 index 6c1ebf9d..00000000 --- a/changelogs/server_server/newsfragments/1521.clarification +++ /dev/null @@ -1 +0,0 @@ -Document why `/state_ids` can respond with a 404. diff --git a/changelogs/server_server/newsfragments/1559.clarification b/changelogs/server_server/newsfragments/1559.clarification deleted file mode 100644 index 4b8b060e..00000000 --- a/changelogs/server_server/newsfragments/1559.clarification +++ /dev/null @@ -1 +0,0 @@ -Fix response definition for `POST /_matrix/federation/v1/user/keys/claim`. diff --git a/changelogs/server_server/newsfragments/1560.clarification b/changelogs/server_server/newsfragments/1560.clarification deleted file mode 100644 index 8ee2452c..00000000 --- a/changelogs/server_server/newsfragments/1560.clarification +++ /dev/null @@ -1 +0,0 @@ -Fix examples in server keys definition. diff --git a/changelogs/server_server/newsfragments/1563.clarification b/changelogs/server_server/newsfragments/1563.clarification deleted file mode 100644 index 1d6ef324..00000000 --- a/changelogs/server_server/newsfragments/1563.clarification +++ /dev/null @@ -1 +0,0 @@ -Make sure examples types match schema in definitions. diff --git a/changelogs/server_server/newsfragments/1564.clarification b/changelogs/server_server/newsfragments/1564.clarification deleted file mode 100644 index 59fcf699..00000000 --- a/changelogs/server_server/newsfragments/1564.clarification +++ /dev/null @@ -1 +0,0 @@ -Allow `null` in `room_types` in `POST /publicRooms` endpoints schemas. diff --git a/changelogs/server_server/newsfragments/1578.clarification b/changelogs/server_server/newsfragments/1578.clarification deleted file mode 100644 index 09e9dc70..00000000 --- a/changelogs/server_server/newsfragments/1578.clarification +++ /dev/null @@ -1 +0,0 @@ -Fix broken header formatting. Contributed by @midnightveil. diff --git a/changelogs/server_server/newsfragments/1615.clarification b/changelogs/server_server/newsfragments/1615.clarification deleted file mode 100644 index 1f95cf69..00000000 --- a/changelogs/server_server/newsfragments/1615.clarification +++ /dev/null @@ -1 +0,0 @@ -Remove spurious mention of a "default port" with respect to SRV record lookup. diff --git a/changelogs/server_server/newsfragments/1623.clarification b/changelogs/server_server/newsfragments/1623.clarification deleted file mode 100644 index eab6c384..00000000 --- a/changelogs/server_server/newsfragments/1623.clarification +++ /dev/null @@ -1 +0,0 @@ -Switch to ordered list for server name resolution steps. diff --git a/changelogs/server_server/newsfragments/1624.deprecation b/changelogs/server_server/newsfragments/1624.deprecation deleted file mode 100644 index 4d8c481a..00000000 --- a/changelogs/server_server/newsfragments/1624.deprecation +++ /dev/null @@ -1 +0,0 @@ -Deprecate `matrix` SRV lookup steps during server discovery, as per [MSC4040](https://github.com/matrix-org/matrix-spec-proposals/pull/4040). \ No newline at end of file diff --git a/changelogs/server_server/newsfragments/1624.feature b/changelogs/server_server/newsfragments/1624.feature deleted file mode 100644 index 324bf07f..00000000 --- a/changelogs/server_server/newsfragments/1624.feature +++ /dev/null @@ -1 +0,0 @@ -Add `matrix-fed` SRV lookup steps to server discovery, as per [MSC4040](https://github.com/matrix-org/matrix-spec-proposals/pull/4040). \ No newline at end of file diff --git a/content/changelog/v1.8.md b/content/changelog/v1.8.md new file mode 100644 index 00000000..0d25f6a2 --- /dev/null +++ b/content/changelog/v1.8.md @@ -0,0 +1,122 @@ +--- +date: 2023-08-23T09:23:53-06:00 +--- + + +## v1.8 + + + + +
Git commithttps://github.com/matrix-org/matrix-spec/tree/v1.8
Release dateAugust 23, 2023
+ + + +### Client-Server API + +**Backwards Compatible Changes** + +- Require callers to be joined to the room to report its events, as per [MSC2249](https://github.com/matrix-org/matrix-spec-proposals/pull/2249). ([#1517](https://github.com/matrix-org/matrix-spec/issues/1517)) + +**Spec Clarifications** + +- Fix missing `type` property in the JSON schema definition of the `m.reaction` event. Contributed by @chebureki. ([#1552](https://github.com/matrix-org/matrix-spec/issues/1552)) +- Make sure examples types match schema in definitions. ([#1563](https://github.com/matrix-org/matrix-spec/issues/1563)) +- Allow `null` in `room_types` in `POST /publicRooms` endpoints schemas. ([#1564](https://github.com/matrix-org/matrix-spec/issues/1564)) +- Fix broken header formatting. Contributed by @midnightveil. ([#1578](https://github.com/matrix-org/matrix-spec/issues/1578)) +- Render binary request and response bodies. ([#1579](https://github.com/matrix-org/matrix-spec/issues/1579)) +- Fix description of MAC calculation in SAS verification. ([#1590](https://github.com/matrix-org/matrix-spec/issues/1590)) +- Update link to SAS emoji definition data. ([#1593](https://github.com/matrix-org/matrix-spec/issues/1593)) +- Fix various typos throughout the specification. ([#1597](https://github.com/matrix-org/matrix-spec/issues/1597)) + + +### Server-Server API + +**Deprecations** + +- Deprecate `matrix` SRV lookup steps during server discovery, as per [MSC4040](https://github.com/matrix-org/matrix-spec-proposals/pull/4040). ([#1624](https://github.com/matrix-org/matrix-spec/issues/1624)) + +**Backwards Compatible Changes** + +- Add `matrix-fed` SRV lookup steps to server discovery, as per [MSC4040](https://github.com/matrix-org/matrix-spec-proposals/pull/4040). ([#1624](https://github.com/matrix-org/matrix-spec/issues/1624)) + +**Spec Clarifications** + +- Document why `/state_ids` can respond with a 404. ([#1521](https://github.com/matrix-org/matrix-spec/issues/1521)) +- Fix response definition for `POST /_matrix/federation/v1/user/keys/claim`. ([#1559](https://github.com/matrix-org/matrix-spec/issues/1559)) +- Fix examples in server keys definition. ([#1560](https://github.com/matrix-org/matrix-spec/issues/1560)) +- Make sure examples types match schema in definitions. ([#1563](https://github.com/matrix-org/matrix-spec/issues/1563)) +- Allow `null` in `room_types` in `POST /publicRooms` endpoints schemas. ([#1564](https://github.com/matrix-org/matrix-spec/issues/1564)) +- Fix broken header formatting. Contributed by @midnightveil. ([#1578](https://github.com/matrix-org/matrix-spec/issues/1578)) +- Remove spurious mention of a "default port" with respect to SRV record lookup. ([#1615](https://github.com/matrix-org/matrix-spec/issues/1615)) +- Switch to ordered list for server name resolution steps. ([#1623](https://github.com/matrix-org/matrix-spec/issues/1623)) + + +### Application Service API + +**Spec Clarifications** + +- Fix type of custom `fields` in thirdparty lookup queries. ([#1584](https://github.com/matrix-org/matrix-spec/issues/1584)) + + +### Identity Service API + +**Spec Clarifications** + +- Make sure examples types match schema in definitions. ([#1563](https://github.com/matrix-org/matrix-spec/issues/1563)) + + +### Push Gateway API + +No significant changes. + + +### Room Versions + +**Backwards Compatible Changes** + +- Add room version 11 as per [MSC3820](https://github.com/matrix-org/matrix-spec-proposals/pull/3820). ([#1604](https://github.com/matrix-org/matrix-spec/issues/1604)) +- Move `redacts` from top level to `content` on `m.room.redaction` events in room version 11, as per [MSC2174](https://github.com/matrix-org/matrix-spec-proposals/pull/2174). ([#1604](https://github.com/matrix-org/matrix-spec/issues/1604)) +- Remove `creator` from `m.room.creator` events in room version 11, as per [MSC2175](https://github.com/matrix-org/matrix-spec-proposals/pull/2175). ([#1604](https://github.com/matrix-org/matrix-spec/issues/1604)) +- Remove remaining usage of `origin` from events in room version 11, as per [MSC3989](https://github.com/matrix-org/matrix-spec-proposals/pull/3989). ([#1604](https://github.com/matrix-org/matrix-spec/issues/1604)) +- Update the redaction rules in room version 11, as per [MSC2176](https://github.com/matrix-org/matrix-spec-proposals/pull/2176) and [MSC3821](https://github.com/matrix-org/matrix-spec-proposals/pull/3821). ([#1604](https://github.com/matrix-org/matrix-spec/issues/1604)) + + +### Appendices + +**Backwards Compatible Changes** + +- Allow `+` in Matrix IDs, as per [MSC4009](https://github.com/matrix-org/matrix-spec-proposals/pull/4009). ([#1583](https://github.com/matrix-org/matrix-spec/issues/1583)) + +**Spec Clarifications** + +- Clarify spec re canonical JSON to handle negative-zero; also, give an example of negative-zero and a large power of ten. ([#1573](https://github.com/matrix-org/matrix-spec/issues/1573)) + + +### Internal Changes/Tooling + +**Backwards Compatible Changes** + +- Upgrade Swagger data to OpenAPI 3.1. ([#1310](https://github.com/matrix-org/matrix-spec/issues/1310)) +- Create `@matrix-org/spec` npm package to ship the SAS Emoji data definitions & translations. ([#1620](https://github.com/matrix-org/matrix-spec/issues/1620)) + +**Spec Clarifications** + +- Update the CI to validate the file extension of changelog entries. ([#1542](https://github.com/matrix-org/matrix-spec/issues/1542)) +- Disclosure sections now only display their title when collapsed. ([#1549](https://github.com/matrix-org/matrix-spec/issues/1549)) +- Fix the sidebar in recent versions of Hugo. ([#1551](https://github.com/matrix-org/matrix-spec/issues/1551)) +- Bump jsonschema to validate JSON Schemas against Draft 2020-12. ([#1556](https://github.com/matrix-org/matrix-spec/issues/1556)) +- Use Redocly CLI to validate OpenAPI definitions. ([#1558](https://github.com/matrix-org/matrix-spec/issues/1558)) +- Use tag name as the OpenAPI definition version. ([#1561](https://github.com/matrix-org/matrix-spec/issues/1561)) +- Make sure version in `x-changedInMatrixVersion` is a string. ([#1562](https://github.com/matrix-org/matrix-spec/issues/1562)) +- Clarify usage of ABNF for grammar in the documentation style guide. ([#1582](https://github.com/matrix-org/matrix-spec/issues/1582)) +- Remove unnecessary `oneOf`s in JSON schemas. ([#1585](https://github.com/matrix-org/matrix-spec/issues/1585)) +- Update the version of Hugo used to render the spec to v0.113.0. ([#1591](https://github.com/matrix-org/matrix-spec/issues/1591)) +- Fix rendered changelog with new version of towncrier. ([#1598](https://github.com/matrix-org/matrix-spec/issues/1598)) +- Improve the layout of tables on desktop displays. Contributed by Martin Fischer. ([#1601](https://github.com/matrix-org/matrix-spec/issues/1601)) From ca456a4f53b5d580c2dad3089b5e37a717f5cd5c Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Wed, 23 Aug 2023 09:44:40 -0600 Subject: [PATCH 012/268] Reset for development --- config.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config.toml b/config.toml index 6da94b09..9377b1f3 100644 --- a/config.toml +++ b/config.toml @@ -47,14 +47,14 @@ privacy_policy = "https://matrix.org/legal/privacy-notice" [params.version] # must be one of "unstable", "current", "historical" # this is used to decide whether to show a banner pointing to the current release -status = "stable" +status = "unstable" # A URL pointing to the latest, stable release of the spec. To be shown in the unstable version warning banner. current_version_url = "https://spec.matrix.org/latest" # The following is used when status = "stable", and is displayed in various UI elements on a released version # of the spec. CI will set these values here automatically when a release git tag (i.e `v1.5`) is created. -major = "1" -minor = "8" -release_date = "August 23, 2023" +# major = "1" +# minor = "8" +# release_date = "August 23, 2023" # User interface configuration [params.ui] From a1b832960c60e00f32b8c810189f689dc2d2d493 Mon Sep 17 00:00:00 2001 From: heinrich5991 Date: Thu, 24 Aug 2023 08:11:47 +0200 Subject: [PATCH 013/268] Clarify that Unix timestamps disregard leap seconds since 1970 (#1627) Fixes #1626. --- .../appendices/newsfragments/1627.clarification | 1 + content/_index.md | 13 ++++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 changelogs/appendices/newsfragments/1627.clarification diff --git a/changelogs/appendices/newsfragments/1627.clarification b/changelogs/appendices/newsfragments/1627.clarification new file mode 100644 index 00000000..44775447 --- /dev/null +++ b/changelogs/appendices/newsfragments/1627.clarification @@ -0,0 +1 @@ +Clarify timestamp specification with respect to leap seconds. diff --git a/content/_index.md b/content/_index.md index 69832f2e..a8c53809 100644 --- a/content/_index.md +++ b/content/_index.md @@ -419,9 +419,16 @@ into the `m.` namespace. ### Timestamps -Unless otherwise stated, timestamps are measured as milliseconds since -the Unix epoch. Throughout the specification this may be referred to as -POSIX, Unix, or just "time in milliseconds". +Unless otherwise stated, timestamps are the number of milliseconds +elapsed since the unix epoch (1970-01-01 00:00:00 UTC), but not counting +leap seconds, so that each day is precisely 86,400,000 milliseconds. + +This means that timestamps can repeat during leap seconds. Most +programming languages provide timestamps in that format natively, e.g. +[ECMAScript](https://tc39.es/ecma262/multipage/numbers-and-dates.html#sec-time-values-and-time-range). +Throughout the specification this may be referred to as POSIX, +[Unix](https://en.wikipedia.org/wiki/Unix_time), or just "time in +milliseconds". ## Specification Versions From 5e938f2b839caaef1e68b598e65c23ceccc1b4f1 Mon Sep 17 00:00:00 2001 From: Patrick Cloke Date: Tue, 5 Sep 2023 09:38:05 -0400 Subject: [PATCH 014/268] Document .m.rule.suppress_edits push rule (MSC3958). (#1617) --- .../client_server/newsfragments/1617.feature | 1 + content/client-server-api/modules/push.md | 24 +++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 changelogs/client_server/newsfragments/1617.feature diff --git a/changelogs/client_server/newsfragments/1617.feature b/changelogs/client_server/newsfragments/1617.feature new file mode 100644 index 00000000..78f112e0 --- /dev/null +++ b/changelogs/client_server/newsfragments/1617.feature @@ -0,0 +1 @@ +Add the `m.rule.suppress_edits` default push rule from [MSC3958](https://github.com/matrix-org/matrix-spec-proposals/pull/3958). diff --git a/content/client-server-api/modules/push.md b/content/client-server-api/modules/push.md index d1855f58..23222ada 100644 --- a/content/client-server-api/modules/push.md +++ b/content/client-server-api/modules/push.md @@ -750,6 +750,30 @@ Definition: } ``` +**`.m.rule.suppress_edits`** + +{{% added-in v="1.9" %}} + +Suppresses notifications related to [event replacements](#event-replacements). + +Definition: + +```json +{ + "rule_id": ".m.rule.suppress_edits", + "default": true, + "enabled": true, + "conditions": [ + { + "kind": "event_property_is", + "key": "content.m\\.relates_to.rel_type", + "value": "m.replace" + } + ], + "actions": [] +} +``` + ##### Default Content Rules **`.m.rule.contains_user_name`** From 838dec272c9887dbf511ecfa341b32232796db33 Mon Sep 17 00:00:00 2001 From: Paarth Shah Date: Tue, 5 Sep 2023 07:29:54 -0700 Subject: [PATCH 015/268] Clarify that `via` is required for `m.space.parent` and `m.space.child` as per MSC1772. (#1618) --- changelogs/client_server/newsfragments/1618.clarification | 1 + data/event-schemas/schema/m.space.child.yaml | 2 ++ data/event-schemas/schema/m.space.parent.yaml | 2 ++ 3 files changed, 5 insertions(+) create mode 100644 changelogs/client_server/newsfragments/1618.clarification diff --git a/changelogs/client_server/newsfragments/1618.clarification b/changelogs/client_server/newsfragments/1618.clarification new file mode 100644 index 00000000..b8d5169d --- /dev/null +++ b/changelogs/client_server/newsfragments/1618.clarification @@ -0,0 +1 @@ +Clarify that the `via` property is required for `m.space.parent` and `m.space.child` as per MSC1772. Contributed by @PaarthShah. diff --git a/data/event-schemas/schema/m.space.child.yaml b/data/event-schemas/schema/m.space.child.yaml index feef0adc..c73d440f 100644 --- a/data/event-schemas/schema/m.space.child.yaml +++ b/data/event-schemas/schema/m.space.child.yaml @@ -34,6 +34,8 @@ properties: Optional (default `false`) flag to denote whether the child is "suggested" or of interest to members of the space. This is primarily intended as a rendering hint for clients to display the room differently, such as eagerly rendering them in the room list. + required: + - via type: object state_key: description: The child room ID being described. diff --git a/data/event-schemas/schema/m.space.parent.yaml b/data/event-schemas/schema/m.space.parent.yaml index ced24d70..fb633789 100644 --- a/data/event-schemas/schema/m.space.parent.yaml +++ b/data/event-schemas/schema/m.space.parent.yaml @@ -20,6 +20,8 @@ properties: When multiple `canonical` parents are found, the lowest parent when ordering by room ID lexicographically by Unicode code-points should be used. + required: + - via type: object state_key: description: The parent room ID. From 044a78730eac66a2b55ed1cf09dd32da80727b13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= <76261501+zecakeh@users.noreply.github.com> Date: Tue, 19 Sep 2023 16:39:07 +0200 Subject: [PATCH 016/268] Clarify that an `m.room.name` event with an absent `name` field is not expected behavior (#1639) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #1632 Signed-off-by: Kévin Commaille --- changelogs/client_server/newsfragments/1639.clarification | 1 + data/event-schemas/schema/m.room.name.yaml | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 changelogs/client_server/newsfragments/1639.clarification diff --git a/changelogs/client_server/newsfragments/1639.clarification b/changelogs/client_server/newsfragments/1639.clarification new file mode 100644 index 00000000..781cc2ca --- /dev/null +++ b/changelogs/client_server/newsfragments/1639.clarification @@ -0,0 +1 @@ +Clarify that an `m.room.name` event with an absent `name` field is not expected behavior. \ No newline at end of file diff --git a/data/event-schemas/schema/m.room.name.yaml b/data/event-schemas/schema/m.room.name.yaml index c9236de0..0b3b34dc 100644 --- a/data/event-schemas/schema/m.room.name.yaml +++ b/data/event-schemas/schema/m.room.name.yaml @@ -7,9 +7,8 @@ description: |- is a human-friendly string designed to be displayed to the end-user. The room name is not unique, as multiple rooms can have the same room name set. - A room with an `m.room.name` event with an absent, null, or empty - `name` field should be treated the same as a room with no `m.room.name` - event. + If a room has an `m.room.name` event with an absent, null, or empty `name` + field, it should be treated the same as a room with no `m.room.name` event. An event of this type is automatically created when creating a room using `/createRoom` with the `name` key. From 46447e02878cfb5523820a32cbc739592b169730 Mon Sep 17 00:00:00 2001 From: Mohit Kumar Patel <85980940+mohit1523@users.noreply.github.com> Date: Tue, 19 Sep 2023 20:29:58 +0530 Subject: [PATCH 017/268] add "case sensitive" to `/publicRooms` (#1638) --- changelogs/client_server/newsfragments/1638.feature | 1 + data/api/client-server/list_public_rooms.yaml | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 changelogs/client_server/newsfragments/1638.feature diff --git a/changelogs/client_server/newsfragments/1638.feature b/changelogs/client_server/newsfragments/1638.feature new file mode 100644 index 00000000..a90cc4dd --- /dev/null +++ b/changelogs/client_server/newsfragments/1638.feature @@ -0,0 +1 @@ +Add a note to the `/publicRooms` API that the server name is case sensitive. diff --git a/data/api/client-server/list_public_rooms.yaml b/data/api/client-server/list_public_rooms.yaml index ba816b06..678f52ad 100644 --- a/data/api/client-server/list_public_rooms.yaml +++ b/data/api/client-server/list_public_rooms.yaml @@ -154,7 +154,7 @@ paths: name: server description: |- The server to fetch the public room lists from. Defaults to the - local server. + local server. Case sensitive. schema: type: string responses: @@ -181,7 +181,7 @@ paths: name: server description: |- The server to fetch the public room lists from. Defaults to the - local server. + local server. Case sensitive. schema: type: string requestBody: From 96f88e035c64df14a4efdba10f541d59d3e6647e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= <76261501+zecakeh@users.noreply.github.com> Date: Tue, 19 Sep 2023 17:52:18 +0200 Subject: [PATCH 018/268] Fix schema of `m.receipt` EDU (#1636) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It was missing a nesting level for the user ID -> user read receipt map. Signed-off-by: Kévin Commaille --- .../newsfragments/1636.clarification | 1 + .../definitions/event-schemas/m.receipt.yaml | 72 ++++++++++--------- 2 files changed, 39 insertions(+), 34 deletions(-) create mode 100644 changelogs/server_server/newsfragments/1636.clarification diff --git a/changelogs/server_server/newsfragments/1636.clarification b/changelogs/server_server/newsfragments/1636.clarification new file mode 100644 index 00000000..9f39a014 --- /dev/null +++ b/changelogs/server_server/newsfragments/1636.clarification @@ -0,0 +1 @@ +Fix schema of `m.receipt` EDU. diff --git a/data/api/server-server/definitions/event-schemas/m.receipt.yaml b/data/api/server-server/definitions/event-schemas/m.receipt.yaml index bbc3ac67..0b064ff1 100644 --- a/data/api/server-server/definitions/event-schemas/m.receipt.yaml +++ b/data/api/server-server/definitions/event-schemas/m.receipt.yaml @@ -41,41 +41,45 @@ allOf: # on. At that point, m.read can become optional (maybe). "m.read": type: object - description: Read receipts for users in the room. - title: User Read Receipt - properties: - event_ids: - type: array - description: |- - The extremity event IDs that the user has read up to. - minItems: 1 - maxItems: 1 - items: - type: string - example: ['$read_this_event:matrix.org'] - data: - type: object - description: Metadata for the read receipt. - title: Read Receipt Metadata - properties: - ts: - type: integer - format: int64 - description: |- - A POSIX timestamp in milliseconds for when the user read - the event specified in the read receipt. - example: 1533358089009 - thread_id: - type: string - x-addedInMatrixVersion: "1.4" + description: |- + Read receipts for users in the room. The string key is the user + ID the receipt belongs to. + additionalProperties: + type: object + title: User Read Receipt + properties: + event_ids: + type: array + description: |- + The extremity event IDs that the user has read up to. + minItems: 1 + maxItems: 1 + items: + type: string + example: ['$read_this_event:matrix.org'] + data: + type: object + description: Metadata for the read receipt. + title: Read Receipt Metadata + properties: + ts: + type: integer + format: int64 description: |- - The root thread event's ID (or `main`) for which - thread this receipt is intended to be under. If - not specified, the read receipt is *unthreaded* - (default). - example: "$threadroot" - required: ['ts'] - required: ['event_ids', 'data'] + A POSIX timestamp in milliseconds for when the user read + the event specified in the read receipt. + example: 1533358089009 + thread_id: + type: string + x-addedInMatrixVersion: "1.4" + description: |- + The root thread event's ID (or `main`) for which + thread this receipt is intended to be under. If + not specified, the read receipt is *unthreaded* + (default). + example: "$threadroot" + required: ['ts'] + required: ['event_ids', 'data'] required: ['m.read'] example: { "!some_room:example.org": { From df3f0af5d4b89cf14ece827f01b52bab19f3a888 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= <76261501+zecakeh@users.noreply.github.com> Date: Tue, 19 Sep 2023 17:59:00 +0200 Subject: [PATCH 019/268] Fix schema of `m.mentions` object (#1635) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Kévin Commaille --- .../internal/newsfragments/1635.clarification | 1 + content/client-server-api/modules/mentions.md | 14 ++++++++++++++ data/api/client-server/definitions/m.mentions.yaml | 12 ++++-------- 3 files changed, 19 insertions(+), 8 deletions(-) create mode 100644 changelogs/internal/newsfragments/1635.clarification diff --git a/changelogs/internal/newsfragments/1635.clarification b/changelogs/internal/newsfragments/1635.clarification new file mode 100644 index 00000000..a5bd245c --- /dev/null +++ b/changelogs/internal/newsfragments/1635.clarification @@ -0,0 +1 @@ +Fix schema of `m.mentions` object. diff --git a/content/client-server-api/modules/mentions.md b/content/client-server-api/modules/mentions.md index 32309740..0cdbad77 100644 --- a/content/client-server-api/modules/mentions.md +++ b/content/client-server-api/modules/mentions.md @@ -13,6 +13,20 @@ the event to reference the entity being mentioned. {{% definition path="api/client-server/definitions/m.mentions" %}} +An event's content will then look like this: + +```json +{ + "body": "Hello Alice!", + "msgtype": "m.text", + "format": "org.matrix.custom.html", + "formatted_body": "Hello Alice!", + "m.mentions": { + "user_ids": ["@alice:example.org"] + } +} +``` + Additionally, see the [`.m.rule.is_user_mention`](#_m_rule_is_user_mention) and [`.m.rule.is_room_mention`](#_m_rule_is_room_mention) push rules. Users should not add their own Matrix ID to the `m.mentions` property as outgoing diff --git a/data/api/client-server/definitions/m.mentions.yaml b/data/api/client-server/definitions/m.mentions.yaml index 806897b4..271ee5c5 100644 --- a/data/api/client-server/definitions/m.mentions.yaml +++ b/data/api/client-server/definitions/m.mentions.yaml @@ -18,17 +18,13 @@ description: |- Describes whether the event mentions other users or the room. This is contained within the event's `content` alongside other fields for the relevant event type. example: { - "body": "Hello Alice!", - "msgtype": "m.text", - "format": "org.matrix.custom.html", - "formatted_body": "Hello Alice!", - "m.mentions": { - "user_ids": ["@alice:example.org"] - } + "user_ids": ["@alice:example.org"] } properties: user_ids: - type: string[] + type: array + items: + type: string description: A list of Matrix IDs of mentioned users. room: type: boolean From 99e2ff4927b56db927d52e82ff802b38f6fa8407 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= <76261501+zecakeh@users.noreply.github.com> Date: Tue, 19 Sep 2023 19:26:07 +0200 Subject: [PATCH 020/268] Replace all mentions of Swagger by OpenAPI (#1633) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Kévin Commaille --- .github/workflows/main.yml | 6 +- .gitignore | 2 +- README.md | 14 ++--- .../internal/newsfragments/1633.clarification | 1 + data/api/client-server/keys.yaml | 2 +- .../partials/json-schema/resolve-allof.html | 2 +- layouts/partials/openapi/render-api.html | 2 +- .../partials/openapi/render-operation.html | 2 +- .../partials/openapi/render-parameters.html | 2 +- layouts/partials/openapi/render-request.html | 4 +- .../partials/openapi/render-responses.html | 2 +- layouts/shortcodes/http-api.html | 4 +- openapi_extensions.md | 55 ++----------------- ...er-sources.py => check-openapi-sources.py} | 10 ++-- scripts/{dump-swagger.py => dump-openapi.py} | 9 ++- ...-http-server.py => openapi-http-server.py} | 10 ++-- ...gger-preview.html => openapi-preview.html} | 0 17 files changed, 40 insertions(+), 87 deletions(-) create mode 100644 changelogs/internal/newsfragments/1633.clarification rename scripts/{check-swagger-sources.py => check-openapi-sources.py} (96%) rename scripts/{dump-swagger.py => dump-openapi.py} (95%) rename scripts/{swagger-http-server.py => openapi-http-server.py} (89%) rename scripts/{swagger-preview.html => openapi-preview.html} (100%) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d836b100..4fc6a960 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -92,17 +92,17 @@ jobs: export RELEASE="unstable" fi # The output path matches the final deployment path at spec.matrix.org - scripts/dump-swagger.py \ + scripts/dump-openapi.py \ --base-url "https://spec.matrix.org${{ needs.calculate-baseurl.outputs.baseURL }}" \ --api application-service \ -r "$RELEASE" \ -o spec/application-service-api/api.json - scripts/dump-swagger.py \ + scripts/dump-openapi.py \ --base-url "https://spec.matrix.org${{ needs.calculate-baseurl.outputs.baseURL }}" \ --api client-server \ -r "$RELEASE" \ -o spec/client-server-api/api.json - scripts/dump-swagger.py \ + scripts/dump-openapi.py \ --base-url "https://spec.matrix.org${{ needs.calculate-baseurl.outputs.baseURL }}" \ --api push-gateway \ -r "$RELEASE" \ diff --git a/.gitignore b/.gitignore index c1a34c50..09afe2d8 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,7 @@ node_modules /data/msc /env* /resources -/scripts/swagger +/scripts/openapi /scripts/tmp /hugo-config.toml /public diff --git a/README.md b/README.md index 26d8f5c2..089bfe17 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ The Matrix spec is compiled with [Hugo](https://gohugo.io/) (a static site gener * `/data`: this can contain TOML, YAML, or JSON files. Files kept here are directly available to template code as [data objects](https://gohugo.io/templates/data-templates/), so templates don't need to load them from a file and - parse them. This is also where our Swagger/OpenAPI definitions and schemas are. + parse them. This is also where our OpenAPI definitions and schemas are. * `/layouts`: this contains [Hugo templates](https://gohugo.io/templates/). Some templates define the overall layout of a page: for example, whether it has header, footer, sidebar, and so on. @@ -52,7 +52,7 @@ Additionally, the following directories may be of interest: * `/data-definitions`: Bits of structured data consumable by Matrix implementations. * `/meta`: Documentation relating to the spec's processes that are otherwise untracked (release instructions, etc). * `/scripts`: Various scripts for generating the spec and validating its contents. -* `/packages`: Various packages for shipping spec files like OpenAPI/swagger bindings and data definitions. +* `/packages`: Various packages for shipping spec files like OpenAPI bindings and data definitions. ## Authoring changes to the spec @@ -87,13 +87,13 @@ steps for authoring changes to the specification and instead of `hugo serve` run spec to `/spec`. If you'd like to serve the spec off a path instead of a domain root (eg: `/unstable`), add `--baseURL "/unstable"` to the `hugo -d "spec"` command. -For building the swagger definitions, create a python3 virtualenv and activate it. Then run `pip install -r ./scripts/requirements.txt` -and finally `python ./scripts/dump-swagger.py` to generate it to `./scripts/swagger/api-docs.json`. To make use of the generated file, +For building the OpenAPI definitions, create a python3 virtualenv and activate it. Then run `pip install -r ./scripts/requirements.txt` +and finally `python ./scripts/dump-openapi.py` to generate it to `./scripts/openapi/api-docs.json`. To make use of the generated file, there are a number of options: -* You can open `./scripts/swagger-preview.html` in your browser, and then open the file by clicking on `Local JSON File`. -* You can run a local HTTP server by running `./scripts/swagger-http-server.py`, and then view the documentation by - opening `./scripts/swagger-preview.html` in your browser. +* You can open `./scripts/openapi-preview.html` in your browser, and then open the file by clicking on `Local JSON File`. +* You can run a local HTTP server by running `./scripts/openapi-http-server.py`, and then view the documentation by + opening `./scripts/openapi-preview.html` in your browser. ## Issue tracking diff --git a/changelogs/internal/newsfragments/1633.clarification b/changelogs/internal/newsfragments/1633.clarification new file mode 100644 index 00000000..64988279 --- /dev/null +++ b/changelogs/internal/newsfragments/1633.clarification @@ -0,0 +1 @@ +Replace all mentions of Swagger by OpenAPI. diff --git a/data/api/client-server/keys.yaml b/data/api/client-server/keys.yaml index cb8a11db..594d141d 100644 --- a/data/api/client-server/keys.yaml +++ b/data/api/client-server/keys.yaml @@ -40,7 +40,7 @@ paths: one_time_keys: # $ref: "definitions/one_time_keys.yaml" # XXX: We can't define an actual object here, so we have to hope - # that people will look at the swagger source or can figure it out + # that people will look at the OpenAPI source or can figure it out # from the other endpoints/example. type: object title: OneTimeKeys diff --git a/layouts/partials/json-schema/resolve-allof.html b/layouts/partials/json-schema/resolve-allof.html index c7ffda15..db8fc13a 100644 --- a/layouts/partials/json-schema/resolve-allof.html +++ b/layouts/partials/json-schema/resolve-allof.html @@ -1,6 +1,6 @@ {{/* - Resolves the `allOf` keyword (https://swagger.io/specification/v2/#composition-and-inheritance-polymorphism), + Resolves the `allOf` keyword (https://spec.openapis.org/oas/v3.1.0#composition-and-inheritance-polymorphism), given a JSON schema object. `allOf` is used to support a kind of inheritance for JSON schema objects. diff --git a/layouts/partials/openapi/render-api.html b/layouts/partials/openapi/render-api.html index db10b98c..8af18e97 100644 --- a/layouts/partials/openapi/render-api.html +++ b/layouts/partials/openapi/render-api.html @@ -2,7 +2,7 @@ Render an HTTP API, given: - * `api_data`: the OpenAPI/Swagger data + * `api_data`: the OpenAPI data * `base_url`: the base URL: that is, the part we glue onto the front of each value in `paths` to get a complete URL. * `path`: the directory under /data where we found this API definition. diff --git a/layouts/partials/openapi/render-operation.html b/layouts/partials/openapi/render-operation.html index 6486f39c..b3878664 100644 --- a/layouts/partials/openapi/render-operation.html +++ b/layouts/partials/openapi/render-operation.html @@ -4,7 +4,7 @@ * `method`: the method, e.g. GET, PUT * `endpoint`: the endpoint - * `operation_data`: the OpenAPI/Swagger data for the operation + * `operation_data`: the OpenAPI data for the operation * `path`: the path where this definition was found, to enable us to resolve "$ref" This template renders the operation as a `
` containing: diff --git a/layouts/partials/openapi/render-parameters.html b/layouts/partials/openapi/render-parameters.html index 0e643a25..925b0197 100644 --- a/layouts/partials/openapi/render-parameters.html +++ b/layouts/partials/openapi/render-parameters.html @@ -2,7 +2,7 @@ Render the parameters of a given type, given: - * `parameters`: OpenAPI/Swagger data specifying the parameters + * `parameters`: OpenAPI data specifying the parameters * `type`: the type of parameters to render: "header, ""path", "query" * `caption`: caption to use for the table diff --git a/layouts/partials/openapi/render-request.html b/layouts/partials/openapi/render-request.html index ce31943c..0771204b 100644 --- a/layouts/partials/openapi/render-request.html +++ b/layouts/partials/openapi/render-request.html @@ -2,8 +2,8 @@ Render the request part of a single HTTP API operation, given: - * `parameters`: OpenAPI/Swagger data specifying the parameters - * `request_body`: OpenAPI/Swagger data specifying the request body + * `parameters`: OpenAPI data specifying the parameters + * `request_body`: OpenAPI data specifying the request body * `path`: the path where this definition was found, to enable us to resolve "$ref" * `anchor_base`: a prefix to add to the HTML anchors generated for each object diff --git a/layouts/partials/openapi/render-responses.html b/layouts/partials/openapi/render-responses.html index 37538b6e..c0ee5279 100644 --- a/layouts/partials/openapi/render-responses.html +++ b/layouts/partials/openapi/render-responses.html @@ -2,7 +2,7 @@ Render the response part of a single HTTP API operation, given: - * `responses`: OpenAPI/Swagger data specifying the responses + * `responses`: OpenAPI data specifying the responses * `path`: the path where this definition was found, to enable us to resolve "$ref" * `anchor_base`: a prefix to add to the HTML anchors generated for each object diff --git a/layouts/shortcodes/http-api.html b/layouts/shortcodes/http-api.html index 2668b1ab..a3b706db 100644 --- a/layouts/shortcodes/http-api.html +++ b/layouts/shortcodes/http-api.html @@ -1,12 +1,12 @@ {{/* - This template is used to render an HTTP API, given an OpenAPI/Swagger definition. + This template is used to render an HTTP API, given an OpenAPI definition. It expects to be passed two parameters: * a `spec` parameter identifying the spec, which must be the name of a directory under /data/api - * an `api` parameter, identifying an OpenAPI/Swagger definition, + * an `api` parameter, identifying an OpenAPI definition, which is the name of a schema file under "data/api/$spec". The file extension is omitted. For example: diff --git a/openapi_extensions.md b/openapi_extensions.md index eba1121c..15b93adc 100644 --- a/openapi_extensions.md +++ b/openapi_extensions.md @@ -1,6 +1,6 @@ # OpenAPI Extensions -For some functionality that is not directly provided by the OpenAPI v2 +For some functionality that is not directly provided by the OpenAPI v3.1 specification, some extensions have been added that are to be consistent across the specification. The defined extensions are listed below. Extensions should not break parsers, however if extra functionality is required, aware @@ -12,56 +12,9 @@ To ease API design and management, the API definition is split across several files. Each of these files is self-contained valid OpenAPI. There is no single root file in the source tree as OpenAPI requires; this file -can be generated by `dump-swagger.py`. The script does not convert -the extensions described further in this document (`oneOf` and parameter -exploding) so there can be minor interoperability issues with tooling that -expects compliant Swagger. - -## Extensible Query Parameters - - - -If a unknown amount of query parameters can be added to a request, the `name` -must be `fields...`, with the trailing ellipses representing the possibility -of more fields. - -Example: - -``` - - in: query - name: fields... - type: string -``` - -## Using oneOf to provide type alternatives - - - -`oneOf` (available in JSON Schema and Swagger/OpenAPI v3 but not in v2) -is used in cases when a simpler type specification as a list of types -doesn't work, as in the following example: -``` - properties: - old: # compliant with old Swagger - type: - - string - - object # Cannot specify a schema here - new: # uses oneOf extension - oneOf: - - type: string - - type: object - title: CustomSchemaForTheWin - properties: - ... -``` - -## OpenAPI 3's "2xx" format for response codes - - - -In some cases, the schema will have HTTP response code definitions like -`2xx`, `3xx`, and `4xx`. These indicate that a response code within those -ranges (`2xx` = `200` to `299`) is valid for the schema. +can be generated by `dump-openapi.py`. The script does not convert +the extensions described further in this document so there can be minor +interoperability issues with tooling that expects compliant OpenAPI. ## Custom `x-addedInMatrixVersion` key diff --git a/scripts/check-swagger-sources.py b/scripts/check-openapi-sources.py similarity index 96% rename from scripts/check-swagger-sources.py rename to scripts/check-openapi-sources.py index 39e27f24..2fb8ad93 100755 --- a/scripts/check-swagger-sources.py +++ b/scripts/check-openapi-sources.py @@ -87,11 +87,11 @@ def check_response(filepath, request, code, response): ), e) -def check_swagger_file(filepath): +def check_openapi_file(filepath): with open(filepath) as f: - swagger = yaml.safe_load(f) + openapi = yaml.safe_load(f) - for path, path_api in swagger.get('paths', {}).items(): + for path, path_api in openapi.get('paths', {}).items(): for method, request_api in path_api.items(): request = "%s %s" % (method.upper(), path) @@ -169,7 +169,7 @@ if __name__ == '__main__': # Get the directory that this script is residing in script_directory = os.path.dirname(os.path.realpath(__file__)) - # Resolve the directory containing the swagger sources, + # Resolve the directory containing the OpenAPI sources, # relative to the script path source_files_directory = os.path.realpath(os.path.join(script_directory, "../data")) @@ -182,6 +182,6 @@ if __name__ == '__main__': path = os.path.join(root, filename) try: - check_swagger_file(path) + check_openapi_file(path) except Exception as e: raise ValueError("Error checking file %s" % (path,), e) diff --git a/scripts/dump-swagger.py b/scripts/dump-openapi.py similarity index 95% rename from scripts/dump-swagger.py rename to scripts/dump-openapi.py index ce97c4c3..1cc2279c 100755 --- a/scripts/dump-swagger.py +++ b/scripts/dump-openapi.py @@ -1,9 +1,8 @@ #!/usr/bin/env python3 -# dump-swagger reads all of the swagger API docs used in spec generation and -# outputs a JSON file which merges them all, for use as input to a swagger UI +# dump-openapi reads all of the OpenAPI docs used in spec generation and +# outputs a JSON file which merges them all, for use as input to an OpenAPI # viewer. -# See https://github.com/swagger-api/swagger-ui for details of swagger-ui. # Copyright 2016 OpenMarket Ltd # @@ -85,7 +84,7 @@ def edit_links(node, base_url): edit_links(item, base_url) parser = argparse.ArgumentParser( - "dump-swagger.py - assemble the Swagger specs into a single JSON file" + "dump-openapi.py - assemble the OpenAPI specs into a single JSON file" ) parser.add_argument( "--base-url", "-b", @@ -114,7 +113,7 @@ parser.add_argument( ) parser.add_argument( "-o", "--output", - default=os.path.join(scripts_dir, "swagger", "api-docs.json"), + default=os.path.join(scripts_dir, "openapi", "api-docs.json"), help="File to write the output to. Default: %(default)s" ) args = parser.parse_args() diff --git a/scripts/swagger-http-server.py b/scripts/openapi-http-server.py similarity index 89% rename from scripts/swagger-http-server.py rename to scripts/openapi-http-server.py index 06d764aa..1865e6c8 100755 --- a/scripts/swagger-http-server.py +++ b/scripts/openapi-http-server.py @@ -1,7 +1,7 @@ #!/usr/bin/env python -# Runs an HTTP server on localhost:8000 which will serve the generated swagger -# JSON so that it can be viewed in an online swagger UI. +# Runs an HTTP server on localhost:8000 which will serve the generated OpenAPI +# JSON so that it can be viewed in an online OpenAPI viewer. # Copyright 2016 OpenMarket Ltd # @@ -41,13 +41,13 @@ if __name__ == '__main__': help='TCP port to listen on (default: %(default)s)', ) parser.add_argument( - 'swagger_dir', nargs='?', - default=os.path.join(scripts_dir, 'swagger'), + 'openapi_dir', nargs='?', + default=os.path.join(scripts_dir, 'openapi'), help='directory to serve (default: %(default)s)', ) args = parser.parse_args() - os.chdir(args.swagger_dir) + os.chdir(args.openapi_dir) httpd = socketserver.TCPServer(("localhost", args.port), MyHTTPRequestHandler) diff --git a/scripts/swagger-preview.html b/scripts/openapi-preview.html similarity index 100% rename from scripts/swagger-preview.html rename to scripts/openapi-preview.html From f11c5600a2c1e3d441642714c392fb945ce128bc Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 26 Sep 2023 19:08:02 +0100 Subject: [PATCH 021/268] Fix npm package release automation (#1648) --- .github/workflows/release.yaml | 1 + changelogs/internal/newsfragments/1648.bugfix | 1 + 2 files changed, 2 insertions(+) create mode 100644 changelogs/internal/newsfragments/1648.bugfix diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index e4f4e536..0c3ae5a2 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -20,6 +20,7 @@ jobs: uses: actions/setup-node@v3 with: cache: "yarn" + cache-dependency-path: packages/npm/yarn.lock registry-url: "https://registry.npmjs.org" - name: 🔨 Install dependencies diff --git a/changelogs/internal/newsfragments/1648.bugfix b/changelogs/internal/newsfragments/1648.bugfix new file mode 100644 index 00000000..68bbd683 --- /dev/null +++ b/changelogs/internal/newsfragments/1648.bugfix @@ -0,0 +1 @@ +Fix github action workflow responsible for releasing of @matrix-org/spec package. From 5672bdbab7b7a9246a6097e777cb7785a14dea29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= <76261501+zecakeh@users.noreply.github.com> Date: Wed, 27 Sep 2023 14:29:14 +0200 Subject: [PATCH 022/268] Fix enum types in JSON schemas (#1634) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `type: enum` does not exist, as an enum can be of any type. Signed-off-by: Kévin Commaille --- changelogs/internal/newsfragments/1634.clarification | 1 + data/api/client-server/definitions/sso_login_flow.yaml | 2 +- .../definitions/event-schemas/m.device_list_update.yaml | 2 +- .../definitions/event-schemas/m.direct_to_device.yaml | 2 +- .../definitions/event-schemas/m.presence.yaml | 4 ++-- .../definitions/event-schemas/m.receipt.yaml | 2 +- .../definitions/event-schemas/m.signing_key_update.yaml | 2 +- .../definitions/event-schemas/m.typing.yaml | 2 +- layouts/partials/openapi/render-object-table.html | 9 +-------- 9 files changed, 10 insertions(+), 16 deletions(-) create mode 100644 changelogs/internal/newsfragments/1634.clarification diff --git a/changelogs/internal/newsfragments/1634.clarification b/changelogs/internal/newsfragments/1634.clarification new file mode 100644 index 00000000..b4d1ce39 --- /dev/null +++ b/changelogs/internal/newsfragments/1634.clarification @@ -0,0 +1 @@ +Fix enum types in JSON schemas. diff --git a/data/api/client-server/definitions/sso_login_flow.yaml b/data/api/client-server/definitions/sso_login_flow.yaml index ca2a6602..e30b18f9 100644 --- a/data/api/client-server/definitions/sso_login_flow.yaml +++ b/data/api/client-server/definitions/sso_login_flow.yaml @@ -15,7 +15,7 @@ type: object title: m.login.sso flow schema properties: type: - type: enum + type: string enum: ["m.login.sso"] description: The string `m.login.sso` example: "m.login.sso" diff --git a/data/api/server-server/definitions/event-schemas/m.device_list_update.yaml b/data/api/server-server/definitions/event-schemas/m.device_list_update.yaml index 81519e66..8bb8a7dd 100644 --- a/data/api/server-server/definitions/event-schemas/m.device_list_update.yaml +++ b/data/api/server-server/definitions/event-schemas/m.device_list_update.yaml @@ -31,7 +31,7 @@ allOf: - type: object properties: edu_type: - type: enum + type: string enum: ['m.device_list_update'] description: The string `m.device_list_update`. example: "m.device_list_update" diff --git a/data/api/server-server/definitions/event-schemas/m.direct_to_device.yaml b/data/api/server-server/definitions/event-schemas/m.direct_to_device.yaml index f628ebe0..6cb59fdd 100644 --- a/data/api/server-server/definitions/event-schemas/m.direct_to_device.yaml +++ b/data/api/server-server/definitions/event-schemas/m.direct_to_device.yaml @@ -23,7 +23,7 @@ allOf: - type: object properties: edu_type: - type: enum + type: string enum: ['m.direct_to_device'] description: The string `m.direct_to_device`. example: "m.direct_to_device" diff --git a/data/api/server-server/definitions/event-schemas/m.presence.yaml b/data/api/server-server/definitions/event-schemas/m.presence.yaml index 09d5d0d2..c79729e0 100644 --- a/data/api/server-server/definitions/event-schemas/m.presence.yaml +++ b/data/api/server-server/definitions/event-schemas/m.presence.yaml @@ -21,7 +21,7 @@ allOf: - type: object properties: edu_type: - type: enum + type: string enum: ['m.presence'] description: The string `m.presence` example: "m.presence" @@ -44,7 +44,7 @@ allOf: description: The user ID this presence EDU is for. example: "@john:matrix.org" presence: - type: enum + type: string enum: ['offline', 'unavailable', 'online'] description: The presence of the user. example: "online" diff --git a/data/api/server-server/definitions/event-schemas/m.receipt.yaml b/data/api/server-server/definitions/event-schemas/m.receipt.yaml index 0b064ff1..677dc28d 100644 --- a/data/api/server-server/definitions/event-schemas/m.receipt.yaml +++ b/data/api/server-server/definitions/event-schemas/m.receipt.yaml @@ -24,7 +24,7 @@ allOf: - type: object properties: edu_type: - type: enum + type: string enum: ['m.receipt'] description: The string `m.receipt` example: "m.receipt" diff --git a/data/api/server-server/definitions/event-schemas/m.signing_key_update.yaml b/data/api/server-server/definitions/event-schemas/m.signing_key_update.yaml index aea99fe0..0748bc35 100644 --- a/data/api/server-server/definitions/event-schemas/m.signing_key_update.yaml +++ b/data/api/server-server/definitions/event-schemas/m.signing_key_update.yaml @@ -23,7 +23,7 @@ allOf: - type: object properties: edu_type: - type: enum + type: string enum: ['m.signing_key_update'] description: The string `m.signing_update`. example: "m.signing_key_update" diff --git a/data/api/server-server/definitions/event-schemas/m.typing.yaml b/data/api/server-server/definitions/event-schemas/m.typing.yaml index 7f23bae1..fa36a871 100644 --- a/data/api/server-server/definitions/event-schemas/m.typing.yaml +++ b/data/api/server-server/definitions/event-schemas/m.typing.yaml @@ -20,7 +20,7 @@ allOf: - type: object properties: edu_type: - type: enum + type: string enum: ['m.typing'] description: The string `m.typing` example: "m.typing" diff --git a/layouts/partials/openapi/render-object-table.html b/layouts/partials/openapi/render-object-table.html index 0f5841a4..0de9d2d1 100644 --- a/layouts/partials/openapi/render-object-table.html +++ b/layouts/partials/openapi/render-object-table.html @@ -53,13 +53,6 @@ {{ $type = delimit (slice "[" $inner_type "]") "" }} {{ end }} - {{/* - If the property is an enum, indicate this. - */}} - {{ if (and (eq $property.type "string") ($property.enum)) }} - {{ $type = "enum" }} - {{ end }} - {{/* Handle two ways of indicating "required", one for simple parameters, the other for request and response body objects. @@ -72,7 +65,7 @@ {{ if $required }}Required: {{end -}} {{ $property.description | markdownify -}} - {{ if eq $type "enum"}}

One of: [{{ delimit $property.enum ", " }}].

{{ end -}} + {{ if $property.enum }}

One of: [{{ delimit $property.enum ", " }}].

{{ end -}} {{ if (index $property "x-addedInMatrixVersion") }}{{ partial "added-in" (dict "v" (index $property "x-addedInMatrixVersion")) }}{{ end -}} {{ if (index $property "x-changedInMatrixVersion") }}{{ partial "changed-in" (dict "changes_dict" (index $property "x-changedInMatrixVersion")) }}{{ end -}} From e40d9ca18676fc774b39f30b44998d7f0118596a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= <76261501+zecakeh@users.noreply.github.com> Date: Wed, 27 Sep 2023 14:42:14 +0200 Subject: [PATCH 023/268] Fix rendering of `m.receipt` event in Client-Server API (#1637) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... and other improvements Signed-off-by: Kévin Commaille Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> --- .../internal/newsfragments/1637.clarification | 1 + .../definitions/protocol.yaml | 1 - data/api/client-server/cross_signing.yaml | 4 +- data/event-schemas/schema/m.direct.yaml | 4 +- .../schema/m.ignored_user_list.yaml | 6 +- data/event-schemas/schema/m.receipt.yaml | 15 +- layouts/partials/events/render-event.html | 5 +- .../json-schema/resolve-additional-types.html | 54 +++--- .../partials/openapi/render-object-table.html | 160 ++++++++++++++---- layouts/partials/openapi/render-request.html | 1 - .../partials/openapi/render-responses.html | 1 - layouts/shortcodes/definition.html | 1 - 12 files changed, 184 insertions(+), 69 deletions(-) create mode 100644 changelogs/internal/newsfragments/1637.clarification diff --git a/changelogs/internal/newsfragments/1637.clarification b/changelogs/internal/newsfragments/1637.clarification new file mode 100644 index 00000000..018cd98f --- /dev/null +++ b/changelogs/internal/newsfragments/1637.clarification @@ -0,0 +1 @@ +Fix rendering of `m.receipt` event in Client-Server API. diff --git a/data/api/application-service/definitions/protocol.yaml b/data/api/application-service/definitions/protocol.yaml index f29d72e8..801faed1 100644 --- a/data/api/application-service/definitions/protocol.yaml +++ b/data/api/application-service/definitions/protocol.yaml @@ -41,7 +41,6 @@ properties: type: string example: "mxc://example.org/aBcDeFgH" field_types: - title: Field Types description: |- The type definitions for the fields defined in the `user_fields` and `location_fields`. Each entry in those arrays MUST have an entry here. The diff --git a/data/api/client-server/cross_signing.yaml b/data/api/client-server/cross_signing.yaml index 2f038e80..15d093c2 100644 --- a/data/api/client-server/cross_signing.yaml +++ b/data/api/client-server/cross_signing.yaml @@ -150,7 +150,6 @@ paths: description: |- Publishes cross-signing signatures for the user. - The request body is a map from user ID to key ID to signed JSON object. The signed JSON object must match the key previously uploaded or retrieved for the given key ID, with the exception of the `signatures` property, which contains the new signature(s) to add. @@ -162,7 +161,8 @@ paths: application/json: schema: type: object - title: Signatures + description: |- + A map of user ID to a map of key ID to signed JSON object. additionalProperties: type: object additionalProperties: diff --git a/data/event-schemas/schema/m.direct.yaml b/data/event-schemas/schema/m.direct.yaml index f00b83bc..3256b574 100644 --- a/data/event-schemas/schema/m.direct.yaml +++ b/data/event-schemas/schema/m.direct.yaml @@ -11,10 +11,12 @@ properties: content: additionalProperties: type: array - title: User ID items: type: string type: object + description: |- + The mapping of user ID to a list of room IDs of the 'direct' rooms for + that user ID. type: enum: - m.direct diff --git a/data/event-schemas/schema/m.ignored_user_list.yaml b/data/event-schemas/schema/m.ignored_user_list.yaml index 0f0b2f85..32cc6a46 100644 --- a/data/event-schemas/schema/m.ignored_user_list.yaml +++ b/data/event-schemas/schema/m.ignored_user_list.yaml @@ -10,12 +10,12 @@ properties: properties: ignored_users: type: object - title: "Ignored users" - description: "The map of users to ignore" + description: |- + The map of users to ignore. This is a mapping of user ID to empty + object. patternProperties: "^@": type: "object" - title: "Ignored User" description: "An empty object for future enhancement" x-pattern: "$USER_ID" required: diff --git a/data/event-schemas/schema/m.receipt.yaml b/data/event-schemas/schema/m.receipt.yaml index 6062d31f..702191d1 100644 --- a/data/event-schemas/schema/m.receipt.yaml +++ b/data/event-schemas/schema/m.receipt.yaml @@ -9,22 +9,24 @@ allOf: properties: content: type: object + description: |- + The mapping of event ID to a collection of receipts for this + event ID. The event ID is the ID of the event being acknowledged + and *not* an ID for the receipt itself. patternProperties: "^\\$": type: object x-pattern: "$EVENT_ID" - title: Receipts + title: Event Receipts description: |- - The mapping of event ID to a collection of receipts for this - event ID. The event ID is the ID of the event being acknowledged - and *not* an ID for the receipt itself. + The collection of receipts for this event ID. properties: "m.read": type: object - title: Users description: |- A collection of users who have sent `m.read` receipts for - this event. + this event. The string key is the user ID the receipt + belongs to. patternProperties: "^@": &receiptUserMap type: object @@ -48,7 +50,6 @@ properties: (default). "m.read.private": type: object - title: Own User description: |- Similar to `m.read`, the users who have sent `m.read.private` receipts for this event. Due to the nature of private read diff --git a/layouts/partials/events/render-event.html b/layouts/partials/events/render-event.html index 0f4d543d..70752721 100644 --- a/layouts/partials/events/render-event.html +++ b/layouts/partials/events/render-event.html @@ -56,7 +56,10 @@

Content

{{ $anchor_base := anchorize $event_name }} -{{ $additional_types := partial "json-schema/resolve-additional-types" (dict "schema" $event_data.properties.content "anchor_base" $anchor_base) }} +{{ $additional_types := partial "json-schema/resolve-additional-types" (dict + "schema" $event_data.properties.content + "anchor_base" $anchor_base +) }} {{ range $additional_types }} {{ partial "openapi/render-object-table" . }} diff --git a/layouts/partials/json-schema/resolve-additional-types.html b/layouts/partials/json-schema/resolve-additional-types.html index 449b4222..c5d420b6 100644 --- a/layouts/partials/json-schema/resolve-additional-types.html +++ b/layouts/partials/json-schema/resolve-additional-types.html @@ -1,6 +1,6 @@ {{/* - Finds and returns all nested objects, given a dict containing: + Finds and returns all objects, including nested ones, given a dict containing: * `schema`: a JSON schema object * `anchor_base`: a prefix to add to the HTML anchors generated for each object. If nil, no anchors are generated. * `name`: optionally, a name to use for this object in error/warning messages. If left unset, @@ -11,20 +11,20 @@ Assumes that "resolve-refs" and "resolve-allof" has already been called on the input schema. - Returns an array of all the objects found. For each object, the following properties are returned: + Returns an array of all the objects found. The first object keeps all its properties. For all other objects, the following properties are returned: * title * properties * required * enum * anchor: a string suitable for using as an html anchor for this object (if `anchor_base` was set, and the object has a title) - Note that the returned array may contain duplicate objects. + Note that the returned array contains only unique objects. */}} {{ $this_object := .schema }} {{ $anchor_base := .anchor_base }} -{{ $additional_objects := slice }} +{{ $all_objects := slice }} {{ $name := .name | default $this_object.title | default "" }} {{ if eq $this_object.type "object" }} @@ -34,31 +34,45 @@ {{ end }} {{/* - Add the object we were passed into the $additional_objects array + Add the object we were passed into the $all_objects array */}} - {{ $additional_objects = $additional_objects | append (partial "clean-object" $this_object) }} + {{ $all_objects = $all_objects | append $this_object }} {{/* Add any nested objects referenced in this object's `additionalProperties` */}} {{ if $this_object.additionalProperties }} {{ if reflect.IsMap $this_object.additionalProperties }} - {{ $additional_objects = partial "get-additional-objects" (dict + {{ $all_objects = partial "get-additional-objects" (dict "this_object" $this_object.additionalProperties - "additional_objects" $additional_objects + "all_objects" $all_objects "anchor_base" $anchor_base "name" (printf "%s.additional" $name) ) }} {{ end }} {{ end }} + {{/* + Add any nested objects referenced in this object's `patternProperties` + */}} + {{ if $this_object.patternProperties }} + {{ range $pattern, $object := $this_object.patternProperties}} + {{ $all_objects = partial "get-additional-objects" (dict + "this_object" $object + "all_objects" $all_objects + "anchor_base" $anchor_base + "name" (printf "%s.pattern.%s" $name $pattern) + ) }} + {{ end }} + {{ end }} + {{/* Add any nested objects referenced in this object's `properties` */}} {{ range $key, $property := $this_object.properties}} - {{ $additional_objects = partial "get-additional-objects" (dict + {{ $all_objects = partial "get-additional-objects" (dict "this_object" $property - "additional_objects" $additional_objects + "all_objects" $all_objects "anchor_base" $anchor_base "name" (printf "%s.%s" $name $key) ) }} @@ -72,17 +86,17 @@ */}} {{ if $this_object.items.anyOf }} {{ range $idx, $item := $this_object.items.anyOf }} - {{ $additional_objects = partial "get-additional-objects" (dict + {{ $all_objects = partial "get-additional-objects" (dict "this_object" $item - "additional_objects" $additional_objects + "all_objects" $all_objects "anchor_base" $anchor_base "name" (printf "%s.items[%d]" $name $idx) ) }} {{ end }} {{ else if reflect.IsMap $this_object.items}} - {{ $additional_objects = partial "get-additional-objects" (dict + {{ $all_objects = partial "get-additional-objects" (dict "this_object" $this_object.items - "additional_objects" $additional_objects + "all_objects" $all_objects "anchor_base" $anchor_base "name" (printf "%s.items" $name) ) }} @@ -97,16 +111,16 @@ */}} {{ if $this_object.oneOf }} {{ range $idx, $item := $this_object.oneOf }} - {{ $additional_objects = partial "get-additional-objects" (dict + {{ $all_objects = partial "get-additional-objects" (dict "this_object" $item - "additional_objects" $additional_objects + "all_objects" $all_objects "anchor_base" $anchor_base "name" (printf "%s.oneOf[%d]" $name $idx) ) }} {{ end }} {{ end }} -{{ return $additional_objects }} +{{ return uniq $all_objects }} {{/* @@ -116,7 +130,7 @@ {{/* .name is the name of the object for logging purposes */}} {{ $name := .name }} - {{ $additional_objects := .additional_objects }} + {{ $all_objects := .all_objects }} {{ if not (reflect.IsMap .this_object) }} {{ errorf "Invalid call to partials/get-additional-objects: %s is not a map" $name .this_object }} @@ -132,9 +146,9 @@ As far as I know we don't have something like Array.concat(), so add them one at a time */}} {{ range $more_objects}} - {{ $additional_objects = $additional_objects | append (partial "clean-object" .) }} + {{ $all_objects = $all_objects | append (partial "clean-object" .) }} {{ end }} - {{ return $additional_objects }} + {{ return $all_objects }} {{ end }} {{/* diff --git a/layouts/partials/openapi/render-object-table.html b/layouts/partials/openapi/render-object-table.html index 0de9d2d1..3d3cfbaa 100644 --- a/layouts/partials/openapi/render-object-table.html +++ b/layouts/partials/openapi/render-object-table.html @@ -6,10 +6,16 @@ * `anchor`: optional HTML element id for the table - * `properties`: dictionary of the properties to list, each given as: + * `properties`: optional dictionary of the properties to list, each given as: `property_name` : `property_data` - * `required`: array containing the names of required properties. + * `additionalProperties`: optional dictionary for properties with undefined + names, in the same format as `property_data` + + * `patternProperties`: optional dictionary for properties with names adhering + to a regex pattern, in the same format as `property_data` + + * `required`: optional array containing the names of required properties. In some cases (such as response body specifications) this isn't used, and instead properties have a `required` boolean attribute. We support this too. @@ -34,24 +40,6 @@ {{ range $property_name, $property := $properties }} {{ $property := partial "json-schema/resolve-allof" $property }} - {{ $type := $property.type }} - - {{ if or (eq $property.type "object") (and $property.oneOf (reflect.IsSlice .oneOf)) }} - {{ $type = partial "type-or-title" $property }} - {{ end }} - - {{/* - If the property is an array, indicate this with square brackets, - like `[type]`. - */}} - {{ if eq $property.type "array"}} - {{ $items := $property.items }} - {{ if $property.items }} - {{ $items = partial "json-schema/resolve-allof" $property.items }} - {{ end }} - {{ $inner_type := partial "type-or-title" $items }} - {{ $type = delimit (slice "[" $inner_type "]") "" }} - {{ end }} {{/* Handle two ways of indicating "required", one for simple parameters, @@ -61,25 +49,93 @@ {{ $property_name }} - {{ $type }} - - {{ if $required }}Required: {{end -}} - {{ $property.description | markdownify -}} - {{ if $property.enum }}

One of: [{{ delimit $property.enum ", " }}].

{{ end -}} - {{ if (index $property "x-addedInMatrixVersion") }}{{ partial "added-in" (dict "v" (index $property "x-addedInMatrixVersion")) }}{{ end -}} - {{ if (index $property "x-changedInMatrixVersion") }}{{ partial "changed-in" (dict "changes_dict" (index $property "x-changedInMatrixVersion")) }}{{ end -}} - + {{ partial "partials/property-type" $property }} + {{ partial "partials/property-description" (dict "property" $property "required" $required) }} {{ end }} +{{ else if (or .additionalProperties .patternProperties) }} + + {{ with $title }} + {{ . }} + {{ end }} + + Type + Description + + + {{ $property := partial "json-schema/resolve-allof" . }} + + + {{ partial "partials/property-type" $property }} + {{ partial "partials/property-description" (dict "property" $property) }} + + + {{ end }} {{/* - Picks either the `title` of a property, or the `type`, to turn into the rendered type field. - Also handles `additionalProperties`, if no `title` is present. + Computes the type to display for a property, given: + + * `type`: string or array of strings for the type(s) of the property + + * `title`: optional string for the title of the property + + * `oneOf`: optional array of dictionaries describing the different formats + that the property can have + + * `additionalProperties`: optional dictionary for properties with undefined + names + + * `patternProperties`: optional dictionary for properties with names + adhering to a regex pattern + + * `items`: if the type is an array, array of dictionaries describing the + format of the array's items +*/}} +{{ define "partials/property-type" }} + {{ $type := .type }} + + {{ if or (eq .type "object") (and .oneOf (reflect.IsSlice .oneOf)) }} + {{ $type = partial "type-or-title" . }} + {{ end }} + + {{/* + If the property is an array, indicate this with square brackets, + like `[type]`. + */}} + {{ if eq .type "array"}} + {{ $items := .items }} + {{ if .items }} + {{ $items = partial "json-schema/resolve-allof" .items }} + {{ end }} + {{ $inner_type := partial "type-or-title" $items }} + {{ $type = delimit (slice "[" $inner_type "]") "" }} + {{ end }} + + {{ return $type }} +{{ end }} + +{{/* + Computes the type to display for a property's schema, given: + + * `type`: string or array of strings for the type(s) of the property + + * `title`: optional string for the title of the property + + * `oneOf`: optional array of dictionaries describing the different formats + that the property can have + + * `additionalProperties`: optional dictionary for properties with undefined + names + + * `patternProperties`: optional dictionary for properties with names + adhering to a regex pattern + + The title has a higher priority than anything else. */}} {{ define "partials/type-or-title" }} {{ $type := "" }} @@ -94,7 +150,24 @@ If the property uses `additionalProperties` to describe its internal structure, handle this with a bit of recursion */}} - {{ $type = delimit (slice "{string: " (partial "type-or-title" .additionalProperties) "}" ) "" }} + {{ $additionalProperties := partial "json-schema/resolve-allof" .additionalProperties }} + {{ $type = delimit (slice "{string: " (partial "property-type" $additionalProperties) "}" ) "" }} + {{ else if reflect.IsMap .patternProperties }} + {{/* + If the property uses `patternProperties` to describe its + internal structure, handle this with a bit of recursion. + Note that we ignore the pattern as the current definitions + always have a single pattern, but we might need to handle + them later to differentiate schemas according to patterns. + */}} + {{ $types := slice }} + + {{ range $pattern, $schema := .patternProperties}} + {{ $schema = partial "json-schema/resolve-allof" $schema }} + {{ $types = $types | append (partial "property-type" $schema) }} + {{ end }} + + {{ $type = delimit (slice "{string: " (delimit $types "|") "}" ) "" }} {{ else if reflect.IsSlice .type }} {{/* It's legal to specify an array of types. Join them together in that case */}} @@ -123,3 +196,28 @@ {{ end }} {{ return $type }} {{ end }} + +{{/* + Computes the description to display for a property, given: + + * `required`: boolean indicating whether this property is required. + + * `property`: dictionary describing the property's data, with these fields: + + * `description`: string describing the property + + * `enum`: optional array indicating the accepted values for the property + + * `x-addedInMatrixVersion`: optional string indicating in which Matrix + spec version this property was added. + + * `x-changedInMatrixVersion`: optional string indicating in which Matrix + spec version this property was last changed. +*/}} +{{ define "partials/property-description" }} + {{ if .required }}Required: {{end -}} + {{ .property.description | markdownify -}} + {{ if .property.enum }}

One of: [{{ delimit .property.enum ", " }}].

{{ end -}} + {{ if (index .property "x-addedInMatrixVersion") }}{{ partial "added-in" (dict "v" (index .property "x-addedInMatrixVersion")) }}{{ end -}} + {{ if (index .property "x-changedInMatrixVersion") }}{{ partial "changed-in" (dict "changes_dict" (index .property "x-changedInMatrixVersion")) }}{{ end -}} +{{ end }} \ No newline at end of file diff --git a/layouts/partials/openapi/render-request.html b/layouts/partials/openapi/render-request.html index 0771204b..3d4b0381 100644 --- a/layouts/partials/openapi/render-request.html +++ b/layouts/partials/openapi/render-request.html @@ -46,7 +46,6 @@ {{ $schema := partial "json-schema/resolve-allof" $schema }} {{ $additional_types := partial "json-schema/resolve-additional-types" (dict "schema" $schema "anchor_base" $anchor_base) }} - {{ $additional_types = uniq $additional_types }} {{ range $additional_types }} {{ partial "openapi/render-object-table" . }} {{ end }} diff --git a/layouts/partials/openapi/render-responses.html b/layouts/partials/openapi/render-responses.html index c0ee5279..99662ad0 100644 --- a/layouts/partials/openapi/render-responses.html +++ b/layouts/partials/openapi/render-responses.html @@ -81,7 +81,6 @@ objects or arrays.) */}} {{ $additional_types := partial "json-schema/resolve-additional-types" (dict "schema" $schema "anchor_base" $anchor_base) }} - {{ $additional_types = uniq $additional_types }} {{ range $additional_types }} {{ partial "openapi/render-object-table" . }} {{ end }} diff --git a/layouts/shortcodes/definition.html b/layouts/shortcodes/definition.html index 67cd63c0..0699ff7b 100644 --- a/layouts/shortcodes/definition.html +++ b/layouts/shortcodes/definition.html @@ -51,7 +51,6 @@ {{ $additional_types := partial "json-schema/resolve-additional-types" (dict "schema" $definition "name" (printf "\"%s\"" $path)) }} -{{ $additional_types = uniq $additional_types }} {{ range $additional_types }} {{ partial "openapi/render-object-table" . }} From 92cf662e3a2b811acff04787bd06edc370627bdf Mon Sep 17 00:00:00 2001 From: tsufeki Date: Mon, 2 Oct 2023 14:13:23 +0200 Subject: [PATCH 024/268] Fix typo in canonical JSON grammar (#1652) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Benedykt Błaszkiewicz --- changelogs/appendices/newsfragments/1652.clarification | 1 + content/appendices.md | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 changelogs/appendices/newsfragments/1652.clarification diff --git a/changelogs/appendices/newsfragments/1652.clarification b/changelogs/appendices/newsfragments/1652.clarification new file mode 100644 index 00000000..488b7e2b --- /dev/null +++ b/changelogs/appendices/newsfragments/1652.clarification @@ -0,0 +1 @@ +Fix typo in canonical JSON grammar. diff --git a/content/appendices.md b/content/appendices.md index 59c1b1c3..a5ddb7bf 100644 --- a/content/appendices.md +++ b/content/appendices.md @@ -136,12 +136,12 @@ removing insignificant whitespace, fractions, exponents and redundant character escapes. value = false / null / true / object / array / number / string - false = %x66.61.6c.73.65 - null = %x6e.75.6c.6c + false = %x66.61.6C.73.65 + null = %x6E.75.6C.6C true = %x74.72.75.65 - object = %x7B [ member *( %x2C member ) ] %7D + object = %x7B [ member *( %x2C member ) ] %x7D member = string %x3A value - array = %x5B [ value *( %x2C value ) ] %5B + array = %x5B [ value *( %x2C value ) ] %x5D number = [ %x2D ] int int = %x30 / ( %x31-39 *digit ) digit = %x30-39 From 9a9221d8efc0d17395aa4bcf5d82e1431feae55f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= <76261501+zecakeh@users.noreply.github.com> Date: Tue, 3 Oct 2023 22:55:37 +0200 Subject: [PATCH 025/268] Fix schemas used for account data and presence events in `GET /initialSync` (#1647) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Kévin Commaille --- .../client_server/newsfragments/1647.clarification | 1 + data/api/client-server/old_sync.yaml | 9 +++------ 2 files changed, 4 insertions(+), 6 deletions(-) create mode 100644 changelogs/client_server/newsfragments/1647.clarification diff --git a/changelogs/client_server/newsfragments/1647.clarification b/changelogs/client_server/newsfragments/1647.clarification new file mode 100644 index 00000000..d7c9a685 --- /dev/null +++ b/changelogs/client_server/newsfragments/1647.clarification @@ -0,0 +1 @@ +Fix schemas used for account data and presence events in `GET /initialSync`. diff --git a/data/api/client-server/old_sync.yaml b/data/api/client-server/old_sync.yaml index 540c97c7..2d1e4f61 100644 --- a/data/api/client-server/old_sync.yaml +++ b/data/api/client-server/old_sync.yaml @@ -137,7 +137,7 @@ paths: type: array description: A list of presence events. items: - $ref: definitions/client_event.yaml + $ref: ../../event-schemas/schema/core-event-schema/event.yaml rooms: type: array items: @@ -219,7 +219,7 @@ paths: The private data that this user has attached to this room. items: - $ref: definitions/client_event.yaml + $ref: ../../event-schemas/schema/core-event-schema/event.yaml required: - room_id - membership @@ -227,10 +227,7 @@ paths: type: array description: The global private data created by this user. items: - title: Event - type: object - allOf: - - $ref: ../../event-schemas/schema/core-event-schema/event.yaml + $ref: ../../event-schemas/schema/core-event-schema/event.yaml required: - end - rooms From c3098cc55c1b809f5e1658f222449a32608171cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= <76261501+zecakeh@users.noreply.github.com> Date: Tue, 3 Oct 2023 22:56:44 +0200 Subject: [PATCH 026/268] Remove required 'fieldname' in Protocol definition (#1646) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Kévin Commaille --- changelogs/application_service/newsfragments/1646.clarification | 1 + data/api/application-service/definitions/protocol.yaml | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 changelogs/application_service/newsfragments/1646.clarification diff --git a/changelogs/application_service/newsfragments/1646.clarification b/changelogs/application_service/newsfragments/1646.clarification new file mode 100644 index 00000000..7779bf73 --- /dev/null +++ b/changelogs/application_service/newsfragments/1646.clarification @@ -0,0 +1 @@ +Remove required `fieldname` in Protocol definition. \ No newline at end of file diff --git a/data/api/application-service/definitions/protocol.yaml b/data/api/application-service/definitions/protocol.yaml index 801faed1..c442a1b1 100644 --- a/data/api/application-service/definitions/protocol.yaml +++ b/data/api/application-service/definitions/protocol.yaml @@ -63,7 +63,6 @@ properties: description: An placeholder serving as a valid example of the field value. type: string required: ['regexp', 'placeholder'] - required: ['fieldname'] example: { "network": { "regexp": "([a-z0-9]+\\.)*[a-z0-9]+", From 242b62ed55be9b52368e43e83c678b747ebf9f0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= <76261501+zecakeh@users.noreply.github.com> Date: Tue, 3 Oct 2023 23:16:53 +0200 Subject: [PATCH 027/268] Fix `m.call.negotiate` schema and example (#1546) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix m.call.negotiate schema and example Signed-off-by: Kévin Commaille * Add changelog Signed-off-by: Kévin Commaille * Add lifetime back Signed-off-by: Kévin Commaille * Fix lifetime description Signed-off-by: Kévin Commaille --------- Signed-off-by: Kévin Commaille --- .../client_server/newsfragments/1546.clarification | 1 + data/event-schemas/examples/m.call.negotiate.yaml | 2 +- data/event-schemas/schema/m.call.negotiate.yaml | 13 ++++++------- 3 files changed, 8 insertions(+), 8 deletions(-) create mode 100644 changelogs/client_server/newsfragments/1546.clarification diff --git a/changelogs/client_server/newsfragments/1546.clarification b/changelogs/client_server/newsfragments/1546.clarification new file mode 100644 index 00000000..d73f43f5 --- /dev/null +++ b/changelogs/client_server/newsfragments/1546.clarification @@ -0,0 +1 @@ +Fix `m.call.negotiate` schema and example. diff --git a/data/event-schemas/examples/m.call.negotiate.yaml b/data/event-schemas/examples/m.call.negotiate.yaml index f4ad8587..fabb6add 100644 --- a/data/event-schemas/examples/m.call.negotiate.yaml +++ b/data/event-schemas/examples/m.call.negotiate.yaml @@ -6,7 +6,7 @@ "party_id": "67890", "call_id": "12345", "lifetime": 10000, - "offer": { + "description": { "type" : "offer", "sdp" : "v=0\r\no=- 6584580628695956864 2 IN IP4 127.0.0.1[...]" } diff --git a/data/event-schemas/schema/m.call.negotiate.yaml b/data/event-schemas/schema/m.call.negotiate.yaml index abc5ef1d..b2b47c1d 100644 --- a/data/event-schemas/schema/m.call.negotiate.yaml +++ b/data/event-schemas/schema/m.call.negotiate.yaml @@ -42,15 +42,16 @@ properties: allOf: - "$ref": core-event-schema/call_event.yaml properties: - offer: + description: type: object - title: Offer + title: Description description: The session description object properties: type: type: string enum: - offer + - answer description: The type of session description. sdp: type: string @@ -60,12 +61,10 @@ properties: - sdp lifetime: type: integer - description: The time in milliseconds that the invite is valid for. - Once the invite age exceeds this value, clients should discard it. - They should also no longer show the call as awaiting an answer in the - UI. + description: The time in milliseconds that the negotiation is valid for. + Once the negotiation age exceeds this value, clients should discard it. required: - - offer + - description - lifetime type: type: string From 72517c0f9cd4bf3a2093a17a0c0d5b2538bf7bdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= <76261501+zecakeh@users.noreply.github.com> Date: Tue, 10 Oct 2023 19:21:38 +0200 Subject: [PATCH 028/268] Generate server-server OpenAPI definition (#1657) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Kévin Commaille --- .github/workflows/main.yml | 5 +++++ changelogs/internal/newsfragments/1657.feature | 1 + 2 files changed, 6 insertions(+) create mode 100644 changelogs/internal/newsfragments/1657.feature diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4fc6a960..0bdf4155 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -107,6 +107,11 @@ jobs: --api push-gateway \ -r "$RELEASE" \ -o spec/push-gateway-api/api.json + scripts/dump-openapi.py \ + --base-url "https://spec.matrix.org${{ needs.calculate-baseurl.outputs.baseURL }}" \ + --api server-server \ + -r "$RELEASE" \ + -o spec/server-server-api/api.json tar -czf openapi.tar.gz spec - name: "📤 Artifact upload" uses: actions/upload-artifact@v2 diff --git a/changelogs/internal/newsfragments/1657.feature b/changelogs/internal/newsfragments/1657.feature new file mode 100644 index 00000000..c5d8155d --- /dev/null +++ b/changelogs/internal/newsfragments/1657.feature @@ -0,0 +1 @@ +Generate server-server OpenAPI definition. From 7fb9e99071953e3d458c5d35c6bfb7ac737e5e58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=BD=D0=B0=D0=B1?= Date: Wed, 11 Oct 2023 08:06:06 +0200 Subject: [PATCH 029/268] annotion (#1658) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ahelenia Ziemiańska --- changelogs/client_server/newsfragments/1658.clarification | 1 + content/client-server-api/modules/event_annotations.md | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changelogs/client_server/newsfragments/1658.clarification diff --git a/changelogs/client_server/newsfragments/1658.clarification b/changelogs/client_server/newsfragments/1658.clarification new file mode 100644 index 00000000..3ccb2333 --- /dev/null +++ b/changelogs/client_server/newsfragments/1658.clarification @@ -0,0 +1 @@ +Fix various typos throughout the specification. diff --git a/content/client-server-api/modules/event_annotations.md b/content/client-server-api/modules/event_annotations.md index 661d8001..6bcfb95d 100644 --- a/content/client-server-api/modules/event_annotations.md +++ b/content/client-server-api/modules/event_annotations.md @@ -14,7 +14,7 @@ event with the corresponding emoji (👍). Another potential usage is to allow bots to send an event indicating the success or failure of a command. Along with the normal properties `event_id` and `rel_type`, an `m.relates_to` -property with `rel_type: m.annotion` should contain a `key` that indicates the +property with `rel_type: m.annotation` should contain a `key` that indicates the annotation being applied. For example, when reacting with emojis, the key contains the emoji being used. From c71b528148c55913ecfb87e3afcf944a9b1e856f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= <76261501+zecakeh@users.noreply.github.com> Date: Wed, 11 Oct 2023 12:23:16 +0200 Subject: [PATCH 030/268] Upgrade GitHub actions (#1660) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Upgrade most github actions Gets rid of warning in CI complaining about those actions using node 12. Signed-off-by: Kévin Commaille * Upgrade node version used to run scripts Use the latest LTS Signed-off-by: Kévin Commaille * Add changelog Signed-off-by: Kévin Commaille --- .github/workflows/checks.yaml | 2 +- .github/workflows/main.yml | 44 +++++++++---------- .github/workflows/netlify.yaml | 6 +-- .github/workflows/release.yaml | 2 +- .github/workflows/spell-check.yaml | 2 +- .../internal/newsfragments/1660.clarification | 1 + 6 files changed, 29 insertions(+), 28 deletions(-) create mode 100644 changelogs/internal/newsfragments/1660.clarification diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml index 083d6831..694962d1 100644 --- a/.github/workflows/checks.yaml +++ b/.github/workflows/checks.yaml @@ -10,7 +10,7 @@ jobs: if: github.event_name == 'pull_request' runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 0 - run: scripts/check-newsfragments diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0bdf4155..c28a3329 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,11 +18,11 @@ jobs: runs-on: ubuntu-latest steps: - name: "📥 Source checkout" - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: "➕ Setup Node" - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: - node-version: '14' + node-version: '18' - name: "🔎 Run validator" run: | npx @redocly/cli@latest lint data/api/*/*.yaml @@ -32,7 +32,7 @@ jobs: runs-on: ubuntu-latest steps: - name: "📥 Source checkout" - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: "➕ Setup Python" uses: actions/setup-python@v4 with: @@ -74,7 +74,7 @@ jobs: needs: [calculate-baseurl] steps: - name: "📥 Source checkout" - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: "➕ Setup Python" uses: actions/setup-python@v4 with: @@ -114,7 +114,7 @@ jobs: -o spec/server-server-api/api.json tar -czf openapi.tar.gz spec - name: "📤 Artifact upload" - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: openapi-artifact path: openapi.tar.gz @@ -126,7 +126,7 @@ jobs: runs-on: ubuntu-latest steps: - name: "📥 Source checkout" - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: "➕ Setup Python" uses: actions/setup-python@v4 - name: "➕ Install towncrier" @@ -134,7 +134,7 @@ jobs: - name: "Generate changelog" run: ./scripts/generate-changelog.sh vUNSTABLE - name: "📤 Artifact upload" - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: changelog-artifact path: content/changelog/vUNSTABLE.md @@ -147,16 +147,16 @@ jobs: if: ${{ always() }} steps: - name: "➕ Setup Node" - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: - node-version: '14' + node-version: '18' - name: "➕ Setup Hugo" - uses: peaceiris/actions-hugo@c03b5dbed22245418539b65eb9a3b1d5fdd9a0a6 + uses: peaceiris/actions-hugo@16361eb4acea8698b220b76c0d4e84e1fd22c61d with: hugo-version: '0.113.0' extended: true - name: "📥 Source checkout" - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: "⚙️ npm" run: | npm i @@ -174,7 +174,7 @@ jobs: # https://spec.matrix.org/latest/client-server-api/api.json # Works for /unstable/ and /v1.1/ as well. - name: "📥 Spec definition download" - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: openapi-artifact - name: "📝 Unpack the OpenAPI definitions in the right location" @@ -184,7 +184,7 @@ jobs: - name: "📦 Tarball creation" run: tar -czf spec.tar.gz spec - name: "📤 Artifact upload" - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: spec-artifact path: spec.tar.gz @@ -195,10 +195,10 @@ jobs: needs: [calculate-baseurl, build-spec] steps: - name: "📥 Source checkout" - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: "📥 Fetch built spec" - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: spec-artifact @@ -224,16 +224,16 @@ jobs: if: ${{ startsWith(github.ref, 'refs/tags/') }} steps: - name: "➕ Setup Node" - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: - node-version: '14' + node-version: '18' - name: "➕ Setup Hugo" - uses: peaceiris/actions-hugo@c03b5dbed22245418539b65eb9a3b1d5fdd9a0a6 + uses: peaceiris/actions-hugo@16361eb4acea8698b220b76c0d4e84e1fd22c61d with: hugo-version: '0.93.3' extended: true - name: "📥 Source checkout" - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: "⚙️ npm" run: | npm i @@ -245,7 +245,7 @@ jobs: hugo --config config.toml,historical.toml --baseURL "/${GITHUB_REF/refs\/tags\//}" -d "spec" - name: "📥 Spec definition download" - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: openapi-artifact - name: "📝 Unpack the OpenAPI definitions in the right location" @@ -255,7 +255,7 @@ jobs: - name: "📦 Tarball creation" run: tar -czf spec-historical.tar.gz spec - name: "📤 Artifact upload" - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: spec-historical-artifact path: spec-historical.tar.gz diff --git a/.github/workflows/netlify.yaml b/.github/workflows/netlify.yaml index 83b6bec5..fb2d05c9 100644 --- a/.github/workflows/netlify.yaml +++ b/.github/workflows/netlify.yaml @@ -35,7 +35,7 @@ jobs: echo "::set-output name=prnumber::$pr_number" - name: '📥 Download artifact' - uses: dawidd6/action-download-artifact@af92a8455a59214b7b932932f2662fdefbd78126 # v2.15.0 + uses: dawidd6/action-download-artifact@268677152d06ba59fcec7a7f0b5d961b6ccd7e1e # v2.28.0 with: workflow: main.yaml run_id: ${{ github.event.workflow_run.id }} @@ -46,8 +46,8 @@ jobs: - name: "📤 Deploy to Netlify" id: netlify - # v1.2.2 - uses: nwtgck/actions-netlify@f517512ae75beec8896aa7b027c1c72f01816200 + # v2.1.0 + uses: nwtgck/actions-netlify@7a92f00dde8c92a5a9e8385ec2919775f7647352 with: publish-dir: spec deploy-message: "Deploy from GitHub Actions" diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 0c3ae5a2..ef4162d8 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -14,7 +14,7 @@ jobs: working-directory: packages/npm steps: - name: 🧮 Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: 🔧 Yarn cache uses: actions/setup-node@v3 diff --git a/.github/workflows/spell-check.yaml b/.github/workflows/spell-check.yaml index d0b4a40e..4ed2930c 100644 --- a/.github/workflows/spell-check.yaml +++ b/.github/workflows/spell-check.yaml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Actions Repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Check spelling of proposals uses: crate-ci/typos@9be36f97fdbe645ee9a12449fb13aca856c2516a diff --git a/changelogs/internal/newsfragments/1660.clarification b/changelogs/internal/newsfragments/1660.clarification new file mode 100644 index 00000000..3e7c7e94 --- /dev/null +++ b/changelogs/internal/newsfragments/1660.clarification @@ -0,0 +1 @@ +Upgrade GitHub actions. From 560d98ba9b25f51f2da4dc2f3892b2be274ac76e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= <76261501+zecakeh@users.noreply.github.com> Date: Wed, 11 Oct 2023 12:36:39 +0200 Subject: [PATCH 031/268] Add more CI checks for OpenAPI definitions and JSON Schemas (#1656) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Kévin Commaille Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> --- .github/workflows/main.yml | 42 +++- .../internal/newsfragments/1656.feature | 1 + .../msgtype_infos/image_info.yaml | 1 - .../msgtype_infos/thumbnail_info.yaml | 1 - .../schema/m.room.third_party_invite.yaml | 1 - scripts/check-event-schema-examples.py | 9 +- scripts/check-json-schemas.py | 196 ++++++++++++++++++ scripts/check-openapi-sources.py | 96 ++++++--- scripts/requirements.txt | 2 + 9 files changed, 315 insertions(+), 34 deletions(-) create mode 100644 changelogs/internal/newsfragments/1656.feature create mode 100755 scripts/check-json-schemas.py diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c28a3329..5fa57a4f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -27,7 +27,7 @@ jobs: run: | npx @redocly/cli@latest lint data/api/*/*.yaml - check-examples: + check-event-examples: name: "🔎 Check Event schema examples" runs-on: ubuntu-latest steps: @@ -45,7 +45,45 @@ jobs: - name: "🔎 Run validator" run: | python scripts/check-event-schema-examples.py - + + check-openapi-examples: + name: "🔎 Check OpenAPI definitions examples" + runs-on: ubuntu-latest + steps: + - name: "📥 Source checkout" + uses: actions/checkout@v2 + - name: "➕ Setup Python" + uses: actions/setup-python@v4 + with: + python-version: '3.9' + cache: 'pip' + cache-dependency-path: scripts/requirements.txt + - name: "➕ Install dependencies" + run: | + pip install -r scripts/requirements.txt + - name: "🔎 Run validator" + run: | + python scripts/check-openapi-sources.py + + check-schemas-examples: + name: "🔎 Check JSON Schemas inline examples" + runs-on: ubuntu-latest + steps: + - name: "📥 Source checkout" + uses: actions/checkout@v2 + - name: "➕ Setup Python" + uses: actions/setup-python@v4 + with: + python-version: '3.9' + cache: 'pip' + cache-dependency-path: scripts/requirements.txt + - name: "➕ Install dependencies" + run: | + pip install -r scripts/requirements.txt + - name: "🔎 Run validator" + run: | + python scripts/check-json-schemas.py + calculate-baseurl: name: "⚙️ Calculate baseURL for later jobs" runs-on: ubuntu-latest diff --git a/changelogs/internal/newsfragments/1656.feature b/changelogs/internal/newsfragments/1656.feature new file mode 100644 index 00000000..3d6fda19 --- /dev/null +++ b/changelogs/internal/newsfragments/1656.feature @@ -0,0 +1 @@ +Add more CI checks for OpenAPI definitions and JSON Schemas. diff --git a/data/event-schemas/schema/core-event-schema/msgtype_infos/image_info.yaml b/data/event-schemas/schema/core-event-schema/msgtype_infos/image_info.yaml index 9607d6fd..7cbfcc87 100644 --- a/data/event-schemas/schema/core-event-schema/msgtype_infos/image_info.yaml +++ b/data/event-schemas/schema/core-event-schema/msgtype_infos/image_info.yaml @@ -1,4 +1,3 @@ -$schema: http://json-schema.org/draft-04/schema# description: Metadata about an image. properties: h: diff --git a/data/event-schemas/schema/core-event-schema/msgtype_infos/thumbnail_info.yaml b/data/event-schemas/schema/core-event-schema/msgtype_infos/thumbnail_info.yaml index 79f7c253..31a3b1b2 100644 --- a/data/event-schemas/schema/core-event-schema/msgtype_infos/thumbnail_info.yaml +++ b/data/event-schemas/schema/core-event-schema/msgtype_infos/thumbnail_info.yaml @@ -1,4 +1,3 @@ -$schema: http://json-schema.org/draft-04/schema# description: Metadata about a thumbnail image. properties: h: diff --git a/data/event-schemas/schema/m.room.third_party_invite.yaml b/data/event-schemas/schema/m.room.third_party_invite.yaml index 7a00616b..bb4883f5 100644 --- a/data/event-schemas/schema/m.room.third_party_invite.yaml +++ b/data/event-schemas/schema/m.room.third_party_invite.yaml @@ -1,5 +1,4 @@ --- -$schema: http://json-schema.org/draft-04/schema# allOf: - $ref: core-event-schema/state_event.yaml description: "Acts as an `m.room.member` invite event, where there isn't a target user_id to invite. This event contains a token and a public key whose private key must be used to sign the token. Any user who can present that signature may use this invitation to join the target room." diff --git a/scripts/check-event-schema-examples.py b/scripts/check-event-schema-examples.py index c6191321..b258ca2e 100755 --- a/scripts/check-event-schema-examples.py +++ b/scripts/check-event-schema-examples.py @@ -1,5 +1,9 @@ #!/usr/bin/env python -# + +# Validates the examples under `../data/event_schemas` against their JSON +# schemas. In the process, the JSON schemas are validated against the JSON +# Schema 2020-12 specification. + # Copyright 2016 OpenMarket Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -92,7 +96,8 @@ def check_example_file(examplepath, schemapath): print ("Checking schema for: %r %r" % (examplepath, schemapath)) try: - jsonschema.validate(example, schema, resolver=resolver) + validator = jsonschema.Draft202012Validator(schema, resolver) + validator.validate(example) except Exception as e: raise ValueError("Error validating JSON schema for %r %r" % ( examplepath, schemapath diff --git a/scripts/check-json-schemas.py b/scripts/check-json-schemas.py new file mode 100755 index 00000000..3901300f --- /dev/null +++ b/scripts/check-json-schemas.py @@ -0,0 +1,196 @@ +#!/usr/bin/env python3 + +# Validates the JSON schemas under `../data`. The schemas are validated against +# the JSON Schema 2020-12 specification, and their inline examples and default +# values are validated against the schema. + +# Copyright 2023 Kévin Commaille +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import sys +import json +import os +import traceback + + +def import_error(module, package, debian, error): + sys.stderr.write(( + "Error importing %(module)s: %(error)r\n" + "To install %(module)s run:\n" + " pip install %(package)s\n" + "or on Debian run:\n" + " sudo apt-get install python-%(debian)s\n" + ) % locals()) + if __name__ == '__main__': + sys.exit(1) + +try: + import jsonschema +except ImportError as e: + import_error("jsonschema", "jsonschema", "jsonschema", e) + raise + +try: + import yaml +except ImportError as e: + import_error("yaml", "PyYAML", "yaml", e) + raise + +try: + import jsonpath +except ImportError as e: + import_error("jsonpath", "python-jsonpath", "jsonpath", e) + raise + +try: + import attrs +except ImportError as e: + import_error("attrs", "attrs", "attrs", e) + raise + +@attrs.define +class SchemaDirReport: + files: int = 0 + errors: int = 0 + + def add(self, other_report): + self.files += other_report.files + self.errors += other_report.errors + +def load_file(path): + if not path.startswith("file://"): + raise Exception(f"Bad ref: {path}") + path = path[len("file://"):] + with open(path, "r") as f: + if path.endswith(".json"): + return json.load(f) + else: + # We have to assume it's YAML because some of the YAML examples + # do not have file extensions. + return yaml.safe_load(f) + +def check_example(path, schema, example): + # URI with scheme is necessary to make RefResolver work. + fileurl = "file://" + os.path.abspath(path) + resolver = jsonschema.RefResolver(fileurl, schema, handlers={"file": load_file}) + validator = jsonschema.Draft202012Validator(schema, resolver) + + validator.validate(example) + +def check_schema_examples(path, full_schema): + """Search objects with inline examples in the schema and check they validate + against the object's definition. + """ + errors = [] + matches = jsonpath.finditer( + # Recurse through all objects and filter out those that don't have an + # `example`, `examples` or `default` field. + "$..[?(@.example != undefined || @.examples != undefined || @.default != undefined)]", + full_schema + ) + + for match in matches: + schema = match.obj + if "example" in schema: + try: + check_example(path, schema, schema["example"]) + except Exception as e: + example_path = f"{match.path}['example']" + print(f"Failed to validate example at {example_path}: {e}") + errors.append(e) + + if "examples" in schema: + for index, example in enumerate(schema["examples"]): + try: + check_example(path, schema, example) + except Exception as e: + example_path = f"{match.path}['examples'][{index}]" + print(f"Failed to validate example at {example_path}: {e}") + errors.append(e) + + if "default" in schema: + try: + check_example(path, schema, schema["default"]) + except Exception as e: + example_path = f"{match.path}['default']" + print(f"Failed to validate example at {example_path}: {e}") + errors.append(e) + + if len(errors) > 0: + raise Exception(errors) + + +def check_schema_file(schema_path): + with open(schema_path) as f: + schema = yaml.safe_load(f) + + print(f"Checking schema: {schema_path}") + + # Check schema is valid. + try: + validator = jsonschema.Draft202012Validator + validator.check_schema(schema) + except Exception as e: + print(f"Failed to validate JSON schema: {e}") + raise + + # Check schema examples are valid. + check_schema_examples(schema_path, schema) + +def check_schema_dir(schemadir: str) -> SchemaDirReport: + report = SchemaDirReport() + for root, dirs, files in os.walk(schemadir): + for schemadir in dirs: + dir_report = check_schema_dir(os.path.join(root, schemadir)) + report.add(dir_report) + for filename in files: + if filename.startswith("."): + # Skip over any vim .swp files. + continue + if filename.endswith(".json"): + # Skip over any explicit examples (partial event definitions) + continue + try: + report.files += 1 + check_schema_file(os.path.join(root, filename)) + except Exception as e: + report.errors += 1 + return report + +# The directory that this script is residing in. +script_dir = os.path.dirname(os.path.realpath(__file__)) +# The directory of the project. +project_dir = os.path.abspath(os.path.join(script_dir, "../")) +print(f"Project dir: {project_dir}") + +# Directories to check, relative to the data folder. +schema_dirs = [ + "api/application-service/definitions", + "api/client-server/definitions", + "api/identity/definitions", + "api/server-server/definitions", + "event-schemas/schema", + "schemas", +] + +report = SchemaDirReport() +for schema_dir in schema_dirs: + dir_report = check_schema_dir(os.path.join(project_dir, "data", schema_dir)) + report.add(dir_report) + +print(f"Found {report.errors} errors in {report.files} files") + +if report.errors: + sys.exit(1) + diff --git a/scripts/check-openapi-sources.py b/scripts/check-openapi-sources.py index 2fb8ad93..467e8091 100755 --- a/scripts/check-openapi-sources.py +++ b/scripts/check-openapi-sources.py @@ -1,5 +1,10 @@ #! /usr/bin/env python -# + +# Validates the OpenAPI definitions under `../data/api`. Checks the request +# parameters and body, and response body. The schemas are validated against the +# JSON Schema 2020-12 specification and the examples are validated against those +# schemas. + # Copyright 2016 OpenMarket Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -47,17 +52,39 @@ def check_schema(filepath, example, schema): example = resolve_references(filepath, example) schema = resolve_references(filepath, schema) resolver = jsonschema.RefResolver(filepath, schema, handlers={"file": load_file}) - jsonschema.validate(example, schema, resolver=resolver) + validator = jsonschema.Draft202012Validator(schema, resolver) + validator.validate(example) def check_parameter(filepath, request, parameter): - schema = parameter.get("schema") - example = schema.get('example') + schema = parameter.get('schema') + example = parameter.get('example') + + if not example: + example = schema.get('example') if example and schema: try: - print("Checking request schema for: %r %r" % ( - filepath, request + print("Checking schema for request parameter: %r %r %r" % ( + filepath, request, parameter.get("name") + )) + check_schema(filepath, example, schema) + except Exception as e: + raise ValueError("Error validating JSON schema for %r" % ( + request + ), e) + +def check_request_body(filepath, request, body): + schema = body.get('schema') + example = body.get('example') + + if not example: + example = schema.get('example') + + if example and schema: + try: + print("Checking schema for request body: %r %r" % ( + filepath, request, )) check_schema(filepath, example, schema) except Exception as e: @@ -67,44 +94,59 @@ def check_parameter(filepath, request, parameter): def check_response(filepath, request, code, response): - example = response.get('examples', {}).get('application/json') schema = response.get('schema') - if example and schema: - try: - print ("Checking response schema for: %r %r %r" % ( - filepath, request, code - )) - check_schema(filepath, example, schema) - except jsonschema.SchemaError as error: - for suberror in sorted(error.context, key=lambda e: e.schema_path): - print(list(suberror.schema_path), suberror.message, sep=", ") - raise ValueError("Error validating JSON schema for %r %r" % ( - request, code - ), e) - except Exception as e: - raise ValueError("Error validating JSON schema for %r %r" % ( - request, code - ), e) + if schema: + for name, example in response.get('examples', {}).items(): + value = example.get('value') + if value: + try: + print ("Checking response schema for: %r %r %r %r" % ( + filepath, request, code, name + )) + check_schema(filepath, value, schema) + except jsonschema.SchemaError as error: + for suberror in sorted(error.context, key=lambda e: e.schema_path): + print(list(suberror.schema_path), suberror.message, sep=", ") + raise ValueError("Error validating JSON schema for %r %r" % ( + request, code + ), e) + except Exception as e: + raise ValueError("Error validating JSON schema for %r %r" % ( + request, code + ), e) def check_openapi_file(filepath): with open(filepath) as f: openapi = yaml.safe_load(f) + openapi_version = openapi.get('openapi') + if not openapi_version: + # This is not an OpenAPI file, skip. + return + elif openapi_version != '3.1.0': + raise ValueError("File %r is not using the proper OpenAPI version: expected '3.1.0', got %r" % (filepath, openapi_version)) + for path, path_api in openapi.get('paths', {}).items(): for method, request_api in path_api.items(): request = "%s %s" % (method.upper(), path) for parameter in request_api.get('parameters', ()): - if parameter['in'] == 'body': - check_parameter(filepath, request, parameter) + check_parameter(filepath, request, parameter) + + json_body = request_api.get('requestBody', {}).get('content', {}).get('application/json') + if json_body: + check_request_body(filepath, request, json_body) try: responses = request_api['responses'] except KeyError: raise ValueError("No responses for %r" % (request,)) for code, response in responses.items(): - check_response(filepath, request, code, response) + json_response = response.get('content', {}).get('application/json') + + if json_response: + check_response(filepath, request, code, json_response) def resolve_references(path, schema): @@ -171,7 +213,7 @@ if __name__ == '__main__': # Resolve the directory containing the OpenAPI sources, # relative to the script path - source_files_directory = os.path.realpath(os.path.join(script_directory, "../data")) + source_files_directory = os.path.realpath(os.path.join(script_directory, "../data/api")) # Walk the source path directory, looking for YAML files to check for (root, dirs, files) in os.walk(source_files_directory): diff --git a/scripts/requirements.txt b/scripts/requirements.txt index 0349d87f..5878b9cc 100644 --- a/scripts/requirements.txt +++ b/scripts/requirements.txt @@ -4,6 +4,8 @@ # we need at least version 4.0.0 for support of JSON Schema Draft 2020-12. jsonschema == 4.17.3 +python-jsonpath == 0.9.0 +attrs >= 23.1.0 PyYAML >= 3.12 requests >= 2.18.4 towncrier == 23.6.0 From 9fe119370b991bb4b088f2d85dc535ac6271dc37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= <76261501+zecakeh@users.noreply.github.com> Date: Wed, 11 Oct 2023 12:42:05 +0200 Subject: [PATCH 032/268] Update typos action and fix typos (#1661) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Kévin Commaille --- .github/workflows/spell-check.yaml | 2 +- changelogs/client_server/newsfragments/1661.clarification | 1 + changelogs/server_server/newsfragments/1661.clarification | 1 + data/api/client-server/create_room.yaml | 2 +- data/api/client-server/login_token.yaml | 2 +- data/api/server-server/joins-v2.yaml | 2 +- data/api/server-server/leaving-v2.yaml | 2 +- meta/documentation_style.rst | 2 +- meta/releasing.md | 2 +- 9 files changed, 9 insertions(+), 7 deletions(-) create mode 100644 changelogs/client_server/newsfragments/1661.clarification create mode 100644 changelogs/server_server/newsfragments/1661.clarification diff --git a/.github/workflows/spell-check.yaml b/.github/workflows/spell-check.yaml index 4ed2930c..b4a9060e 100644 --- a/.github/workflows/spell-check.yaml +++ b/.github/workflows/spell-check.yaml @@ -14,6 +14,6 @@ jobs: uses: actions/checkout@v4 - name: Check spelling of proposals - uses: crate-ci/typos@9be36f97fdbe645ee9a12449fb13aca856c2516a + uses: crate-ci/typos@ff3f309513469397e1094520fb7a054e057589e1 with: config: ${{github.workspace}}/.github/_typos.toml \ No newline at end of file diff --git a/changelogs/client_server/newsfragments/1661.clarification b/changelogs/client_server/newsfragments/1661.clarification new file mode 100644 index 00000000..3ccb2333 --- /dev/null +++ b/changelogs/client_server/newsfragments/1661.clarification @@ -0,0 +1 @@ +Fix various typos throughout the specification. diff --git a/changelogs/server_server/newsfragments/1661.clarification b/changelogs/server_server/newsfragments/1661.clarification new file mode 100644 index 00000000..3ccb2333 --- /dev/null +++ b/changelogs/server_server/newsfragments/1661.clarification @@ -0,0 +1 @@ +Fix various typos throughout the specification. diff --git a/data/api/client-server/create_room.yaml b/data/api/client-server/create_room.yaml index 2188a370..3c04de00 100644 --- a/data/api/client-server/create_room.yaml +++ b/data/api/client-server/create_room.yaml @@ -209,7 +209,7 @@ paths: based on a preset. If unspecified, the server should use the `visibility` to determine - which preset to use. A visbility of `public` equates to a preset of + which preset to use. A visibility of `public` equates to a preset of `public_chat` and `private` visibility equates to a preset of `private_chat`. is_direct: diff --git a/data/api/client-server/login_token.yaml b/data/api/client-server/login_token.yaml index 73e607d1..d31607fb 100644 --- a/data/api/client-server/login_token.yaml +++ b/data/api/client-server/login_token.yaml @@ -39,7 +39,7 @@ paths: In v1.7 of the specification, transmission of the generated token to an unauthenticated client is left as an implementation detail. Future MSCs such as [MSC3906](https://github.com/matrix-org/matrix-spec-proposals/pull/3906) - might standarise a way to transmit the token between clients. + might standardise a way to transmit the token between clients. The generated token MUST only be valid for a single login, enforced by the server. Clients which intend to log in multiple devices must generate a token for each. diff --git a/data/api/server-server/joins-v2.yaml b/data/api/server-server/joins-v2.yaml index 32819193..1182e100 100644 --- a/data/api/server-server/joins-v2.yaml +++ b/data/api/server-server/joins-v2.yaml @@ -27,7 +27,7 @@ paths: exception of the response format being fixed. This endpoint is preferred over the v1 API as it provides - a more standarised response format. Senders which receive + a more standardised response format. Senders which receive a 400, 404, or other status code which indicates this endpoint is not available should retry using the v1 API instead. diff --git a/data/api/server-server/leaving-v2.yaml b/data/api/server-server/leaving-v2.yaml index b79ce008..60064cfc 100644 --- a/data/api/server-server/leaving-v2.yaml +++ b/data/api/server-server/leaving-v2.yaml @@ -27,7 +27,7 @@ paths: exception of the response format being fixed. This endpoint is preferred over the v1 API as it provides - a more standarised response format. Senders which receive + a more standardised response format. Senders which receive a 400, 404, or other status code which indicates this endpoint is not available should retry using the v1 API instead. diff --git a/meta/documentation_style.rst b/meta/documentation_style.rst index e7b71408..89c462f8 100644 --- a/meta/documentation_style.rst +++ b/meta/documentation_style.rst @@ -191,4 +191,4 @@ Describing grammar Use `RFC5234-style ABNF `_ when describing the grammar for something in the spec, such as user IDs or server names. Use lowercase -and underscore-deliminated element names (`user_id`, not `UserID` or `user-id`). +and underscore-delimited element names (`user_id`, not `UserID` or `user-id`). diff --git a/meta/releasing.md b/meta/releasing.md index 92dd9be8..83261385 100644 --- a/meta/releasing.md +++ b/meta/releasing.md @@ -31,7 +31,7 @@ day until the release has actually happened & blog post published. Once a release is scheduled, the SCT will begin planning what the next release is expected to look like. The plan should be included in the spec release blog post, -and be ready for exeuction on spec release day. Plans are guides and not promises. +and be ready for execution on spec release day. Plans are guides and not promises. A blog post for the SCT members to review should be ready at minimum 1 week before the target release date. 1-2 days before the release itself, the prerequisite steps From 7c19500da7272cccd849ff8cd1bf17286eb363c5 Mon Sep 17 00:00:00 2001 From: Val Lorentz Date: Wed, 25 Oct 2023 04:18:45 +0200 Subject: [PATCH 033/268] server-server-api: Fix grammar in server discovery (#1665) --- changelogs/client_server/newsfragments/1665.clarification | 1 + content/server-server-api.md | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 changelogs/client_server/newsfragments/1665.clarification diff --git a/changelogs/client_server/newsfragments/1665.clarification b/changelogs/client_server/newsfragments/1665.clarification new file mode 100644 index 00000000..3ccb2333 --- /dev/null +++ b/changelogs/client_server/newsfragments/1665.clarification @@ -0,0 +1 @@ +Fix various typos throughout the specification. diff --git a/content/server-server-api.md b/content/server-server-api.md index d658e009..e7c23179 100644 --- a/content/server-server-api.md +++ b/content/server-server-api.md @@ -186,8 +186,8 @@ to send. The process overall is as follows: header of ``. The target server must present a valid certificate for ``. -6. If the `/.well-known` request returned an error response, and the - SRV record was not found, an IP address is resolved using CNAME, AAAA and A +6. If the `/.well-known` request returned an error response, and + no SRV records were found, an IP address is resolved using CNAME, AAAA and A records. Requests are made to the resolved IP address using port 8448 and a `Host` header containing the ``. The target server must present a valid certificate for ``. From 91724e4aef87047a6704151766e838a7a73e9dee Mon Sep 17 00:00:00 2001 From: No Date: Wed, 8 Nov 2023 03:00:35 -0500 Subject: [PATCH 034/268] Fix .m.rule.suppress_notices push rule not being valid JSON (#1671) Signed-off-by: tusooa --- changelogs/client_server/newsfragments/1671.clarification | 1 + content/client-server-api/modules/push.md | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changelogs/client_server/newsfragments/1671.clarification diff --git a/changelogs/client_server/newsfragments/1671.clarification b/changelogs/client_server/newsfragments/1671.clarification new file mode 100644 index 00000000..eade49a7 --- /dev/null +++ b/changelogs/client_server/newsfragments/1671.clarification @@ -0,0 +1 @@ +Fix `.m.rule.suppress_notices` push rule not being valid JSON. diff --git a/content/client-server-api/modules/push.md b/content/client-server-api/modules/push.md index 23222ada..8a515d2f 100644 --- a/content/client-server-api/modules/push.md +++ b/content/client-server-api/modules/push.md @@ -454,7 +454,7 @@ Definition: { "kind": "event_match", "key": "content.msgtype", - "pattern": "m.notice", + "pattern": "m.notice" } ], "actions": [] From 7b72c42ba6da4b7d796ce613e41e6b8089ca4a9d Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Sun, 12 Nov 2023 01:55:45 +0000 Subject: [PATCH 035/268] put the e back into erik --- data/event-schemas/examples/m.receipt.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/event-schemas/examples/m.receipt.yaml b/data/event-schemas/examples/m.receipt.yaml index 17e5a67e..f09872b5 100644 --- a/data/event-schemas/examples/m.receipt.yaml +++ b/data/event-schemas/examples/m.receipt.yaml @@ -4,7 +4,7 @@ "content": { "$1435641916114394fHBLK:matrix.org": { "m.read": { - "@rikj:jki.re": { + "@erikj:jki.re": { "ts": 1436451550453 } }, From 161a4a2cfb060baa8914655115ef5d1ddcf98a91 Mon Sep 17 00:00:00 2001 From: Patrick Cloke Date: Tue, 14 Nov 2023 11:15:57 -0500 Subject: [PATCH 036/268] Federation requests must be for local users. (#1672) This is already mentioned for /user/devices, but is not mentioned for /query/profile, /user/keys/claim, or /user/keys/query. See GHSA-mp92-3jfm-3575 for an issue found with this in Synapse. --- changelogs/server_server/newsfragments/1672.clarification | 1 + data/api/server-server/query.yaml | 2 +- data/api/server-server/user_keys.yaml | 6 ++++-- 3 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 changelogs/server_server/newsfragments/1672.clarification diff --git a/changelogs/server_server/newsfragments/1672.clarification b/changelogs/server_server/newsfragments/1672.clarification new file mode 100644 index 00000000..d664c0b3 --- /dev/null +++ b/changelogs/server_server/newsfragments/1672.clarification @@ -0,0 +1 @@ +Clarify that federation requests for non-local users are invalid. diff --git a/data/api/server-server/query.yaml b/data/api/server-server/query.yaml index 23a6dffd..8d727a57 100644 --- a/data/api/server-server/query.yaml +++ b/data/api/server-server/query.yaml @@ -121,7 +121,7 @@ paths: parameters: - in: query name: user_id - description: The user ID to query. + description: The user ID to query. Must be a user local to the receiving homeserver. required: true example: "@someone:example.org" schema: diff --git a/data/api/server-server/user_keys.yaml b/data/api/server-server/user_keys.yaml index fb598e94..be50fcea 100644 --- a/data/api/server-server/user_keys.yaml +++ b/data/api/server-server/user_keys.yaml @@ -34,7 +34,8 @@ paths: type: object description: |- The keys to be claimed. A map from user ID, to a map from - device ID to algorithm name. + device ID to algorithm name. Requested users must be local + to the receiving homeserver. additionalProperties: type: object additionalProperties: @@ -121,7 +122,8 @@ paths: description: |- The keys to be downloaded. A map from user ID, to a list of device IDs, or to an empty list to indicate all devices for the - corresponding user. + corresponding user. Requested users must be local to the + receiving homeserver. additionalProperties: type: array items: From 25a9157f0a51ebc932c4132160c572932f0b75ce Mon Sep 17 00:00:00 2001 From: No Date: Thu, 16 Nov 2023 08:25:15 -0500 Subject: [PATCH 037/268] Add event_property_is and event_property_contains props to PushConditions (#1673) Signed-off-by: tusooa Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> --- .../client_server/newsfragments/1673.clarification | 1 + data/api/client-server/definitions/push_condition.yaml | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 changelogs/client_server/newsfragments/1673.clarification diff --git a/changelogs/client_server/newsfragments/1673.clarification b/changelogs/client_server/newsfragments/1673.clarification new file mode 100644 index 00000000..8ab3da4d --- /dev/null +++ b/changelogs/client_server/newsfragments/1673.clarification @@ -0,0 +1 @@ +Add missing properties for `event_property_is` and `event_property_contains` push conditions to `PushConditions` object. diff --git a/data/api/client-server/definitions/push_condition.yaml b/data/api/client-server/definitions/push_condition.yaml index 8a3a9f32..4c35cfe4 100644 --- a/data/api/client-server/definitions/push_condition.yaml +++ b/data/api/client-server/definitions/push_condition.yaml @@ -23,8 +23,8 @@ properties: key: type: string description: |- - Required for `event_match` conditions. The dot-separated field of the - event to match. + Required for `event_match`, `event_property_is` and `event_property_contains` + conditions. The dot-separated field of the event to match. Required for `sender_notification_permission` conditions. The field in the power level event the user needs a minimum power level for. Fields @@ -43,5 +43,11 @@ properties: optionally prefixed by one of, ==, <, >, >= or <=. A prefix of < matches rooms where the member count is strictly less than the given number and so forth. If no prefix is present, this parameter defaults to ==. + value: + type: ["string", "integer", "boolean", "null"] + description: |- + Required for `event_property_is` and `event_property_contains` conditions. + A non-compound [canonical JSON](/appendices#canonical-json) value to match + against. required: - kind From 634b24fb2574e3f76217d83b5d84dc67052536ba Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Mon, 27 Nov 2023 15:58:06 -0700 Subject: [PATCH 038/268] Normalize changelog for 1.9 --- changelogs/appendices/newsfragments/1652.clarification | 2 +- changelogs/application_service/newsfragments/1646.clarification | 1 - changelogs/client_server/newsfragments/1617.feature | 2 +- changelogs/client_server/newsfragments/1618.clarification | 2 +- .../newsfragments/{1638.feature => 1638.clarification} | 0 changelogs/internal/newsfragments/1646.clarification | 1 + .../internal/newsfragments/{1648.bugfix => 1648.clarification} | 0 7 files changed, 4 insertions(+), 4 deletions(-) delete mode 100644 changelogs/application_service/newsfragments/1646.clarification rename changelogs/client_server/newsfragments/{1638.feature => 1638.clarification} (100%) create mode 100644 changelogs/internal/newsfragments/1646.clarification rename changelogs/internal/newsfragments/{1648.bugfix => 1648.clarification} (100%) diff --git a/changelogs/appendices/newsfragments/1652.clarification b/changelogs/appendices/newsfragments/1652.clarification index 488b7e2b..3ccb2333 100644 --- a/changelogs/appendices/newsfragments/1652.clarification +++ b/changelogs/appendices/newsfragments/1652.clarification @@ -1 +1 @@ -Fix typo in canonical JSON grammar. +Fix various typos throughout the specification. diff --git a/changelogs/application_service/newsfragments/1646.clarification b/changelogs/application_service/newsfragments/1646.clarification deleted file mode 100644 index 7779bf73..00000000 --- a/changelogs/application_service/newsfragments/1646.clarification +++ /dev/null @@ -1 +0,0 @@ -Remove required `fieldname` in Protocol definition. \ No newline at end of file diff --git a/changelogs/client_server/newsfragments/1617.feature b/changelogs/client_server/newsfragments/1617.feature index 78f112e0..353987ad 100644 --- a/changelogs/client_server/newsfragments/1617.feature +++ b/changelogs/client_server/newsfragments/1617.feature @@ -1 +1 @@ -Add the `m.rule.suppress_edits` default push rule from [MSC3958](https://github.com/matrix-org/matrix-spec-proposals/pull/3958). +Add the `m.rule.suppress_edits` default push rule, as per [MSC3958](https://github.com/matrix-org/matrix-spec-proposals/pull/3958). diff --git a/changelogs/client_server/newsfragments/1618.clarification b/changelogs/client_server/newsfragments/1618.clarification index b8d5169d..cd043f0d 100644 --- a/changelogs/client_server/newsfragments/1618.clarification +++ b/changelogs/client_server/newsfragments/1618.clarification @@ -1 +1 @@ -Clarify that the `via` property is required for `m.space.parent` and `m.space.child` as per MSC1772. Contributed by @PaarthShah. +Clarify that the `via` property is required for `m.space.parent` and `m.space.child` as per [MSC1772](https://github.com/matrix-org/matrix-spec-proposals/pull/1772). Contributed by @PaarthShah. diff --git a/changelogs/client_server/newsfragments/1638.feature b/changelogs/client_server/newsfragments/1638.clarification similarity index 100% rename from changelogs/client_server/newsfragments/1638.feature rename to changelogs/client_server/newsfragments/1638.clarification diff --git a/changelogs/internal/newsfragments/1646.clarification b/changelogs/internal/newsfragments/1646.clarification new file mode 100644 index 00000000..41e73c34 --- /dev/null +++ b/changelogs/internal/newsfragments/1646.clarification @@ -0,0 +1 @@ +Remove required `fieldname` in appservice Protocol definition. \ No newline at end of file diff --git a/changelogs/internal/newsfragments/1648.bugfix b/changelogs/internal/newsfragments/1648.clarification similarity index 100% rename from changelogs/internal/newsfragments/1648.bugfix rename to changelogs/internal/newsfragments/1648.clarification From 6fe2ff4fa7d6ca0ed032c9c7163fe93c5408eefe Mon Sep 17 00:00:00 2001 From: Andy Balaam Date: Tue, 28 Nov 2023 17:45:36 +0000 Subject: [PATCH 039/268] Make clear the thread root is not in the thread (#1677) * Make clear the thread root is not in the thread Signed-off-by: Andy Balaam * Changlog entry for thread PR 1677 - thread roots not in thread * Fix typo * Add formatting for code values. Co-authored-by: Patrick Cloke * Reword main timeline ID paragraph * Use close to the original wording for the 'recurse' part of the 'in the thread' definition * Remove note about thread roots being displayed in a thread * Define the thread root --------- Signed-off-by: Andy Balaam Co-authored-by: Patrick Cloke --- .../newsfragments/1677.clarification | 1 + content/client-server-api/modules/push.md | 20 ++++++++--------- content/client-server-api/modules/receipts.md | 22 +++++++++++-------- .../client-server-api/modules/threading.md | 10 ++++----- 4 files changed, 29 insertions(+), 24 deletions(-) create mode 100644 changelogs/client_server/newsfragments/1677.clarification diff --git a/changelogs/client_server/newsfragments/1677.clarification b/changelogs/client_server/newsfragments/1677.clarification new file mode 100644 index 00000000..56c89af8 --- /dev/null +++ b/changelogs/client_server/newsfragments/1677.clarification @@ -0,0 +1 @@ +Clarify that thread roots are not considered within the thread. diff --git a/content/client-server-api/modules/push.md b/content/client-server-api/modules/push.md index 8a515d2f..c674bac9 100644 --- a/content/client-server-api/modules/push.md +++ b/content/client-server-api/modules/push.md @@ -1070,16 +1070,16 @@ ahead), however if the `m.read.private` receipt were to be updated to event D then the user has read up to D (the `m.read` receipt is now behind the `m.read.private` receipt). -{{< added-in v="1.4" >}} When handling threaded read receipts, the server -is to partition the notification count to each thread (with the main timeline -being its own thread). To determine if an event is part of a thread the -server follows the [event relationship](#forming-relationships-between-events) -until it finds a thread root (as specified by the [threading module](#threading)), -however it is not recommended that the server traverse infinitely. Instead, -implementations are encouraged to do a maximum of 3 hops to find a thread -before deciding that the event does not belong to a thread. This is primarily -to ensure that future events, like `m.reaction`, are correctly considered -"part of" a given thread. +{{< added-in v="1.4" >}} When handling threaded read receipts, the server is to +partition the notification count to each thread (with the main timeline being +its own thread). To determine if an event is part of a thread the server follows +the [event relationship](#forming-relationships-between-events) until it finds a +thread root via an `m.thread` relation (as specified by the [threading +module](#threading)), however it is not recommended that the server traverse +infinitely. Instead, implementations are encouraged to do a maximum of 3 hops to +find a thread before deciding that the event does not belong to a thread. This +is primarily to ensure that future events, like `m.reaction`, are correctly +considered "part of" a given thread. #### Server behaviour diff --git a/content/client-server-api/modules/receipts.md b/content/client-server-api/modules/receipts.md index 8cd4e9f6..54c8c7cf 100644 --- a/content/client-server-api/modules/receipts.md +++ b/content/client-server-api/modules/receipts.md @@ -137,16 +137,20 @@ either a thread root's event ID or `main` for the main timeline. Threading introduces a concept of multiple conversations being held in the same room and thus deserve their own read receipts and notification counts. An event is -considered to be "in a thread" if it meets any of the following criteria: -* It has a `rel_type` of `m.thread`. -* It has child events with a `rel_type` of `m.thread` (in which case it'd be the - thread root). -* Following the event relationships, it has a parent event which qualifies for - one of the above. Implementations should not recurse infinitely, though: a - maximum of 3 hops is recommended to cover indirect relationships. +considered to be "in a thread" if: -Events not in a thread but still in the room are considered to be part of the -"main timeline", or a special thread with an ID of `main`. +* It has a `rel_type` of `m.thread`, or +* Following the event relationships, it has a parent event which references + the thread root with a `rel_type` of `m.thread`. Implementations should + not recurse infinitely, though: a maximum of 3 hops is recommended to + cover indirect relationships. + +Events not in a thread but still in the room are considered to be in the "main +timeline". When referring to the main timeline as a thread (e.g. in receipts +and notifications counts) a special thread ID of `main` is used. + +Thread roots are considered to be in the main timeline, as are events that are +related to a thread root via non-thread relations. The following is an example DAG for a room, with dotted lines showing event relationships and solid lines showing topological ordering. diff --git a/content/client-server-api/modules/threading.md b/content/client-server-api/modules/threading.md index 04440a07..b6e11821 100644 --- a/content/client-server-api/modules/threading.md +++ b/content/client-server-api/modules/threading.md @@ -12,11 +12,11 @@ as by providing some context to what is going on in the thread but keeping the f history behind a disclosure. Threads are established using a `rel_type` of `m.thread` and reference the -*thread root* (the first event in a thread). It is not possible to create a -thread from an event which itself is the child of an event relationship (i.e., -one with an `m.relates_to` property). It is therefore also not possible to nest -threads. All events in a thread reference the thread root instead of the -most recent message, unlike rich reply chains. +*thread root* (the main timeline event to which the thread events refer). It is not possible to create a thread from an event which itself +is the child of an event relationship (i.e., one with an `m.relates_to` +property). It is therefore also not possible to nest threads. All events in a +thread reference the thread root instead of the most recent message, unlike rich +reply chains. As a worked example, the following represents a thread and how it would be formed: From 62c377e19c778f98766036def7af400d3fdd17f1 Mon Sep 17 00:00:00 2001 From: Hubert Chathi Date: Wed, 29 Nov 2023 11:56:57 -0500 Subject: [PATCH 040/268] fallback keys should have a "fallback: true" property (#1676) * fallback keys should have a "fallback: true" property * add changelog --- changelogs/client_server/newsfragments/1676.clarification | 1 + content/client-server-api/modules/end_to_end_encryption.md | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 changelogs/client_server/newsfragments/1676.clarification diff --git a/changelogs/client_server/newsfragments/1676.clarification b/changelogs/client_server/newsfragments/1676.clarification new file mode 100644 index 00000000..79275096 --- /dev/null +++ b/changelogs/client_server/newsfragments/1676.clarification @@ -0,0 +1 @@ +Indicate that fallback keys should have a `fallback` property set to `true`. diff --git a/content/client-server-api/modules/end_to_end_encryption.md b/content/client-server-api/modules/end_to_end_encryption.md index f2f75705..cdeed706 100644 --- a/content/client-server-api/modules/end_to_end_encryption.md +++ b/content/client-server-api/modules/end_to_end_encryption.md @@ -77,6 +77,7 @@ algorithm is represented by an object with the following properties: |------------|------------|---------------------------------------------------------------------------------------------------------------------------------------------------| | key | string | **Required.** The unpadded Base64-encoded 32-byte Curve25519 public key. | | signatures | Signatures | **Required.** Signatures of the key object. The signature is calculated using the process described at [Signing JSON](/appendices/#signing-json). | +| fallback | boolean | Indicates whether this is a [fallback key](#one-time-and-fallback-keys). Defaults to `false`. | Example: @@ -150,7 +151,9 @@ JSON](/appendices/#signing-json). One-time and fallback keys are also uploaded to the homeserver using the [`/keys/upload`](/client-server-api/#post_matrixclientv3keysupload) API. New -one-time and fallback keys are uploaded as needed. +one-time and fallback keys are uploaded as needed. Fallback keys for key +algorithms whose format is a signed JSON object should contain a property named +`fallback` with a value of `true`. Devices must store the private part of each key they upload. They can discard the private part of a one-time key when they receive a message From 0c099e3b796028c495ad7b6cb3bd544200a102f2 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Wed, 29 Nov 2023 10:03:44 -0700 Subject: [PATCH 041/268] Matrix 1.9 --- .../newsfragments/1627.clarification | 1 - .../newsfragments/1652.clarification | 1 - .../newsfragments/1546.clarification | 1 - .../client_server/newsfragments/1617.feature | 1 - .../newsfragments/1618.clarification | 1 - .../newsfragments/1638.clarification | 1 - .../newsfragments/1639.clarification | 1 - .../newsfragments/1647.clarification | 1 - .../newsfragments/1658.clarification | 1 - .../newsfragments/1661.clarification | 1 - .../newsfragments/1665.clarification | 1 - .../newsfragments/1671.clarification | 1 - .../newsfragments/1673.clarification | 1 - .../newsfragments/1676.clarification | 1 - .../newsfragments/1677.clarification | 1 - .../internal/newsfragments/1633.clarification | 1 - .../internal/newsfragments/1634.clarification | 1 - .../internal/newsfragments/1635.clarification | 1 - .../internal/newsfragments/1637.clarification | 1 - .../internal/newsfragments/1646.clarification | 1 - .../internal/newsfragments/1648.clarification | 1 - .../internal/newsfragments/1656.feature | 1 - .../internal/newsfragments/1657.feature | 1 - .../internal/newsfragments/1660.clarification | 1 - .../newsfragments/1636.clarification | 1 - .../newsfragments/1661.clarification | 1 - .../newsfragments/1672.clarification | 1 - config.toml | 8 +- content/changelog/v1.9.md | 93 +++++++++++++++++++ 29 files changed, 97 insertions(+), 31 deletions(-) delete mode 100644 changelogs/appendices/newsfragments/1627.clarification delete mode 100644 changelogs/appendices/newsfragments/1652.clarification delete mode 100644 changelogs/client_server/newsfragments/1546.clarification delete mode 100644 changelogs/client_server/newsfragments/1617.feature delete mode 100644 changelogs/client_server/newsfragments/1618.clarification delete mode 100644 changelogs/client_server/newsfragments/1638.clarification delete mode 100644 changelogs/client_server/newsfragments/1639.clarification delete mode 100644 changelogs/client_server/newsfragments/1647.clarification delete mode 100644 changelogs/client_server/newsfragments/1658.clarification delete mode 100644 changelogs/client_server/newsfragments/1661.clarification delete mode 100644 changelogs/client_server/newsfragments/1665.clarification delete mode 100644 changelogs/client_server/newsfragments/1671.clarification delete mode 100644 changelogs/client_server/newsfragments/1673.clarification delete mode 100644 changelogs/client_server/newsfragments/1676.clarification delete mode 100644 changelogs/client_server/newsfragments/1677.clarification delete mode 100644 changelogs/internal/newsfragments/1633.clarification delete mode 100644 changelogs/internal/newsfragments/1634.clarification delete mode 100644 changelogs/internal/newsfragments/1635.clarification delete mode 100644 changelogs/internal/newsfragments/1637.clarification delete mode 100644 changelogs/internal/newsfragments/1646.clarification delete mode 100644 changelogs/internal/newsfragments/1648.clarification delete mode 100644 changelogs/internal/newsfragments/1656.feature delete mode 100644 changelogs/internal/newsfragments/1657.feature delete mode 100644 changelogs/internal/newsfragments/1660.clarification delete mode 100644 changelogs/server_server/newsfragments/1636.clarification delete mode 100644 changelogs/server_server/newsfragments/1661.clarification delete mode 100644 changelogs/server_server/newsfragments/1672.clarification create mode 100644 content/changelog/v1.9.md diff --git a/changelogs/appendices/newsfragments/1627.clarification b/changelogs/appendices/newsfragments/1627.clarification deleted file mode 100644 index 44775447..00000000 --- a/changelogs/appendices/newsfragments/1627.clarification +++ /dev/null @@ -1 +0,0 @@ -Clarify timestamp specification with respect to leap seconds. diff --git a/changelogs/appendices/newsfragments/1652.clarification b/changelogs/appendices/newsfragments/1652.clarification deleted file mode 100644 index 3ccb2333..00000000 --- a/changelogs/appendices/newsfragments/1652.clarification +++ /dev/null @@ -1 +0,0 @@ -Fix various typos throughout the specification. diff --git a/changelogs/client_server/newsfragments/1546.clarification b/changelogs/client_server/newsfragments/1546.clarification deleted file mode 100644 index d73f43f5..00000000 --- a/changelogs/client_server/newsfragments/1546.clarification +++ /dev/null @@ -1 +0,0 @@ -Fix `m.call.negotiate` schema and example. diff --git a/changelogs/client_server/newsfragments/1617.feature b/changelogs/client_server/newsfragments/1617.feature deleted file mode 100644 index 353987ad..00000000 --- a/changelogs/client_server/newsfragments/1617.feature +++ /dev/null @@ -1 +0,0 @@ -Add the `m.rule.suppress_edits` default push rule, as per [MSC3958](https://github.com/matrix-org/matrix-spec-proposals/pull/3958). diff --git a/changelogs/client_server/newsfragments/1618.clarification b/changelogs/client_server/newsfragments/1618.clarification deleted file mode 100644 index cd043f0d..00000000 --- a/changelogs/client_server/newsfragments/1618.clarification +++ /dev/null @@ -1 +0,0 @@ -Clarify that the `via` property is required for `m.space.parent` and `m.space.child` as per [MSC1772](https://github.com/matrix-org/matrix-spec-proposals/pull/1772). Contributed by @PaarthShah. diff --git a/changelogs/client_server/newsfragments/1638.clarification b/changelogs/client_server/newsfragments/1638.clarification deleted file mode 100644 index a90cc4dd..00000000 --- a/changelogs/client_server/newsfragments/1638.clarification +++ /dev/null @@ -1 +0,0 @@ -Add a note to the `/publicRooms` API that the server name is case sensitive. diff --git a/changelogs/client_server/newsfragments/1639.clarification b/changelogs/client_server/newsfragments/1639.clarification deleted file mode 100644 index 781cc2ca..00000000 --- a/changelogs/client_server/newsfragments/1639.clarification +++ /dev/null @@ -1 +0,0 @@ -Clarify that an `m.room.name` event with an absent `name` field is not expected behavior. \ No newline at end of file diff --git a/changelogs/client_server/newsfragments/1647.clarification b/changelogs/client_server/newsfragments/1647.clarification deleted file mode 100644 index d7c9a685..00000000 --- a/changelogs/client_server/newsfragments/1647.clarification +++ /dev/null @@ -1 +0,0 @@ -Fix schemas used for account data and presence events in `GET /initialSync`. diff --git a/changelogs/client_server/newsfragments/1658.clarification b/changelogs/client_server/newsfragments/1658.clarification deleted file mode 100644 index 3ccb2333..00000000 --- a/changelogs/client_server/newsfragments/1658.clarification +++ /dev/null @@ -1 +0,0 @@ -Fix various typos throughout the specification. diff --git a/changelogs/client_server/newsfragments/1661.clarification b/changelogs/client_server/newsfragments/1661.clarification deleted file mode 100644 index 3ccb2333..00000000 --- a/changelogs/client_server/newsfragments/1661.clarification +++ /dev/null @@ -1 +0,0 @@ -Fix various typos throughout the specification. diff --git a/changelogs/client_server/newsfragments/1665.clarification b/changelogs/client_server/newsfragments/1665.clarification deleted file mode 100644 index 3ccb2333..00000000 --- a/changelogs/client_server/newsfragments/1665.clarification +++ /dev/null @@ -1 +0,0 @@ -Fix various typos throughout the specification. diff --git a/changelogs/client_server/newsfragments/1671.clarification b/changelogs/client_server/newsfragments/1671.clarification deleted file mode 100644 index eade49a7..00000000 --- a/changelogs/client_server/newsfragments/1671.clarification +++ /dev/null @@ -1 +0,0 @@ -Fix `.m.rule.suppress_notices` push rule not being valid JSON. diff --git a/changelogs/client_server/newsfragments/1673.clarification b/changelogs/client_server/newsfragments/1673.clarification deleted file mode 100644 index 8ab3da4d..00000000 --- a/changelogs/client_server/newsfragments/1673.clarification +++ /dev/null @@ -1 +0,0 @@ -Add missing properties for `event_property_is` and `event_property_contains` push conditions to `PushConditions` object. diff --git a/changelogs/client_server/newsfragments/1676.clarification b/changelogs/client_server/newsfragments/1676.clarification deleted file mode 100644 index 79275096..00000000 --- a/changelogs/client_server/newsfragments/1676.clarification +++ /dev/null @@ -1 +0,0 @@ -Indicate that fallback keys should have a `fallback` property set to `true`. diff --git a/changelogs/client_server/newsfragments/1677.clarification b/changelogs/client_server/newsfragments/1677.clarification deleted file mode 100644 index 56c89af8..00000000 --- a/changelogs/client_server/newsfragments/1677.clarification +++ /dev/null @@ -1 +0,0 @@ -Clarify that thread roots are not considered within the thread. diff --git a/changelogs/internal/newsfragments/1633.clarification b/changelogs/internal/newsfragments/1633.clarification deleted file mode 100644 index 64988279..00000000 --- a/changelogs/internal/newsfragments/1633.clarification +++ /dev/null @@ -1 +0,0 @@ -Replace all mentions of Swagger by OpenAPI. diff --git a/changelogs/internal/newsfragments/1634.clarification b/changelogs/internal/newsfragments/1634.clarification deleted file mode 100644 index b4d1ce39..00000000 --- a/changelogs/internal/newsfragments/1634.clarification +++ /dev/null @@ -1 +0,0 @@ -Fix enum types in JSON schemas. diff --git a/changelogs/internal/newsfragments/1635.clarification b/changelogs/internal/newsfragments/1635.clarification deleted file mode 100644 index a5bd245c..00000000 --- a/changelogs/internal/newsfragments/1635.clarification +++ /dev/null @@ -1 +0,0 @@ -Fix schema of `m.mentions` object. diff --git a/changelogs/internal/newsfragments/1637.clarification b/changelogs/internal/newsfragments/1637.clarification deleted file mode 100644 index 018cd98f..00000000 --- a/changelogs/internal/newsfragments/1637.clarification +++ /dev/null @@ -1 +0,0 @@ -Fix rendering of `m.receipt` event in Client-Server API. diff --git a/changelogs/internal/newsfragments/1646.clarification b/changelogs/internal/newsfragments/1646.clarification deleted file mode 100644 index 41e73c34..00000000 --- a/changelogs/internal/newsfragments/1646.clarification +++ /dev/null @@ -1 +0,0 @@ -Remove required `fieldname` in appservice Protocol definition. \ No newline at end of file diff --git a/changelogs/internal/newsfragments/1648.clarification b/changelogs/internal/newsfragments/1648.clarification deleted file mode 100644 index 68bbd683..00000000 --- a/changelogs/internal/newsfragments/1648.clarification +++ /dev/null @@ -1 +0,0 @@ -Fix github action workflow responsible for releasing of @matrix-org/spec package. diff --git a/changelogs/internal/newsfragments/1656.feature b/changelogs/internal/newsfragments/1656.feature deleted file mode 100644 index 3d6fda19..00000000 --- a/changelogs/internal/newsfragments/1656.feature +++ /dev/null @@ -1 +0,0 @@ -Add more CI checks for OpenAPI definitions and JSON Schemas. diff --git a/changelogs/internal/newsfragments/1657.feature b/changelogs/internal/newsfragments/1657.feature deleted file mode 100644 index c5d8155d..00000000 --- a/changelogs/internal/newsfragments/1657.feature +++ /dev/null @@ -1 +0,0 @@ -Generate server-server OpenAPI definition. diff --git a/changelogs/internal/newsfragments/1660.clarification b/changelogs/internal/newsfragments/1660.clarification deleted file mode 100644 index 3e7c7e94..00000000 --- a/changelogs/internal/newsfragments/1660.clarification +++ /dev/null @@ -1 +0,0 @@ -Upgrade GitHub actions. diff --git a/changelogs/server_server/newsfragments/1636.clarification b/changelogs/server_server/newsfragments/1636.clarification deleted file mode 100644 index 9f39a014..00000000 --- a/changelogs/server_server/newsfragments/1636.clarification +++ /dev/null @@ -1 +0,0 @@ -Fix schema of `m.receipt` EDU. diff --git a/changelogs/server_server/newsfragments/1661.clarification b/changelogs/server_server/newsfragments/1661.clarification deleted file mode 100644 index 3ccb2333..00000000 --- a/changelogs/server_server/newsfragments/1661.clarification +++ /dev/null @@ -1 +0,0 @@ -Fix various typos throughout the specification. diff --git a/changelogs/server_server/newsfragments/1672.clarification b/changelogs/server_server/newsfragments/1672.clarification deleted file mode 100644 index d664c0b3..00000000 --- a/changelogs/server_server/newsfragments/1672.clarification +++ /dev/null @@ -1 +0,0 @@ -Clarify that federation requests for non-local users are invalid. diff --git a/config.toml b/config.toml index 9377b1f3..ac5dae65 100644 --- a/config.toml +++ b/config.toml @@ -47,14 +47,14 @@ privacy_policy = "https://matrix.org/legal/privacy-notice" [params.version] # must be one of "unstable", "current", "historical" # this is used to decide whether to show a banner pointing to the current release -status = "unstable" +status = "stable" # A URL pointing to the latest, stable release of the spec. To be shown in the unstable version warning banner. current_version_url = "https://spec.matrix.org/latest" # The following is used when status = "stable", and is displayed in various UI elements on a released version # of the spec. CI will set these values here automatically when a release git tag (i.e `v1.5`) is created. -# major = "1" -# minor = "8" -# release_date = "August 23, 2023" +major = "1" +minor = "9" +release_date = "November 29, 2023" # User interface configuration [params.ui] diff --git a/content/changelog/v1.9.md b/content/changelog/v1.9.md new file mode 100644 index 00000000..46a79f37 --- /dev/null +++ b/content/changelog/v1.9.md @@ -0,0 +1,93 @@ +--- +date: 2023-11-29T10:04:26-07:00 +--- + + +## v1.9 + + + + +
Git commithttps://github.com/matrix-org/matrix-spec/tree/v1.9
Release dateNovember 29, 2023
+ + + +### Client-Server API + +**Backwards Compatible Changes** + +- Add the `m.rule.suppress_edits` default push rule, as per [MSC3958](https://github.com/matrix-org/matrix-spec-proposals/pull/3958). ([#1617](https://github.com/matrix-org/matrix-spec/issues/1617)) + +**Spec Clarifications** + +- Fix `m.call.negotiate` schema and example. ([#1546](https://github.com/matrix-org/matrix-spec/issues/1546)) +- Clarify that the `via` property is required for `m.space.parent` and `m.space.child` as per [MSC1772](https://github.com/matrix-org/matrix-spec-proposals/pull/1772). Contributed by @PaarthShah. ([#1618](https://github.com/matrix-org/matrix-spec/issues/1618)) +- Add a note to the `/publicRooms` API that the server name is case sensitive. ([#1638](https://github.com/matrix-org/matrix-spec/issues/1638)) +- Clarify that an `m.room.name` event with an absent `name` field is not expected behavior. ([#1639](https://github.com/matrix-org/matrix-spec/issues/1639)) +- Fix schemas used for account data and presence events in `GET /initialSync`. ([#1647](https://github.com/matrix-org/matrix-spec/issues/1647)) +- Fix various typos throughout the specification. ([#1658](https://github.com/matrix-org/matrix-spec/issues/1658), [#1661](https://github.com/matrix-org/matrix-spec/issues/1661), [#1665](https://github.com/matrix-org/matrix-spec/issues/1665)) +- Fix `.m.rule.suppress_notices` push rule not being valid JSON. ([#1671](https://github.com/matrix-org/matrix-spec/issues/1671)) +- Add missing properties for `event_property_is` and `event_property_contains` push conditions to `PushConditions` object. ([#1673](https://github.com/matrix-org/matrix-spec/issues/1673)) +- Indicate that fallback keys should have a `fallback` property set to `true`. ([#1676](https://github.com/matrix-org/matrix-spec/issues/1676)) +- Clarify that thread roots are not considered within the thread. ([#1677](https://github.com/matrix-org/matrix-spec/issues/1677)) + + +### Server-Server API + +**Spec Clarifications** + +- Fix schema of `m.receipt` EDU. ([#1636](https://github.com/matrix-org/matrix-spec/issues/1636)) +- Fix various typos throughout the specification. ([#1661](https://github.com/matrix-org/matrix-spec/issues/1661)) +- Clarify that federation requests for non-local users are invalid. ([#1672](https://github.com/matrix-org/matrix-spec/issues/1672)) + + +### Application Service API + +No significant changes. + + +### Identity Service API + +No significant changes. + + +### Push Gateway API + +No significant changes. + + +### Room Versions + +No significant changes. + + +### Appendices + +**Spec Clarifications** + +- Clarify timestamp specification with respect to leap seconds. ([#1627](https://github.com/matrix-org/matrix-spec/issues/1627)) +- Fix various typos throughout the specification. ([#1652](https://github.com/matrix-org/matrix-spec/issues/1652)) + + +### Internal Changes/Tooling + +**Backwards Compatible Changes** + +- Add more CI checks for OpenAPI definitions and JSON Schemas. ([#1656](https://github.com/matrix-org/matrix-spec/issues/1656)) +- Generate server-server OpenAPI definition. ([#1657](https://github.com/matrix-org/matrix-spec/issues/1657)) + +**Spec Clarifications** + +- Replace all mentions of Swagger by OpenAPI. ([#1633](https://github.com/matrix-org/matrix-spec/issues/1633)) +- Fix enum types in JSON schemas. ([#1634](https://github.com/matrix-org/matrix-spec/issues/1634)) +- Fix schema of `m.mentions` object. ([#1635](https://github.com/matrix-org/matrix-spec/issues/1635)) +- Fix rendering of `m.receipt` event in Client-Server API. ([#1637](https://github.com/matrix-org/matrix-spec/issues/1637)) +- Remove required `fieldname` in appservice Protocol definition. ([#1646](https://github.com/matrix-org/matrix-spec/issues/1646)) +- Fix github action workflow responsible for releasing of @matrix-org/spec package. ([#1648](https://github.com/matrix-org/matrix-spec/issues/1648)) +- Upgrade GitHub actions. ([#1660](https://github.com/matrix-org/matrix-spec/issues/1660)) From d50929d46bf50d49c0dd0b6317e7f29501fb895f Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Wed, 29 Nov 2023 10:11:14 -0700 Subject: [PATCH 042/268] Become unstable --- config.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config.toml b/config.toml index ac5dae65..0ed67d16 100644 --- a/config.toml +++ b/config.toml @@ -47,14 +47,14 @@ privacy_policy = "https://matrix.org/legal/privacy-notice" [params.version] # must be one of "unstable", "current", "historical" # this is used to decide whether to show a banner pointing to the current release -status = "stable" +status = "unstable" # A URL pointing to the latest, stable release of the spec. To be shown in the unstable version warning banner. current_version_url = "https://spec.matrix.org/latest" # The following is used when status = "stable", and is displayed in various UI elements on a released version # of the spec. CI will set these values here automatically when a release git tag (i.e `v1.5`) is created. -major = "1" -minor = "9" -release_date = "November 29, 2023" +# major = "1" +# minor = "9" +# release_date = "November 29, 2023" # User interface configuration [params.ui] From 59f8d632a38f797c02bae3af2c8c22feb837b329 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Wed, 29 Nov 2023 10:59:23 -0700 Subject: [PATCH 043/268] Add step to release process to remind ourselves to reach out to Advocacy (#1680) * Add step to release process to remind ourselves to reach out to Advocacy * changelog --- .github/ISSUE_TEMPLATE/release.md | 1 + changelogs/internal/newsfragments/1680.clarification | 1 + 2 files changed, 2 insertions(+) create mode 100644 changelogs/internal/newsfragments/1680.clarification diff --git a/.github/ISSUE_TEMPLATE/release.md b/.github/ISSUE_TEMPLATE/release.md index 83701f14..e46834b9 100644 --- a/.github/ISSUE_TEMPLATE/release.md +++ b/.github/ISSUE_TEMPLATE/release.md @@ -16,6 +16,7 @@ Previous release: Preflight checklist ([release steps](https://github.com/matrix-org/matrix-spec/blob/main/meta/releasing.md)): +* [ ] Ensure the social media account holders are available for the release day. * [ ] Blog post written * [ ] Check for release blockers that may have been missed * [ ] Review/fix the changelog diff --git a/changelogs/internal/newsfragments/1680.clarification b/changelogs/internal/newsfragments/1680.clarification new file mode 100644 index 00000000..16352364 --- /dev/null +++ b/changelogs/internal/newsfragments/1680.clarification @@ -0,0 +1 @@ +Update the spec release process. \ No newline at end of file From 3b2146c875c25ad87f5424af4294c169957bc3a0 Mon Sep 17 00:00:00 2001 From: Andy Balaam Date: Tue, 5 Dec 2023 16:28:05 +0000 Subject: [PATCH 044/268] Batch receipts by thread as well as room (#1685) --- changelogs/client_server/newsfragments/1685.clarification | 1 + content/client-server-api/modules/receipts.md | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changelogs/client_server/newsfragments/1685.clarification diff --git a/changelogs/client_server/newsfragments/1685.clarification b/changelogs/client_server/newsfragments/1685.clarification new file mode 100644 index 00000000..9daf762e --- /dev/null +++ b/changelogs/client_server/newsfragments/1685.clarification @@ -0,0 +1 @@ +Clarify that read-receipts should be batched by thread as well as room. diff --git a/content/client-server-api/modules/receipts.md b/content/client-server-api/modules/receipts.md index 54c8c7cf..d8733e19 100644 --- a/content/client-server-api/modules/receipts.md +++ b/content/client-server-api/modules/receipts.md @@ -208,7 +208,7 @@ event when the user expands that thread. #### Server behaviour -For efficiency, receipts SHOULD be batched into one event per room +For efficiency, receipts SHOULD be batched into one event per room and thread before delivering them to clients. Some receipts are sent across federation as EDUs with type `m.receipt`. The From a843cad285f9b302f12060631bda58d289be10ee Mon Sep 17 00:00:00 2001 From: Andy Balaam Date: Mon, 11 Dec 2023 13:00:59 +0000 Subject: [PATCH 045/268] Clarify that threads can be created based on replies (#1687) Signed-off-by: Andy Balaam Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> --- changelogs/client_server/newsfragments/1687.clarification | 1 + content/client-server-api/modules/threading.md | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 changelogs/client_server/newsfragments/1687.clarification diff --git a/changelogs/client_server/newsfragments/1687.clarification b/changelogs/client_server/newsfragments/1687.clarification new file mode 100644 index 00000000..09bacd28 --- /dev/null +++ b/changelogs/client_server/newsfragments/1687.clarification @@ -0,0 +1 @@ +Clarify that threads can be created based on replies. diff --git a/content/client-server-api/modules/threading.md b/content/client-server-api/modules/threading.md index b6e11821..f082f389 100644 --- a/content/client-server-api/modules/threading.md +++ b/content/client-server-api/modules/threading.md @@ -14,9 +14,11 @@ history behind a disclosure. Threads are established using a `rel_type` of `m.thread` and reference the *thread root* (the main timeline event to which the thread events refer). It is not possible to create a thread from an event which itself is the child of an event relationship (i.e., one with an `m.relates_to` -property). It is therefore also not possible to nest threads. All events in a -thread reference the thread root instead of the most recent message, unlike rich -reply chains. +property with a `rel_type` property - see [Relationship types](#relationship-types)). +It is therefore also not possible to nest threads. + +Unlike rich reply chains, all events in a thread reference the thread root +instead of the most recent message. As a worked example, the following represents a thread and how it would be formed: From 37ab151aad55e9f2145e479b72eae6f7c60a23e3 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> Date: Mon, 11 Dec 2023 16:29:01 +0000 Subject: [PATCH 046/268] Clarify secret storage format (#1695) --- .../newsfragments/1695.clarification | 1 + content/client-server-api/modules/secrets.md | 139 ++++++++++++------ 2 files changed, 94 insertions(+), 46 deletions(-) create mode 100644 changelogs/client_server/newsfragments/1695.clarification diff --git a/changelogs/client_server/newsfragments/1695.clarification b/changelogs/client_server/newsfragments/1695.clarification new file mode 100644 index 00000000..32d9bb51 --- /dev/null +++ b/changelogs/client_server/newsfragments/1695.clarification @@ -0,0 +1 @@ +Clarify the format of account data objects for secret storage. diff --git a/content/client-server-api/modules/secrets.md b/content/client-server-api/modules/secrets.md index 2d12d488..e222b814 100644 --- a/content/client-server-api/modules/secrets.md +++ b/content/client-server-api/modules/secrets.md @@ -66,6 +66,70 @@ default key. |------------|-----------|------------------------------------------| | key | string | **Required.** The ID of the default key. | + +###### `m.secret_storage.v1.aes-hmac-sha2` + +For the purposes of allowing clients to check whether a user has correctly +entered the key, keys for use with the `m.secret_storage.v1.aes-hmac-sha2` +algorithm are stored with some additional data. + +When storing a key, clients SHOULD: + +1. Given the secret storage key, generate 64 bytes by performing an + HKDF with SHA-256 as the hash, a salt of 32 bytes of 0, and the empty + string as the info. The first 32 bytes are used as the AES key, + and the next 32 bytes are used as the MAC key. + +2. Generate 16 random bytes, set bit 63 to 0 (in order to work around + differences in AES-CTR implementations), and use this as the AES + initialization vector (IV). + +3. Encrypt a message consisting of 32 byutes of 0, using AES-CTR-256 using the + AES key and IV generated above. + +4. Pass the raw encrypted data through HMAC-SHA-256 using the MAC key + generated above. + +5. Encode the IV from step 2, and the MAC from step 4, using [unpadded + base64](/appendices/#unpadded-base64), and store the results in the `iv` + and `mac` properties respectively in the `m.secret_storage.key.[key ID]` + account-data. (The ciphertext from step 3 is discarded after passing + through the MAC calculation.) + +This process can be repeated by a client checking if the key is correct: the +MAC should match if the key is correct. Note, however, that these properties +are **optional**. If they are not present, clients must assume that the key is +valid. + +Note also, that although clients SHOULD use unpadded base64 as specified above, +some existing implementations use standard [RFC4648-compliant +base64](https://datatracker.ietf.org/doc/html/rfc4648#section-4) with padding, +so clients must accept either encoding. + +The structure of a `m.secret_storage.key.[key ID]` account data object for use +with this algorithm is therefore as follows: + +`AesHmacSha2KeyDescription` + +| Parameter | Type | Description | +|-------------|--------|------------------------------------------------------------------------------------------------------| +| name | string | Optional. The name of the key. | +| algorithm | string | **Required.** The encryption algorithm to be used for this key: `m.secret_storage.v1.aes-hmac-sha2`. | +| passphrase | object | See [deriving keys from passphrases](#deriving-keys-from-passphrases) section for a description of this property. | +| iv | string | Optional. The 16-byte initialization vector for the validation check, encoded as base64. | +| mac | string | Optional. The MAC of the result of encrypting 32 bytes of 0, encoded as base64. | + +For example, it could look like: + +```json +{ + "name": "m.default", + "algorithm": "m.secret_storage.v1.aes-hmac-sha2", + "iv": "random+data", + "mac": "mac+of+encrypted+zeros" +} +``` + ##### Secret storage Encrypted data is stored in the user's account data using the event @@ -82,7 +146,7 @@ of the data. | Parameter | Type | Description | |-----------|------------------|-------------| -| encrypted | {string: object} | **Required.** Map from key ID the encrypted data. The exact format for the encrypted data is dependent on the key algorithm. See the definition of `AesHmacSha2EncryptedData` in the [m.secret_storage.v1.aes-hmac-sha2](#msecret_storagev1aes-hmac-sha2) section. | +| encrypted | {string: object} | **Required.** Map from key ID the encrypted data. The exact format for the encrypted data is dependent on the key algorithm. See the definition of `AesHmacSha2EncryptedData` in the [m.secret_storage.v1.aes-hmac-sha2](#msecret_storagev1aes-hmac-sha2-1) section. | Example: @@ -147,58 +211,41 @@ HMAC-SHA-256. The secret is encrypted as follows: 1. Given the secret storage key, generate 64 bytes by performing an HKDF with SHA-256 as the hash, a salt of 32 bytes of 0, and with the secret name as the info. The first 32 bytes are used as the AES key, - and the next 32 bytes are used as the MAC key + and the next 32 bytes are used as the MAC key. + 2. Generate 16 random bytes, set bit 63 to 0 (in order to work around differences in AES-CTR implementations), and use this as the AES - initialization vector. This becomes the `iv` property, encoded using - base64. -3. Encrypt the data using AES-CTR-256 using the AES key generated - above. This encrypted data, encoded using base64, becomes the - `ciphertext` property. -4. Pass the raw encrypted data (prior to base64 encoding) through - HMAC-SHA-256 using the MAC key generated above. The resulting MAC is - base64-encoded and becomes the `mac` property. + initialization vector (IV). + +3. Encrypt the data using AES-CTR-256 using the AES key and IV generated + above. + +4. Pass the raw encrypted data through HMAC-SHA-256 using the MAC key + generated above. + +5. Encode the IV from step 2, the ciphertext from step 3, and MAC from step 4, + using [unpadded base64](/appendices/#unpadded-base64), and store them as + the `iv`, `ciphertext`, and `mac` properties respectively in the account + data object. + + **Note**: some existing implementations encode these properties using + standard [RFC4648-compliant + base64](https://datatracker.ietf.org/doc/html/rfc4648#section-4) with + padding, so clients must accept either encoding. + +The structure of the `encrypted` property of an account data object encrypted +with this algorithm is therefore as follows: `AesHmacSha2EncryptedData` | Parameter | Type | Description |------------|---------|------------------------------------------------------------------------| -| iv | string | **Required.** The 16-byte initialization vector, encoded as base64. | -| ciphertext | string | **Required.** The AES-CTR-encrypted data, encoded as base64. | -| mac | string | **Required.** The MAC, encoded as base64. | +| iv | string | **Required.** The 16-byte initialization vector, encoded as base64. | +| ciphertext | string | **Required.** The AES-CTR-encrypted data, encoded as base64. | +| mac | string | **Required.** The MAC, encoded as base64. | -For the purposes of allowing clients to check whether a user has -correctly entered the key, clients should: -1. encrypt and MAC a message consisting of 32 bytes of 0 as described - above, using the empty string as the info parameter to the HKDF in - step 1. -2. store the `iv` and `mac` in the `m.secret_storage.key.[key ID]` - account-data. - -`AesHmacSha2KeyDescription` - -| Parameter | Type | Description | -|-------------|--------|-----------------------------------------------------------------------------------------------------------------------------------| -| name | string | Optional. The name of the key. | -| algorithm | string | **Required.** The encryption algorithm to be used for this key. Currently, only `m.secret_storage.v1.aes-hmac-sha2` is supported. | -| passphrase | object | See [deriving keys from passphrases](#deriving-keys-from-passphrases) section for a description of this property. | -| iv | string | The 16-byte initialization vector, encoded as base64. | -| mac | string | The MAC of the result of encrypting 32 bytes of 0, encoded as base64. | - -For example, the `m.secret_storage.key.key_id` for a key using this -algorithm could look like: - -```json -{ - "name": "m.default", - "algorithm": "m.secret_storage.v1.aes-hmac-sha2", - "iv": "random+data", - "mac": "mac+of+encrypted+zeros" -} -``` - -and data encrypted using this algorithm could look like this: +For example, data encrypted using this algorithm could look like this: ```json { @@ -212,7 +259,7 @@ and data encrypted using this algorithm could look like this: } ``` -###### Key representation +##### Key representation When a user is given a raw key for `m.secret_storage.v1.aes-hmac-sha2`, it will be presented as a string constructed as follows: @@ -232,7 +279,7 @@ it will be presented as a string constructed as follows: When decoding a raw key, the process should be reversed, with the exception that whitespace is insignificant in the user's input. -###### Deriving keys from passphrases +##### Deriving keys from passphrases A user may wish to use a chosen passphrase rather than a randomly generated key. In this case, information on how to generate the key from From 4a80df364aa7ff95e7c3f4f3b4932b54032879fb Mon Sep 17 00:00:00 2001 From: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> Date: Thu, 21 Dec 2023 18:13:26 +0000 Subject: [PATCH 047/268] Wording tweak in CONTRIBUTING.rst (#1697) --- CONTRIBUTING.rst | 2 +- changelogs/internal/newsfragments/1697.clarification | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changelogs/internal/newsfragments/1697.clarification diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 46c6c560..93763a29 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -72,7 +72,7 @@ ask. Adding to the changelog ~~~~~~~~~~~~~~~~~~~~~~~ -All API specifications require a changelog entry. Adding to the changelog can only +All changes to the contents of this repository require a changelog entry. Adding to the changelog can only be done after you've opened your pull request, so be sure to do that first. The changelog is managed by `Towncrier `_ in the diff --git a/changelogs/internal/newsfragments/1697.clarification b/changelogs/internal/newsfragments/1697.clarification new file mode 100644 index 00000000..d238b2e9 --- /dev/null +++ b/changelogs/internal/newsfragments/1697.clarification @@ -0,0 +1 @@ +Minor clarifications to the contributing guide. From 1d35e7aac6a56d052b066d8cb35dc981005e896f Mon Sep 17 00:00:00 2001 From: Samuel Loury Date: Mon, 15 Jan 2024 13:35:06 +0100 Subject: [PATCH 048/268] Make clearer in the example that the fallback prefix sequence should be repeated for each line (#1690) Signed-off-by: Samuel Loury Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> --- changelogs/client_server/newsfragments/1690.clarification | 1 + content/client-server-api/modules/rich_replies.md | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/client_server/newsfragments/1690.clarification diff --git a/changelogs/client_server/newsfragments/1690.clarification b/changelogs/client_server/newsfragments/1690.clarification new file mode 100644 index 00000000..02427e33 --- /dev/null +++ b/changelogs/client_server/newsfragments/1690.clarification @@ -0,0 +1 @@ +Make clearer in the example for reply fallbacks that the prefix sequence should be repeated for each line. \ No newline at end of file diff --git a/content/client-server-api/modules/rich_replies.md b/content/client-server-api/modules/rich_replies.md index a0018630..ef07b697 100644 --- a/content/client-server-api/modules/rich_replies.md +++ b/content/client-server-api/modules/rich_replies.md @@ -60,7 +60,8 @@ specific fallback text is different for each `msgtype`, however the general format for the `body` is: ```text -> <@alice:example.org> This is the original body +> <@alice:example.org> This is the first line of the original body +> This is the second line This is where the reply goes ``` From 9a5cacda902d6a37bc20e74ee89f1642cd282a78 Mon Sep 17 00:00:00 2001 From: Sumner Evans Date: Tue, 16 Jan 2024 12:11:44 -0700 Subject: [PATCH 049/268] Clarify that the key backup MAC is implemented incorrectly (#1712) * Clarify that the key backup MAC is implemented incorrectly Due to a bug in libolm, all implementations of the m.megolm_backup.v1.curve25519-aes-sha2 key backup algorithm incorrectly pass an empty string through HMAC-SHA-256 to generate the `mac` property of the `session_data`. It was intended for the entire raw encrypted data to be passed through HMAC-SHA-256, but the issue was caught too late in the process, and thus we are stuck with this until a new key backup algorithm is introduced. This commit clarifies the real-world behavior of all current implementations. Signed-off-by: Sumner Evans --- .../newsfragments/1712.clarification | 1 + .../modules/end_to_end_encryption.md | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 changelogs/client_server/newsfragments/1712.clarification diff --git a/changelogs/client_server/newsfragments/1712.clarification b/changelogs/client_server/newsfragments/1712.clarification new file mode 100644 index 00000000..9e1523c5 --- /dev/null +++ b/changelogs/client_server/newsfragments/1712.clarification @@ -0,0 +1 @@ +Clarify that the key backup MAC is implemented incorrectly and does not pass the ciphertext through HMAC-SHA-256. diff --git a/content/client-server-api/modules/end_to_end_encryption.md b/content/client-server-api/modules/end_to_end_encryption.md index cdeed706..a4131d05 100644 --- a/content/client-server-api/modules/end_to_end_encryption.md +++ b/content/client-server-api/modules/end_to_end_encryption.md @@ -1364,10 +1364,18 @@ The `session_data` field in the backups is constructed as follows: PKCS\#7 padding. This encrypted data, encoded using unpadded base64, becomes the `ciphertext` property of the `session_data`. -5. Pass the raw encrypted data (prior to base64 encoding) through - HMAC-SHA-256 using the MAC key generated above. The first 8 bytes of - the resulting MAC are base64-encoded, and become the `mac` property - of the `session_data`. +5. Pass an empty string through HMAC-SHA-256 using the MAC key generated above. + The first 8 bytes of the resulting MAC are base64-encoded, and become the + `mac` property of the `session_data`. + +{{% boxes/warning %}} +Step 5 was intended to pass the raw encrypted data, but due to a bug in libolm, +all implementations have since passed an empty string instead. + +Future versions of the spec will fix this problem. See +[MSC4048](https://github.com/matrix-org/matrix-spec-proposals/pull/4048) for a +potential new key backup algorithm version that would fix this issue. +{{% /boxes/warning %}} {{% definition path="api/client-server/definitions/key_backup_session_data" %}} From 650e691a22221b56804c8aebfee1398381ecb370 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 17 Jan 2024 17:16:28 +0000 Subject: [PATCH 050/268] Fix npm release script (#1713) * Fix npm release script * Create 1713.misc --- .github/workflows/release.yaml | 2 +- changelogs/internal/newsfragments/1713.misc | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changelogs/internal/newsfragments/1713.misc diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index ef4162d8..05e5be7a 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -27,7 +27,7 @@ jobs: run: "yarn install --frozen-lockfile" - name: 🎖 Bump package.json version - run: "yarn version $VERSION" + run: "yarn version --new-version $VERSION" env: VERSION: ${{ github.event.release.tag_name }}.0 diff --git a/changelogs/internal/newsfragments/1713.misc b/changelogs/internal/newsfragments/1713.misc new file mode 100644 index 00000000..c1b999bf --- /dev/null +++ b/changelogs/internal/newsfragments/1713.misc @@ -0,0 +1 @@ +Fix npm release script for `@matrix-org/spec`. From 170626da67be5cf7e14aef189b23b8354fcd14e8 Mon Sep 17 00:00:00 2001 From: Hubert Chathi Date: Thu, 8 Feb 2024 15:54:52 -0500 Subject: [PATCH 051/268] clarify otk and fallback key types in examples (#1715) * clarify otk and fallback key types in examples - remove unsigned curve25519 keys from examples because we don't use those for otks and fallback keys - add missing `device_unused_fallback_key_types` property, which is required * add changelog --- changelogs/client_server/newsfragments/1715.clarification | 1 + content/client-server-api/modules/end_to_end_encryption.md | 4 ++-- data/api/client-server/keys.yaml | 3 --- 3 files changed, 3 insertions(+), 5 deletions(-) create mode 100644 changelogs/client_server/newsfragments/1715.clarification diff --git a/changelogs/client_server/newsfragments/1715.clarification b/changelogs/client_server/newsfragments/1715.clarification new file mode 100644 index 00000000..a1d30432 --- /dev/null +++ b/changelogs/client_server/newsfragments/1715.clarification @@ -0,0 +1 @@ +Clarify one-time key and fallback key types in examples. diff --git a/content/client-server-api/modules/end_to_end_encryption.md b/content/client-server-api/modules/end_to_end_encryption.md index a4131d05..880082bb 100644 --- a/content/client-server-api/modules/end_to_end_encryption.md +++ b/content/client-server-api/modules/end_to_end_encryption.md @@ -1776,9 +1776,9 @@ Example response: ], }, "device_one_time_keys_count": { - "curve25519": 10, "signed_curve25519": 20 - } + }, + "device_unused_fallback_key_types": ["signed_curve25519"] } ``` diff --git a/data/api/client-server/keys.yaml b/data/api/client-server/keys.yaml index 594d141d..3ec2a977 100644 --- a/data/api/client-server/keys.yaml +++ b/data/api/client-server/keys.yaml @@ -52,7 +52,6 @@ paths: May be absent if no new one-time keys are required. example: - curve25519:AAAAAQ: /qyvZvwjiTxGdGU0RCguDCLeR+nmsb3FfNG3/Ve4vU8 signed_curve25519:AAAAHg: key: zKbLg+NrIjpnagy+pIY6uPL4ZwEG2v+8F9lmgsnlZzs signatures: @@ -84,7 +83,6 @@ paths: May be absent if a new fallback key is not required. example: - curve25519:AAAAAG: /qyvZvwjiTxGdGU0RCguDCLeR+nmsb3FfNG3/Ve4vU8 signed_curve25519:AAAAGj: key: zKbLg+NrIjpnagy+pIY6uPL4ZwEG2v+8F9lmgsnlZzs fallback: true @@ -111,7 +109,6 @@ paths: If an algorithm is not listed, the count for that algorithm is to be assumed zero. example: - curve25519: 10 signed_curve25519: 20 required: - one_time_key_counts From c4e69d8cb15c3442484e988a83dc85d749423caa Mon Sep 17 00:00:00 2001 From: kegsay <7190048+kegsay@users.noreply.github.com> Date: Wed, 21 Feb 2024 21:16:40 +0000 Subject: [PATCH 052/268] Clarify that invite->knock is not a valid transition (#1717) This reverts https://github.com/matrix-org/matrix-spec/pull/1175 See https://github.com/matrix-org/matrix-spec/issues/1710 --- changelogs/room_versions/newsfragments/1717.clarification | 1 + content/rooms/fragments/v8-auth-rules.md | 3 ++- content/rooms/v10.md | 3 ++- content/rooms/v11.md | 3 ++- content/rooms/v7.md | 3 ++- 5 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 changelogs/room_versions/newsfragments/1717.clarification diff --git a/changelogs/room_versions/newsfragments/1717.clarification b/changelogs/room_versions/newsfragments/1717.clarification new file mode 100644 index 00000000..80bc9d55 --- /dev/null +++ b/changelogs/room_versions/newsfragments/1717.clarification @@ -0,0 +1 @@ +For room versions 7 through 11: Clarify that `invite->knock` is not a legal transition. \ No newline at end of file diff --git a/content/rooms/fragments/v8-auth-rules.md b/content/rooms/fragments/v8-auth-rules.md index 98a88bf1..3f1a4558 100644 --- a/content/rooms/fragments/v8-auth-rules.md +++ b/content/rooms/fragments/v8-auth-rules.md @@ -117,7 +117,8 @@ The rules are as follows: 7. If `membership` is `knock`: 1. If the `join_rule` is anything other than `knock`, reject. 2. If `sender` does not match `state_key`, reject. - 3. If the `sender`'s current membership is not `ban` or `join`, allow. + 3. If the `sender`'s current membership is not `ban`, `invite`, + or `join`, allow. 4. Otherwise, reject. 8. Otherwise, the membership is unknown. Reject. 5. If the `sender`'s current membership state is not `join`, reject. diff --git a/content/rooms/v10.md b/content/rooms/v10.md index 46bdb4c7..1d366c8c 100644 --- a/content/rooms/v10.md +++ b/content/rooms/v10.md @@ -194,7 +194,8 @@ The rules are as follows: If the `join_rule` is anything other than `knock` or `knock_restricted`, reject. 2. If `sender` does not match `state_key`, reject. - 3. If the `sender`'s current membership is not `ban` or `join`, allow. + 3. If the `sender`'s current membership is not `ban`, `invite`, + or `join`, allow. 4. Otherwise, reject. 8. Otherwise, the membership is unknown. Reject. 5. If the `sender`'s current membership state is not `join`, reject. diff --git a/content/rooms/v11.md b/content/rooms/v11.md index d0aa4b45..5d44161c 100644 --- a/content/rooms/v11.md +++ b/content/rooms/v11.md @@ -200,7 +200,8 @@ The rules are as follows: 1. If the `join_rule` is anything other than `knock` or `knock_restricted`, reject. 2. If `sender` does not match `state_key`, reject. - 3. If the `sender`'s current membership is not `ban` or `join`, allow. + 3. If the `sender`'s current membership is not `ban`, `invite`, + or `join`, allow. 4. Otherwise, reject. 8. Otherwise, the membership is unknown. Reject. 5. If the `sender`'s current membership state is not `join`, reject. diff --git a/content/rooms/v7.md b/content/rooms/v7.md index 40a9962c..eda351d0 100644 --- a/content/rooms/v7.md +++ b/content/rooms/v7.md @@ -139,7 +139,8 @@ The rules are as follows: If `membership` is `knock`: 1. If the `join_rule` is anything other than `knock`, reject. 2. If `sender` does not match `state_key`, reject. - 3. If the `sender`'s current membership is not `ban` or `join`, allow. + 3. If the `sender`'s current membership is not `ban`, `invite`, + or `join`, allow. 4. Otherwise, reject. 7. Otherwise, the membership is unknown. Reject. 5. If the `sender`'s current membership state is not `join`, reject. From 6096a289848a9558b9852d740c3bde4cf1a7bd7e Mon Sep 17 00:00:00 2001 From: Sumner Evans Date: Mon, 26 Feb 2024 09:24:52 -0700 Subject: [PATCH 053/268] sas: clarify HKDF calculation uses base64-encoded keys (#1719) --- changelogs/client_server/newsfragments/1719.clarification | 1 + .../client-server-api/modules/end_to_end_encryption.md | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 changelogs/client_server/newsfragments/1719.clarification diff --git a/changelogs/client_server/newsfragments/1719.clarification b/changelogs/client_server/newsfragments/1719.clarification new file mode 100644 index 00000000..031e1e41 --- /dev/null +++ b/changelogs/client_server/newsfragments/1719.clarification @@ -0,0 +1 @@ +Clarify that the HKDF calculation for SAS uses base64-encoded keys rather than the raw key bytes. diff --git a/content/client-server-api/modules/end_to_end_encryption.md b/content/client-server-api/modules/end_to_end_encryption.md index 880082bb..1126c648 100644 --- a/content/client-server-api/modules/end_to_end_encryption.md +++ b/content/client-server-api/modules/end_to_end_encryption.md @@ -836,15 +836,15 @@ is the concatenation of: - The Device ID of the device which sent the `m.key.verification.start` message, followed by `|`. - The public key from the `m.key.verification.key` message sent by - the device which sent the `m.key.verification.start` message, - followed by `|`. + the device which sent the `m.key.verification.start` message, encoded as + unpadded base64, followed by `|`. - The Matrix ID of the user who sent the `m.key.verification.accept` message, followed by `|`. - The Device ID of the device which sent the `m.key.verification.accept` message, followed by `|`. - The public key from the `m.key.verification.key` message sent by - the device which sent the `m.key.verification.accept` message, - followed by `|`. + the device which sent the `m.key.verification.accept` message, encoded as + unpadded base64, followed by `|`. - The `transaction_id` being used. When the `key_agreement_protocol` is the deprecated method `curve25519`, From 9a1f0ad532579c55f583c0ddb683a4ba85283bc9 Mon Sep 17 00:00:00 2001 From: Sumner Evans Date: Mon, 26 Feb 2024 09:26:34 -0700 Subject: [PATCH 054/268] sas: clarify ECDH process in step 12 (#1720) Co-authored-by: Denis Kasak --- .../client_server/newsfragments/1720.clarification | 1 + .../client-server-api/modules/end_to_end_encryption.md | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 changelogs/client_server/newsfragments/1720.clarification diff --git a/changelogs/client_server/newsfragments/1720.clarification b/changelogs/client_server/newsfragments/1720.clarification new file mode 100644 index 00000000..e8c8a623 --- /dev/null +++ b/changelogs/client_server/newsfragments/1720.clarification @@ -0,0 +1 @@ +Clarify how to perform the ECDH exchange in step 12 of the SAS process. diff --git a/content/client-server-api/modules/end_to_end_encryption.md b/content/client-server-api/modules/end_to_end_encryption.md index 1126c648..6c3bbbea 100644 --- a/content/client-server-api/modules/end_to_end_encryption.md +++ b/content/client-server-api/modules/end_to_end_encryption.md @@ -660,10 +660,12 @@ The process between Alice and Bob verifying each other would be: 11. Alice's device receives Bob's message and verifies the commitment hash from earlier matches the hash of the key Bob's device just sent and the content of Alice's `m.key.verification.start` message. -12. Both Alice and Bob's devices perform an Elliptic-curve - Diffie-Hellman - (*ECDH(KAprivate*, *KBpublic*)), - using the result as the shared secret. +12. Both Alice's and Bob's devices perform an Elliptic-curve Diffie-Hellman using + their private ephemeral key, and the other device's ephemeral public key + (*ECDH(KAprivate*, *KBpublic*) + for Alice's device and + *ECDH(KBprivate*, *KApublic*) + for Bob's device), using the result as the shared secret. 13. Both Alice and Bob's devices display a SAS to their users, which is derived from the shared key using one of the methods in this section. If multiple SAS methods are available, clients should allow From 4cfe2fbf8d482f9c8f1b9b7a450cc948cd533fd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= <76261501+zecakeh@users.noreply.github.com> Date: Mon, 26 Feb 2024 23:15:44 +0100 Subject: [PATCH 055/268] Use `body` field as media caption (#1731) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Use `body` field as media caption As per MSC2530. Signed-off-by: Kévin Commaille * Add changelog Signed-off-by: Kévin Commaille * Use `s` HTML tag in example Signed-off-by: Kévin Commaille * Move changed-in annotation Signed-off-by: Kévin Commaille --------- Signed-off-by: Kévin Commaille --- .../client_server/newsfragments/1731.feature | 1 + .../modules/instant_messaging.md | 59 +++++++++++++++++-- .../schema/m.room.message$m.audio.yaml | 23 +++++++- .../schema/m.room.message$m.file.yaml | 19 +++++- .../schema/m.room.message$m.image.yaml | 23 +++++++- .../schema/m.room.message$m.video.yaml | 23 +++++++- 6 files changed, 140 insertions(+), 8 deletions(-) create mode 100644 changelogs/client_server/newsfragments/1731.feature diff --git a/changelogs/client_server/newsfragments/1731.feature b/changelogs/client_server/newsfragments/1731.feature new file mode 100644 index 00000000..f4561bf3 --- /dev/null +++ b/changelogs/client_server/newsfragments/1731.feature @@ -0,0 +1 @@ +Use the `body` field as media caption, as per [MSC2530](https://github.com/matrix-org/matrix-spec-proposals/pull/2530). \ No newline at end of file diff --git a/content/client-server-api/modules/instant_messaging.md b/content/client-server-api/modules/instant_messaging.md index 5fcf379f..1fda62f4 100644 --- a/content/client-server-api/modules/instant_messaging.md +++ b/content/client-server-api/modules/instant_messaging.md @@ -27,10 +27,18 @@ instead. Some message types support HTML in the event content that clients should prefer to display if available. Currently `m.text`, `m.emote`, `m.notice`, -and `m.key.verification.request` support an additional `format` parameter of -`org.matrix.custom.html`. When this field is present, a `formatted_body` -with the HTML must be provided. The plain text version of the HTML -should be provided in the `body`. +`m.image`, `m.file`, `m.audio`, `m.video` and `m.key.verification.request` +support an additional `format` parameter of `org.matrix.custom.html`. When this +field is present, a `formatted_body` with the HTML must be provided. The plain +text version of the HTML should be provided in the `body`. + +{{% boxes/note %}} +{{% changed-in v="1.10" %}} +In previous versions of the specification, the `format` and `formatted` fields +were limited to `m.text`, `m.emote`, `m.notice`, and +`m.key.verification.request`. This list is expanded to include `m.image`, +`m.file`, `m.audio` and `m.video` for [media captions](#media-captions). +{{% /boxes/note %}} Clients should limit the HTML they render to avoid Cross-Site Scripting, HTML injection, and similar attacks. The strongly suggested set of HTML @@ -320,6 +328,49 @@ to the media repository, then reference the `mxc://` URI in a markdown-style lin Clients SHOULD render spoilers differently with some sort of disclosure. For example, the client could blur the actual text and ask the user to click on it for it to be revealed. +##### Media captions + +{{% added-in v="1.10" %}} + +Media messages, comprised of `m.image`, `m.file`, `m.audio` and `m.video`, can +include a caption to convey additional information about the media. + +To send captions, clients MUST use the `filename` and the `body`, and optionally +the `formatted_body` with the `org.matrix.custom.html` format, described above. + +If the `filename` is present, and its value is different than `body`, then +`body` is considered to be a caption, otherwise `body` is a filename. `format` +and `formatted_body` are only used for captions. + +{{% boxes/note %}} +In previous versions of the specification, `body` was usually used to set the +filename of the uploaded file, and `filename` was only present on `m.file` with +the same purpose. +{{% /boxes/note %}} + +An example of a media message with a caption is: + +```json +{ + "msgtype": "m.image", + "url": "mxc://example.org/abc123", + "filename": "dog.jpg", + "body": "this is a ~~cat~~ picture :3", + "format": "org.matrix.custom.html", + "formatted_body": "this is a cat picture :3", + "info": { + "w": 479, + "h": 640, + "mimetype": "image/jpeg", + "size": 27253 + }, + "m.mentions": {} +} +``` + +Clients MUST render the caption alongside the media and SHOULD prefer its +formatted representation. + #### Server behaviour Homeservers SHOULD reject `m.room.message` events which don't have a diff --git a/data/event-schemas/schema/m.room.message$m.audio.yaml b/data/event-schemas/schema/m.room.message$m.audio.yaml index 6cf742e4..825419bd 100644 --- a/data/event-schemas/schema/m.room.message$m.audio.yaml +++ b/data/event-schemas/schema/m.room.message$m.audio.yaml @@ -6,8 +6,29 @@ properties: content: properties: body: - description: "A description of the audio e.g. 'Bee Gees - Stayin' Alive', or some kind of content description for accessibility e.g. 'audio attachment'." + description: |- + If `filename` is not set or the value of both properties are + identical, this is the filename of the original upload. Otherwise, + this is a caption for the audio. type: string + x-changedInMatrixVersion: + "1.10": This property can act as a caption for the audio. + format: + description: |- + The format used in the `formatted_body`. Currently only + `org.matrix.custom.html` is supported. + type: string + x-addedInMatrixVersion: "1.10" + formatted_body: + description: |- + The formatted version of the `body`, when it acts as a caption. This + is required if `format` is specified. + type: string + x-addedInMatrixVersion: "1.10" + filename: + description: The original filename of the uploaded file. + type: string + x-addedInMatrixVersion: "1.10" info: description: Metadata for the audio clip referred to in `url`. properties: diff --git a/data/event-schemas/schema/m.room.message$m.file.yaml b/data/event-schemas/schema/m.room.message$m.file.yaml index af181964..8e269366 100644 --- a/data/event-schemas/schema/m.room.message$m.file.yaml +++ b/data/event-schemas/schema/m.room.message$m.file.yaml @@ -6,8 +6,25 @@ properties: content: properties: body: - description: A human-readable description of the file. This is recommended to be the filename of the original upload. + description: |- + If `filename` is not set or the value of both properties are + identical, this is the filename of the original upload. Otherwise, + this is a caption for the file. type: string + x-changedInMatrixVersion: + "1.10": This property can act as a caption for the file. + format: + description: |- + The format used in the `formatted_body`. Currently only + `org.matrix.custom.html` is supported. + type: string + x-addedInMatrixVersion: "1.10" + formatted_body: + description: |- + The formatted version of the `body`, when it acts as a caption. This + is required if `format` is specified. + type: string + x-addedInMatrixVersion: "1.10" filename: description: The original filename of the uploaded file. type: string diff --git a/data/event-schemas/schema/m.room.message$m.image.yaml b/data/event-schemas/schema/m.room.message$m.image.yaml index 91985ed0..15bdeda4 100644 --- a/data/event-schemas/schema/m.room.message$m.image.yaml +++ b/data/event-schemas/schema/m.room.message$m.image.yaml @@ -6,8 +6,29 @@ properties: content: properties: body: - description: "A textual representation of the image. This could be the alt text of the image, the filename of the image, or some kind of content description for accessibility e.g. 'image attachment'." + description: |- + If `filename` is not set or the value of both properties are + identical, this is the filename of the original upload. Otherwise, + this is a caption for the image. type: string + x-changedInMatrixVersion: + "1.10": This property can act as a caption for the image. + format: + description: |- + The format used in the `formatted_body`. Currently only + `org.matrix.custom.html` is supported. + type: string + x-addedInMatrixVersion: "1.10" + formatted_body: + description: |- + The formatted version of the `body`, when it acts as a caption. This + is required if `format` is specified. + type: string + x-addedInMatrixVersion: "1.10" + filename: + description: The original filename of the uploaded file. + type: string + x-addedInMatrixVersion: "1.10" info: allOf: - $ref: core-event-schema/msgtype_infos/image_info.yaml diff --git a/data/event-schemas/schema/m.room.message$m.video.yaml b/data/event-schemas/schema/m.room.message$m.video.yaml index e3b782b8..75752534 100644 --- a/data/event-schemas/schema/m.room.message$m.video.yaml +++ b/data/event-schemas/schema/m.room.message$m.video.yaml @@ -6,8 +6,29 @@ properties: content: properties: body: - description: "A description of the video e.g. 'Gangnam style', or some kind of content description for accessibility e.g. 'video attachment'." + description: |- + If `filename` is not set or the value of both properties are + identical, this is the filename of the original upload. Otherwise, + this is a caption for the video. type: string + x-changedInMatrixVersion: + "1.10": This property can act as a caption for the video. + format: + description: |- + The format used in the `formatted_body`. Currently only + `org.matrix.custom.html` is supported. + type: string + x-addedInMatrixVersion: "1.10" + formatted_body: + description: |- + The formatted version of the `body`, when it acts as a caption. This + is required if `format` is specified. + type: string + x-addedInMatrixVersion: "1.10" + filename: + description: The original filename of the uploaded file. + type: string + x-addedInMatrixVersion: "1.10" info: description: Metadata about the video clip referred to in `url`. properties: From e2dc5a38264d5883ed222e9263a6058816e29587 Mon Sep 17 00:00:00 2001 From: Cadence Ember Date: Tue, 27 Feb 2024 11:20:47 +1300 Subject: [PATCH 056/268] strike element is deprecated, s replaces it (#1629) * strike element is deprecated, s replaces it * Add newsfragment --- changelogs/client_server/newsfragments/1629.clarification | 1 + content/client-server-api/modules/instant_messaging.md | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changelogs/client_server/newsfragments/1629.clarification diff --git a/changelogs/client_server/newsfragments/1629.clarification b/changelogs/client_server/newsfragments/1629.clarification new file mode 100644 index 00000000..81ed5aaa --- /dev/null +++ b/changelogs/client_server/newsfragments/1629.clarification @@ -0,0 +1 @@ +The [strike](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/strike) element is deprecated in the HTML spec. Clients should prefer [s](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/s) instead. \ No newline at end of file diff --git a/content/client-server-api/modules/instant_messaging.md b/content/client-server-api/modules/instant_messaging.md index 1fda62f4..8a63dd9e 100644 --- a/content/client-server-api/modules/instant_messaging.md +++ b/content/client-server-api/modules/instant_messaging.md @@ -45,7 +45,7 @@ HTML injection, and similar attacks. The strongly suggested set of HTML tags to permit, denying the use and rendering of anything else, is: `font`, `del`, `h1`, `h2`, `h3`, `h4`, `h5`, `h6`, `blockquote`, `p`, `a`, `ul`, `ol`, `sup`, `sub`, `li`, `b`, `i`, `u`, `strong`, `em`, -`strike`, `code`, `hr`, `br`, `div`, `table`, `thead`, `tbody`, `tr`, +`s`, `code`, `hr`, `br`, `div`, `table`, `thead`, `tbody`, `tr`, `th`, `td`, `caption`, `pre`, `span`, `img`, `details`, `summary`. Not all attributes on those tags should be permitted as they may be From b136b357e01e68f6ec68a51e7d7524890d98d2f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= <76261501+zecakeh@users.noreply.github.com> Date: Tue, 27 Feb 2024 19:12:39 +0100 Subject: [PATCH 057/268] Update docsy to v0.8.0 (#1699) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Kévin Commaille --- .gitmodules | 7 - README.md | 5 +- .../{custom.scss => _styles_project.scss} | 34 +- assets/scss/_variables_project.scss | 5 +- .../internal/newsfragments/1699.clarification | 1 + config.toml | 28 +- go.mod | 5 + go.sum | 4 + layouts/partials/breadcrumb.html | 4 +- layouts/partials/hooks/head-end.html | 11 - layouts/partials/navbar.html | 93 ++- package-lock.json | 541 ++++++++---------- package.json | 3 - themes/docsy | 1 - 14 files changed, 382 insertions(+), 360 deletions(-) delete mode 100644 .gitmodules rename assets/scss/{custom.scss => _styles_project.scss} (95%) create mode 100644 changelogs/internal/newsfragments/1699.clarification create mode 100644 go.mod create mode 100644 go.sum delete mode 160000 themes/docsy diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 3760b077..00000000 --- a/.gitmodules +++ /dev/null @@ -1,7 +0,0 @@ -[submodule "themes/docsy"] - path = themes/docsy - # We use our own forked version of the Docsy theme, - # to avoid loading fonts from CDNs, which Docsy currently - # doesn't support (see https://github.com/google/docsy/issues/605). - url = https://github.com/matrix-org/docsy.git - branch = master diff --git a/README.md b/README.md index 089bfe17..8b40c0f5 100644 --- a/README.md +++ b/README.md @@ -61,13 +61,12 @@ place after an MSC has been accepted, not as part of a proposal itself. 1. Install the extended version (often the OS default) of Hugo: . Note that at least Hugo - v0.93.0 is required. + v0.110.0 is required. Alternatively, use the Docker image at https://hub.docker.com/r/klakegg/hugo/. (The "extended edition" is required to process the SCSS.) -2. Run `npm i` to install the dependencies and fetch the docsy git submodule. - Note that this will require NodeJS to be installed. +2. Run `npm i` to install the dependencies. Note that this will require NodeJS to be installed. 3. Run `npm run get-proposals` to seed proposal data. This is merely for populating the content of the "Spec Change Proposals" page and is not required. 4. Run `hugo serve` (or `docker run --rm -it -v $(pwd):/src -p 1313:1313 diff --git a/assets/scss/custom.scss b/assets/scss/_styles_project.scss similarity index 95% rename from assets/scss/custom.scss rename to assets/scss/_styles_project.scss index c147b645..b275db4f 100644 --- a/assets/scss/custom.scss +++ b/assets/scss/_styles_project.scss @@ -18,9 +18,6 @@ limitations under the License. Custom SCSS for the Matrix spec */ -@import "variables_project"; -@import "variables"; - /* Import the CSS classes for the syntax highlighter. * * This is generated with: @@ -49,6 +46,10 @@ Custom SCSS for the Matrix spec } + .nav-link { + font-weight: normal; + } + a { color: $black; } @@ -292,7 +293,7 @@ footer { } /* Styles for sections that are rendered from data, such as HTTP APIs and event schemas */ -.rendered-data { +.td-content .rendered-data { background-color: $secondary-lightest-background; padding: 0.85rem; margin: 0.85rem 0; @@ -346,7 +347,7 @@ footer { } p code, table code { - background-color: inherit; + background-color: transparent; } table { @@ -396,6 +397,7 @@ footer { th, td, caption { padding: 1rem; + border-top: 1px $table-border-color solid; } &.object-table, &.response-table, &.content-type-table { @@ -408,14 +410,12 @@ footer { // ... but avoid double border between caption and table border-bottom: 0; + + background-color: $secondary-lighter-background; } - caption, tbody tr { - background-color: $table-row-default; - } - - tbody tr:nth-child(even) { - background-color: $table-row-alternate; + tbody tr { + --bs-table-striped-bg: #{$secondary-lighter-background}; } } @@ -517,3 +517,15 @@ dd { border-radius: 0.25rem; // was $border-radius, but that var isn't accessible here. } } + +/* Style for breadcrumbs */ +.td-breadcrumbs { + padding: .75rem 1rem; + background-color: #eee; + border-radius: .25rem; + margin-bottom: 1rem; + + .breadcrumb { + margin: 0; + } +} \ No newline at end of file diff --git a/assets/scss/_variables_project.scss b/assets/scss/_variables_project.scss index 8ff5fe98..6eec3e7c 100644 --- a/assets/scss/_variables_project.scss +++ b/assets/scss/_variables_project.scss @@ -20,7 +20,7 @@ $dark: #333; $gray-100: #FBFBFB; $secondary-background: #E5F5FB; -$secondary-lighter-background: #F4FaFC; +$secondary-lighter-background: #F4FAFC; $secondary-lightest-background: #FBFDFD; @@ -33,8 +33,7 @@ $warning-background: #FFE0E0; // colours for definition tables. // the border colour matches that used for "highlight" divs $table-border-color: rgba(black, .125); -$table-row-alternate: $secondary-lightest-background; -$table-row-default: $secondary-lighter-background; +$table-bg: $secondary-lightest-background; /* Configure docsy to use the default system fonts instead of Google Fonts. * See https://www.docsy.dev/docs/adding-content/lookandfeel/#fonts */ diff --git a/changelogs/internal/newsfragments/1699.clarification b/changelogs/internal/newsfragments/1699.clarification new file mode 100644 index 00000000..7d1c0526 --- /dev/null +++ b/changelogs/internal/newsfragments/1699.clarification @@ -0,0 +1 @@ +Update Docsy to v0.8.0. diff --git a/config.toml b/config.toml index 0ed67d16..15a284b5 100644 --- a/config.toml +++ b/config.toml @@ -7,9 +7,6 @@ canonifyURLs = true enableRobotsTXT = true -# Hugo allows theme composition (and inheritance). The precedence is from left to right. -theme = ["docsy"] - # We disable RSS, because (a) it's useless, (b) Hugo seems to generate broken # links to it when used with a --baseURL (for example, https://spec.matrix.org/v1.4/ # contains ``). @@ -23,6 +20,21 @@ languageName ="English" # Weight used for sorting. weight = 1 +# Entries in the main menu in the header. +[menus] +[[menus.main]] + name = 'Foundation' + url = 'https://matrix.org/foundation/' + weight = 10 +[[menus.main]] + name = 'FAQs' + url = 'https://matrix.org/faq' + weight = 20 +[[menus.main]] + name = 'Blog' + url = 'https://matrix.org/blog/posts' + weight = 30 + [markup] [markup.goldmark] [markup.goldmark.renderer] @@ -111,3 +123,13 @@ sidebar_menu_compact = true X-Frame-Options = "sameorigin" Access-Control-Allow-Origin = "*" Access-Control-Allow-Methods = "GET" + +# hugo module configuration + +[module] + [module.hugoVersion] + extended = true + min = "0.110.0" + [[module.imports]] + path = "github.com/matrix-org/docsy" + disable = false diff --git a/go.mod b/go.mod new file mode 100644 index 00000000..7988b29f --- /dev/null +++ b/go.mod @@ -0,0 +1,5 @@ +module github.com/matrix-org/matrix-spec + +go 1.12 + +require github.com/matrix-org/docsy v0.0.0-20231227121313-d55dbaf3aaaf // indirect diff --git a/go.sum b/go.sum new file mode 100644 index 00000000..1fb47ebd --- /dev/null +++ b/go.sum @@ -0,0 +1,4 @@ +github.com/FortAwesome/Font-Awesome v0.0.0-20230327165841-0698449d50f2/go.mod h1:IUgezN/MFpCDIlFezw3L8j83oeiIuYoj28Miwr/KUYo= +github.com/matrix-org/docsy v0.0.0-20231227121313-d55dbaf3aaaf h1:e1mutHvMYJ92F/VkAp2ixQthXf6zNHJll4wYGbBHznI= +github.com/matrix-org/docsy v0.0.0-20231227121313-d55dbaf3aaaf/go.mod h1:TAN2cSMJzy0hnx9OYDbBYluS8raV61UHxT/tfjaLt3g= +github.com/twbs/bootstrap v5.2.3+incompatible/go.mod h1:fZTSrkpSf0/HkL0IIJzvVspTt1r9zuf7XlZau8kpcY0= diff --git a/layouts/partials/breadcrumb.html b/layouts/partials/breadcrumb.html index 8e1fb9b2..af3a9551 100644 --- a/layouts/partials/breadcrumb.html +++ b/layouts/partials/breadcrumb.html @@ -8,8 +8,8 @@ */}} {{ if not .IsHome }} -