-
Notifications
You must be signed in to change notification settings - Fork 536
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
Add recaptcha for new addon submission upload #22755
Conversation
c4c1414
to
0a63203
Compare
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.
Missing a test around the captcha not being included (even if the waffle switch is active) for new versions submissions.
(Please update the PR title before merging too) |
@diox I'm not sure I understand this scenario?
If the switch is active, we include the field... so the test is testing where the captcha is not included.. how would that happen? |
"for new versions submissions." (not new add-ons). That's a different view, |
recaptcha_enabled = waffle.switch_is_active('developer-submit-addon-captcha') | ||
if not recaptcha_enabled or not self.include_recaptcha: |
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.
For your consideration, I don't necessarily think this is better, but we could do the waffle check in the view, just passing include_recaptcha=waffle.switch_is_active('developer-submit-addon-captcha')
?
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.
I don't have a super strong opinion if the waffle check happens in the view or the form, but I think the waffle check should be distinct from the view logic, in fact it has to be.
We need to be able to control whether or not to show the feature, and separately whether the feature is avaialble (regardless if we want it or not)
I think given those requirements, having the waffle check in the form actually makes sense, it is totally internalized and centralized.
The expression of "intent" to include the recaptcha is still on the view level (where it belongs IMO)
507cbcc
to
ea0efc6
Compare
* Tests * Add recaptcha to addon submit form * TMP: cover negative case tests
Fixes: mozilla/addons#15076
Description
Adds recaptcha for new addon submissions, behind a waffle switch.
Context
In order to combat spam uploads, we will enable the google recaptcha field on all new addon upload submissions.
This should NOT lead to a recaptcha being seen on each submission, but will include the field to decide if and when to display.
Testing
You can enable seeing the recaptcha by flipping
developer-submit-addon-captcha
onNote: if the waffle flag is "disabled" expect 4 to not display the captcha and thus 6 will always let you continue (assuming other fields are valid)
Checklist
#ISSUENUM
at the top of your PR to an existing open issue in the mozilla/addons repository.