LG-14216: Implement configurable percent tested reCAPTCHA at sign-in#11148
Merged
LG-14216: Implement configurable percent tested reCAPTCHA at sign-in#11148
Conversation
kevinsmaster5
approved these changes
Aug 29, 2024
Contributor
kevinsmaster5
left a comment
There was a problem hiding this comment.
LGTM
Tested locally and behaves as expected.
changelog: Upcoming Features, Fraud Prevent, Implement configurable percent tested reCAPTCHA at sign-in
Move contextual arguments to constructor
Co-authored-by: Zach Margolis <zachmargolis@users.noreply.github.com>
See: #11148 (comment) Co-Authored-By: Zach Margolis <zachmargolis@users.noreply.github.com>
A/B test constants are defined before the stubs go into effect, so they'll use the default even if stubbed with something different. Reload A/B tests after stub goes into effect / is torn down to force configuration to be used.
9e03bf2 to
4799980
Compare
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.
🎫 Ticket
LG-14216
🛠 Summary of changes
Implements support to run a reCAPTCHA verification at sign-in for a configurable percentage of attempts.
📜 Testing Plan
Verify you're not subjected to reCAPTCHA if percent tested configured to 0%:
config/application.yml:sign_in_recaptcha_percent_tested: 0make runmake watch_eventsin a separate terminal processmake watch_events), observe:captcha_validation_performed: falseVerify you're subjected to reCAPTCHA if percent tested configured to 100%:
config/application.yml:sign_in_recaptcha_percent_tested: 100make runmake watch_eventsin a separate terminal processmake watch_events), observe:captcha_validation_performed: trueandab_tests.recaptcha_sign_in_bucket, plus an event for "reCAPTCHA verify result received"Verify that you're not selected for A/B test when signing in from a known device:
config/application.yml:sign_in_recaptcha_percent_tested: 100make runmake watch_eventsin a separate terminal processmake watch_events), observe: "Email and Password Authentication" event does not includeab_tests.recaptcha_sign_invalueVerify that A/B test bucket is included in event properties if subjected to reCAPTCHA, for the following events.