Upgrade express-rate-limit
authorChocobozzz <me@florianbigard.com>
Tue, 4 Feb 2020 09:52:05 +0000 (10:52 +0100)
committerChocobozzz <me@florianbigard.com>
Tue, 4 Feb 2020 09:52:05 +0000 (10:52 +0100)
package.json
server/controllers/api/index.ts
server/controllers/api/users/index.ts
yarn.lock

index 0a5484d2a6c4aa74e3a7c83e993a229e72d08c11..cec311a18cf68582e64bfb8c170a9abe0ebf645c 100644 (file)
@@ -95,7 +95,7 @@
     "deep-object-diff": "^1.1.0",
     "express": "^4.12.4",
     "express-oauth-server": "^2.0.0",
-    "express-rate-limit": "^4.0.4",
+    "express-rate-limit": "^5.0.0",
     "express-validator": "^6.4.0",
     "flat": "^5.0.0",
     "fluent-ffmpeg": "^2.1.0",
index 6138a32de9305c0d1877ab3042a42d0377e80bcb..7bec6c527c2e368e06772755e2bddce7a12f557d 100644 (file)
@@ -1,5 +1,4 @@
 import * as express from 'express'
-import * as RateLimit from 'express-rate-limit'
 import { configRouter } from './config'
 import { jobsRouter } from './jobs'
 import { oauthClientsRouter } from './oauth-clients'
@@ -15,6 +14,7 @@ import { overviewsRouter } from './overviews'
 import { videoPlaylistRouter } from './video-playlist'
 import { CONFIG } from '../../initializers/config'
 import { pluginRouter } from './plugins'
+import * as RateLimit from 'express-rate-limit'
 
 const apiRouter = express.Router()
 
@@ -24,8 +24,6 @@ apiRouter.use(cors({
   credentials: true
 }))
 
-// FIXME: https://github.com/nfriedly/express-rate-limit/issues/138
-// @ts-ignore
 const apiRateLimiter = RateLimit({
   windowMs: CONFIG.RATES_LIMIT.API.WINDOW_MS,
   max: CONFIG.RATES_LIMIT.API.MAX
index b960e80c18da3a309847c2f23fe9e568ac6e4f32..0b70125370c34d1b758afdd899c1817c0d853906 100644 (file)
@@ -53,8 +53,6 @@ import { Hooks } from '@server/lib/plugins/hooks'
 
 const auditLogger = auditLoggerFactory('users')
 
-// FIXME: https://github.com/nfriedly/express-rate-limit/issues/138
-// @ts-ignore
 const loginRateLimiter = RateLimit({
   windowMs: CONFIG.RATES_LIMIT.LOGIN.WINDOW_MS,
   max: CONFIG.RATES_LIMIT.LOGIN.MAX
index 6e75dab9a59e50fe20ee9fbbd7f2c661fa2bfab7..68f281e4524e9145768f6f9df0694604b8e14030 100644 (file)
--- a/yarn.lock
+++ b/yarn.lock
@@ -2282,10 +2282,10 @@ express-oauth-server@^2.0.0:
     express "^4.13.3"
     oauth2-server "3.0.0"
 
-express-rate-limit@^4.0.4:
-  version "4.0.4"
-  resolved "https://registry.yarnpkg.com/express-rate-limit/-/express-rate-limit-4.0.4.tgz#a495338ae9e58c856b66d1346ec0d86f43ba2e43"
-  integrity sha512-DLRj2vMO7Xgai8qWKU9O6ZztF2bdDmfFNFi9k3G9BPzJ+7MG7eWaaBikbe0eBpNGSxU8JziwW0PQKG78aNWa6g==
+express-rate-limit@^5.0.0:
+  version "5.0.0"
+  resolved "https://registry.yarnpkg.com/express-rate-limit/-/express-rate-limit-5.0.0.tgz#9a6f4cacc388c1a1da7ba2f65db69f7395e9b04e"
+  integrity sha512-dhT57wqxfqmkOi4HM7NuT4Gd7gbUgSK2ocG27Y6lwm8lbOAw9XQfeANawGq8wLDtlGPO1ZgDj0HmKsykTxfFAg==
 
 express-validator@^6.4.0:
   version "6.4.0"