Skip to main content

Integration with rercaptcha in Plone

Project description

collective.rercaptcha

Integration with captcha validator in Plone

Features

This project implements an event subscriber that catch every IBeforeTraverseEvent event and an expander for using the functionality from the frontend.

In order to be checked by the captcha service, a request:

  • has to be a POST request
  • has to be included in a list (configurable from the controlpanel)

The custom frontend form will send a request to an eternal captcha valdidator service and recieve a token that will be sent to the backend with all the POST payload. The backend will then verify the legitimacy of the request by checking the same external service for a confirmation.

All requests that are not POST will not be checked. All POST requests that are not on the configurable list will not be checked. All POST requests on the list that don't have the token in the payload will be blocked. All POST requests on the list that have a token not validated by the external service will be blocked.

Configuration

A custom controlpanel is added for easy configurability:

  • use_captcha, a boolean value that enables the checks
  • captcha_uri, the url to the external validator
  • whitelisted_routes, the routes (last portions of urls) that will be subject to the validator.
  • captcha_site_key and captcha_secret, used during the validator phase in the backend, in the shape shown below:
requests.post(
    f"{captcha_uri}/{captcha_site_key}/siteverify",
    data={"secret": captcha_secret, "response": token})

every custom form that implements this service will have to read the custom expander:

"rercaptcha-data": {
    "@id": ...,
    "captcha-url": captcha_uri,
    "captcha-site-key": captcha_site_key,
}

Installation

Install collective.rercaptcha with uv.

uv add collective.rercaptcha

Create the Plone site.

make create-site

Contribute

Prerequisites ✅

Installation 🔧

  1. Clone this repository.

    git clone git@github.com:collective/collective-rercaptcha.git
    cd collective-rercaptcha/backend
    
  2. Install this code base.

    make install
    

Add features using plonecli or bobtemplates.plone

This package provides markers as strings (<!-- extra stuff goes here -->) that are compatible with plonecli and bobtemplates.plone. These markers act as hooks to add all kinds of features through subtemplates, including behaviors, control panels, upgrade steps, or other subtemplates from bobtemplates.plone. plonecli is a command line client for bobtemplates.plone, adding autocompletion and other features.

To add a feature as a subtemplate to your package, use the following command pattern.

make add <template_name>

For example, you can add a content type to your package with the following command.

make add content_type

You can add a behavior with the following command.

make add behavior
You can check the list of available subtemplates in the [`bobtemplates.plone` `README.md` file](https://github.com/plone/bobtemplates.plone/?tab=readme-ov-file#provided-subtemplates).
See also the documentation of [Mockup and Patternslib](https://6.docs.plone.org/classic-ui/mockup.html) for how to build the UI toolkit for Classic UI.

License

The project is licensed under GPLv2.

Credits and acknowledgements 🙏

Generated from the cookieplone-templates template on 2026-03-02 13:59:22.. A special thanks to all contributors and supporters!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

collective_rercaptcha-1.0.0a7.tar.gz (26.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

collective_rercaptcha-1.0.0a7-py3-none-any.whl (34.2 kB view details)

Uploaded Python 3

File details

Details for the file collective_rercaptcha-1.0.0a7.tar.gz.

File metadata

  • Download URL: collective_rercaptcha-1.0.0a7.tar.gz
  • Upload date:
  • Size: 26.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for collective_rercaptcha-1.0.0a7.tar.gz
Algorithm Hash digest
SHA256 3282efbe193f9801b5ea934facc1be2ffeea9226dc1c3b6459880302aafe75f9
MD5 4023bbe9711e5edb0bf0200db4a3e906
BLAKE2b-256 e5f48800d74d5b6afd2af86d9370dc56d48205df2922bcebccb63f0dce733be5

See more details on using hashes here.

File details

Details for the file collective_rercaptcha-1.0.0a7-py3-none-any.whl.

File metadata

  • Download URL: collective_rercaptcha-1.0.0a7-py3-none-any.whl
  • Upload date:
  • Size: 34.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for collective_rercaptcha-1.0.0a7-py3-none-any.whl
Algorithm Hash digest
SHA256 025c10fd6f6bb384535137c3619c561a1eccee16522a35617b25fdff9e4b8b6a
MD5 7c05dfddf101e1bc511ec7c315b1bf90
BLAKE2b-256 7fe881791e389c8899093351fbef7dbad9b507b8a01e9705e8ef22a6134dcf95

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page