* 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
29 lines
380 B
TypeScript
29 lines
380 B
TypeScript
export default class MockRateLimiter {
|
|
static getRateLimiter() {
|
|
return {
|
|
points: 100,
|
|
consume: jest.fn(),
|
|
};
|
|
}
|
|
|
|
static setRateLimiter() {
|
|
//
|
|
}
|
|
|
|
static hasRateLimiter() {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
export const RateLimiterStrategy = new Proxy(
|
|
{},
|
|
{
|
|
get() {
|
|
return {
|
|
duration: 60,
|
|
requests: 10,
|
|
};
|
|
},
|
|
}
|
|
);
|