-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Tighten account creation validations #10486
base: master
Are you sure you want to change the base?
Tighten account creation validations #10486
Conversation
INVALIDATING_ERRORS = [ | ||
"invalid-input-secret", | ||
"missing-input-secret", | ||
"missing-input-response", | ||
"invalid-input-response", | ||
"bad-request", | ||
"timeout-or-duplicate", | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm! Good catch. One non blocking suggestion 👍
@@ -38,6 +50,6 @@ def validate(self, value=None): | |||
data = r.json() | |||
if not data.get('success', False) and 'error-codes' in data: | |||
logger.error(f"Recaptcha Error: {data['error-codes']}") | |||
return True | |||
return accept_error(data['error-codes']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might be more easily done with some set logic:
return accept_error(data['error-codes']) | |
return not (set(data['error-codes']) & INVALIDATING_ERRORS) |
Ie check that the provided errors don't intersect the invalidating errors. But it's the same, so just a suggestion.
Ensures that legitimately invalid ReCaptcha tests cause account creation form validations to fail.
Technical
Testing
Screenshot
Stakeholders