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

View file

@ -22,6 +22,12 @@ export const meta = {
ref: 'Following',
},
},
// 10 calls per 5 seconds
limit: {
duration: 1000 * 5,
max: 10,
},
} as const;
export const paramDef = {

View file

@ -22,6 +22,12 @@ export const meta = {
ref: 'Following',
},
},
// 10 calls per 5 seconds
limit: {
duration: 1000 * 5,
max: 10,
},
} as const;
export const paramDef = {

View file

@ -27,6 +27,12 @@ export const meta = {
ref: 'FederationInstance',
},
},
// 10 calls per 5 seconds
limit: {
duration: 1000 * 5,
max: 10,
},
} as const;
export const paramDef = {

View file

@ -20,6 +20,12 @@ export const meta = {
optional: false, nullable: true,
ref: 'FederationInstance',
},
// 10 calls per 5 seconds
limit: {
duration: 1000 * 5,
max: 10,
},
} as const;
export const paramDef = {

View file

@ -50,6 +50,12 @@ export const meta = {
otherFollowingCount: { type: 'number' },
},
},
// 10 calls per 5 seconds
limit: {
duration: 1000 * 5,
max: 10,
},
} as const;
export const paramDef = {

View file

@ -12,6 +12,12 @@ export const meta = {
tags: ['federation'],
requireCredential: false,
// 2 calls per second
limit: {
duration: 1000,
max: 2,
},
} as const;
export const paramDef = {

View file

@ -24,6 +24,12 @@ export const meta = {
ref: 'UserDetailedNotMe',
},
},
// 10 calls per 5 seconds
limit: {
duration: 1000 * 5,
max: 10,
},
} as const;
export const paramDef = {