huluti/altcha-bundle
Symfony bundle that integrates ALTCHA, a privacy-friendly proof-of-work CAPTCHA, into your forms. Protect against spam and bots without cookies, tracking, or third-party services, with simple form type and validator support.
Architecture fit — mismatch, unchanged as of 3.1.0. huluti/altcha-bundle is a Symfony bundle, not a Laravel package. Its integration surface is Symfony-specific: it registers as a Bundle subclass, wires services through the Symfony DI container, and relies on Symfony's configuration tree, autoconfiguration tags, and typically a Flex recipe. Laravel has no equivalent bundle lifecycle — no Bundle interface, no extension/config-dump mechanism, no recipe system. Dropping this into a Laravel app would mean pulling symfony/http-kernel, symfony/dependency-injection, and symfony/config into a framework that already has its own container, which is a hard no for a production Laravel service. This package cannot be adopted as-is in a Laravel stack. Nothing in 3.1.0 touches the bundle's framework coupling, so the verdict is unchanged.
What 3.1.0 actually delivers. Two things, neither structural:
Fix #70 type exception (PR #71) — a correctness fix. Good to see, but a type-exception fix in a 3.x line is also a signal the package is still settling; it argues for "read as reference," not "depend on it."Support CSP (PR #73, authored by Huluti) — the substantive item. The bundle now presumably emits nonce-aware or CSP-compatible asset/script handling for the widget. This does not help us, because we are not using the bundle — but the underlying problem it solves is real for the build we are recommending (see Integration Approach). Treat it as confirmation that CSP is a genuine integration concern, not as a feature we inherit.Provenance note. The 3.1.0 changelog shows Huluti (the original namesake author) contributing to tito10047's repository, which is consistent with a maintainer transfer or active upstream collaboration rather than an abandoned fork. That's a mildly positive signal for the bundle's health, but it does not change the adoption math: still ~20 stars, 0 dependents, single-maintainer, and still the wrong framework.
What is portable. Altcha itself is a protocol, not a framework feature. The server side is a small, well-defined flow: issue a signed challenge (salt + SHA-256 proof-of-work parameters, HMAC-signed), receive the client's solved payload, then verify the hash, the HMAC signature, and the expiry. That logic is ~100 lines and framework-agnostic. The client side is a Web Component (<altcha-widget>) loaded from CDN or npm. Both are directly usable in Laravel via a service class, a validation rule, and a Blade component — no Symfony dependency required.
Integration feasibility: high, but not via this package. Realistic paths, in order of preference:
altcha-org/altcha PHP server library + a thin Laravel wrapper (validation rule altcha, Blade component, config file for HMAC secret and difficulty). Lowest risk, smallest owned surface.Technical risk: low protocol risk, elevated supply-chain risk. Repository metadata remains the red flag set: package name huluti vs. URL tito10047, ~20 stars, 0 dependents, and a release history whose dates should be reconciled against the actual registry before anyone cites them. A single-maintainer package with zero downstream consumers is not a dependency you take on Laravel-side; it's a reference implementation you read. The 3.1.0 fix releases slightly improve the "is it maintained" answer without improving the "should we depend on it" answer.
Key questions for the team:
script-src, the widget needs a nonce or hash, and the WASM proof-of-work path may need wasm-unsafe-eval. This is now the highest-likelihood integration blocker and should be settled before the spike ends, not after.Stack fit. Nothing about this bundle fits a Laravel stack. Laravel's equivalents — service providers, config/*.php, Validator::extend, Blade components, middleware — have no mapping to Symfony's bundle/extension/compiler-pass model. Treat the bundle as documentation of the protocol, not as a dependency.
Recommended build. Three small pieces:
config/altcha.php — HMAC secret (from env, rotated), algorithm, cost/difficulty, challenge TTL.App\Services\Altcha\ChallengeService — issues signed challenges; verify(string $payload): bool checks hash, signature, and expiry.App\Rules\Altcha validation rule + a <x-altcha /> Blade component wrapping the self-hosted widget script. Register the rule so it composes with existing FormRequest validation.CSP — now an explicit build task. 3.1.0's CSP support is the clearest evidence that this is non-trivial on the Symfony side, and we get none of it for free. Budget it:
unsafe-inline by emitting a per-request nonce (Laravel's Vite::useCspNonce() / a CspNonce helper) into the component's script tag.script-src 'wasm-unsafe-eval' in our target browsers, or whether Altcha's pure-JS fallback lets us avoid it. Prefer avoiding it — an unsafe-eval-class carve-out on every page is a poor trade for bot mitigation.connect-src or worker-src additions are needed (self-hosted means no CDN origin, which is a second reason to self-host).report-uri/report-to collection during shadow mode is the cheapest way to catch this before users do.Migration path. There is no migration — this is greenfield. If a legacy captcha (reCAPTCHA/hCaptcha) is in place, run Altcha in shadow mode on one low-risk form for 2–3 weeks: collect pass/fail, false-positive, and CSP-violation rates without blocking submissions, then flip to enforcing.
Compatibility concerns to test explicitly:
script-src. See above — the failure mode is silent (widget never renders, form never submits), so test under our production headers, not a dev default.Sequencing.
unsafe-eval needed.Maintenance. If we build the wrapper, we own it — roughly a few hours per quarter for dependency bumps plus whatever the widget's JS surface costs, plus a re-check whenever we tighten CSP. That is genuinely small, and far cheaper than owning a Symfony-bundle fork. Do not fork huluti/altcha-bundle into the Laravel app; that path produces a permanent, undocumented divergence.
Support. Effectively none. ~20 stars, zero dependents, and a single maintainer mean there is no vendor, no SLA, and no meaningful community backstop. The correct posture is: the protocol is stable and simple enough to reimplement, so do not depend on this package for anything. Track upstream altcha-org for protocol changes; watch this repo's changelog as free intelligence on edge cases (3.1.0 just told us CSP is one). 3.1.0's two-line changelog is exactly the level of signal you get from a package like this — enough to notice, not enough to rely on.
Scaling. Favourable. Verification is a SHA-256 hash comparison plus an HMAC check — microseconds, no I/O, no external service call, no per-request vendor cost. The expensive work (solving the proof-of-work) happens on the client, which is the whole point versus reCAPTCHA. Two caveats: the HMAC secret must be shared across all app instances (env/config, not per-node), and Altcha is not a rate limiter — keep throttle middleware in front of every protected endpoint, because PoW raises cost per request but does not cap request volume.
Failure modes to instrument:
Ramp-up. One engineer, roughly half a day to understand the protocol and the widget API, then 1–2 days to build and test the Laravel wrapper, plus up to half a day on CSP given it's now a known sharp edge. No framework-specific expertise needed beyond standard Laravel validation, Blade, and response headers. The bundle's Symfony idioms will cost a reviewer an hour of confusion before concluding it's not applicable — budget that as deliberate spike time rather than discovery-by-surprise.
Recommendation. Unchanged by 3.1.0. Do not adopt huluti/altcha-bundle on a Laravel codebase — the framework mismatch is disqualifying and the adoption signals (low stars, 0 dependents, ambiguous repo provenance, still fixing type exceptions) don't justify working around it. The CSP support in 3.1.0 is worth reading as documentation for our own widget integration, not as a reason to reconsider. If Altcha is the right bot-mitigation choice, implement the challenge/verify flow directly against the official PHP library behind a Laravel validation rule and a self-hosted, nonce-aware widget. Cost is low, risk is contained, and ownership stays internal.
How can I help you explore Laravel packages today?