Skip to content

Release: Cloudflare Turnstile on network request and internship forms - #140

Merged
StanBarrows merged 2 commits into
productionfrom
main
Oct 29, 2026
Merged

StanBarrows merged 2 commits into
productionfrom
main

Conversation

@StanBarrows

Copy link
Copy Markdown
Contributor

Summary

  • Cloudflare Turnstile on the public network request form (POST network/request) and the internship application form (POST jobs/internship), alongside the existing honeypot and throttle.
  • TurnstileRule verifies the token server-side (siteverify, 5 s timeout); missing, rejected or unverifiable tokens fail with a translated message (de_CH, en_CH).
  • CSP allows challenges.cloudflare.com for script-src/script-src-elem and frame-src.
  • Both form pages are already DoNotCacheResponse, so no cached copy serves a stale widget. Signed application/manage routes are unchanged.
  • Tests: unit test for the rule, feature tests for both endpoints and widget rendering, CSP test, browser test against Cloudflare's test keys.

Activation

The check stays off until TURNSTILE_SITE_KEY and TURNSTILE_SECRET_KEY are set in the Laravel Cloud production environment (then redeploy). Without them the forms behave exactly as before.

🤖 Generated with Claude Code

Sebastian BURGIN-FIX (ext) and others added 2 commits October 29, 2026 08:36
…Cloudflare Turnstile

The network request and internship application forms are the public,
unauthenticated POSTs of the site. The honeypot and per-IP throttle stay;
Turnstile adds a server-side verified bot check alongside them.

- TurnstileRule verifies the token against Cloudflare siteverify (5 s
  timeout) and fails on missing, invalid or unverifiable tokens
- widget and check are active only when TURNSTILE_SITE_KEY and
  TURNSTILE_SECRET_KEY are set, so local development and CI need no keys
- both GET pages already use DoNotCacheResponse, so no cached copy can
  serve a stale widget
- CSP allows challenges.cloudflare.com for scripts and frames
- the token is neither stored nor mailed; the controllers only read email
- signed application and manage routes are unchanged

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A developer .env with real TURNSTILE_* keys switched the check on for
every form test that posts without a token. phpunit now blanks both
keys; tests that cover Turnstile enable it themselves.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@StanBarrows
StanBarrows merged commit e352eab into production Oct 29, 2026
7 checks passed
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.

1 participant