-
Notifications
You must be signed in to change notification settings - Fork 355
feat: implement rate limiting to prevent brute-force attacks (#1210) #1222
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: implement rate limiting to prevent brute-force attacks (#1210) #1222
Conversation
@100NikhilBro is attempting to deploy a commit to the avdheshvarshney's projects Team on Vercel. A member of the Team first needs to authorize it. |
Thank you for submitting your pull request! We'll review it as soon as possible. For further communication, join our discord server https://discord.gg/tSqtvHUJzE. |
Hi @maintainers, This PR is ready for review β
. Vercel check is failing β Authorization required to deploy (likely a deployment permission/configuration issue). Branch protection β Requires at least one approving review from a collaborator with write access. The code changes themselves are passing the other checks. Thanks! |
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the feedback. Iβve removed all unrelated modifications from package.json (kept only "rate-limiter-flexible").
Also cleaned up backend/Routes/index.js β deleted commented code, kept only middleware-applied routes, and ensured a single export default router
at the bottom.
Bro, Iβm not very active on Discord. If you have any issues or queries, you can message me hereβIβll check and reply on Discord if needed, or I can reply directly here as well. |
Closes: #1210
π Rate Limiter Setup
This project adds a new feature using
rate-limiter-flexible
to protect APIs against abuse and brute-force attacks.π Folder Structure
βββ routes/
βΒ Β Β Β βββ api.js
βΒ Β Β Β βββ index.js
βββ middlewares/
βΒ Β Β Β βββ rateLimit/
βΒ Β Β Β Β Β Β Β βββ authLimiter.js
βΒ Β Β Β Β Β Β Β βββ generalLimiter.js
βΒ Β Β Β Β Β Β Β βββ index.js
βββ app.js
βοΈ Installation
β PR Type
π Note to reviewers
This PR introduces rate limiting for both
/auth
(strict) and other routes (general). Please verify middleware placement inroutes/index.js
and confirm limits are appropriate.