-
Notifications
You must be signed in to change notification settings - Fork 349
Ignore received EDUs if origin server in room ACL #18475
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
base: develop
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Make ACLs apply to EDUs. | ||
devonh marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -551,6 +551,30 @@ async def _process_edu(edu_dict: JsonDict) -> None: | |||||
edu_type=edu_dict["edu_type"], | ||||||
content=edu_dict["content"], | ||||||
) | ||||||
|
||||||
if edu.edu_type == EduTypes.TYPING: | ||||||
MadLittleMods marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
origin_host, _ = parse_server_name(origin) | ||||||
room_id = edu.content["room_id"] | ||||||
try: | ||||||
await self.check_server_matches_acl(origin_host, room_id) | ||||||
except AuthError: | ||||||
logger.warning( | ||||||
"Ignoring typing EDU for room %s from banned server", room_id | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
) | ||||||
return | ||||||
|
||||||
if edu.edu_type == EduTypes.RECEIPT: | ||||||
origin_host, _ = parse_server_name(origin) | ||||||
for room_id, _ in edu.content.items(): | ||||||
try: | ||||||
await self.check_server_matches_acl(origin_host, room_id) | ||||||
except AuthError: | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Feels like we should also have a general Perhaps we should just nest everything under that single |
||||||
logger.warning( | ||||||
"Ignoring receipt EDU containing room %s from banned server", | ||||||
room_id, | ||||||
) | ||||||
return | ||||||
|
||||||
try: | ||||||
await self.registry.on_edu(edu.edu_type, origin, edu.content) | ||||||
except Exception: | ||||||
|
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.
There is
tests/federation_acl_test.go
in ComplementThere 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.
Complement PR: matrix-org/complement#783
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.
The Complement PR is still in draft and has a piece of pending review