-
Notifications
You must be signed in to change notification settings - Fork 380
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Room versions 8 and 9: Restricted rooms
- Loading branch information
Showing
12 changed files
with
388 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
--- | ||
title: Room Version 8 | ||
type: docs | ||
weight: 60 | ||
--- | ||
|
||
This room version builds on [version 7](/rooms/v7) to introduce a new | ||
join rule that allows members to join the room based on membership in | ||
another room. | ||
|
||
{{% boxes/warning %}} | ||
This room version is known to have issues relating to redactions of member | ||
join events. [Room version 9](/rooms/v9) should be preferred over v8 when | ||
creating rooms. | ||
{{% /boxes/warning %}} | ||
|
||
## Client considerations | ||
|
||
Clients are encouraged to expose the option for the join rule in their | ||
user interface for supported room versions. Specifically, this feature | ||
is intended to be used primarily in conjunction with | ||
[MSC1772-style Spaces](https://github.com/matrix-org/matrix-doc/pull/1772) | ||
(allowing members of a space to join a given room), though any v8 capable | ||
room will be able to support this newly introduced join rule. | ||
|
||
The new join rule, `restricted`, is described in the Client-Server API | ||
under the [`m.room.join_rules`](/client-server-api/#mroomjoin_rules) section. | ||
|
||
## 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 %}} | ||
|
||
Room version 8 adds a new join rule to allow members of a room to join another | ||
room without invite. Otherwise, the room version inherits all properties of | ||
[Room version 7](/rooms/v7). | ||
|
||
### Authorization rules for events | ||
|
||
`m.room.member` events for `membership` of `join` are now validated as such: | ||
|
||
1. If the only previous event is an `m.room.create` and the `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 | ||
`knock`. | ||
5. **[New in this room version]** If the `join_rule` is `restricted`: | ||
1. If membership state is `join`, allow. | ||
2. If `content.join_authorised_via_users_server` is not a user with | ||
sufficient permission to invite other users, reject. | ||
3. If the event is not validly signed by the server denoted by the user ID in | ||
`content.join_authorised_via_users_server`, reject. | ||
4. Otherwise, allow. | ||
6. If the `join_rule` is `public`, allow. | ||
7. Otherwise, reject. | ||
|
||
The remaining rules are the same as in [room version 7](/rooms/v7#server-implementation-components). | ||
|
||
### Redactions | ||
|
||
Events of type `m.room.join_rules` now keep the following `content` properties | ||
when the event is redacted: | ||
* `join_rule` | ||
* **[New in this room version]** `allow` | ||
|
||
{{% boxes/warning %}} | ||
[Room version 9](/rooms/v9) adds additional cases of protected properties for behaviour | ||
related to restricted rooms (the functionality introduced in v8). v9 is preferred over | ||
v8 when creating new rooms. | ||
{{% /boxes/warning %}} | ||
|
||
The remaining rules are the same as in [room version 6](/rooms/v6#redactions) (the | ||
last room version to modify the redaction rules). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
--- | ||
title: Room Version 9 | ||
type: docs | ||
weight: 60 | ||
--- | ||
|
||
This room version builds on [version 8](/rooms/v8) to add additional redaction | ||
rules that were unintentionally missed when incorporating v8. | ||
|
||
## Client considerations | ||
|
||
See [room version 8](/rooms/v8) for specific details regarding the addition of | ||
restricted rooms. | ||
|
||
Clients which implement a local redaction algorithm are encouraged to read on. | ||
|
||
## 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 %}} | ||
|
||
Room version 8 added a new `restricted` join rule to allow members of a room | ||
to join another room without invite. Room version 9 is based upon v8 with the | ||
following considerations. | ||
|
||
### Redactions | ||
|
||
Events of type `m.room.member` now keep the following `content` properties | ||
when the event is redacted: | ||
* `membership` | ||
* **[New in this room version]** `join_authorised_via_users_server` | ||
|
||
The remaining rules are the same as in [room version 8](/rooms/v8#redactions). | ||
|
||
{{% 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 %}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.