-
-
Notifications
You must be signed in to change notification settings - Fork 140
Specify room version 10: knock_restricted and int power levels
#1099
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
Changes from 19 commits
f443b3d
6b175d6
7fd54c4
666baf6
a5a4c1f
503a815
3dd5bee
b2fa4e5
be12f1e
16e7383
3d50019
1f3dc21
0174618
0eec78d
41ed640
5e3175a
56157dc
a8cd1ae
290fa16
1653b43
67d2847
47169fd
1e2f4f6
2b7483a
05ad39d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Add support for a new `knock_restricted` join rule in supported room versions, as per [MSC3787](https://github.com/matrix-org/matrix-spec-proposals/pull/3787). |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Clarify that room versions 1 through 9 accept stringy power levels, as noted by [MSC3667](https://github.com/matrix-org/matrix-spec-proposals/pull/3667). |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Add room version 10 as per [MSC3604](https://github.com/matrix-org/matrix-spec-proposals/pull/3604). |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Enforce integer power levels in room version 10 as per [MSC3667](https://github.com/matrix-org/matrix-spec-proposals/pull/3667). |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Add a `knock_restricted` join rule supported by room version 10 as per [MSC3787](https://github.com/matrix-org/matrix-spec-proposals/pull/3787). |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Clarifies the historical handling of non-integer power levels. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| --- | ||
| toc_hide: true | ||
| --- | ||
|
|
||
| Events sent into rooms of this version can have formats which are different | ||
| from their normal schema. Those cases are documented here. | ||
|
|
||
| {{% boxes/warning %}} | ||
| The behaviour described here is preserved strictly for backwards compatibility | ||
| only. A homeserver should take reasonable precautions to prevent users from | ||
| sending these so-called "malformed" events, and must never rely on the behaviours | ||
| described here as a default. | ||
| {{% /boxes/warning %}} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| --- | ||
| toc_hide: true | ||
| --- | ||
|
|
||
| ##### Power levels accepted as strings | ||
|
turt2live marked this conversation as resolved.
Outdated
|
||
|
|
||
| In order to maintain backwards compatibility with early implementations, | ||
| power levels can optionally be represented in string format instead of | ||
| integer format. A homeserver must be prepared to deal with this by parsing | ||
| the power level from a string. In these cases, the following formatting of the | ||
| power level string is allowed: | ||
|
turt2live marked this conversation as resolved.
Outdated
|
||
|
|
||
| * a single Base10 integer, no float values or decimal points, optionally with | ||
|
turt2live marked this conversation as resolved.
Outdated
|
||
| any number of leading zeroes (`"100"`, `"000100"`); | ||
| * optionally with any number of leading or trailing whitespace characters (`" 100 "`, | ||
| `" 00100 "`); | ||
|
turt2live marked this conversation as resolved.
Outdated
|
||
| * optionally prefixed with a single `-` or `+` character before the integer | ||
| but after leading whitespace padding (`" +100 "`, `" -100 "`, `"+100"`, | ||
| `"-100"`). | ||
|
|
||
| {{% boxes/note %}} | ||
| The integer represented by the string must still be within the `[-2^53, 2^53)` | ||
|
turt2live marked this conversation as resolved.
Outdated
|
||
| range accepted by normal, non-string, power level values. | ||
| {{% /boxes/note %}} | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. are you sure about this bit? I've not been able to find any sign of synapse rejecting strings outside this range. (in any case, what are servers meant to do with PL values outside this range?)
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is coming from #1082 (comment) which felt small enough to warrant inclusion. Rejection would be the same process as someone specifying a number too large for canonical json, I think.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. well, the problem here is that Synapse doesn't actually reject such events. Indeed, it doesn't even reject This is a spec change, and I find it hard to justify without either an MSC or evidence that it's always been this way. |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| --- | ||
| toc_hide: true | ||
| --- | ||
|
|
||
| {{% 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="v3-handling-redactions" %}} | ||
|
|
||
|
turt2live marked this conversation as resolved.
Outdated
|
||
| 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` | ||
| - `prev_state` | ||
| - `auth_events` | ||
| - `origin` | ||
| - `origin_server_ts` | ||
| - `membership` | ||
|
|
||
| The content object must also be stripped of all keys, unless it is one | ||
| of one 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`. | ||
Uh oh!
There was an error while loading. Please reload this page.