Skip to content

FORMS-28171: Backport reCAPTCHA v3 support (FORMS-27648) to release/650 - #2008

Open
kartikey19427 wants to merge 1 commit into
release/650from
FORMS-28171
Open

kartikey19427 wants to merge 1 commit into
release/650from
FORMS-28171

Conversation

@kartikey19427

Copy link
Copy Markdown
Contributor

Description

Backport of #1986 (reCAPTCHA v3 support, FORMS-27648) to release/650. The v3 changes were deliberately left out of the master→release/650 sync in #1991; this PR adds them back.

  • RecaptchaImpl.getCaptchaDisplayMode() returns invisible for v3. af-core's built-in submitForm (already in af-core 1.0.4, which release/650 uses) then fetches the token automatically.
  • Bumps @aemforms/af-custom-functions from 1.0.17 to 1.0.18. 1.0.18 is exactly 1.0.17 plus the v3 fetchCaptchaToken change (livecycle/af-custom-functions#15), so no separate custom-functions backport is needed.
  • The recaptcha widget and edit dialog treat v3 as invisible and score-based (badge only, size disabled).
  • Container submit/save handlers now guard against a missing state.events.
  • IT: v3 cloud config and sample form, FT_FORMS-27648 added to the IT toggle config, and Cypress authoring/runtime v3 tests gated on FT_FORMS-27648 and the latest addon.

Feature toggle: Kept (FT_FORMS-27648), as FORMS-28171 asks.

Adaptations: Conflicts were resolved by hand:

  • package-lock.json: only the af-custom-functions bump was kept. af-core-xfa is not a release/650 dependency.
  • recaptcha.runtime.cy.js: kept release/650's FT_CLOUD_CONFIG_PROVIDER block structure and added the v3 helper and tests next to it.

Related Issue

https://jira.corp.adobe.com/browse/FORMS-28171 (backport of https://jira.corp.adobe.com/browse/FORMS-27648)

Companion PR (cq-guides, release/650): https://github.com/adobe-aem-forms/cq-guides/pull/7602

Motivation and Context

Adds the client/runtime side of reCAPTCHA v3 to 6.5. The server-side validation and cloud-config wizard come from the companion cq-guides PR.

How Has This Been Tested?

  • mvn -pl bundles/af-core -am test -Dtest=RecaptchaImplTest (JDK 11): 13/13 pass, including the new v3 URL and display-mode tests.
  • Cypress v3 specs are FT-gated and still need to run in CI with FT_FORMS-27648 enabled. The v3 submit tests need the RECAPTCHA_V3_API_KEY env var.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes and the overall coverage did not decrease.
  • All unit tests pass on CircleCi.
  • I ran all tests locally and they pass.

Backport of #1986 onto release/650:
- RecaptchaImpl.getCaptchaDisplayMode() returns invisible for v3 so af-core's
  built-in submitForm auto-fetches the token.
- Bump @aemforms/af-custom-functions 1.0.17 -> 1.0.18 (adds v3 support to
  fetchCaptchaToken; 1.0.18 is exactly 1.0.17 + the v3 change).
- recaptcha widget/edit dialog treat v3 as invisible, score-based.
- Guard container submit/save handlers against a missing state.events.
- IT content (v3 cloud config + form), Cypress authoring/runtime coverage
  gated on FT_FORMS-27648, and FT enabled in IT toggle config.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@adobe-bot

Copy link
Copy Markdown

Lighthouse scores (mobile)

Performance Accessibility Best-Practices SEO
Scores 84 91 96 75

@adobe-bot

Copy link
Copy Markdown

Lighthouse scores (desktop)

Performance Accessibility Best-Practices SEO
Scores 100 91 96 75

@adobe-bot

Copy link
Copy Markdown

Accessibility Violations Found

Id Impact
aria-required-attr critical
empty-heading minor
label-title-only serious
page-has-heading-one moderate
target-size serious

This branch has not been deployed

No deployments
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.

2 participants