Skip to content

fix: validate form in login()#7435

Merged
rjsparks merged 6 commits intoietf-tools:mainfrom
jennifer-richards:validate-login-form
May 24, 2024
Merged

fix: validate form in login()#7435
rjsparks merged 6 commits intoietf-tools:mainfrom
jennifer-richards:validate-login-form

Conversation

@jennifer-richards
Copy link
Copy Markdown
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.

@codecov
Copy link
Copy Markdown

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
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