Skip to content

Move, rename reCAPTCHA validator as form#10549

Merged
aduth merged 3 commits intomainfrom
aduth-mv-recaptcha-validator
May 2, 2024
Merged

Move, rename reCAPTCHA validator as form#10549
aduth merged 3 commits intomainfrom
aduth-mv-recaptcha-validator

Conversation

@aduth
Copy link
Contributor

@aduth aduth commented May 2, 2024

🎫 Ticket

Supports LG-12873

🛠 Summary of changes

Continues refactoring in #10540 to rename and move the current validator service classes as forms.

📜 Testing Plan

Validate that there are no regressions in the expected behavior of reCAPTCHA phone validation.

Configure reCAPTCHA score threshold in config/application.yml

phone_recaptcha_score_threshold: 0.5
  1. Go to http://localhost:3000
  2. Create an account
  3. When prompted to select MFA, choose phone
  4. Enter an international phone number, e.g. +610491570006
  5. In the reCAPTCHA score debugger tool, enter a value between 0.0 and 1.0
  6. Click "Send code"
  7. Observe that you are blocked if the score you entered was less than 0.5

changelog: Internal, reCAPTCHA, Refactor reCAPTCHA validator as form model
@aduth aduth requested a review from a team May 2, 2024 18:49
Copy link
Contributor

@kevinsmaster5 kevinsmaster5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Tested locally and confirm testing plan expected outcome.

# @param [Float] score_threshold Minimum value for considering passing result
# @param [Boolean] evaluated_as_valid Whether result was considered valid
# @param [String] validator_class Class name of validator
# @param [String] form_class Class name of form
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd consider leaving this so it's easier to track over time?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Normally I'd agree if we were already using this in dashboards or saved queries, but I think this was added primarily as a way to diagnose individual log entries, so I don't know that I'm quite as concerned about backwards compatibility?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense then

@aduth aduth merged commit dc7ea61 into main May 2, 2024
@aduth aduth deleted the aduth-mv-recaptcha-validator branch May 2, 2024 20:51
@jmdembe jmdembe mentioned this pull request May 7, 2024
samathad2023 pushed a commit that referenced this pull request May 11, 2024
* Move, rename reCAPTCHA validator as form

changelog: Internal, reCAPTCHA, Refactor reCAPTCHA validator as form model

* Update more validator references

* Disambiguate form variable name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants