clipwright/cloud
juancarlos.cavero e4331467e5 fix(auth): harden MX verification after code review
Review findings on the MX-gate commit, addressed:

- Rate limits now run BEFORE the DNS work, and the attempt row is
  inserted before the MX gate, so rejected junk-domain floods count
  toward both limits instead of getting unlimited free DNS lookups.
- Existing accounts bypass the MX gate: it protects sign-up only, so a
  domain whose MX later matches the disposable list can't lock an owner
  out of their account.
- RFC 5321 implicit MX now also checks AAAA (IPv6-only mail domains
  were falsely rejected).
- Error-derived verdicts cache for 60s instead of 1h: a transient
  NXDOMAIN no longer pins a lockout, a resolver blip no longer
  whitelists a domain for an hour.
- One shared resolver with an LRU record cache (was: new resolver +
  resolv.conf read per lookup); verdict cache evicts FIFO instead of
  full clear.
- MX blocklist moved to disposable_mx.txt, same loader and ops workflow
  as disposable_domains.txt (the two lists were already drifting).
- Both rate-limit counts merged into one FILTER query; distinct 429
  message for the per-IP limit (shared-NAT lockouts diagnosable).
- Index on (request_ip, created_at) + 30-day token purge in the
  retention sweeper. NOTE: schema is create_all-only, prod needs:
  CREATE INDEX IF NOT EXISTS ix_magic_ip_created
    ON magic_link_tokens (request_ip, created_at);
2026-08-13 10:07:20 +02:00
..
__init__.py feat(agents): the pipeline as a platform — API keys, MCP server, webhooks 2026-08-03 22:33:16 +02:00
alerts.py fix(gemini): distinguir bloqueo de contenido de fallo transitorio 2026-07-24 00:37:14 +02:00
analytics.py feat(analytics): report job outcomes to OpenPanel, with the user's job index 2026-07-28 21:49:40 +02:00
api_keys.py feat(agents): the pipeline as a platform — API keys, MCP server, webhooks 2026-08-03 22:33:16 +02:00
auth.py fix(auth): harden MX verification after code review 2026-08-13 10:07:20 +02:00
billing.py fix(billing): stop stranding customers whose payment failed 2026-07-25 15:14:15 +02:00
config.py fix(subtitles): stop charging quota for burning captions 2026-07-25 17:16:59 +02:00
database.py feat: add hosted paid mode (managed keys, Stripe trial, metering) 2026-07-14 13:04:43 +02:00
disposable_domains.txt feat(auth): verify email domain MX before sending magic links 2026-08-13 01:03:05 +02:00
disposable_mx.txt fix(auth): harden MX verification after code review 2026-08-13 10:07:20 +02:00
email_policy.py fix(auth): harden MX verification after code review 2026-08-13 10:07:20 +02:00
emails.py fix(emails): stop duplicate expiry warnings and fix the button that 404s 2026-07-27 22:31:04 +02:00
LICENSE fix(cloud): harden paid-mode surface + source-available license for cloud/ 2026-07-16 17:30:12 +02:00
managed_keys.py feat: add hosted paid mode (managed keys, Stripe trial, metering) 2026-07-14 13:04:43 +02:00
metering.py fix(billing): stop stranding customers whose payment failed 2026-07-25 15:14:15 +02:00
models.py fix(auth): harden MX verification after code review 2026-08-13 10:07:20 +02:00
oauth.py feat(abuse): abrir free a email normal + bloquear dominios desechables 2026-07-21 00:45:54 +02:00
social_profiles.py feat(social): keep scheduling calendar + add Content calendar button in dashboard 2026-07-16 19:26:51 +02:00
storage.py feat(projects): reopen archived projects from history for further editing 2026-07-18 03:42:17 +02:00
videos.py fix(auth): harden MX verification after code review 2026-08-13 10:07:20 +02:00