Replace reCAPTCHA service to tencent captcha on backend side
Problem to solve
Replace reCAPTCHA service to Tencent Captcha on backend side.
Overview of reCAPTCHA usage
Gitlab is using reCAPTCHA to protect websites from spams, which has been integrated within HTML forms and APIs.
For HTML requests, the reCAPTCHA uses recaptcha_tags
to load frontend partials in views with recaptcha_enabled?
as a checking flag and uses params['g-recaptcha-response']
for backend verification.
For APIs, the needs_captcha_response
will be added in HTTP response header to let clients know that reCAPTCHA response is needed and it uses X-GitLab-Captcha-Response
in HTTP request headers for backend.
Proposal
- Add a flag variable to determine when reCAPTCHA will be replaced by Tencent Captcha.
- Override the
recaptcha_tags
method. - Override the
recaptcha_verify_via_api_call
and point it to Tencent Cloud.
How to
- To enable this feature, #478 (closed) frontend required.
- This feature can be enabled by execute
Feature.enable :tencent_captcha
由 Martin Tan 编辑于