enhance(server): add rate limits for some endpoints
This commit is contained in:
parent
e46e7f5252
commit
2047449294
7 changed files with 28 additions and 4 deletions
|
|
@ -1,4 +1,5 @@
|
|||
import { Inject, Injectable } from '@nestjs/common';
|
||||
import ms from 'ms';
|
||||
import type { NotesRepository, NoteThreadMutingsRepository } from '@/models/index.js';
|
||||
import { IdService } from '@/core/IdService.js';
|
||||
import { Endpoint } from '@/server/api/endpoint-base.js';
|
||||
|
|
@ -14,6 +15,11 @@ export const meta = {
|
|||
|
||||
kind: 'write:account',
|
||||
|
||||
limit: {
|
||||
duration: ms('1hour'),
|
||||
max: 10,
|
||||
},
|
||||
|
||||
errors: {
|
||||
noSuchNote: {
|
||||
message: 'No such note.',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue