diff --git a/data/api/server-server/invites-v1.yaml b/data/api/server-server/invites-v1.yaml index b1d86208..1e74a555 100644 --- a/data/api/server-server/invites-v1.yaml +++ b/data/api/server-server/invites-v1.yaml @@ -38,8 +38,8 @@ paths: transaction](/server-server-api/#transactions). Servers MUST apply certain validation to ensure they don't accidentally sign non-invite - events from a malicious server. The `M_MISSING_PARAM` error code is used to indicate one - or more of the following: + 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: * 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`. @@ -47,8 +47,8 @@ paths: * The event sender is not a user ID on the origin server. * The `state_key` is not a user ID on the receiving server. - The `M_MISSING_PARAM` error code is also used to indicate one or more of the following - problems in the `invite_room_state` field: + 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: * The `m.room.create` event is missing from `invite_room_state`. * One or more entries in `invite_room_state` are not formatted according @@ -57,9 +57,6 @@ paths: * One or more events does not reside in the same room as the invite. Note: Some room versions may require calculating the room ID for an event rather than relying on the presence of `room_id`. - - Servers MAY apply the `invite_room_state` validation to room versions 1 through 11, - and SHOULD apply the validation to all other room versions. operationId: sendInviteV1 security: - signedRequest: [] @@ -107,8 +104,7 @@ paths: MUST additionally be formatted according to the room version specification. Servers might need to apply validation to the `invite_room_state` depending - on room version. See the `400 M_MISSING_PARAM` error definition for more - information. + on room version. See endpoint description for more information. Note that events have a different format depending on the room version - check the [room version specification](/rooms) for diff --git a/data/api/server-server/invites-v2.yaml b/data/api/server-server/invites-v2.yaml index b919b7a6..4883965e 100644 --- a/data/api/server-server/invites-v2.yaml +++ b/data/api/server-server/invites-v2.yaml @@ -42,8 +42,8 @@ paths: transaction](/server-server-api/#transactions). Servers MUST apply certain validation to ensure they don't accidentally sign non-invite - events from a malicious server. The `M_MISSING_PARAM` error code is used to indicate one - or more of the following: + 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: * 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`. @@ -51,8 +51,8 @@ paths: * The event sender is not a user ID on the origin server. * The `state_key` is not a user ID on the receiving server. - The `M_MISSING_PARAM` error code is also used to indicate one or more of the following - problems in the `invite_room_state` field: + 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: * The `m.room.create` event is missing from `invite_room_state`. * One or more entries in `invite_room_state` are not formatted according @@ -61,9 +61,6 @@ paths: * One or more events does not reside in the same room as the invite. Note: Some room versions may require calculating the room ID for an event rather than relying on the presence of `room_id`. - - Servers MAY apply the `invite_room_state` validation to room versions 1 through 11, - and SHOULD apply the validation to all other room versions. operationId: sendInviteV2 security: - signedRequest: [] @@ -108,8 +105,7 @@ paths: MUST additionally be formatted according to the room version specification. Servers might need to apply validation to the `invite_room_state` depending - on room version. See the `400 M_MISSING_PARAM` error definition for more - information. + on room version. See the endpoint description for more information. Note that events have a different format depending on the room version - check the [room version specification](/rooms) for @@ -178,8 +174,8 @@ paths: The error should be passed through to clients so that they may give better feedback to users. - If `M_MISSING_PARAM` is returned and the request is associated with a - Client-Server API request, the Client-Server API request SHOULD fail + If `M_MISSING_PARAM` or `M_INVALID_PARAM` is returned and the request is associated + with a Client-Server API request, the Client-Server API request SHOULD fail with a 5xx error rather than being passed through. content: application/json: diff --git a/data/api/server-server/joins-v1.yaml b/data/api/server-server/joins-v1.yaml index a319011e..fe09e3a1 100644 --- a/data/api/server-server/joins-v1.yaml +++ b/data/api/server-server/joins-v1.yaml @@ -251,7 +251,8 @@ paths: fields for a PDU.** The receiving server MUST apply certain validation before accepting the event. - The `M_INVALID_PARAM` error code is used to indicate one or more of the following: + A specific error code is not mandated, but servers SHOULD use `M_INVALID_PARAM` + for errors from all the following validation checks: * 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 0f23ca94..33b25342 100644 --- a/data/api/server-server/joins-v2.yaml +++ b/data/api/server-server/joins-v2.yaml @@ -40,7 +40,8 @@ paths: fields for a PDU.** The receiving server MUST apply certain validation before accepting the event. - The `M_INVALID_PARAM` error code is used to indicate one or more of the following: + A specific error code is not mandated, but servers SHOULD use `M_INVALID_PARAM` + for errors from all the following validation checks: * 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 6bbc31a4..7d2cb85b 100644 --- a/data/api/server-server/knocks.yaml +++ b/data/api/server-server/knocks.yaml @@ -217,7 +217,8 @@ paths: fields for a PDU.** The receiving server MUST apply certain validation before accepting the event. - The `M_INVALID_PARAM` error code is used to indicate one or more of the following: + A specific error code is not mandated, but servers SHOULD use `M_INVALID_PARAM` + for errors from all the following validation checks: * 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 bbecc6b3..0fcebc96 100644 --- a/data/api/server-server/leaving-v1.yaml +++ b/data/api/server-server/leaving-v1.yaml @@ -166,7 +166,8 @@ paths: fields for a PDU.** The receiving server MUST apply certain validation before accepting the event. - The `M_INVALID_PARAM` error code is used to indicate one or more of the following: + A specific error code is not mandated, but servers SHOULD use `M_INVALID_PARAM` + for errors from all the following validation checks: * 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 33dab2d4..0361cc84 100644 --- a/data/api/server-server/leaving-v2.yaml +++ b/data/api/server-server/leaving-v2.yaml @@ -40,7 +40,8 @@ paths: fields for a PDU.** The receiving server MUST apply certain validation before accepting the event. - The `M_INVALID_PARAM` error code is used to indicate one or more of the following: + A specific error code is not mandated, but servers SHOULD use `M_INVALID_PARAM` + for errors from all the following validation checks: * 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`.