Skip to content

Fix some event auth issues#430

Merged
S7evinK merged 8 commits intomainfrom
s7evink/event-auth-fix
Jan 15, 2024
Merged

Fix some event auth issues#430
S7evinK merged 8 commits intomainfrom
s7evink/event-auth-fix

Conversation

@S7evinK
Copy link
Collaborator

@S7evinK S7evinK commented Jan 15, 2024

No description provided.

@codecov
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
Collaborator 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
Collaborator 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.

@S7evinK S7evinK merged commit 19c0a71 into main Jan 15, 2024
@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