1
0

add rate limits to all public endpoints

This commit is contained in:
Hazelnoot
2024-11-22 13:43:06 -05:00
parent a38d8a91a1
commit e3b826db5a
243 changed files with 2908 additions and 9 deletions
@@ -24,6 +24,12 @@ export const meta = {
ref: 'GalleryPost',
},
},
// 10 calls per 5 seconds
limit: {
duration: 1000 * 5,
max: 10,
},
} as const;
export const paramDef = {
@@ -23,6 +23,12 @@ export const meta = {
ref: 'GalleryPost',
},
},
// 10 calls per 5 seconds
limit: {
duration: 1000 * 5,
max: 10,
},
} as const;
export const paramDef = {
@@ -22,6 +22,12 @@ export const meta = {
ref: 'GalleryPost',
},
},
// 10 calls per 5 seconds
limit: {
duration: 1000 * 5,
max: 10,
},
} as const;
export const paramDef = {
@@ -10,6 +10,7 @@ import { DI } from '@/di-symbols.js';
import { ModerationLogService } from '@/core/ModerationLogService.js';
import { RoleService } from '@/core/RoleService.js';
import { ApiError } from '../../../error.js';
import ms from 'ms';
export const meta = {
tags: ['gallery'],
@@ -31,6 +32,11 @@ export const meta = {
id: 'c86e09de-1c48-43ac-a435-1c7e42ed4496',
},
},
limit: {
duration: ms('1hour'),
max: 300,
},
} as const;
export const paramDef = {
@@ -39,6 +39,12 @@ export const meta = {
id: '40e9ed56-a59c-473a-bf3f-f289c54fb5a7',
},
},
// 2 calls per second
limit: {
duration: 1000,
max: 2,
},
} as const;
export const paramDef = {
@@ -28,6 +28,12 @@ export const meta = {
optional: false, nullable: false,
ref: 'GalleryPost',
},
// 10 calls per 5 seconds
limit: {
duration: 1000 * 5,
max: 10,
},
} as const;
export const paramDef = {
@@ -33,6 +33,12 @@ export const meta = {
id: 'e3e8e06e-be37-41f7-a5b4-87a8250288f0',
},
},
// 2 calls per second
limit: {
duration: 1000,
max: 2,
},
} as const;
export const paramDef = {