Description
The .env.example file contains 20+ environment variables for rate limiting, retention, cron schedules, and salt versioning that are not validated in env.validation.ts. This allows invalid configuration to reach production.
Add complete Zod schema validation for all environment variables documented in .env.example including AUTH_RATE_LIMIT_, RETENTION_, cron expressions, and VERIFICATION_HASH_SALT_V* variables.
Acceptance criteria
- Every variable in .env.example has corresponding validation in env.validation.ts
- Invalid values fail fast at startup with clear error messages
- Cron expressions are validated with proper regex patterns
- Retention day values are bounded (1-3650 days)
- Rate limit windows and counts have sensible bounds
Testing requirements
- Validation catches invalid cron syntax
- Validation rejects out-of-range retention values
- npm run lint and npm run test pass
Files
src/config/env.validation.ts, .env.example, src/config/env.validation.spec.ts
Suggested branch
feat/complete-env-validation
Suggested commit message
feat(config): add comprehensive environment validation
Description
The .env.example file contains 20+ environment variables for rate limiting, retention, cron schedules, and salt versioning that are not validated in env.validation.ts. This allows invalid configuration to reach production.
Add complete Zod schema validation for all environment variables documented in .env.example including AUTH_RATE_LIMIT_, RETENTION_, cron expressions, and VERIFICATION_HASH_SALT_V* variables.
Acceptance criteria
Testing requirements
Files
src/config/env.validation.ts,.env.example,src/config/env.validation.spec.tsSuggested branch
Suggested commit message