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

Clarify when an event is returned from /send_join. #1840

Merged
merged 3 commits into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Clarify that the `event` field of the `/v2/send_join` response is only required when `join_authorised_via_users_server` was present in the `content` field of the request.
Clarify that the `event` field of the `/v2/send_join` response is only required when the event is signed by the resident server.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Clarify that the `event` field of the `/v2/send_join` response is only required when the event is signed by the resident server.
5 changes: 2 additions & 3 deletions data/api/server-server/joins-v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,8 @@ paths:
title: SignedMembershipEvent
x-addedInMatrixVersion: "1.2"
description: |-
Required if the `content` of the event in the request contained the `join_authorised_via_users_server`
field. The signed copy of the membership event sent to other servers by the resident server,
including the resident server's signature.
The signed copy of the membership event sent to other servers by the resident server.
Required if the event is signed by the resident server.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So as the sender of the /send_join request, should we still ensure that the signed event is present when performing a restricted join, as it must be signed in this case?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean by present? Present when you get the room state?

As the joining server I think the important things to do are:

  1. Verify the signatures as with any event.
  2. Ensure this copy of the event is persisted locally and not the copy that was used to make the /send_join call.

I'd have to double check what synapse does to see if there's anything else though.

Copy link
Contributor

@Kladki Kladki Jun 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean by present?

The signed event being returned in the event field of the response.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The signature needs to be checked (as is in the auth rules), Synapse does this @ https://github.com/matrix-org/synapse/blob/23740eaa3da94fbe2e25180376961979fc4e8cd3/synapse/federation/federation_base.py#L238-L259.

I'm still unsure if that's your question or not though.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hrm. I think we need to clarify this a bit more. It just begs the question, "so when should the event be signed by the resident server".

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would linking back to restricted joins be enough?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I took another attempt at this, let me know what you think.

servers_in_room:
type: array
x-addedInMatrixVersion: "1.6"
Expand Down