-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Implement rechecking of redactions for room versions v3 #4499
Conversation
a909470
to
2fbd985
Compare
We add the constant, but don't add it to the known room versions. This lets us start adding V3 logic, but the servers will never join or create V3 rooms
2fbd985
to
7709d2b
Compare
Codecov Report
@@ Coverage Diff @@
## develop #4499 +/- ##
===========================================
- Coverage 74.71% 74.67% -0.04%
===========================================
Files 336 336
Lines 34258 34280 +22
Branches 5578 5585 +7
===========================================
+ Hits 25595 25599 +4
- Misses 7081 7099 +18
Partials 1582 1582 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
erm: do we not need to check that the sender of a redaction matches the original sender when we pull the original event out of the database?
synapse/event_auth.py
Outdated
redacter_domain = get_domain_from_id(event.event_id) | ||
redactee_domain = get_domain_from_id(event.redacts) | ||
if redacter_domain == redactee_domain: | ||
if room_version in (RoomVersions.V1, RoomVersions.V2, RoomVersions.VDH_TEST): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can't we just drop VDH_TEST
?
@@ -63,6 +63,9 @@ def get_send_on_behalf_of(self): | |||
""" | |||
return getattr(self, "send_on_behalf_of", None) | |||
|
|||
def need_to_check_redaction(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can has docstring please - what does this mean?
Co-Authored-By: erikjohnston <[email protected]>
Argh, bollocks |
sytest looks to be unhappy that i killed off VDH_TEST |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
synapse/events/__init__.py
Outdated
Starting in room v3 redaction events are accepted up front, and later | ||
checked to see if the redacter and redactee's domains match. | ||
|
||
If the sender of the redaction event is allowed to redact due to auth |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"is allowed to redact any event"
Original proposal: #1659 Implementation proofs (some traversing of the PR tree may be required to get all of them): * matrix-org/synapse#4483 * matrix-org/synapse#4499 This doesn't intentionally change anything from the proposal. **Implementation details**: The simple part of this is the introduction of a rooms/v3.html document. The somewhat unclear part is the stuff done to the s2s definitions. This pulls `unsigned_pdu` out to `unsigned_pdu_base` (all fields except `event_id`) where it can be reused in `pdu` and `pdu_v3` (for rooms v3). These definitions are further moved into the room version specifications where they can highlight the exact schemas in detail. Version 1 has been updated to include the pre-existing event format, however the core principles of the room have not been changed. The same applies to room version 2. Room versions have immutable core principles once in the spec, otherwise these format changes would land in a pre-existing version. The client-server API event formats will need updating, however that is being punted to a different commit to try and keep these changes reviewable.
This starts implementing support for V3 rooms, while keeping V3 disabled