Spamschutz Kontakt + Registrierung: Turnstile, Rate-Limit, Honeypot; Passwort min. 8

- Kontaktformular: keine Mail mehr an die eingegebene Adresse (wurde als
  Spam-Versender missbraucht); Anfrage nur an Kontakt-Adresse + Berater (BCC),
  Reply-To = Absender; Eingaben in der Mail escaped
- Kontakt + Registrierung: Cloudflare Turnstile statt reCAPTCHA (Schluessel
  aus dem Code in die .env), Rate-Limits, Honeypot + Mindest-Ausfuellzeit,
  Namensregel (lateinische Schrift, max. 50 Zeichen), Form Requests
- Registrierung: Partner-Nummer nur fuer aktive Berater (vorher ungeprueft)
- CRM: POST /register abgeschaltet (legte ohne Captcha Benutzer an)
- Passwort-Mindestlaenge systemweit 8 Zeichen ueber Password::defaults()
- Log abgefangener Anfragen: storage/logs/form-spam-*.log
- Doku und Protokoll: dev/2026-10-09-spam/README.md

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kevin Adametz 2026-10-09 08:22:02 +00:00
parent fe1a9478f4
commit 4c944aa15d
44 changed files with 1320 additions and 248 deletions

View file

@ -0,0 +1,35 @@
<?php
use Illuminate\Support\Facades\Validator;
use Illuminate\Validation\Rules\Password;
use Tests\TestCase;
uses(TestCase::class);
/**
* Registrierung, Wizard, Erst-Passwort, Passwort ändern und Zurücksetzen nutzen alle Password::defaults().
*/
it('verlangt systemweit mindestens 8 Zeichen für neue Passwörter', function (string $password, bool $passes) {
$validator = Validator::make(
['password' => $password, 'password_confirmation' => $password],
['password' => ['required', 'string', 'confirmed', Password::defaults()]],
);
expect($validator->passes())->toBe($passes);
})->with([
'6 Zeichen' => ['abc123', false],
'7 Zeichen' => ['abcd123', false],
'8 Zeichen' => ['abcd1234', true],
'20 Zeichen' => [str_repeat('x', 20), true],
]);
it('nennt in der Fehlermeldung die Mindestlänge', function () {
app()->setLocale('de');
$validator = Validator::make(
['password' => 'kurz', 'password_confirmation' => 'kurz'],
['password' => ['required', 'confirmed', Password::defaults()]],
);
expect($validator->errors()->first('password'))->toContain('8');
});