From aa3abad39ab24d496a01b0016c792cf2cab44027 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Tue, 24 Feb 2026 15:19:46 +0200 Subject: [PATCH] Adjust wording so the validation reads nicer --- data/api/server-server/invites-v1.yaml | 5 +++-- data/api/server-server/invites-v2.yaml | 5 +++-- data/api/server-server/joins-v1.yaml | 3 +-- data/api/server-server/joins-v2.yaml | 3 +-- data/api/server-server/knocks.yaml | 3 +-- data/api/server-server/leaving-v1.yaml | 3 +-- data/api/server-server/leaving-v2.yaml | 3 +-- 7 files changed, 11 insertions(+), 14 deletions(-) diff --git a/data/api/server-server/invites-v1.yaml b/data/api/server-server/invites-v1.yaml index 1e74a555..9468590b 100644 --- a/data/api/server-server/invites-v1.yaml +++ b/data/api/server-server/invites-v1.yaml @@ -39,7 +39,7 @@ paths: Servers MUST apply certain validation to ensure they don't accidentally sign non-invite events from a malicious server. A specific error code is not mandated, but servers SHOULD - use `M_INVALID_PARAM` for errors from all the following validation checks: + return `M_INVALID_PARAM` if: * The invite event fails a [signature check](/server-server-api/#validating-hashes-and-signatures-on-received-events). * The event type is not `m.room.member`. @@ -48,7 +48,8 @@ paths: * The `state_key` is not a user ID on the receiving server. The `invite_room_state` has additional validation, which servers MAY apply to room versions - 1 through 11 and SHOULD apply to all other room versions: + 1 through 11 and SHOULD apply to all other room versions. As with the above errors, servers + SHOULD return `M_INVALID_PARAM` if: * The `m.room.create` event is missing from `invite_room_state`. * One or more entries in `invite_room_state` are not formatted according diff --git a/data/api/server-server/invites-v2.yaml b/data/api/server-server/invites-v2.yaml index 4883965e..b145f339 100644 --- a/data/api/server-server/invites-v2.yaml +++ b/data/api/server-server/invites-v2.yaml @@ -43,7 +43,7 @@ paths: Servers MUST apply certain validation to ensure they don't accidentally sign non-invite events from a malicious server. A specific error code is not mandated, but servers SHOULD - use `M_INVALID_PARAM` for errors from all the following validation checks: + return `M_INVALID_PARAM` if: * The invite event fails a [signature check](/server-server-api/#validating-hashes-and-signatures-on-received-events). * The event type is not `m.room.member`. @@ -52,7 +52,8 @@ paths: * The `state_key` is not a user ID on the receiving server. The `invite_room_state` has additional validation, which servers MAY apply to room versions - 1 through 11 and SHOULD apply to all other room versions: + 1 through 11 and SHOULD apply to all other room versions. As with the above errors, servers + SHOULD return `M_INVALID_PARAM` if: * The `m.room.create` event is missing from `invite_room_state`. * One or more entries in `invite_room_state` are not formatted according diff --git a/data/api/server-server/joins-v1.yaml b/data/api/server-server/joins-v1.yaml index fe09e3a1..50bd3652 100644 --- a/data/api/server-server/joins-v1.yaml +++ b/data/api/server-server/joins-v1.yaml @@ -251,8 +251,7 @@ paths: fields for a PDU.** The receiving server MUST apply certain validation before accepting the event. - A specific error code is not mandated, but servers SHOULD use `M_INVALID_PARAM` - for errors from all the following validation checks: + A specific error code is not mandated, but servers SHOULD return `M_INVALID_PARAM` if: * The join event fails a [signature check](/server-server-api/#validating-hashes-and-signatures-on-received-events). * The event type is not `m.room.member`. diff --git a/data/api/server-server/joins-v2.yaml b/data/api/server-server/joins-v2.yaml index 33b25342..816bff9a 100644 --- a/data/api/server-server/joins-v2.yaml +++ b/data/api/server-server/joins-v2.yaml @@ -40,8 +40,7 @@ paths: fields for a PDU.** The receiving server MUST apply certain validation before accepting the event. - A specific error code is not mandated, but servers SHOULD use `M_INVALID_PARAM` - for errors from all the following validation checks: + A specific error code is not mandated, but servers SHOULD return `M_INVALID_PARAM` if: * The join event fails a [signature check](/server-server-api/#validating-hashes-and-signatures-on-received-events). * The event type is not `m.room.member`. diff --git a/data/api/server-server/knocks.yaml b/data/api/server-server/knocks.yaml index 7d2cb85b..1cc530ff 100644 --- a/data/api/server-server/knocks.yaml +++ b/data/api/server-server/knocks.yaml @@ -217,8 +217,7 @@ paths: fields for a PDU.** The receiving server MUST apply certain validation before accepting the event. - A specific error code is not mandated, but servers SHOULD use `M_INVALID_PARAM` - for errors from all the following validation checks: + A specific error code is not mandated, but servers SHOULD return `M_INVALID_PARAM` if: * The knock event fails a [signature check](/server-server-api/#validating-hashes-and-signatures-on-received-events). * The event type is not `m.room.member`. diff --git a/data/api/server-server/leaving-v1.yaml b/data/api/server-server/leaving-v1.yaml index 0fcebc96..16ba2262 100644 --- a/data/api/server-server/leaving-v1.yaml +++ b/data/api/server-server/leaving-v1.yaml @@ -166,8 +166,7 @@ paths: fields for a PDU.** The receiving server MUST apply certain validation before accepting the event. - A specific error code is not mandated, but servers SHOULD use `M_INVALID_PARAM` - for errors from all the following validation checks: + A specific error code is not mandated, but servers SHOULD return `M_INVALID_PARAM` if: * The leave event fails a [signature check](/server-server-api/#validating-hashes-and-signatures-on-received-events). * The event type is not `m.room.member`. diff --git a/data/api/server-server/leaving-v2.yaml b/data/api/server-server/leaving-v2.yaml index 0361cc84..15fbad75 100644 --- a/data/api/server-server/leaving-v2.yaml +++ b/data/api/server-server/leaving-v2.yaml @@ -40,8 +40,7 @@ paths: fields for a PDU.** The receiving server MUST apply certain validation before accepting the event. - A specific error code is not mandated, but servers SHOULD use `M_INVALID_PARAM` - for errors from all the following validation checks: + A specific error code is not mandated, but servers SHOULD return `M_INVALID_PARAM` if: * The leave event fails a [signature check](/server-server-api/#validating-hashes-and-signatures-on-received-events). * The event type is not `m.room.member`.