Fastapi Captcha

fastapi_captcha
REPOSITORY
REPOSITORYOCA/rest-framework
GIT
GIThttps://github.com/OCA/rest-framework.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/rest-framework/tree/18.0/fastapi_captcha
VERSION
VERSION 1.0.0
CATEGORY
CATEGORYTools
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSOdoo Community Association (OCA), Akretion
MAINTAINERS
MAINTAINERSOdoo Community Association (OCA), Akretion
COMMITTERS
COMMITTERSWeblate, OCA-git-bot, oca-ci, Florian Mounier
WEBSITE
WEBSITEhttps://github.com/OCA/rest-framework
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 19:30:05
ODOO DEPENDENCIES
ODOO DEPENDENCIES OCA/rest-framework:
    - fastapi
OCA/web-api:
    - endpoint_route_handler
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES a2wsgi>=1.10.6
fastapi>=0.110.0
parse-accept-language
python-multipart
ujson
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION
This module provides a simple way to protect several fastapi endpoints routes with a
captcha.

It currently supports the following captcha providers:

- [Google reCAPTCHA](https://www.google.com/recaptcha)
- [hCaptcha](https://www.hcaptcha.com/)
- [Altcha](https://altcha.org/)

Code Analysis

Views touched (1)
XML IDNameModelTypeStatus
fastapi_endpoint_form_view fastapi.endpoint field Inherits fastapi.fastapi_endpoint_form_view
Models touched (1)

New fields (6)
  • captcha_custom_verify_url Char
    help='Custom URL to use for the captcha verification'
  • captcha_minimum_score Float
    default=0.5 help='Minimum score to accept the captcha if a score is provided by the captcha service.'
  • captcha_routes_regex Char
    help='Regexes to match against routes url that should be protected by this captcha, comma separated. If empty, all routes will be protected'
  • captcha_secret_key Char
    groups='base.group_system' help='Secret key to use for the captcha validation'
  • captcha_type Selection
    help='Type of captcha to use for this endpoint' args: [('recaptcha', 'Recaptcha'), ('hcaptcha', 'Hcaptcha'), ('altcha', 'Altcha')]
  • use_captcha Boolean
    help='If checked, this endpoint will be protected by a captcha'
Public methods (1)
  • validate_captcha(self, captcha_response)
    Validate the captcha response.