chore: Rate limiter audit (#3965)

* chore: Rate limiter audit api/users

* Make requests required

* api/collections

* Remove checkRateLimit on FileOperation (now done at route level through rate limiter)

* auth rate limit

* Add metric logging when rate limit exceeded

* Refactor to shared configs

* test
This commit is contained in:
Tom Moor
2022-08-14 16:04:04 +01:00
committed by GitHub
parent 9338328a82
commit a326e0ee88
14 changed files with 367 additions and 282 deletions

View File

@@ -5,12 +5,15 @@ import bodyParser from "koa-body";
import Router from "koa-router";
import { AuthenticationError } from "@server/errors";
import auth from "@server/middlewares/authentication";
import { defaultRateLimiter } from "@server/middlewares/rateLimiter";
import { Collection, Team, View } from "@server/models";
import providers from "./providers";
const app = new Koa();
const router = new Router();
router.use(passport.initialize());
router.use(defaultRateLimiter());
// dynamically load available authentication provider routes
providers.forEach((provider) => {