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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user