VoucherBot v1.0.2
v1.0.2 — Security Hardening
Security and hygiene patch release: closes HIGH-severity findings from the codebase audit, tightens the exposed API surface, and removes dead code.
Security
- SHA-1 replaced with SHA-256 (H-3) — all four collectors now hash with
hashlib.sha256; behavior-neutral since dedup is driven by the pipeline's independent SHA-256identity_hash - Secrets redacted from log output (H-4) — new
redact_secretsstructlog processor masks sensitive keys and secret-shaped fragments (API keys, Bearer tokens, URL credentials, sensitive query params) across all log sites, including nested config dicts and exception strings - Rate limiting on
/health(H-5) — minimal in-memory sliding-window limiter (default 60 req/min/IP, configurable viaHEALTH_RATE_LIMIT_PER_MINUTE,0disables) returning429+Retry-After - API surface reduced to
/healthonly —/ready,/sources,/posts, and/alertsendpoints removed along with their routers, shrinking the unauthenticated attack surface - CSS selector validation (H-1) — bootstrap now logs a warning for malformed selectors in source config (log-only, never rejects)
Maintenance
- Removed vestigial
NormalizedPost.external_idfield and its now-unusedhashlibimports across all collectors - Removed unused
apschedulerdependency (scheduling is a custom asyncio loop) - Applied
ruff formatfixes
Testing
- Full suite: 167 passed, 15 skipped
ruff check,ruff format --check, andmypy voucherbot testsall clean- New tests for log redaction and health rate-limiting (429 + disabled paths)
Full Changelog: v1.0.1...v1.0.2