Skip to content

Commit e5a2537

Browse files
chore: bump limiter from 1.1.5 to 2.1.0 (#6001)
* chore: bump limiter from 1.1.5 to 2.1.0 Bumps [limiter](https://github.com/jhurliman/node-rate-limiter) from 1.1.5 to 2.1.0. - [Release notes](https://github.com/jhurliman/node-rate-limiter/releases) - [Commits](https://github.com/jhurliman/node-rate-limiter/commits) --- updated-dependencies: - dependency-name: limiter dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> * Update limiter usage --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Asher <[email protected]>
1 parent bce6239 commit e5a2537

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
"httpolyglot": "^0.1.2",
9898
"i18next": "^22.4.6",
9999
"js-yaml": "^4.0.0",
100-
"limiter": "^1.1.5",
100+
"limiter": "^2.1.0",
101101
"pem": "^1.14.2",
102102
"proxy-agent": "^5.0.0",
103103
"qs": "6.11.0",

src/node/routes/login.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ import i18n from "../i18n"
1212
// RateLimiter wraps around the limiter library for logins.
1313
// It allows 2 logins every minute plus 12 logins every hour.
1414
export class RateLimiter {
15-
private readonly minuteLimiter = new Limiter(2, "minute")
16-
private readonly hourLimiter = new Limiter(12, "hour")
15+
private readonly minuteLimiter = new Limiter({ tokensPerInterval: 2, interval: "minute" })
16+
private readonly hourLimiter = new Limiter({ tokensPerInterval: 12, interval: "hour" })
1717

1818
public canTry(): boolean {
1919
// Note: we must check using >= 1 because technically when there are no tokens left

yarn.lock

+11-4
Original file line numberDiff line numberDiff line change
@@ -2151,6 +2151,11 @@ jsonparse@^1.2.0:
21512151
resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280"
21522152
integrity sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=
21532153

2154+
2155+
version "4.3.0"
2156+
resolved "https://registry.yarnpkg.com/just-performance/-/just-performance-4.3.0.tgz#cc2bc8c9227f09e97b6b1df4cd0de2df7ae16db1"
2157+
integrity sha512-L7RjvtJsL0QO8xFs5wEoDDzzJwoiowRw6Rn/GnvldlchS2JQr9wFYPiwZcDfrbbujEKqKN0tvENdbjXdYhDp5Q==
2158+
21542159
levn@^0.4.1:
21552160
version "0.4.1"
21562161
resolved "https://registry.yarnpkg.com/levn/-/levn-0.4.1.tgz#ae4562c007473b932a6200d403268dd2fffc6ade"
@@ -2167,10 +2172,12 @@ levn@~0.3.0:
21672172
prelude-ls "~1.1.2"
21682173
type-check "~0.3.2"
21692174

2170-
limiter@^1.1.5:
2171-
version "1.1.5"
2172-
resolved "https://registry.yarnpkg.com/limiter/-/limiter-1.1.5.tgz#8f92a25b3b16c6131293a0cc834b4a838a2aa7c2"
2173-
integrity sha512-FWWMIEOxz3GwUI4Ts/IvgVy6LPvoMPgjMdQ185nN6psJyBJ4yOpzqm695/h5umdLJg2vW3GR5iG11MAkR2AzJA==
2175+
limiter@^2.1.0:
2176+
version "2.1.0"
2177+
resolved "https://registry.yarnpkg.com/limiter/-/limiter-2.1.0.tgz#d38d7c5b63729bb84fb0c4d8594b7e955a5182a2"
2178+
integrity sha512-361TYz6iay6n+9KvUUImqdLuFigK+K79qrUtBsXhJTLdH4rIt/r1y8r1iozwh8KbZNpujbFTSh74mJ7bwbAMOw==
2179+
dependencies:
2180+
just-performance "4.3.0"
21742181

21752182
locate-path@^6.0.0:
21762183
version "6.0.0"

0 commit comments

Comments
 (0)