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

Add API token creation notifications #9245

Merged
merged 5 commits into from
Aug 16, 2024

Conversation

domodwyer
Copy link
Contributor

@domodwyer domodwyer commented Aug 10, 2024

This PR will make crates.io email the user's registered email address when a new token is added to their account.

An email notification helps mitigate a sneaky 3rd party with access to the account from creating a token and using it to do nasty things later. Without the notification you'd only know about the token if you were periodically checking the token page.

Part of #2639


  • feat: token creation notification email (83c8313)

    When a new token is created for an account, send a notification email to
    the account owner.
    

src/controllers/token.rs Show resolved Hide resolved
src/controllers/token.rs Outdated Show resolved Hide resolved
src/controllers/token.rs Outdated Show resolved Hide resolved
@domodwyer domodwyer force-pushed the dom/token-creation-email branch from b77b774 to 83c8313 Compare August 10, 2024 22:00
Copy link

codecov bot commented Aug 10, 2024

Codecov Report

Attention: Patch coverage is 95.55556% with 2 lines in your changes missing coverage. Please review.

Project coverage is 89.29%. Comparing base (3018369) to head (4618f59).
Report is 18 commits behind head on main.

Files Patch % Lines
src/controllers/token.rs 93.10% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9245      +/-   ##
==========================================
+ Coverage   89.27%   89.29%   +0.01%     
==========================================
  Files         282      282              
  Lines       28590    28629      +39     
==========================================
+ Hits        25525    25563      +38     
- Misses       3065     3066       +1     

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

@Turbo87 Turbo87 changed the title feat: token creation notification email Add API token creation notifications Aug 11, 2024
Copy link
Member

@Turbo87 Turbo87 left a comment

Choose a reason for hiding this comment

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

looks good to me at first glance, but I'm on mobile-only due to vacation until the end of the week so a proper review will have to wait until then :)

in any case, thanks for working on this!

@domodwyer
Copy link
Contributor Author

No worries! Go and enjoy vacation - this can definitely wait 🙏

@Turbo87 Turbo87 added C-enhancement ✨ Category: Adding new behavior or a change to the way an existing feature works A-backend ⚙️ labels Aug 13, 2024
domodwyer and others added 5 commits August 16, 2024 09:28
When a new token is created for an account, send a notification email to
the account owner.
Use "{domain}" instead of "crates.io" when describing where the token
was created.
Reduces the diff of the pull request since this is an unrelated change ;)
A little easier on the eyes :)
@Turbo87 Turbo87 force-pushed the dom/token-creation-email branch from 91da220 to 4618f59 Compare August 16, 2024 07:43
@Turbo87
Copy link
Member

Turbo87 commented Aug 16, 2024

I've rebased and slightly tweaked it to include the token name in the notification email, but other than that this looks great. thanks again! :)

@Turbo87 Turbo87 enabled auto-merge August 16, 2024 07:45
@Turbo87 Turbo87 merged commit 412b3e9 into rust-lang:main Aug 16, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-backend ⚙️ C-enhancement ✨ Category: Adding new behavior or a change to the way an existing feature works
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants