mirror of
https://github.com/matrix-org/matrix-spec
synced 2026-01-01 05:28:38 +01:00
Update schemas and auth rules to cover the @ state key restriction
Fixes https://github.com/matrix-org/matrix-doc/issues/1305 Also fixes an issue regarding the `_` being restricted previously, which is false.
This commit is contained in:
parent
132c5b0f48
commit
c297c6a35d
|
|
@ -11,7 +11,11 @@ properties:
|
||||||
state_key:
|
state_key:
|
||||||
description: A unique key which defines the overwriting semantics for this piece
|
description: A unique key which defines the overwriting semantics for this piece
|
||||||
of room state. This value is often a zero-length string. The presence of this
|
of room state. This value is often a zero-length string. The presence of this
|
||||||
key makes this event a State Event. The key MUST NOT start with '_'.
|
key makes this event a State Event.
|
||||||
|
|
||||||
|
State keys starting with an ``@`` are reserved for referencing user IDs, such
|
||||||
|
as room members. With the exception of a few events, state events set with a
|
||||||
|
given user's ID as the state key MUST only be set by that user.
|
||||||
type: string
|
type: string
|
||||||
required:
|
required:
|
||||||
- state_key
|
- state_key
|
||||||
|
|
|
||||||
|
|
@ -105,7 +105,10 @@ properties:
|
||||||
title: EventContent
|
title: EventContent
|
||||||
type: object
|
type: object
|
||||||
state_key:
|
state_key:
|
||||||
description: The ``user_id`` this membership event relates to.
|
description: |-
|
||||||
|
The ``user_id`` this membership event relates to. In all cases except for when ``membership`` is
|
||||||
|
``join``, the user ID sending the event does not need to match the user ID in the ``state_key``,
|
||||||
|
unlike other events. Regular authorisation rules still apply.
|
||||||
type: string
|
type: string
|
||||||
type:
|
type:
|
||||||
enum:
|
enum:
|
||||||
|
|
|
||||||
|
|
@ -450,7 +450,10 @@ The rules are as follows:
|
||||||
|
|
||||||
#. Otherwise, reject.
|
#. Otherwise, reject.
|
||||||
|
|
||||||
7. Otherwise, allow.
|
7. If the ``state_key`` starts with ``@`` and the ``state_key`` does not match
|
||||||
|
the ``sender``, reject.
|
||||||
|
|
||||||
|
8. Otherwise, allow.
|
||||||
|
|
||||||
.. NOTE::
|
.. NOTE::
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue