feat: wire in rate limiter with HTTPException handler and env var disable#277
feat: wire in rate limiter with HTTPException handler and env var disable#277shivv23 wants to merge 1 commit intoc2siorg:mainfrom
Conversation
cf8a740 to
f9986e7
Compare
f9986e7 to
dd7d90d
Compare
|
The PR imports |
|
You're right @ivantha - the rate_limiter.py implementation is missing from this PR. That's because the implementation was added in PR #288 (which is now mergeable). This PR #277 just wires the rate limiter into main.py, but it depends on #288 being merged first.I'll close this PR and re-create it after #288 is merged so it has the full implementation. |
Description:
Wire rate limiter into main.py with HTTPException handler
Add rate_limit_enabled config option to disable via env var
Changes:
app/config.py: Add rate_limit_enabled: bool = True
app/main.py: Conditionally add rate limit middleware, add HTTPException handler for 429 responses
Checklist:
✅ Rate limit enforced on training endpoints
✅ 429 returns JSON: {"success": false, "message": "...", "data": null}
✅ Can disable via RATE_LIMIT_ENABLED=false