Repository navigation
Releases
Releases · Particle-Academy/fancy-captcha
v0.1.0
Added
- One
Verifiercontract with four drivers, chosen byfancy-captcha.driver:
builtin(the default),turnstile,recaptcha(v2 checkbox or v3 with
score_thresholdand expected action) andhcaptcha. Providers are called over plain
HTTP with Laravel's HTTP client, with no SDK and no new dependency. - Built-in checks: a honeypot field (
contact_fax), a form-render time signed with
HMAC-SHA256 under a key derived fromAPP_KEY(3 seconds minimum, 6 hours maximum), and
optional proof-of-work: a random, 5-minute, cache-stored challenge from
GET /fancy-captcha/challenge(throttled per IP), a SHA-256 leading-zero-bits search in
the browser, one hash to verify, and each challenge accepted once. - Fails closed. Network errors, timeouts (3 seconds by default), non-2xx statuses,
redirects, unreadable bodies, a wrong hostname or action, and low v3 scores are all
refusals. A provider selected without keys refuses everything in production and falls back
to the built-in checks, with a logged warning, elsewhere. - The
captcha:<action>middleware, theRules\Captchavalidation rule and the
Captchafacade. One generic message for the visitor; the reason goes to the log, which
never carries a token, a solution, a timestamp or a secret. The verdict is memoised per
request, so the middleware and the rule together redeem a proof-of-work once. - Optional consent gating with
particle-academy/fancy-compliance(not a dependency):
consent.categoryputs the provider behind a consent category, with the built-in checks
and proof-of-work as the fallback when it is refused. - Props for
@particle-academy/fancy-captcha-ui, shared with Inertia asfancyCaptcha
when Inertia is installed. Field names are shared constants (FancyCaptcha\Fields). Captcha::fake()for host tests, withpasses(),fails(),assertVerified(),
assertNotVerified()andassertVerifiedCount(). Refused in production.- Tests: Pest 5 on a hand-built Laravel 13 kernel, no testbench, no network.
laravel/frameworkis a dev dependency under the estate's carve-out for the framework a
package integrates with.
Consumer action: new package. Install, then either keep the default built-in driver or
set a provider's two keys. If you choose a provider, set the keys before deploying:
production refuses every submission until both are present.