-
Notifications
You must be signed in to change notification settings - Fork 5
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
Rate Limit API Calls #402
base: master
Are you sure you want to change the base?
Rate Limit API Calls #402
Conversation
Thanks for contributing! |
api/middleware/RateLimiter.ts
Outdated
}); | ||
|
||
use(req: express.Request, res: express.Response, next: express.NextFunction) { | ||
if (req.path === '/api/v2/user') { |
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.
I think this is kinda ugly, is there a more modular/cleaner way to check this? Ideally, we're only checking this against the express checkin route
@@ -53,4 +53,6 @@ const app = createExpressServer({ | |||
defaultErrorHandler: false, | |||
}); | |||
|
|||
app.set('trust proxy', 1); |
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.
Also this is ugly as well, it feels weird adding this app.set here. I don't think there's a way with our routing-controllers package to have the app.set config set, but maybe there's other ideas out there
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.
Will take a look again after u implemented the decorators.
Info
Partially closes [#391].
Description
We're introducing rate limiting to prevent features like Express Checkin from being abused, since it's an unauthenticated route tied to SendGrid.
Changes
Type of Change
expected)
workflows, linting, etc.)
If you've selected Patch, Minor, or Major as your change type, make sure to bump the version before merging in
package.json
!Testing
I have tested that my changes fully resolve the linked issue ...
Checklist
package.json
file.Screenshots
Please include a screenshot of your Postman testing passing successfully.
TODO