feat: add rate limiting to API endpoints to mitigate abuse and Dos#1282
feat: add rate limiting to API endpoints to mitigate abuse and Dos#1282dataCenter430 wants to merge 1 commit intoeigent-ai:mainfrom
Conversation
bytecii
left a comment
There was a problem hiding this comment.
I think we may not need this server side rate limiting? cc @Wendong-Fan
|
Hi, @bytecii @Wendong-Fan thank you for catching this out. then I think it's essential for current Eigent codebase. Why it’s essential for Eigent specifically
Therefore, I'd really appreciate if you have a deep considering. |
|
Thank @dataCenter430 for this PR and for thinking carefully about abuse/stability risks. After a thorough review, i think this feature may not for now, since at this stage, access already requires account registration/login, and each account is constrained by credits-based limits, most of our user are deploying&running Eigent locally so this is not a top priority right now We’ll revisit and prioritize rate limiting if we see abnormal traffic patterns, open more public-facing endpoints, or move to broader gateway-level traffic controls, thanks again for the thoughtful contribution. cc @bytecii |
|
close for now |
Related Issue
Rate limiting – endpoints not rate-limited, increasing abuse and DoS risk.
Closes #1260
Description
Rate limiting is implemented for both the server and backend FastAPI apps using slowapi.
Changes
server/pyproject.tomlAdded slowapi>=0.1.9backend/pyproject.tomlAdded slowapi>=0.1.9server/app/rate_limit.pyNew rate limiting modulebackend/app/rate_limit.pyNew rate limiting moduleserver/app/middleware/__init__.pyCalls setup_rate_limiting(api)backend/app/__init__.pyCalls setup_rate_limiting(api)server/app/controller/health_controller.pyAdded @limiter.exempt on health endpointbackend/app/controller/health_controller.pyAdded @limiter.exempt on health endpointserver/.env.exampleAdded RATE_LIMIT_ENABLED, RATE_LIMIT_DEFAULTBehavior
Why it's better
To install dependencies and try it
cd server && uv sync # or: pip install slowapi
cd backend && uv sync # or: pip install slowapi
What is the purpose of this pull request?
Contribution Guidelines Acknowledgement