Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
|||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace App\Domain\Contact\Service; |
| 6 | |
| 7 | /** |
| 8 | * Verifies a Cloudflare Turnstile token against the siteverify endpoint. |
| 9 | * |
| 10 | * Stands in for the auth gate on the public contact form: a logged-out |
| 11 | * submitter must clear the challenge before their message is stored. |
| 12 | * |
| 13 | * Tests substitute {@see \App\Test\Fake\FakeTurnstileVerifier}. |
| 14 | */ |
| 15 | interface TurnstileVerifierInterface |
| 16 | { |
| 17 | /** |
| 18 | * @param string $token The Turnstile response token from the client widget. |
| 19 | * @param string|null $remoteIp Submitter IP, forwarded to Cloudflare when available. |
| 20 | * @return bool True only when Cloudflare confirms the challenge passed. |
| 21 | */ |
| 22 | public function verify(string $token, ?string $remoteIp = null): bool; |
| 23 | } |