- Add peekview.auth.captcha.* config (enabled, site_key, secret_key,
verify_url, exempt_first_user)
- New peekview.api.captcha module: verify_captcha_token + enforce_captcha
- New peekview.api.config_router: GET /api/v1/config/captcha public endpoint
(returns site_key/endpoint/enabled, never secret_key)
- auth.py: register/login enforce captcha when enabled
- 3 new error codes: CAPTCHA_REQUIRED, CAPTCHA_INVALID, CAPTCHA_CONFIG_ERROR
- UserRegister/UserLogin schemas accept optional captcha_token
Testing:
- New tests/test_captcha.py: 15 cases covering verify_captcha unit,
register/login integration, exempt scenarios, public endpoint
- All 432 backend tests passing
Cap is self-hosted (Apache 2.0), no third-party tracking, GDPR-friendly.
See docs/plans/captcha-integration.md and docs/roadmap/improvement-backlog.md#13.