Skip to content
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

Fix some event auth issues #430

Merged
merged 8 commits into from
Jan 15, 2024
Merged

Fix some event auth issues #430

merged 8 commits into from
Jan 15, 2024

Conversation

S7evinK
Copy link
Contributor

@S7evinK S7evinK commented Jan 15, 2024

No description provided.

Copy link

codecov bot commented Jan 15, 2024

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (3495e57) 59.23% compared to head (281118d) 59.80%.

Files Patch % Lines
eventauth.go 92.30% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #430      +/-   ##
==========================================
+ Coverage   59.23%   59.80%   +0.56%     
==========================================
  Files          51       51              
  Lines        7129     7137       +8     
==========================================
+ Hits         4223     4268      +45     
+ Misses       2519     2477      -42     
- Partials      387      392       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines +1193 to +1195
if m.oldMember.Membership == spec.Leave && m.joinRule.JoinRule == spec.Public {
return nil
}
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 need the m.oldMember.Membership == spec.Leave portion of the check?
I think it would be more accurate just to check if the room is public. The only case to reject the join for a public room would be if the user was banned, and that is already handled before this switch block.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'd rather be explicit here, as not to open up for potential bugs.

"not_allowed": "Sender not invited or joined"
}
}]
}`, RoomVersionV1)
Copy link
Contributor

Choose a reason for hiding this comment

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

Room version 10 I presume?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Shouldn't matter for join_rule set to invite, there were no changes to this, if I saw that correctly.

eventauth.go Show resolved Hide resolved
@S7evinK S7evinK merged commit 19c0a71 into main Jan 15, 2024
7 checks passed
@S7evinK S7evinK deleted the s7evink/event-auth-fix branch January 15, 2024 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants