test: cover the captcha and sign-up gates #255
Etiketter
Inga etiketter
area/backups
area/ci
area/control-panel
area/identity
area/infra
area/observability
area/payments
area/security
area/storage
area/web
blocked
needs-info
needs-triage
ready-for-implementation
type
bug
type
chore
type
docs
type
epic
type
feature
type
task
wontfix
Ingen milstolpe
Inget projekt
Inga tilldelade
1 deltagare
Notiser
Förfallodatum
Inget förfallodatum satt.
Beroenden
Inga beroenden satta
Referens
bitborg/bitborg-web#255
Läser in…
Hänvisa till i nytt ärende
Ingen beskrivning angiven.
Ta bort grenen "%!s()"
Borttagning av en gren är permanent. Även om den borttagna grenen kan fortsätta existera en kort tid innan den faktiskt tas bort, kan det INTE ångras i de flesta fall. Vill du fortsätta?
Problem
The anti-spam and sign-up gates have no direct tests:
src/lib/captcha.ts:capSecret()fail-closed and dev bypass,validateCapToken()single-use spend,redeemChallenge()replay prevention.src/lib/signup-access.ts:signupsOpen()andtrialOpen(), the kill switches from ADR 0029 and ADR 0036.src/pages/api/signup.ts: the order of the eligibility short-circuit, the database health check before provisioning, and the PRG status mapping. The pieces are unit-tested; the orchestration is not.src/pages/api/captcha/{challenge,redeem}.ts.redeem.tsalso castsrequest.json()without the schema validation other routes use.Done when
Each path above has a test that fails if its guard is removed, and
redeem.tsvalidates its body with a schema.Epic: bitborg/bitborg-docs#69