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
@@ -9,6 +9,7 @@ import { GetterService } from '@/server/api/GetterService.js';
import { DI } from '@/di-symbols.js';
import type { NoteFavoritesRepository } from '@/models/_.js';
import { ApiError } from '../../../error.js';
import ms from 'ms';
export const meta = {
tags: ['notes', 'favorites'],
@@ -30,6 +31,12 @@ export const meta = {
id: 'b625fc69-635e-45e9-86f4-dbefbef35af5',
},
},
// 20 calls per hour (match create)
limit: {
duration: ms('1hour'),
max: 20,
},
} as const;
export const paramDef = {