Skip to content

feat(equipment): protect photo submissions - #767

Merged
Perdolique merged 3 commits into
masterfrom
codex/742-photo-turnstile
Sep 21, 2026
Merged

Perdolique merged 3 commits into
masterfrom
codex/742-photo-turnstile

Conversation

@Perdolique

Copy link
Copy Markdown
Owner

Summary

Protects catalog photo uploads with a fresh Turnstile check before any expensive work 🔐📸 The existing upload and review flow stays intact while bot traffic gets stopped at the door 😎👍

  • 🔐 Require a server-validated photo_submission token before idempotent replay, rate limiting, multipart parsing, Images upload, or database writes
  • 🧩 Reuse the existing interaction-only widget and send its token only through X-Turnstile-Token
  • ♻️ Keep one idempotency key for unchanged retries while issuing a fresh single-use security token for every attempt
  • ♿ Recover from cancellation and widget failures without sending the upload
  • ✅ Cover verification ordering, short-circuit behavior, token transport, retries, and interactive browser states

Motivation

Invalid, expired, replayed, or mismatched Turnstile tokens must not reach multipart parsing or Cloudflare Images. This draft also opens the staging deployment for the remaining external Cloudflare ruleset check 🌬️

Related issues

Closes #742

- 🔐 Verify Turnstile before replay, upload, and persistence
- 🧩 Send fresh tokens while preserving stable retry keys
- ✅ Cover verification order and browser retry behavior
- 🎯 Close #742
@Perdolique Perdolique self-assigned this Sep 21, 2026
@github-actions

github-actions Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

- 🐛 Preserve native node:crypto imports in Nitro Worker builds
- ✅ Guard the compatibility flag and document its removal condition
- 🛡️ Rate-limit Turnstile checks before Siteverify by user and IP
- ♿ Restore submit focus after recoverable API failures
- ✅ Cover missing tokens, retry keys, and limiter ordering
@Perdolique
Perdolique marked this pull request as ready for review September 21, 2026 15:44
@Perdolique
Perdolique merged commit 8d30fdb into master Sep 21, 2026
12 checks passed
@Perdolique
Perdolique deleted the codex/742-photo-turnstile branch September 21, 2026 15:44

This branch was successfully deployed

1 active deployment
staging — fa9e2e78 Deployed Sep 21, 2026 by Perdolique via Database migration #543
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.

Protect photo submissions with Cloudflare Turnstile

1 participant