hngprojects / hng_boilerplate_python_fastapi_web

Apache License 2.0
154 stars 137 forks source link

Bugfix: implement rate limiting for auth endpoints #942

Closed MikeSoft007 closed 3 weeks ago

MikeSoft007 commented 3 weeks ago

Description

This pull request introduces rate limiting to selected API endpoints in our application. The goal is to prevent abuse and ensure fair usage by restricting the number of requests a client can make within a given time frame.

Rate Limiting Implementation:

Related Issue (Link to issue ticket)

https://github.com/hngprojects/hng_boilerplate_nestjs/issues/911

Motivation and Context

This change is required to ensure that the backend can handle request loads more effectively and prevent abuse, especially in high-traffic scenarios. Implementing rate limiting helps to maintain service availability and improves the overall user experience by ensuring that the API remains responsive and fair to all users. This change is required to ensure that the backend can send emails that are more aligned with the requirements of the endpoints.

How Has This Been Tested?

The change was tested using integration tests in a development environment. The tests included:

Screenshots (if appropriate - Postman, etc):

image

Types of changes

Checklist:

johnson-oragui commented 3 weeks ago

@MikeSoft007

add slowapi to requirements.txt, then update the branch