Skip to content
This repository has been archived by the owner on Nov 25, 2024. It is now read-only.

Failures when receiving events/PDUs without the origin field #2736

Closed
gnieto opened this issue Sep 26, 2022 · 1 comment
Closed

Failures when receiving events/PDUs without the origin field #2736

gnieto opened this issue Sep 26, 2022 · 1 comment

Comments

@gnieto
Copy link

gnieto commented Sep 26, 2022

Background information

  • Dendrite version or git SHA:
  • Monolith or Polylith?: Both
  • SQLite3 or Postgres?: Both
  • Running in Docker?: Yes
  • go version:
  • Client used (if applicable):

Description

  • What is the problem:

After removing origin fields from events in sytest (see matrix-org/sytest#1293), Dendrite builds failed. According to the v1.3 spec release, origin fields in PDUs are not required (matrix-org/matrix-spec#998).

Dendrite and gomatrixserverlib checks this field in several places and leads to failing tests in sytest (after removign the origin field; see the failed GHA runs on sytest's linked PR). For example, CheckFields validation from gometrixserverlib will fail if this field is not present: https://github.com/matrix-org/gomatrixserverlib/blob/2217f6c65ce3ab829b5d103d70be4891e68dc518/event.go#L751-L780

Dendrite is also doing some additional checks. For example, SendJoin is doing some additional checks here :

if event.Origin() != request.Origin() {
return util.JSONResponse{
Code: http.StatusForbidden,
JSON: jsonerror.Forbidden("The join must be sent by the server it originated on"),
}
}

Steps to reproduce

  • Remove origin in any federation endpoint receiving an event (for example, SendJoin)
@gnieto
Copy link
Author

gnieto commented Sep 26, 2022

This issue has been fixed in: #2737

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant