Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cherry pick commits which went missing from what was matrix-doc #1052

Merged
merged 8 commits into from
May 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove unenforced size limit on the `name` field of `m.room.name` events.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove erroneous `room_id` field from examples of `m.read`, `m.typing` in `/sync` and `m.fully_read` in room account data.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix various typos throughout the specification.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix membership state transitions to denote that `invite->knock` and `external->leave` are valid transitions.
1 change: 1 addition & 0 deletions changelogs/room_versions/3739.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update the default room version to 9.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix join membership auth rules when `join_rule` is `knock`.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Clarify that the `content` for `X-Matrix` signature validation is the parsed JSON body.
Original file line number Diff line number Diff line change
Expand Up @@ -1171,7 +1171,7 @@ originally sent the key request to; a device that receives a
`request` message with the same `request_id` and `requesting_device_id`.

If a device does not wish to share keys with that device, it can
indicate this by sending an [m.room\_key.withheld](#mroom_key.withheld) to-device message,
indicate this by sending an [m.room\_key.withheld](#mroom_keywithheld) to-device message,
as described in [Reporting that decryption keys are
withheld](#reporting-that-decryption-keys-are-withheld).

Expand Down
2 changes: 1 addition & 1 deletion content/rooms/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ stable and unstable periodically for a variety of reasons, including
discovered security vulnerabilities and age.

Clients should not ask room administrators to upgrade their rooms if the
room is running a stable version. Servers SHOULD use **room version 6** as
room is running a stable version. Servers SHOULD use **room version 9** as
the default room version when creating new rooms.

The available room versions are:
Expand Down
4 changes: 2 additions & 2 deletions content/rooms/fragments/v8-auth-rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ The rules are as follows:
`state_key` is the creator, 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` then allow if membership
state is `invite` or `join`.
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`:
1. If membership state is `join` or `invite`, allow.
2. If the `join_authorised_via_users_server` key in `content`
Expand Down
4 changes: 2 additions & 2 deletions content/rooms/v7.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ The rules are as follows:
`state_key` is the creator, 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` then allow if membership
state is `invite` or `join`.
4. If the `join_rule` is `invite` or `knock` then allow if
membership state is `invite` or `join`.
5. If the `join_rule` is `public`, allow.
6. Otherwise, reject.
3. If `membership` is `invite`:
Expand Down
3 changes: 2 additions & 1 deletion content/server-server-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ Step 1 sign JSON:
"uri": "/target",
"origin": "origin.hs.example.com",
"destination": "destination.hs.example.com",
"content": <request body>,
"content": <JSON-parsed request body>,
"signatures": {
"origin.hs.example.com": {
"ed25519:key1": "ABCDEF..."
Expand Down Expand Up @@ -274,6 +274,7 @@ def authorization_headers(origin_name, origin_signing_key,
}

if content is not None:
# Assuming content is already parsed as JSON
request_json["content"] = content

signed_json = sign_json(request_json, origin_name, origin_signing_key)
Expand Down
3 changes: 1 addition & 2 deletions data/event-schemas/examples/core/room_edu.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{
"$ref": "event.json",
"room_id": "!jEsUZKDJdhlrceRyVU:example.org"
"$ref": "event.json"
}
1 change: 0 additions & 1 deletion data/event-schemas/examples/m.fully_read.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"$ref": "core/event.json",
"type": "m.fully_read",
"room_id": "!somewhere:example.org",
"content": {
"event_id": "$someplace:example.org"
}
Expand Down
6 changes: 1 addition & 5 deletions data/event-schemas/schema/m.fully_read.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@
"type": {
"type": "string",
"enum": ["m.fully_read"]
},
"room_id": {
"type": "string",
"description": "The room ID the read marker applies to."
}
},
"required": ["type", "room_id", "content"]
"required": ["type", "content"]
}
5 changes: 1 addition & 4 deletions data/event-schemas/schema/m.receipt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,7 @@
"type": {
"type": "string",
"enum": ["m.receipt"]
},
"room_id": {
"type": "string"
}
},
"required": ["room_id", "type", "content"]
"required": ["type", "content"]
}
16 changes: 8 additions & 8 deletions data/event-schemas/schema/m.room.member.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ description: |-
from the `prev_content` object on an event. If not present, the user's previous membership must be assumed
as `leave`.

| | to `invite` | to `join` | to `leave` | to `ban` | to `knock` |
|-------------------|----------------------|----------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------|-----------------------------|--------------------|
| **from `invite`** | No change. | User joined the room. | If the `state_key` is the same as the `sender`, the user rejected the invite. Otherwise, the `state_key` user had their invite revoked. | User was banned. | Must never happen. |
| **from `join`** | Must never happen. | `displayname` or `avatar_url` changed. | If the `state_key` is the same as the `sender`, the user left. Otherwise, the `state_key` user was kicked. | User was kicked and banned. | Must never happen. |
| **from `leave`** | New invitation sent. | User joined. | No change. | User was banned. | User is knocking. |
| **from `ban`** | Must never happen. | Must never happen. | User was unbanned. | No change. | Must never happen. |
| **from `knock`** | Knock accepted. | Must never happen. | If the `state_key` is the same as the `sender`, the user retracted the knock. Otherwise, the `state_key` user had their knock denied. | User was banned. | No change. |
| | to `invite` | to `join` | to `leave` | to `ban` | to `knock` |
|-------------------|----------------------|----------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------|-----------------------------|----------------------|
| **from `invite`** | No change. | User joined the room. | If the `state_key` is the same as the `sender`, the user rejected the invite. Otherwise, the `state_key` user had their invite revoked. | User was banned. | User is re-knocking. |
| **from `join`** | Must never happen. | `displayname` or `avatar_url` changed. | If the `state_key` is the same as the `sender`, the user left. Otherwise, the `state_key` user was kicked. | User was kicked and banned. | Must never happen. |
| **from `leave`** | New invitation sent. | User joined. | No change. | User was banned. | User is knocking. |
| **from `ban`** | Must never happen. | Must never happen. | User was unbanned. | No change. | Must never happen. |
| **from `knock`** | Knock accepted. | Must never happen. | If the `state_key` is the same as the `sender`, the user retracted the knock. Otherwise, the `state_key` user had their knock denied. | User was banned. | No change. |

properties:
content:
Expand Down Expand Up @@ -72,7 +72,7 @@ properties:

Client and server implementations should be aware of the [signing implications](/rooms/v8/#authorization-rules) of including this
field in further events: in particular, the event must be signed by the server which
owns the user ID in the field. When copying the membership event's `content`
owns the user ID in the field. When copying the membership event's `content`
(for profile updates and similar) it is therefore encouraged to exclude this
field in the copy, as otherwise the event might fail event authorization.
reason:
Expand Down
2 changes: 1 addition & 1 deletion data/event-schemas/schema/m.room.name.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ properties:
content:
properties:
name:
description: The name of the room. This MUST NOT exceed 255 bytes.
description: The name of the room.
type: string
required:
- name
Expand Down
5 changes: 1 addition & 4 deletions data/event-schemas/schema/m.typing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@
"type": {
"type": "string",
"enum": ["m.typing"]
},
"room_id": {
"type": "string"
}
},
"required": ["type", "room_id", "content"]
"required": ["type", "content"]
}
6 changes: 6 additions & 0 deletions scripts/dump-swagger.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ def edit_links(node, base_url):
except FileNotFoundError:
print("No security definitions available for this API")

untagged = 0
for filename in os.listdir(selected_api_dir):
if not filename.endswith(".yaml"):
continue
Expand All @@ -185,6 +186,11 @@ def edit_links(node, base_url):
if path not in output["paths"]:
output["paths"][path] = {}
output["paths"][path][method] = spec
if "tags" not in spec.keys():
print("Warning: {} {} is not tagged ({}).".format(method.upper(), path, filename))
untagged +=1
if untagged != 0:
print("{} untagged operations, you may want to look into fixing that.".format(untagged))

edit_links(output, base_url)

Expand Down
2 changes: 1 addition & 1 deletion static/diagrams/membership.drawio
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<mxfile host="Electron" modified="2022-01-18T16:40:44.155Z" agent="5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/16.1.2 Chrome/96.0.4664.55 Electron/16.0.5 Safari/537.36" etag="XO6otxm1zp3-pSiWzgkD" version="16.1.2" type="device"><diagram id="4a_pTli-mcEMNPq0ciXK" name="Page-1">1Vvbbts4EP0aA7sPMUTq6sfGTdIusrvFGtht+lLQNm0rlUWDpnzp15eyKOvGeEnJkpwAQcTRkBKHZ2YOh8rAHK8PTxRtVn+SOQ4G0JgfBubHAYTABR7/E0uOQmJAkEiW1J8LWSaY+D9xqiikkT/H24IiIyRg/qYonJEwxDNWkCFKyb6otiBB8akbtMQVwWSGgqr0P3/OVonUg24m/4T95Sp9MnBGyZ01SpXFTLYrNCf7nMh8GJhjSghLrtaHMQ5i66V2Sfo9vnH3/GIUh0ylwxfD/vnh+T6YhN/2m/CbPY5G7A6IYXYoiMSM+QivxA/FS7Njagk854YRTULZiixJiIKHTHpPSRTOcfw4g7cynWdCNlwIuPAVM3YUq4wiRrhoxdaBuFudkni9LYnoDF+ah4AGokvMLujBRC+eS+4BwmBPmKwxo0euQHGAmL8rggAJLC3PeqLrB0rRMaew4fZj29zIX2IBVxB+AUcCE8IrTKe0dHr6/CJ5g7SVm0omOsFBBxqWDBoBRtwqPWADH3z2NXf9Eg81hLZofjyIoU+NY9oIuQ2+5jTj9kv+Ztbv1Eo71kcif44a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r8i70/FWOXL/Hj0Srcal/0tUJ9PMIR3TWDNGqX1Prs61RJ5tPOCptPm29qkpJvw0882b2XyiJevbPPObDLw==</diagram></mxfile>
<mxfile host="Electron" modified="2022-02-18T05:31:13.369Z" agent="5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/16.5.1 Chrome/96.0.4664.110 Electron/16.0.7 Safari/537.36" etag="FwSKbslSItXwNPoLLuzM" version="16.5.1" type="device"><diagram id="4a_pTli-mcEMNPq0ciXK" name="Page-1">1VvZkto4FP0aqjIPdNnyBo9peklSnZmeoWayvKQECHC3sSghN5CvHxnLeFMbyeCFh1TQ9ZUX6Zyje6/UPWO02j0SuF5+xTPk9YA22/WMux4Auu4M2H+hZR9ZHE2LDAvizrhTYhi7vxE3xm6BO0ObjCPF2KPuOmucYt9HU5qxQULwNus2x172qWu4QAXDeAq9ovWbO6PLyDoATmL/hNzFMn6ybg+jKysYO/Mv2SzhDG9TJuO+Z4wIxjT6tdqNkBcOXjwuUb+Hd64eX4wgn8p0eNas3x+fbr2x/3O79n9ao2BI+zq/zRv0Av7F7A4v2PX5S9N9PBJoxgaGNzGhS7zAPvTuE+stwYE/Q+HjNNZKfJ4wXjOjzowviNI9n2UYUMxMS7ry+NXiJ/HX2+CATFHZd3BoQLJAtMQPRH7ht6QewAfsEeEVomTPHDh++9qNo5tG1IkgD1L3LQsMyPG1OPblt/tICNynHNZsTOkm9bTn0JA8Cgw5TjhRDDs3nWr+7Ef0Brne8evg+XzDRirbIzUEiekAIxVIFRDl+m8uRQVAZeGyXTKf8RoepnnLxEQSGm+IULSTmUymPZkRAxZvbxNi67E8LVOkjv1Ec50ZPeWhskXs8xBkIAMaJr2Q0g+v7vT1utgIJNloqrFRu9GG9qAKGZvEPwCiSZ3AVhQV7Vz6Pex+Y/HWj9SVux2/86Gxjxs+G4CoE7Di9rFb2Ej6HVpxx/oBYyjLt21Vk+9GEVMAjHABVtLLOfbpA1y5Xjg5Izb+L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J784aRx/z8=</diagram></mxfile>
Binary file modified static/diagrams/membership.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.