fix(e2e): exempt non-prod registration cap + force JMAP public origin (BUNYIP-150) #225
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/bunyip-150-register-nonprod-jmap-origin"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Finish BUNYIP-150 by fixing the two root causes that kept the email-driven e2e specs (magic-link, password-reset, change-email) red. Consolidates four fragmented attempts into one change.
Root causes + fixes
/v1/auth/registeris capped 3/hour/IP - a production anti-abuse control. The deployed-instance e2e suite self-provisions disposable accounts (each needs a fresh unique email, so they cannot be pre-seeded/reused like the shared login account) from the single CI runner egress IP, so registrations accumulate across serial runs in the one-hour window and trip a spurious 429. Fix (bunyip-api/src/handlers/auth.rs::register): apply the cap in production ONLY (if config.is_production()); staging/dev register unthrottled, with the auto-ban still catching abusive bursts.apiUrlas the internalhttp://mail.a8n.run:8080/jmap/, unreachable from the CI runner.lib/mail-sink.ts:jmapSessionnow keeps only the apiUrl path and forces the public origin (the.well-known/jmapGET already proved 443 reachability).Main's three separate specs are kept as-is - once the cap no longer throttles staging they each register one disposable account and pass, so the combine-into-one-spec workaround is unnecessary (YAGNI).
Supersedes / closes
REGISTRATION_RATE_LIMIT_MAX): superseded - non-prod exemption needs no env knob. The docker env it relied on (c-01REGISTRATION_RATE_LIMIT_MAX=100) is reverted in a companion docker PR.Deploy ordering (important)
The registration fix tests the DEPLOYED instance, so it only takes effect after this image is deployed to staging. The PR's own pre-merge e2e run can still 429 against the not-yet-redeployed staging; it goes green on the post-merge run. No 429-skip is added to mask that. After merge: staging rebuilds
:latest-> redeploy c-01 bunyip-api -> the next e2e run is green.Verification
just check-containergreen (fmt + clippy + lib tests);tsc --noEmitclean. Full green requires the post-merge staging redeploy.🤖 Generated with Claude Code