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.0a4.tar.gz (26.1 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.0a4-py3-none-any.whl (33.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: collective_rercaptcha-1.0.0a4.tar.gz
  • Upload date:
  • Size: 26.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","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.0a4.tar.gz
Algorithm Hash digest
SHA256 ecbfa565f34b99c12ff019e6a6762c4bf900de8c3fbdf948cc31f7111e3a4fab
MD5 2a558340b1677b38fdfdb0acaa7a4395
BLAKE2b-256 b9bc70ea0040760ea60729806f024c7f246ad6667af6ec13550f1e23c115539a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: collective_rercaptcha-1.0.0a4-py3-none-any.whl
  • Upload date:
  • Size: 33.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","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.0a4-py3-none-any.whl
Algorithm Hash digest
SHA256 99feed4093ed3955a2818187b7ea088d0674fd02bf5843f0d43d819ff9349852
MD5 2766e971b4dec5b079867be200fe8430
BLAKE2b-256 b38c1e9754fa740361bd1d012d221812ff1e26005e5485dfa52f1e65ac6d84e8

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