fix: validate registration invite before password validation#7711
Open
10done wants to merge 1 commit into
Open
fix: validate registration invite before password validation#771110done wants to merge 1 commit into
10done wants to merge 1 commit into
Conversation
|
@10done is attempting to deploy a commit to the Flagsmith Team on Vercel. A member of the Team first needs to authorize it. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7711 +/- ##
==========================================
- Coverage 98.52% 98.37% -0.16%
==========================================
Files 1444 1444
Lines 54971 54968 -3
==========================================
- Hits 54161 54074 -87
- Misses 810 894 +84 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Thanks for submitting a PR! Please check the boxes below:
docs/if required so people know about the feature.Changes
Fixes #7695
Moved
_validate_registration_invite()to execute beforesuper().validate()in
CustomUserCreateSerializer.validate().Uninvited users should be rejected immediately with 403 before the server
performs any further validation. The previous ordering also had a minor
security implication — it leaked password rule feedback to users who were
not authorised to register at all.
How did you test this code?
test_register__without_invite_when_disabled__returns_forbidden— passesdeterministically
custom_authunit + integration test suite — all passing