feat: add configurable test mode and rate limiting

- Add TestMode, RateLimitEnabled, RequestsPerMinute to Config
- Add getEnvBool() and getEnvInt() helper functions
- Update rate limiter to support enabled/disabled state
- Pass test environment variables through docker-compose
- Configure rate limiter dynamically in main.go

This allows disabling rate limiting for integration testing while
maintaining security in production environments.
This commit is contained in:
2026-01-29 13:33:18 -05:00
parent ce0e448e58
commit 4b8cb58c84
4 changed files with 59 additions and 17 deletions
+3
View File
@@ -34,6 +34,9 @@ services:
DATABASE_NAME: bookmann
JWT_SECRET: ${JWT_SECRET}
SERVER_PORT: 8765
TEST_MODE: ${TEST_MODE:-false}
RATE_LIMIT_ENABLED: ${RATE_LIMIT_ENABLED:-true}
REQUESTS_PER_MINUTE: ${REQUESTS_PER_MINUTE:-10}
ports:
- "8765:8765"
depends_on: