Skip to content

chore: pin to altcha v1 API after upstream v2 release - #48

Merged
tdruez merged 1 commit into
mainfrom
altcha-lib-py-v2
Jul 16, 2026
Merged

chore: pin to altcha v1 API after upstream v2 release#48
tdruez merged 1 commit into
mainfrom
altcha-lib-py-v2

Conversation

@tdruez

@tdruez tdruez commented Apr 21, 2026

Copy link
Copy Markdown
Contributor

Signed-off-by: tdruez <tdruez@aboutcode.org>
@tdruez
tdruez merged commit 9a532cc into main Jul 16, 2026
8 checks passed
@tdruez
tdruez deleted the altcha-lib-py-v2 branch July 16, 2026 07:47
hleroy pushed a commit to hleroy/django-altcha that referenced this pull request Aug 6, 2026
Upgrade the bundled JS widget from ALTCHA v2.3.0 to v3.2.1 and move the
server side from the v1 Proof-of-Work API to the v2 one, raising the altcha
requirement to >=2.1.0,<3.0.0. PR aboutcode-org#48 took the altcha v2 package while
staying on the *_v1 compatibility functions; this replaces those with the
real v2 API, so the widget and the library speak the same KDF-based
Proof-of-Work. Challenges and payloads are not compatible across versions.

`get_altcha_challenge()` now takes `algorithm` and `cost` in place of
`max_number`, driven by the new ALTCHA_ALGORITHM and ALTCHA_COST settings,
and `verify_solution()` returns a result object rather than a tuple. Replay
protection keys the cache on the challenge signature, as the v3 payload no
longer carries a challenge string.

Widget side, the v3 options replace the v2 ones. `challengeurl` and
`challengejson` are mapped to the unified `challenge` option with a
DeprecationWarning; options the widget does not accept as an HTML attribute
are collected into the JSON-encoded `configuration` attribute.

Add an ALTCHA_STRICT_CSP setting that switches the widget template and the
new form Media to the modular /dist_external build: the stylesheet is served
as a separate file and the Proof-of-Work workers are loaded from the static
files instead of a blob: URL, removing the need for `style-src
'unsafe-inline'` and `worker-src blob:`. The modular build registers no
algorithm on its own, so a small altcha-workers.js module wires
$altcha.algorithms to the bundled worker scripts.

The new asset settings — ALTCHA_JS_STRICT_CSP_URL, ALTCHA_CSS_URL,
ALTCHA_WORKERS_REGISTER_URL and ALTCHA_WORKERS_URL — go through the
STATIC_URL resolution added in aboutcode-org#45.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01956qnAS7qztaS7tghEKDta
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant