Unreleased
[0.1.0] - 2026-12-04
The first release, an alpha: a self-hosted image captcha for Laravel for Go, ported from mews/captcha 3.5.1. The API may still change before 1.0.
Added
- Session captchas for forms (
GET /captcha/{profile},captcha.Rule) and keyed captchas for APIs (GET /captcha/api/{profile},captcha.Keyed,captcha.KeyedWith,captcha.Issue). - The five profiles mews/captcha ships,
captcha.Defaults()with PHP's class defaults, and math profiles. - Images drawn in mews/captcha's order with its bundled fonts and backgrounds, matching GD's filters and
resize; the build tag
captcha_noassetsleaves the assets out. captcha.Check,captcha.CheckKey, and the detailed verdicts ofCheckSessionandCheckKeyed.captcha.Src,captcha.Img,captcha.Image, and the template functionscaptchaSrc,captchaImgandcaptchaField, with an optional refresh script.captcha.ParsePHPConfig, which reads an exportedconfig('captcha').captchatest.Disableandcaptchatest.Recordfor application tests.Config.Rendererfor drawing images yourself.
Security
- Each challenge has its own random id and is consumed atomically: of many simultaneous correct answers, exactly one passes, on Redis and on the database cache.
- The answer is never stored or sent; the store keeps a keyed verifier.
- Wrong answers are limited per client and profile, and image requests per client.
- The package refuses a cache store that can't keep challenges safely, and runs store operations outside the caller's database transaction, reading from the writer.
Compatibility
- Go 1.27 or newer,
go.laravel.comv0.2.0. - Behaviour that differs from mews/captcha is listed in the README and in Migrating from PHP.