Skip to content

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

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

devonh
Copy link
Member

@devonh devonh commented May 23, 2025

Implements: MSC4163: Make ACLs apply to EDUs

Part of #18118 to declare support for Matrix v1.13

Complement PR: matrix-org/complement#783

Pull Request Checklist

  • Pull request is based on the develop branch
  • Pull request includes a changelog file. The entry should:
    • Be a short description of your change which makes sense to users. "Fixed a bug that prevented receiving messages from other servers." instead of "Moved X method from EventStore to EventWorkerStore.".
    • Use markdown where necessary, mostly for code blocks.
    • End with either a period (.) or an exclamation mark (!).
    • Start with a capital letter.
    • Feel free to credit yourself, by adding a sentence "Contributed by @github_username." or "Contributed by [Your Name]." to the end of the entry.
  • Code style is correct (run the linters)

@devonh devonh requested a review from a team as a code owner May 23, 2025 21:59
@@ -0,0 +1 @@
Make ACLs apply to EDUs.
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we have any tests for ACLs on /send anywhere? I can't seem to find any and don't want to waste time reinventing the wheel trying to add tests for these 2 cases.

There is tests/federation_acl_test.go in Complement

Copy link
Member

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

@@ -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:
Copy link
Contributor

Choose a reason for hiding this comment

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

For each of these cases, we should add a comment to mark the MSC that determines this behavior

// Server ACL's apply to `EduTypes.TYPING` per MSC4163

Copy link
Member

Choose a reason for hiding this comment

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

That was a good suggestion, helped me figure out that we were rejecting the whole EDU instead of stripping read receipts for banned rooms only

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants