Rate limit register and unregister#29
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (7)
WalkthroughThis PR introduces a dedicated per-IP rate limiter for ChangesRegister Endpoint Rate Limiting
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
AndreaDiazCorreia
left a comment
There was a problem hiding this comment.
Nice work, the implementation looks solid and covers the acceptance criteria from #7. Just one thing before merging: could you update CLAUDE.md to mention that /api/register and /api/unregister can now return 429 with the shared rate_limited_response body? Same style as the 403 whitelist exception that's already documented there. The absolute upper bound on TokenStore from the issue is a different threat model (botnet/multi-IP), so probably better as a separate follow-up. Otherwise LGTM.
Summary
Security validation
Source/sink/control: unauthenticated /api/register and /api/unregister could be called repeatedly from one client IP and churn or grow the in-memory TokenStore without an HTTP rate limit. Both routes now share a per-IP limiter with 120/min and burst 100, while /api/health, /api/info, and /api/status remain unwrapped.
Original issue no longer reproduces:
Refs #7
Tests
Summary by CodeRabbit
New Features
/api/registerand/api/unregisterendpoints with per-IP limits (120 requests/min, burst 100), returning HTTP 429 when exceededDocumentation