-
Notifications
You must be signed in to change notification settings - Fork 63
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
Add Rate Limit Support #481
Conversation
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.
Nice progress.
Please add documentation, .env
level configuration and streamline the rate limiting logic removing parts that aren't necessary and capturing in a future ticket.
Also note HBAR comment
Codecov ReportBase: 76.38% // Head: 76.38% // No change to project coverage 👍
Additional details and impacted files@@ Coverage Diff @@
## main #481 +/- ##
=======================================
Coverage 76.38% 76.38%
=======================================
Files 12 12
Lines 923 923
Branches 144 144
=======================================
Hits 705 705
Misses 165 165
Partials 53 53
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Signed-off-by: georgi-l95 <glazarov95@gmail.com> ts fix Signed-off-by: georgi-l95 <glazarov95@gmail.com> add test Signed-off-by: georgi-l95 <glazarov95@gmail.com> fix test and code smell Signed-off-by: georgi-l95 <glazarov95@gmail.com> remove comments and auth support Signed-off-by: georgi-l95 <glazarov95@gmail.com> test Signed-off-by: georgi-l95 <glazarov95@gmail.com> test Signed-off-by: georgi-l95 <glazarov95@gmail.com> test Signed-off-by: georgi-l95 <glazarov95@gmail.com> test Signed-off-by: georgi-l95 <glazarov95@gmail.com> test Signed-off-by: georgi-l95 <glazarov95@gmail.com> test Signed-off-by: georgi-l95 <glazarov95@gmail.com> test Signed-off-by: georgi-l95 <glazarov95@gmail.com> Exposed limit configuration and added comment Signed-off-by: georgi-l95 <glazarov95@gmail.com> add comment on test Signed-off-by: georgi-l95 <glazarov95@gmail.com> add rate limit docs Signed-off-by: georgi-l95 <glazarov95@gmail.com> revert some changes Signed-off-by: georgi-l95 <glazarov95@gmail.com>
6eb96ba
to
3478c49
Compare
Signed-off-by: georgi-l95 <glazarov95@gmail.com>
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
@rustyShacklefurd heads up as this contains some additional configs. |
const relay: Relay = new RelayImpl(logger, register); | ||
const cors = require('koa-cors'); | ||
const app = new Koa(); | ||
const rpc = koaJsonRpc(); | ||
const rpc = new KoaJsonRpc(); |
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.
Does using the custom implementation make any of the controller logic in this file moveable?
That is should anything here move to koaJsonRPc/index.ts
?
Don't have to do it in this PR but it's be good to know so we track that.
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 that's doable. I've opened a separate issue to take care of this. Issue #530
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.
LG
Description:
Adds application level rate limiting with support for method based rate limiting with a tighter limit on relay account costing methods. Custom solution implemented in
koa-jsonrpc
module.Related issue(s):
Fixes #426
Notes for reviewer:
Some rate limit values in
methodConfiguration
module, perhaps should be modified.Checklist