feat: add EU CAPTCHA as a first-class captcha provider#317
Open
saschaatmyra wants to merge 1 commit intomaxlerebourg:mainfrom
Open
feat: add EU CAPTCHA as a first-class captcha provider#317saschaatmyra wants to merge 1 commit intomaxlerebourg:mainfrom
saschaatmyra wants to merge 1 commit intomaxlerebourg:mainfrom
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
Changes:
Configuration:
captchaProvider: eucaptcha
captchaSiteKey:
captchaSecretKey:
captchaGracePeriodSeconds: 1800 captchaHTMLFilePath: /captcha.html