98369[FEATURE] Add spam protection provider API to forms
Commit message
The honeypot was hard-wired into the form runtime, so every captcha or bot detection extension shipped its own element, validator and templates, and editors had to add that element to every form. Spam protection providers now run on every page of a form: prepare() before a page is rendered and verify() when it is submitted, before its values are validated. They are enabled below renderingOptions.spamProtection, per prototype or per form. The honeypot becomes the first provider; its old rendering option still applies and is deprecated.
Resolves: #111742 Releases: main Change-Id: I6de7008626f0d04a98cb7eca40f2d0e8c53ddf88
Test this change
Run a command in your clone of the TYPO3 Core. Then try what the change does and vote on Verified in Gerrit. How to review a patch
- Check out patch set 1
-
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/69/98369/1 && git checkout FETCH_HEAD
- Cherry-pick onto main
-
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/69/98369/1 && git cherry-pick FETCH_HEAD
Review
-
Code review CR 0 Needs a vote
-
Verified V 0 Needs a vote
Merge conflicts 41
- 98344[FEATURE] Rate limit form submissions
- 98360[FEATURE] Allow disabling the first form page
- 98366[FEATURE] Clean up stored form submissions and their files
- 97848[BUGFIX] Ignore removed uploads in stale form state
- 95093[FEATURE] Allow form elements on summary page
- 96543[WIP][POC][TASK] Write and read records by the same rules and rights
- 94572[TASK] Resolve EXT:form variants lazily per step
- 98154[FEATURE] Use Monolog as backend of the TYPO3 logger
- 97533[FEATURE] Use symfony/lock for locking
- 92349[TASK] Replace deprecated usage for custom phpstan rule and add tests
- 94552[WIP][FEATURE] Passwordless passkey login for the backend
- 97641[WIP][TASK] Reuse Styleguide fixtures on all databases
- 97655[TEST][TASK] Test framework snapshot sequence metadata in Core
- 97630[!!!][FEATURE] Support dependency injection for routing aspects
- 97554[FEATURE] Introduce remote media providers
- 97550[TASK] Deprecate language key "default" in TypoScript _LOCAL_LANG
- 91666[TASK] Provide OpenAPI spec w/ Swagger UI for Actions API
- 91563[FEATURE] Introduce Action API
- 92197[WIP][FEATURE] Provide Record Actions
- 91486[FEATURE] Implement API Hub
- 95867[FEATURE] Render pages without TypoScript
- 96660[TASK] Derive argument schemas from signatures
- 96661[TASK] Add capability invoker and registry
- 96682[FEATURE] Add MCP system extension and endpoint
- 94709[BUGFIX] Fix sending spooled emails using HttpTransport
- 96533[WIP][!!!][TASK] Build Extbase persistence on doctrine/orm
- 96201[FEATURE] Introduce upload constraints for file uploads
- 92589[TASK] Replace unneeded instanceof on xxx|null. Use a null check instead
- 88507[WIP][FEATURE] AI suggest demo using tools API
- 95337[WIP][TASK] Evaluate phpunit parallel test execution
- 94945[WIP][TASK] Test testing-framework context leak fix
- 94571[WIP][BUGFIX] Re-evaluate form variants per step and make them revertible
- 94503[WIP][TASK] Save finishers in dedicated table
- 94128[WIP][FEATURE] Provide a webhook for EXT:form submissions
- 93558[POC][FEATURE] form <3 tca
- 94029[FEATURE] Add secrets store and key management
- 92068[WIP][TASK] Avoid Symfony v8 for transitive Symfony dependencies
- 85574[WIP][FEATURE] Language-aware slugs and slug normalizer API
- 76662[FEATURE] Introduce global routes
- 67656[FEATURE] Add CSRF protection for frontend forms (ext:form)
- 88232[WIP][TASK] fixture-packages composer plugin
Show 36 more changes Show less
Issues 1
Files 42
- typo3/sysext/core/Documentation/Changelog/15.0/Deprecation-111742-FormRenderingOptionHoneypotMoved.rstnew+54 −0
- typo3/sysext/core/Documentation/Changelog/15.0/Feature-111742-SpamProtectionProviderAPIForForms.rstnew+89 −0
- typo3/sysext/form/Classes/Domain/Runtime/FormRuntime.php+47 −65
- typo3/sysext/form/Classes/Domain/Runtime/FormState.php+6 −6
- typo3/sysext/form/Classes/SpamProtection/Exception/UnknownSpamProtectionProviderException.phpnew+25 −0
- typo3/sysext/form/Classes/SpamProtection/Provider/HoneypotProvider.phpnew+91 −0
- typo3/sysext/form/Classes/SpamProtection/SpamProtectionContext.phpnew+61 −0
- typo3/sysext/form/Classes/SpamProtection/SpamProtectionProviderInterface.phpnew+48 −0
- typo3/sysext/form/Classes/SpamProtection/SpamProtectionProviderRegistry.phpnew+74 −0
- typo3/sysext/form/Configuration/Form/Base/FormElements/Form.yaml+4 −3
- typo3/sysext/form/Documentation/D/SpamProtection/Index.rstnew+82 −0
- typo3/sysext/form/Documentation/D/SpamProtection/_config.yamlnew+9 −0
- typo3/sysext/form/Documentation/D/SpamProtection/_MinimumTimeProvider.phpnew+32 −0
- typo3/sysext/form/Documentation/D/Index.rst+1 −0
- typo3/sysext/form/Documentation/I/Config/proto/form/renderingOptions/spamProtection/honeypot/enable.rst.txtrenamed+13 −7
- typo3/sysext/form/Documentation/I/Config/proto/form/renderingOptions/spamProtection/honeypot/formElementToUse.rst.txtrenamed+14 −8
- typo3/sysext/form/Documentation/I/Config/proto/form/renderingOptions/translation/translationFiles.rst.txt+4 −3
- typo3/sysext/form/Documentation/I/Config/proto/form/renderingOptions/additionalParams.rst.txt+4 −3
- typo3/sysext/form/Documentation/I/Config/proto/form/renderingOptions/addQueryString.rst.txt+4 −3
- typo3/sysext/form/Documentation/I/Config/proto/form/renderingOptions/argumentsToBeExcludedFromQueryString.rst.txt+4 −3
- typo3/sysext/form/Documentation/I/Config/proto/form/renderingOptions/controllerAction.rst.txt+4 −3
- typo3/sysext/form/Documentation/I/Config/proto/form/renderingOptions/httpEnctype.rst.txt+4 −3
- typo3/sysext/form/Documentation/I/Config/proto/form/renderingOptions/httpMethod.rst.txt+4 −3
- typo3/sysext/form/Documentation/I/Config/proto/form/renderingOptions/layoutRootPaths.rst.txt+4 −3
- typo3/sysext/form/Documentation/I/Config/proto/form/renderingOptions/partialRootPaths.rst.txt+4 −3
- typo3/sysext/form/Documentation/I/Config/proto/form/renderingOptions/skipUnknownElements.rst.txt+5 −4
- typo3/sysext/form/Documentation/I/Config/proto/form/renderingOptions/spamProtection.rst.txtnew+43 −0
- typo3/sysext/form/Documentation/I/Config/proto/form/renderingOptions/submitButtonLabel.rst.txt+5 −4
- typo3/sysext/form/Documentation/I/Config/proto/form/renderingOptions/templateRootPaths.rst.txt+4 −3
- typo3/sysext/form/Documentation/I/Config/proto/form/renderingOptions/_isCompositeFormElement.rst.txt+4 −3
- typo3/sysext/form/Documentation/I/Config/proto/form/renderingOptions/_isTopLevelFormElement.rst.txt+4 −3
- typo3/sysext/form/Documentation/I/Config/proto/form/Index.rst+7 −2
- typo3/sysext/form/Tests/Functional/Domain/Runtime/FormRuntimeTest.php+6 −0
- typo3/sysext/form/Tests/Functional/Fixtures/Extensions/form_request_handling_tests/Classes/SpamProtection/RejectingSpamProtectionProvider.phpnew+50 −0
- typo3/sysext/form/Tests/Functional/Fixtures/Extensions/form_request_handling_tests/Configuration/Services.yamlnew+8 −0
- typo3/sysext/form/Tests/Functional/Fixtures/Extensions/form_request_handling_tests/composer.json+5 −0
- typo3/sysext/form/Tests/Functional/RequestHandling/Fixtures/Forms/DeprecatedHoneypotOptionTestForm.form.yamlnew+18 −0
- typo3/sysext/form/Tests/Functional/RequestHandling/Fixtures/Forms/SinglestepTestForm.form.yaml+5 −0
- typo3/sysext/form/Tests/Functional/RequestHandling/Fixtures/OnePageWithMultipleFormIntegrationsScenario.yaml+4 −0
- typo3/sysext/form/Tests/Functional/RequestHandling/RequestHandlingTest.php+60 −0
- typo3/sysext/form/Tests/Unit/SpamProtection/SpamProtectionProviderRegistryTest.phpnew+121 −0
- composer.json+1 −0
Show 22 more files Show less
Review log 2
-
Josua Vogel uploaded patch set 1 12/05/26, 16:37
-
Josua Vogel wrote 12/05/26, 18:44
Unset private