Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

@gnieto gnieto closed this as completed Sep 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant