-
-
Notifications
You must be signed in to change notification settings - Fork 928
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: properly normalize uppercase mail addresses #3330
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3330 +/- ##
=======================================
Coverage 78.11% 78.12%
=======================================
Files 325 325
Lines 21081 21085 +4
=======================================
+ Hits 16468 16472 +4
Misses 3384 3384
Partials 1229 1229
|
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.
LGTM!
How will this affect existing addresses? Does it make sense to use SQL's ToLower like for credential identifiers?
May also fix ory/network#273 |
Indeed, putting that on the list as well! |
29d6c31
to
c93b543
Compare
We already normalize the recovery and verifiable addresses on identity create and update here: kratos/persistence/sql/identity/persister_identity.go Lines 351 to 356 in c93b543
We also had a migration that made all addresses lowercase here: kratos/persistence/sql/migrations/sql/20220610155809000000_identity_address_casing.cockroach.up.sql Lines 1 to 2 in c93b543
So existing addresses should be fine, as all addresses are written lowercase, and we migrated all mixedcase addresses to lowercase at some point. Note, this fix is still necessary (or actually fixes things), because in a patch/update of an identity we get the identity from the database (with a lowercase email address), and then verify the traits to see if the verified address changed (which may be mixed case). Finally, in
|
Thanks for such a quick turn around on this @hperl 👏 |
Related issue(s)
Fixes #3187
Fixes #3289
Fixes ory/network#273