Skip to content

Conversation

satyam-code45
Copy link

Description

This PR implements API rate limiting to strengthen the system’s security and prevent abuse.
It introduces a middleware that restricts the number of requests a user can make within a defined time window.
Stricter limits are applied to sensitive authentication endpoints to mitigate brute-force attacks.


Semver Changes

  • Minor (new features, no breaking changes)
  • Patch (bug fix, no new features)
  • Major (breaking changes)

Issues

Closes #18 — [Feature]: Add API Rate Limiting


Checklist


🧩 Summary

  • Added rate-limiting middleware for all API routes.
  • Implemented stricter limits for /api/auth/login and /api/auth/register.
  • Returns 429 Too Many Requests when the limit is exceeded.
  • Enhances protection against brute-force and spam attacks.

🧪 How to Test

  1. Start the server locally.
  2. Make repeated requests to /api/auth/login and /api/auth/register.
  3. Observe that after exceeding the allowed number of requests, the API responds with 429 Too Many Requests.
  4. Verify that normal routes still function within general rate limits.

Labels: security · enhancement · middleware
Related PR: #25

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Add API Rate Limiting

2 participants