This repository was archived by the owner on Apr 26, 2024. It is now read-only.
Remove usages of event ID's domain#4514
Merged
Merged
Conversation
Since newer versions of events don't have the same format for event ID.
The event ID is changing, so we can no longer get the domain from it. On the other hand, the check is unnecessary.
The transaction queue only sends out events that we generate. This was done by checking domain of event ID, but that can no longer be used. Instead, we may as well use the sender field.
We only process events sent to us from a server if the event ID matches the server, to help guard against federation storms. We replace this with a check against the event origin.
This was referenced Jan 29, 2019
Member
Author
|
|
In future version events won't have an event ID, so we won't be able to do this check.
ecd6c6b to
b40abe0
Compare
Member
Author
|
Fixed now |
Codecov Report
@@ Coverage Diff @@
## develop #4514 +/- ##
===========================================
+ Coverage 74.75% 74.75% +<.01%
===========================================
Files 336 336
Lines 34219 34266 +47
Branches 5570 5583 +13
===========================================
+ Hits 25580 25617 +37
- Misses 7060 7065 +5
- Partials 1579 1584 +5 |
richvdh
approved these changes
Jan 29, 2019
| # Check the event_id's domain has signed the event | ||
| if not event.signatures.get(event_id_domain): | ||
| raise AuthError(403, "Event not signed by sending server") | ||
| if event.format_version in (RoomVersions.V1, RoomVersions.V2): |
Member
There was a problem hiding this comment.
surely event.format_version should be an event version, not a room version?
| # now let's look for events where the sender's domain is different to the | ||
| # event id's domain (normally only the case for joins/leaves), and add additional | ||
| # checks. Only do this if the room version has a concept of event ID domain | ||
| if room_version in KNOWN_ROOM_VERSIONS: |
Member
There was a problem hiding this comment.
does this not need to be different?
Member
Author
There was a problem hiding this comment.
It currently gets done in #4515, I'm not sure why I didn't write it out fully here
| # | ||
| # let's start by getting the domain for each pdu, and flattening the event back | ||
| # to JSON. | ||
|
|
Member
There was a problem hiding this comment.
could you update the comment at line 230 about event_id?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In future room version event IDs won't have a domain part