Skip to main content

splent_feature_recaptcha

The recaptcha feature of a SPLENT product line.

A SPLENT feature is a Python package that a product composes with others. Its models, routes, services, templates and hooks are registered when the product starts. What this feature provides and requires is listed in the [tool.splent.contract] section of pyproject.toml, which splent feature:contract --write keeps in sync with the source.

What it does

Google reCAPTCHA v2 as the product's captcha. It is one of the providers of splent_feature_captcha, next to splent_feature_cloudflare (Turnstile) and splent_feature_captcha_image (an image the product draws itself). A product installs captcha and one of them.

RecaptchaService implements captcha's CaptchaService and registers through it. captcha does the rest, the same for every provider: it draws the widget and Google's script on the forms named in CAPTCHA_PROTECTED_FORMS (the sign-up alone by default) and asks verify() for the token they post as g-recaptcha-response. See captcha's README for the forms it can protect.

The keys come from the settings stored by the panel first and from RECAPTCHA_SITE_KEY and RECAPTCHA_SECRET_KEY second. Their defaults are Google's test keys, which always pass, so development works out of the box and a live site sets its own pair. Without a site key no widget is drawn, and without a secret every submission goes through.

The panel edits the keys at /admin/captcha, for the accounts whose role is admin.

Upgrading from 0.3

0.3 checked the comment, contact and careers forms on its own, whatever the product wanted, and never the sign-up. Now captcha decides, and by default it checks the sign-up alone. A product that relied on the old forms names them:

[tool.splent.config]
CAPTCHA_PROTECTED_FORMS = ["contact", "comment", "careers"]

The product installs splent_feature_captcha too, which recaptcha now requires, in the same change that upgrades recaptcha and sets the forms. On the first request captcha's log names any form in CAPTCHA_PROTECTED_FORMS the product does not have, and says so as an error when that leaves no form protected, which is what a product without a sign-up that kept the default sees. captcha added next to recaptcha 0.3 or older leaves the forms to it, as before, and the log says to upgrade it.

Use it in a product

splent feature:add splent_feature_captcha
splent feature:add splent_feature_recaptcha

Develop

splent feature:test splent_feature_recaptcha
splent feature:contract splent_feature_recaptcha

Release

splent feature:release splent_feature_recaptcha --dry-run --bump minor
splent feature:release splent_feature_recaptcha

The first command rehearses the release and changes nothing. The second publishes it to the git forge and to PyPI, and a PyPI version is permanent.

Metadata

Release files for splent-feature-recaptcha 0.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for splent-feature-recaptcha 0.4.1
File Size Uploaded Provenance Actions
splent_feature_recaptcha-0.4.1.tar.gz 21.1 kB Without provenance Details for splent_feature_recaptcha-0.4.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for splent-feature-recaptcha 0.4.1
File Interpreter ABI Platform Actions
splent_feature_recaptcha-0.4.1-py3-none-any.whl Python 3 none any Details for splent_feature_recaptcha-0.4.1-py3-none-any.whl

Total release size: 43.6 kB

Release files / splent_feature_recaptcha-0.4.1.tar.gz

Download URL splent_feature_recaptcha-0.4.1.tar.gz
Size 21.1 kB
Tags Source
SHA-256 checksum
How to use checksums
96128f95289c782ab019914ef70daaf4005aa83bf693c6a3ac4f25022eb4cdcb
BLAKE2b-256 checksum
How to use checksums
6df5f11b7f091e06e74ba6b525d14634feba140c704e3f9e3b9bf98ace8de331
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.16

Release files / splent_feature_recaptcha-0.4.1-py3-none-any.whl

Download URL splent_feature_recaptcha-0.4.1-py3-none-any.whl
Size 22.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dc33c7f379102430b633658a2b00d3b02ccab97ba5eb5872a0835f4441543f79
BLAKE2b-256 checksum
How to use checksums
d08b6b7abc45772c6ae59174283ee8f303b7dd9e14f7d458d1ba52e96ebd63a3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.16

Security for splent-feature-recaptcha 0.4.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page