add rate limits to all public endpoints
This commit is contained in:
parent
a38d8a91a1
commit
e3b826db5a
243 changed files with 2908 additions and 9 deletions
|
|
@ -10,6 +10,7 @@ import { DI } from '@/di-symbols.js';
|
|||
import { GetterService } from '@/server/api/GetterService.js';
|
||||
import { UserMutingService } from '@/core/UserMutingService.js';
|
||||
import { ApiError } from '../../error.js';
|
||||
import ms from 'ms';
|
||||
|
||||
export const meta = {
|
||||
tags: ['account'],
|
||||
|
|
@ -37,6 +38,12 @@ export const meta = {
|
|||
id: '5467d020-daa9-4553-81e1-135c0c35a96d',
|
||||
},
|
||||
},
|
||||
|
||||
// 20 calls per hour (match create)
|
||||
limit: {
|
||||
duration: ms('1hour'),
|
||||
max: 20,
|
||||
},
|
||||
} as const;
|
||||
|
||||
export const paramDef = {
|
||||
|
|
|
|||
|
|
@ -26,6 +26,12 @@ export const meta = {
|
|||
ref: 'Muting',
|
||||
},
|
||||
},
|
||||
|
||||
// 5 calls per second
|
||||
limit: {
|
||||
duration: 1000,
|
||||
max: 5,
|
||||
},
|
||||
} as const;
|
||||
|
||||
export const paramDef = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue