-
-
Notifications
You must be signed in to change notification settings - Fork 716
[16.0][IMP] Add modularity for other reCAPTCHA v2-compatible APIs #1111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Honeyxilia
wants to merge
2
commits into
OCA:16.0
Choose a base branch
from
Honeyxilia:16.0-imp-add-hcaptcha-compability
base: 16.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
To be able to make use of the work of this module for other CAPTCHA APIs compatible with reCAPTCHA v2 (ie. hCaptcha), we added fields to allow modification of the API used by the CAPTCHA widget. To avoid disrupting current implementations of the module, we however still set default fields that correspond to the Google reCAPTCHA API.
By adding these fields (API urls, CSS class, response attribute) in Settings -> Website, alongside the previous fields, this allows front-end users to handily change the values related to the used API, to be able to input other implementations, such as hCaptcha.
055d41a
to
8684451
Compare
Honeyxilia
added a commit
to Honeyxilia/commown-odoo-addons
that referenced
this pull request
Jun 27, 2025
- Since the base implementation of reCAPTCHA in the Odoo module is based on reCAPTCHA v3, and the v3 implementation of hCaptcha is kept behind an Enterprise subscription, we aimed to reimplement hCaptcha (reCAPT. v2) though other means. - While researching, we found the OCA module 'website_recapatcha_v2', which reimplements reCAPTCHA v2 on Odoo 16 - so, urban_mine now depends on website_captcha_v2 to reimplement hCaptcha. (Since the values for reCAPTCHA were hardcoded in the module, we added the ability to customized the CAPTCHA API used in website_recaptche_v2 : OCA/website#1111 ) - We then call the recaptcha_widget template to insert and initialize the hCaptcha check, by changing the values in Odoo's settings.
Honeyxilia
added a commit
to Honeyxilia/commown-odoo-addons
that referenced
this pull request
Jun 27, 2025
- Since the base implementation of reCAPTCHA in the Odoo module is based on reCAPTCHA v3, and the v3 implementation of hCaptcha is kept behind an Enterprise subscription, we aimed to reimplement hCaptcha (reCAPT. v2) though other means. - While researching, we found the OCA module 'website_recapatcha_v2', which reimplements reCAPTCHA v2 on Odoo 16 - so, urban_mine now depends on website_captcha_v2 to reimplement hCaptcha. (Since the values for reCAPTCHA were hardcoded in the module, we added the ability to customized the CAPTCHA API used in website_recaptche_v2 : OCA/website#1111 ) - We then call the recaptcha_widget template to insert and initialize the hCaptcha check, by changing the values in Odoo's settings.
Honeyxilia
added a commit
to Honeyxilia/commown-odoo-addons
that referenced
this pull request
Jul 1, 2025
With our PR to add captcha API customization to OCA/website (OCA/website#1111), we added fields in the website model, which we use in the urban_mine module. So, we add this source in our test requirements in order to fetch the code in the GitHub test job.
Honeyxilia
added a commit
to Honeyxilia/commown-odoo-addons
that referenced
this pull request
Jul 1, 2025
With our PR to add captcha API customization to OCA/website (OCA/website#1111), we added fields in the website model, which we use in the urban_mine module. So, we add this source in our test requirements in order to fetch the code in the GitHub test job.
Honeyxilia
added a commit
to Honeyxilia/commown-odoo-addons
that referenced
this pull request
Jul 1, 2025
With our PR to add captcha API customization to OCA/website (OCA/website#1111), we added fields in the website model, which we use in the urban_mine module. So, we add this source in our test requirements in order to fetch the code in the GitHub test job.
Honeyxilia
added a commit
to Honeyxilia/commown-odoo-addons
that referenced
this pull request
Jul 1, 2025
With our PR to add captcha API customization to OCA/website (OCA/website#1111), we added fields in the website model, which we use in the urban_mine module. So, we add this source in our test requirements in order to fetch the code in the GitHub test job.
Honeyxilia
added a commit
to Honeyxilia/commown-odoo-addons
that referenced
this pull request
Jul 1, 2025
- Since the base implementation of reCAPTCHA in the Odoo module is based on reCAPTCHA v3, and the v3 implementation of hCaptcha is kept behind an Enterprise subscription, we aimed to reimplement hCaptcha (reCAPT. v2) though other means. - While researching, we found the OCA module 'website_recapatcha_v2', which reimplements reCAPTCHA v2 on Odoo 16 - so, urban_mine now depends on website_captcha_v2 to reimplement hCaptcha. (Since the values for reCAPTCHA were hardcoded in the module, we added the ability to customized the CAPTCHA API used in website_recaptche_v2 : OCA/website#1111 ) - We then call the recaptcha_widget template to insert and initialize the hCaptcha check, by changing the values in Odoo's settings.
Honeyxilia
added a commit
to Honeyxilia/commown-odoo-addons
that referenced
this pull request
Jul 1, 2025
With our PR to add captcha API customization to OCA/website (OCA/website#1111), we added fields in the website model, which we use in the urban_mine module. So, we add this source in our test requirements in order to fetch the code in the GitHub test job.
Honeyxilia
added a commit
to Honeyxilia/commown-odoo-addons
that referenced
this pull request
Jul 1, 2025
- Since the base implementation of reCAPTCHA in the Odoo module is based on reCAPTCHA v3, and the v3 implementation of hCaptcha is kept behind an Enterprise subscription, we aimed to reimplement hCaptcha (reCAPT. v2) though other means. - While researching, we found the OCA module 'website_recapatcha_v2', which reimplements reCAPTCHA v2 on Odoo 16 - so, urban_mine now depends on website_captcha_v2 to reimplement hCaptcha. (Since the values for reCAPTCHA were hardcoded in the module, we added the ability to customized the CAPTCHA API used in website_recaptche_v2 : OCA/website#1111 ) - We then call the recaptcha_widget template to insert and initialize the hCaptcha check, by changing the values in Odoo's settings.
Honeyxilia
added a commit
to Honeyxilia/commown-odoo-addons
that referenced
this pull request
Jul 1, 2025
With our PR to add captcha API customization to OCA/website (OCA/website#1111), we added fields in the website model, which we use in the urban_mine module. So, we add this source in our test requirements in order to fetch the code in the GitHub test job.
Honeyxilia
added a commit
to Honeyxilia/commown-odoo-addons
that referenced
this pull request
Jul 2, 2025
- Since the base implementation of reCAPTCHA in the Odoo module is based on reCAPTCHA v3, and the v3 implementation of hCaptcha is kept behind an Enterprise subscription, we aimed to reimplement hCaptcha (reCAPT. v2) though other means. - While researching, we found the OCA module 'website_recapatcha_v2', which reimplements reCAPTCHA v2 on Odoo 16 - so, urban_mine now depends on website_captcha_v2 to reimplement hCaptcha. (Since the values for reCAPTCHA were hardcoded in the module, we added the ability to customized the CAPTCHA API used in website_recaptche_v2 : OCA/website#1111 ) - We then call the recaptcha_widget template to insert and initialize the hCaptcha check, by changing the values in Odoo's settings.
Honeyxilia
added a commit
to Honeyxilia/commown-odoo-addons
that referenced
this pull request
Jul 2, 2025
With our PR to add captcha API customization to OCA/website (OCA/website#1111), we added fields in the website model, which we use in the urban_mine module. So, we add this source in our test requirements in order to fetch the code in the GitHub test job.
Honeyxilia
added a commit
to Honeyxilia/commown-odoo-addons
that referenced
this pull request
Jul 2, 2025
- Since the base implementation of reCAPTCHA in the Odoo module is based on reCAPTCHA v3, and the v3 implementation of hCaptcha is kept behind an Enterprise subscription, we aimed to reimplement hCaptcha (reCAPT. v2) through other means. - While researching, we found the OCA module 'website_recapatcha_v2', which reimplements reCAPTCHA v2 on Odoo 16 - so, urban_mine now depends on website_captcha_v2 to reimplement hCaptcha. (Since the values for reCAPTCHA were hardcoded in the module, we added the ability to customized the CAPTCHA API used in website_recaptche_v2 : OCA/website#1111 ) - We then call the recaptcha_widget template to insert and initialize the hCaptcha check, by changing the values in Odoo's settings.
Honeyxilia
added a commit
to Honeyxilia/commown-odoo-addons
that referenced
this pull request
Jul 2, 2025
With our PR to add captcha API customization to OCA/website (OCA/website#1111), we added fields in the website model, which we use in the urban_mine module. So, we add this source in our test requirements in order to fetch the code in the GitHub test job.
Honeyxilia
added a commit
to Honeyxilia/commown-odoo-addons
that referenced
this pull request
Jul 3, 2025
- Since the base implementation of reCAPTCHA in the Odoo module is based on reCAPTCHA v3, and the v3 implementation of hCaptcha is kept behind an Enterprise subscription, we aimed to reimplement hCaptcha (reCAPT. v2) through other means. - While researching, we found the OCA module 'website_recapatcha_v2', which reimplements reCAPTCHA v2 on Odoo 16 - so, urban_mine now depends on website_captcha_v2 to reimplement hCaptcha. (Since the values for reCAPTCHA were hardcoded in the module, we added the ability to customized the CAPTCHA API used in website_recaptche_v2 : OCA/website#1111 ) - We then call the recaptcha_widget template to insert and initialize the hCaptcha check, by changing the values in Odoo's settings.
Honeyxilia
added a commit
to Honeyxilia/commown-odoo-addons
that referenced
this pull request
Jul 3, 2025
With our PR to add captcha API customization to OCA/website (OCA/website#1111), we added fields in the website model, which we use in the urban_mine module. So, we add this source in our test requirements in order to fetch the code in the GitHub test job.
Honeyxilia
added a commit
to Honeyxilia/commown-odoo-addons
that referenced
this pull request
Jul 3, 2025
- Since the base implementation of reCAPTCHA in the Odoo module is based on reCAPTCHA v3, and the v3 implementation of hCaptcha is kept behind an Enterprise subscription, we aimed to reimplement hCaptcha (reCAPT. v2) through other means. - While researching, we found the OCA module 'website_recapatcha_v2', which reimplements reCAPTCHA v2 on Odoo 16 - so, urban_mine now depends on website_captcha_v2 to reimplement hCaptcha. (Since the values for reCAPTCHA were hardcoded in the module, we added the ability to customized the CAPTCHA API used in website_recaptche_v2 : OCA/website#1111 ) - We then call the recaptcha_widget template to insert and initialize the hCaptcha check, by changing the values in Odoo's settings.
Honeyxilia
added a commit
to Honeyxilia/commown-odoo-addons
that referenced
this pull request
Jul 3, 2025
With our PR to add captcha API customization to OCA/website (OCA/website#1111), we added fields in the website model, which we use in the urban_mine module. So, we add this source in our test requirements in order to fetch the code in the GitHub test job.
Honeyxilia
added a commit
to Honeyxilia/commown-odoo-addons
that referenced
this pull request
Jul 3, 2025
- Since the base implementation of reCAPTCHA in the Odoo module is based on reCAPTCHA v3, and the v3 implementation of hCaptcha is kept behind an Enterprise subscription, we aimed to reimplement hCaptcha (reCAPT. v2) through other means. - While researching, we found the OCA module 'website_recapatcha_v2', which reimplements reCAPTCHA v2 on Odoo 16 - so, urban_mine now depends on website_captcha_v2 to reimplement hCaptcha. (Since the values for reCAPTCHA were hardcoded in the module, we added the ability to customized the CAPTCHA API used in website_recaptche_v2 : OCA/website#1111 ) - We then call the recaptcha_widget template to insert and initialize the hCaptcha check, by changing the values in Odoo's settings.
Honeyxilia
added a commit
to Honeyxilia/commown-odoo-addons
that referenced
this pull request
Jul 3, 2025
With our PR to add captcha API customization to OCA/website (OCA/website#1111), we added fields in the website model, which we use in the urban_mine module. So, we add this source in our test requirements in order to fetch the code in the GitHub test job.
Honeyxilia
added a commit
to Honeyxilia/commown-odoo-addons
that referenced
this pull request
Jul 3, 2025
- Since the base implementation of reCAPTCHA in the Odoo module is based on reCAPTCHA v3, and the v3 implementation of hCaptcha is kept behind an Enterprise subscription, we aimed to reimplement hCaptcha (reCAPT. v2) through other means. - While researching, we found the OCA module 'website_recapatcha_v2', which reimplements reCAPTCHA v2 on Odoo 16 - so, urban_mine now depends on website_captcha_v2 to reimplement hCaptcha. (Since the values for reCAPTCHA were hardcoded in the module, we added the ability to customized the CAPTCHA API used in website_recaptche_v2 : OCA/website#1111 ) - We then call the recaptcha_widget template to insert and initialize the hCaptcha check, by changing the values in Odoo's settings.
Honeyxilia
added a commit
to Honeyxilia/commown-odoo-addons
that referenced
this pull request
Jul 3, 2025
With our PR to add captcha API customization to OCA/website (OCA/website#1111), we added fields in the website model, which we use in the urban_mine module. So, we add this source in our test requirements in order to fetch the code in the GitHub test job.
Honeyxilia
added a commit
to Honeyxilia/commown-odoo-addons
that referenced
this pull request
Jul 3, 2025
- Since the base implementation of reCAPTCHA in the Odoo module is based on reCAPTCHA v3, and the v3 implementation of hCaptcha is kept behind an Enterprise subscription, we aimed to reimplement hCaptcha (reCAPT. v2) through other means. - While researching, we found the OCA module 'website_recapatcha_v2', which reimplements reCAPTCHA v2 on Odoo 16 - so, urban_mine now depends on website_captcha_v2 to reimplement hCaptcha. (Since the values for reCAPTCHA were hardcoded in the module, we added the ability to customized the CAPTCHA API used in website_recaptche_v2 : OCA/website#1111 ) - We then call the recaptcha_widget template to insert and initialize the hCaptcha check, by changing the values in Odoo's settings. - Finally, we add base values linked to hCaptcha to the website, with data/hcaptcha.xml
Honeyxilia
added a commit
to Honeyxilia/commown-odoo-addons
that referenced
this pull request
Jul 3, 2025
With our PR to add captcha API customization to OCA/website (OCA/website#1111), we added fields in the website model, which we use in the urban_mine module. So, we add this source in our test requirements in order to fetch the code in the GitHub test job.
Honeyxilia
added a commit
to Honeyxilia/commown-odoo-addons
that referenced
this pull request
Jul 3, 2025
- Since the base implementation of reCAPTCHA in the Odoo module is based on reCAPTCHA v3, and the v3 implementation of hCaptcha is kept behind an Enterprise subscription, we aimed to reimplement hCaptcha (reCAPT. v2) through other means. - While researching, we found the OCA module 'website_recapatcha_v2', which reimplements reCAPTCHA v2 on Odoo 16 - so, urban_mine now depends on website_captcha_v2 to reimplement hCaptcha. (Since the values for reCAPTCHA were hardcoded in the module, we added the ability to customized the CAPTCHA API used in website_recaptche_v2 : OCA/website#1111 ) - We then call the recaptcha_widget template to insert and initialize the hCaptcha check, by changing the values in Odoo's settings.
Honeyxilia
added a commit
to Honeyxilia/commown-odoo-addons
that referenced
this pull request
Jul 3, 2025
With our PR to add captcha API customization to OCA/website (OCA/website#1111), we added fields in the website model, which we use in the urban_mine module. So, we add this source in our test requirements in order to fetch the code in the GitHub test job.
fcayre
approved these changes
Jul 4, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code review + real life tests OK (with hCaptcha).
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.
Context
In Odoo v12.0, the OCA module
website_form_recaptcha
allowed for the use of CAPTCHA APIs that were compatible with reCAPTCHA v2 by changing some variables.However, with
website_form_recaptcha
being fused intowebsite_form
(and itself intowebsite
), there are no reCAPTCHA v2 compatibility tool for various APIs.So, we bring forward this development, to allow for customisation of the used CAPTCHA API for the widget introduced by this module.
Additions
We add 4 new Char fields to the
website
model, to offer customization of the used API :recaptcha_v2_api_url
: the link to the JS CAPTCHA library file (default is https://www.recaptcha.net/recaptcha/api.js )recaptcha_v2_verify_url
: the link to the verification endpoint of the API (default is https://www.recaptcha.net/recaptcha/api/siteverify )recaptcha_v2_html_class
: the CSS class to indicate in which element the widget is to be inserted (default isg-recaptcha
)recaptcha_v2_resp_attr
: the value of the form field for hCaptcha validation (default isg-recaptcha-response
)-> These fields are inserted into the verification code of the
website
model, as well as in the reCAPTCHA template.We added editable fields in the Settings section to allow them to be easily changed by frontend users.
Other points
As we were coding this addition, we noticed that, despite the stated goal for this module to "used by other modules to actually display it on website forms", the widget is actually not available in the Website Page Editor menu, in the Snippets Blocks - is it voluntary ? If not, would it be interesting to add the widget as a Snippet block in the Website Page Editor menu ?
While the module offers the widget, its initialization and a method to verify the CAPTCHA, there are no controllers in the module for the
/website/form/
endpoint to actually verify it - would it be worth considering adding controllers in this module in order to offer reCAPTCHA verification for the/website/form/
endpoint ?