This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
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.
Make historical events discoverable from backfill for servers without any scrollback history (MSC2716) (federation) #10245
Make historical events discoverable from backfill for servers without any scrollback history (MSC2716) (federation) #10245
Changes from 20 commits
d2e2aa7
2d942ec
38bcf13
e405a23
36f1565
05d6c51
defc536
dfad8a8
7d850db
164dee4
04b1f7e
b703962
8c205e5
7b8b2d1
281588f
4226165
baae5d8
c05e43b
02b1bea
66cf5be
ab8011b
f20ba02
64aeb73
ea7c30d
9a6fd3f
0f6179f
5970e3f
bc13396
669da52
9a86e05
8999567
35a4569
b2be8ce
04a29fe
258fa57
9352635
5c454b7
e881cff
c9330ec
a8c5311
ae606c7
bc896cc
f231066
465b3d8
44bb3f0
4d936b5
706770c
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Where is the best place to limit who can add an
insertion
event or a chunk connection content field?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.
We probably want to reject such events, so we probably want to add some stuff to the event authorization code.
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.
I am having trouble fitting this into the existing code.
synapse/event_auth.py
->check(...)
:check_redaction
store
so I can't usestore.get_app_service_by_user_id(...)
to make sure the sender is an application service. Plus this code is probably run for events coming over federation which don't know whichsender
is an application service.synapse/handlers/event_auth.py
->check_from_context(...)
store.get_app_service_by_user_id(...)
but other code is still only protected by the rawcheck(...)
def _check_if_allowed_to_send_historical_events
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.
Using the
m.room.power_levels
->events
("The level required to send specific event types. This is a mapping from event type to power level required.") field seems perfect 🎉But we would probably want to default the power level for those events in existing rooms which don't have it set yet. Maybe default to only the creator or admins can do it if not explicitly set in power levels. Or keep it simple and not allow the history based events at all unless the power level was set. Is there any precedent for this? There is
events_default
but it's usually set low to allow any events.The one problem I see is that there doesn't seem to be precedent for controlling a
content
field. Thecontent.chunk_id
field would also be on normal events from a non-application service user so I don't see a way to differentiate and auth it 🤔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.
Added unstable room version
org.matrix.msc2716
which adds thehistorical
power level that controls whether you can sendinsertion
,chunk
, andmarker
events ✅I switched to
chunk
events so we can easily auth them against the PL level because they are sent by the application service user ID with the proper PL level for the room. See #10432