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

fix: validate form in login() #7435

Merged
merged 6 commits into from
May 24, 2024

Conversation

jennifer-richards
Copy link
Member

@jennifer-richards jennifer-richards commented May 19, 2024

This prevents 500s if username/password contain null characters. It refactors our custom login() view as a custom LoginView subclass and an associated custom AuthenticationForm subclass.

The following applied to the first commit only (which broke the ability to log in using any email address):
The error is happening in some checks we do prior to the actual authentication check - it's looking to see if the User's password was cleared and whether it has a Person. The actual auth happens in the LoginView.as_view() call, which already checks and rejects attempts involving null characters. If that were to change, this PR would potentially make it possible someone to bypass the checks for a cleared password or missing Person. I don't think that's either likely or harmful, but wanted to point at it.

Copy link

codecov bot commented May 22, 2024

Codecov Report

Attention: Patch coverage is 82.75862% with 5 lines in your changes are missing coverage. Please review.

Project coverage is 88.91%. Comparing base (187c2c5) to head (003545f).
Report is 213 commits behind head on main.

Files Patch % Lines
ietf/ietfauth/views.py 82.75% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7435      +/-   ##
==========================================
- Coverage   88.98%   88.91%   -0.08%     
==========================================
  Files         291      294       +3     
  Lines       40717    41181     +464     
==========================================
+ Hits        36233    36617     +384     
- Misses       4484     4564      +80     

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

@rjsparks rjsparks merged commit 3c13db4 into ietf-tools:main May 24, 2024
9 checks passed
Hamidzai456hzj

This comment was marked as spam.

@jennifer-richards jennifer-richards deleted the validate-login-form branch May 27, 2024 14:09
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants