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

feat: Case-insensitive username and email fields #480

Merged
merged 1 commit into from
Oct 22, 2024

Conversation

spencewenski
Copy link
Member

@spencewenski spencewenski commented Oct 22, 2024

Problem

It's common for typos to occur when entering usernames and emails that result in random incorrect capitalization. Additionally, it's both a security vulnerability and a usability issue if multiple users can have the same username/email just with different capitalization.

Solution

  • Add a case-insensitive collation (we only officially support this on Postgres
  • Assign the Username and Email columns of the User table to use the case-insensitive collation.

Closes #479

Problem
-------
It's common for typos to occur when entering usernames and emails that
result in random incorrect capitalization. Additionally, it's both a
security vulnerability and a usability issue if multiple users can
have the same username/email just with different capitalization.

Solution
--------
- Add a case-insensitive collation (we only officially support this on
  Postgres
- Assign the Username and Email columns of the User table to use the
  case-insensitive collation.
Copy link

codecov bot commented Oct 22, 2024

Codecov Report

Attention: Patch coverage is 57.35294% with 58 lines in your changes missing coverage. Please review.

Project coverage is 42.64%. Comparing base (81f6b13) to head (383c4c3).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/migration/collation/mod.rs 49.29% 36 Missing ⚠️
...20241022_072216_case_insensitive_username_email.rs 71.92% 16 Missing ⚠️
...ion/m20241022_065427_case_insensitive_collation.rs 0.00% 6 Missing ⚠️
Files with missing lines Coverage Δ
.../m20240723_201404_add_update_timestamp_function.rs 0.00% <ø> (ø)
src/migration/timestamp/mod.rs 56.41% <ø> (ø)
src/migration/user/mod.rs 100.00% <100.00%> (ø)
src/service/worker/sidekiq/builder.rs 45.50% <ø> (ø)
...ion/m20241022_065427_case_insensitive_collation.rs 0.00% <0.00%> (ø)
...20241022_072216_case_insensitive_username_email.rs 71.92% <71.92%> (ø)
src/migration/collation/mod.rs 49.29% <49.29%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 81f6b13...383c4c3. Read the comment docs.

@spencewenski spencewenski merged commit 8dc1ed4 into main Oct 22, 2024
20 checks passed
@spencewenski spencewenski deleted the case-insensitive-username-email branch October 22, 2024 10:33
@github-actions github-actions bot mentioned this pull request Oct 22, 2024
spencewenski added a commit that referenced this pull request Oct 22, 2024
## 🤖 New release
* `roadster`: 0.6.14 -> 0.6.15 (✓ API compatible changes)

<details><summary><i><b>Changelog</b></i></summary><p>

<blockquote>

##
[0.6.15](roadster-v0.6.14...roadster-v0.6.15)
- 2024-10-22

### Added

- Case-insensitive username and email fields
([#480](#480))

### Other

- Add `AnyInitializer` feature to changelog
([#476](#476))
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/MarcoIeni/release-plz/).

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Spencer Ferris <[email protected]>
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.

Case-insensitive collation for username/email fields of user schema
1 participant