hotosm / galaxy-api

Backend to fetch data from Underpass
https://galaxy-api.hotosm.org/latest/redoc
GNU Affero General Public License v3.0
14 stars 5 forks source link

[FEATURE] Introduce Rate limiting on API #339

Open kshitijrajsharma opened 2 years ago

kshitijrajsharma commented 2 years ago

API already uses redis for the task queue , we can use the same for rate limiting as well , Currently focus will be to stop those continuous request that may can come through some scripts or a program ! So basically idea will be to stop the same ip if making n no of calls with n no of seconds ! But while doing that this feature request also cares about the extension of the feature implemented ,it should be easily extendable in terms of rate limiting on other API endpoint and flexible may be using a single decorator or so on . I have seen few libraries on fastapi such as slowapi , fastapi-limiter , We can evaluate other open source tools and implement this