Fastapi Captcha Altcha Backend
This module adds Altcha service as a FastApi router and add local Altcha verification as a captcha method.
auto_awesome What this module does
AI-generated from the code · Odoo 18.0Adds an Altcha captcha option to FastAPI endpoints in Odoo, so API requests can be protected by a proof-of-work challenge instead of another captcha service.
This module extends the FastAPI endpoint configuration in Odoo with a new captcha choice called "Altcha (Local)". When that option is selected on a FastAPI endpoint, the endpoint uses the locally installed Altcha library to create and check captcha challenges, so no external captcha provider is needed.
What users can do:
- Choose "Altcha (Local)" as the captcha type on a fastapi.endpoint record.
- Rely on the endpoint's existing captcha secret key to sign and verify challenges.
Automatic behaviour:
- The module exposes challenge endpoints under /altcha/v2/challenge, /altcha/v1/challenge and the deprecated /altcha/challenge. These return a challenge that the client must solve.
- Challenges expire after 5 minutes.
- When a request comes in, the captcha response is validated against the endpoint's secret key. If verification fails, access is denied with an error message.
- If the Altcha Python library is missing, or the secret key is not set, the module raises a clear error instead of silently failing.
It touches the fastapi.endpoint model by adding a selection value and captcha validation logic. It depends on the fastapi_captcha module and requires the Python package altcha version 2.0.0 or higher.
Depends on
Models and fields (1)
- fastapi.endpoint · extends an existing modelcaptcha_type
Text generated by AI (DeepSeek) from reading the Odoo 18.0 code on GitHub; it may contain mistakes, so check the code before deciding. View the code on GitHub
Availability by version
Reviewed: 2026-11-03Confirmation status: 1 confirmed, 8 with no information of 9 versions.
Sources · Odoo 18.0
Confirmed on 2026-11-03 in branch 18.0 of OCA/rest-framework.
terminal Installation and usage
OCA documentation · Odoo 18.0Usage
Source · Odoo 18.0Add the altcha router in your FastAPI application to enable the Altcha captcha verification.
Get the challenge from the /altcha/v2/challenge endpoint if you are using altcha widget v3+ or from /altcha/v1/challenge if you are still using altcha widget v2 or less.
Choose the altcha_local captcha type in your FastAPI endpoint configuration.
No verified information in OCA: Installation, Configuration.
Installation instructions, the distribution package, dependencies and configuration steps are not shown because they have not yet been verified in the module documentation for any version.
Data imported from GitHub: this sheet reflects the latest catalog review, not a live lookup. Always check the module documentation and staging before installing in production.