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.
Allow for
identifier
dicts in User Interactive Auth dicts #7438Allow for
identifier
dicts in User Interactive Auth dicts #7438Changes from 1 commit
b674bb8
7044c1f
f240a8d
cb64c95
1807115
358e51b
699904c
7184c16
1876235
b8f4b0c
efb5670
53981c3
b1c0eb3
d9277e9
cb272bc
af21fbb
7affcd0
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.
The lower-casing of
medium
here seems to be a change in behavior? Or maybe I can't follow the logic...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.
Ah! Yes it is, and apologies for not calling it out during the commit.
This would've allowed someone to bypass the ratelimiter by specifying
eMail
or some other combination of capitalisation.However, now that I'm testing it, this trickery will get caught later on in the flow anyways, and return an immediate 403 before trying anything CPU-heavy like password hashing.
So it's not too sensitive - but I am going to pull it out of here into another PR as I think it's worthwhile, but needs more careful thought.
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.
Yes, please do! 👍
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.
This code path seems to now go through an additional
self.auth_handler.validate_login
, I don't know if that's OK or not.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.
Aha, yes good spot.
I believe this originally did not as we have already validated the password via the password auth provider, so there's no need to
validate_login
at that point (which will itself ask password auth providers with a user_id/password combo).Considering this would change Synapse's behaviour related to third-party code we should probably try to get the behaviour to match.
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.
This comment seems more helpful than the new version.
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.
Hmm, I think things have slightly changed now though (which may or may not be an issue as well).
This is no longer true. If
None
is returned byusername_from_identifier
and amedium
andaddress
was used, then we will check the ratelimiter. This sounds sensible, but it is a change from before, where it seems like the code would rate limit on the User ID instead.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.
Hmm...I think I was thinking the part about the incorrect password vs. the account not existing seems useful to keep (if that's still true).
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.
This logic seems to have disappeared.
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.
It moved to
AuthHandler.validate_login
.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.
Ah, actually this was always in
validate_login
, I think? So this was just duplicated?