[3.0] Implement AntiSpam System #8847
Draft
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.
This overhauls the entire AntiSpam system in SMF to provide a modular-based system, which should allow adding and removing methods for handling AntiSpam easily. The design was set up so we could implement solutions like hCaptcha or Cloudflare Turnstile by simply dropping in the needed integration file and adding any needed vendor files.
A first note. The AntiSpam system is currently broken in 3.0. Due to it never verifying the verification questions, it only generates them. I could send a separate PR just to fix that, but I fixed it in this to get my initial testing done.
The old "Verifier" was moved into the AntiSpam namespace and called "Verification" now. It differs from the AntiSpam class itself in that it's a wrapper to provide the GUI to the standardized GenericControls, while the AntiSpam logic itself should be callable by any code that wants to implement its templating handling.
The BlankField Verification method may be better renamed to HiddenField, I haven't decided really. I also thought about making this a required field for verification, because it's a very simple bot check, if they don't check that the CSS is hiding the field.
There is no restriction on having competing agents even if they offer the same deal (i.e., multiple types of CAPTCHA).
I want to work on getting reCAPTCHA V3 to work; we currently only support V2. I don't want to do its enterprise captcha, but we may need to add support for that.
The upgrader does not yet handle converting from the old data to the new.
Looking for feedback to ensure I am going in the right direction here. Things are named properly, and it looks like we can achieve the goal of extending the system.
Current TODO on this PR is