Open
feat(auth): 补齐找回密码、改密与全端登出 #7
jaxAdd on Sep 8
feat(auth): 补齐找回密码、改密与全端登出 #7
Open
Merged fromintegration/f7-auth-recoveryintointegration/f0-foundation
Total: 9 files changed+1147-16
| @@ -83,14 +83,30 @@ AUTH_PUBLIC_BASE_URL=http://127.0.0.1:3000 | |||
| 83 | # Exposed via GET /api/v1/auth/status (no secrets). Do not use AUTH_EMAIL_DELIVERY=test | 83 | # Exposed via GET /api/v1/auth/status (no secrets). Do not use AUTH_EMAIL_DELIVERY=test |
| 84 | # with a non-loopback AUTH_PUBLIC_BASE_URL. | 84 | # with a non-loopback AUTH_PUBLIC_BASE_URL. |
| 85 | AUTH_REGISTRATION_MODE=open | 85 | AUTH_REGISTRATION_MODE=open |
| 86 | -# Required when set: only smtp|test. test = log links to console; smtp = send real email. | 86 | +# Required when set: only smtp|test. test = tokens returned inline in the API |
| 87 | +# response (loopback only); smtp = send real email via AUTH_SMTP_* below. | ||
| 88 | +# With smtp selected but AUTH_SMTP_HOST empty, auth emails are dropped with a | ||
| 89 | +# warning rather than failing the request — verification and password reset then | ||
| 90 | +# cannot be delivered. | ||
| 87 | AUTH_EMAIL_DELIVERY=test | 91 | AUTH_EMAIL_DELIVERY=test |
| 88 | AUTH_EMAIL_FROM=DataFoundry <no-reply@example.com> | 92 | AUTH_EMAIL_FROM=DataFoundry <no-reply@example.com> |
| 89 | AUTH_SMTP_HOST=smtp.example.com | 93 | AUTH_SMTP_HOST=smtp.example.com |
| 94 | +# Defaults to 587 with STARTTLS, or 465 when AUTH_SMTP_SECURE=true. | ||
| 90 | AUTH_SMTP_PORT=587 | 95 | AUTH_SMTP_PORT=587 |
| 96 | +# true = implicit TLS (SMTPS). Use AUTH_SMTP_SECURITY=starttls|ssl|none to | ||
| 97 | +# override explicitly; `none` disables TLS and should only be used for a | ||
| 98 | +# trusted local relay. | ||
| 91 | AUTH_SMTP_SECURE=false | 99 | AUTH_SMTP_SECURE=false |
| 92 | AUTH_SMTP_USER= | 100 | AUTH_SMTP_USER= |
| 93 | AUTH_SMTP_PASSWORD= | 101 | AUTH_SMTP_PASSWORD= |
| 102 | +AUTH_SMTP_TIMEOUT=10 | ||
| 103 | + | ||
| 104 | +# Throttle for POST /api/v1/auth/password/forgot, applied per client address and | ||
| 105 | +# per target address within a sliding window. In-process only: a multi-replica | ||
| 106 | +# deployment needs a shared limiter or an edge rate limit. | ||
| 107 | +AUTH_PASSWORD_RESET_IP_LIMIT=5 | ||
| 108 | +AUTH_PASSWORD_RESET_EMAIL_LIMIT=3 | ||
| 109 | +AUTH_PASSWORD_RESET_WINDOW_SECONDS=900 | ||
| 94 | 110 | ||
| 95 | # Next.js BFF (apps/web) → API. Set this in apps/web/.env.local (not required in root .env). | 111 | # Next.js BFF (apps/web) → API. Set this in apps/web/.env.local (not required in root .env). |
| 96 | # Used in password / formal mode when the browser calls same-origin `/api/v1/*` and `/api/copilotkit`. | 112 | # Used in password / formal mode when the browser calls same-origin `/api/v1/*` and `/api/copilotkit`. |
Aapps/api/src/datafoundry_api/rate_limit.py+42-0File content is under review, please try again later
Aapps/api/tests/test_auth_email_delivery.py+213-0File content is under review, please try again later
Aapps/api/tests/test_auth_password_recovery.py+292-0File content is under review, please try again later
Aapps/api/tests/test_auth_sessions_and_change_password.py+160-0File content is under review, please try again later