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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add generic rate limiter middleware #1004
Conversation
4e8ce90
to
9690b47
Compare
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 like this a lot
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.
Generally looks good to me, let's wait for @SidSethi ack for cnode
* Combines and applies middlewares in an array | ||
* @param {Array} middleware | ||
*/ | ||
const compose = (middleware) => { |
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.
(low pri / non blocking) nit - compose what? seems like composeMiddleware
?
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 update name :)
@raymondjacobson we should add this if it's not there already https://expressjs.com/en/guide/behind-proxies.html |
Looks like we only have it on identity. I thought i saw it on both! Adding to cn! |
6bc9ffd
to
bb9a90e
Compare
Trello Card Link
Description
Adds a generic rate limiter to both node services (creator + identity).
The config for the rate limits are per endpoint, per method, per expiry time and are defined as a stringified JSON object in the config.
Services
Does it touch a critical flow like Discovery indexing, Creator Node track upload, Creator Node gateway, or Creator Node file system?
Delete an option.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide repro instructions & any configuration.
Include log analysis if applicable.
Default config (very permissive):