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

chore: enforce 2fa for legacy uploaders #16365

Merged

Conversation

miketheman
Copy link
Member

Disallow uploads if the token from a user account does not have 2FA.

  • Add UserFactory trait to simplify email creation in test cases
  • Update test coverage for repeat_window to exercise logic independent
    of email-specific test cases
  • Remove email template

Signed-off-by: Mike Fiedler miketheman@gmail.com

Disallow uploads if the token from a user account does not have 2FA.

- Add `UserFactory` trait to simplify email creation in test cases
- Update test coverage for `repeat_window` to exercise logic independent
  of email-specific test cases
- Remove email template

Signed-off-by: Mike Fiedler <miketheman@gmail.com>
Signed-off-by: Mike Fiedler <miketheman@gmail.com>
@miketheman miketheman added security Security-related issues and pull requests 2FA email Related to emails labels Jul 30, 2024
@miketheman miketheman requested a review from a team as a code owner July 30, 2024 20:58
@miketheman
Copy link
Member Author

Here's a chart showing the dropoff over time.

Screenshot 2024-07-30 at 16 12 15

Copy link
Member

@woodruffw woodruffw left a comment

Choose a reason for hiding this comment

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

Exciting!

@@ -226,6 +226,49 @@ def test_doesnt_send_within_reset_window(self, pyramid_request, pyramid_services
assert pyramid_request.task.calls == []
assert task.delay.calls == []

def test_sends_when_outside_repeat_window(self, db_request, pyramid_services):
Copy link
Member Author

Choose a reason for hiding this comment

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

I had to add this test case since the repeat_window logic wasn't exercised directly, only via another email template test.

@miketheman miketheman merged commit 54c1583 into pypi:main Aug 2, 2024
17 checks passed
@miketheman miketheman deleted the miketheman/disallow-upload-without-2fa branch August 2, 2024 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2FA email Related to emails security Security-related issues and pull requests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants