Skip to content

Comments

feat: add EU CAPTCHA as a first-class captcha provider#317

Open
saschaatmyra wants to merge 1 commit intomaxlerebourg:mainfrom
Myra-Security-GmbH:feat/eucaptcha-provider
Open

feat: add EU CAPTCHA as a first-class captcha provider#317
saschaatmyra wants to merge 1 commit intomaxlerebourg:mainfrom
Myra-Security-GmbH:feat/eucaptcha-provider

Conversation

@saschaatmyra
Copy link

EU CAPTCHA (eu-captcha.eu) is a GDPR-compliant, privacy-first anti-bot service hosted entirely within the EU. This commit adds it as a native provider alongside hcaptcha, recaptcha, and turnstile.

Key differences from existing providers that required code changes:

  • Verification uses a JSON body instead of form-encoding, and must include sitekey, client_ip, and client_user_agent in addition to the token and secret.
  • At startup, sitekey/secret validity is checked via the dedicated /verify-credentials endpoint and the result is logged.

Changes:

  • pkg/configuration/configuration.go: add EucaptchaProvider constant; include it in the validateCaptcha allowlist.
  • pkg/captcha/captcha.go: register eucaptcha in infoProviders (including credentialsCheck URL); extend Validate() to accept remoteIP so client context can be forwarded; extract validateEucaptcha() for the JSON verification path; add checkEucaptchaCredentials() for startup credential probing; update ServeHTTP() call accordingly. All existing providers are unaffected.
  • README.md, examples/captcha/README.md: document the new provider.

Configuration:
captchaProvider: eucaptcha
captchaSiteKey:
captchaSecretKey:
captchaGracePeriodSeconds: 1800 captchaHTMLFilePath: /captcha.html

EU CAPTCHA (eu-captcha.eu) is a GDPR-compliant, privacy-first anti-bot
service hosted entirely within the EU. This commit adds it as a native
provider alongside hcaptcha, recaptcha, and turnstile.

Key differences from existing providers that required code changes:

- Verification uses a JSON body instead of form-encoding, and must
  include sitekey, client_ip, and client_user_agent in addition to the
  token and secret.
- At startup, sitekey/secret validity is checked via the dedicated
  /verify-credentials endpoint and the result is logged.

Changes:
- pkg/configuration/configuration.go: add EucaptchaProvider constant;
  include it in the validateCaptcha allowlist.
- pkg/captcha/captcha.go: register eucaptcha in infoProviders (including
  credentialsCheck URL); extend Validate() to accept remoteIP so client
  context can be forwarded; extract validateEucaptcha() for the JSON
  verification path; add checkEucaptchaCredentials() for startup
  credential probing; update ServeHTTP() call accordingly.
  All existing providers are unaffected.
- README.md, examples/captcha/README.md: document the new provider.

Configuration:
  captchaProvider: eucaptcha
  captchaSiteKey: <public sitekey from app.eu-captcha.eu>
  captchaSecretKey: <secret key from app.eu-captcha.eu>
  captchaGracePeriodSeconds: 1800
  captchaHTMLFilePath: /captcha.html
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