Skip to content

Commit 3620026

Browse files
committed
feat: add rate limit whitelists for pubkeys/ips
1 parent 792d45d commit 3620026

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

settings.sample.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,14 @@
7373
"period": 86400000,
7474
"rate": 2880
7575
}
76-
]
76+
],
77+
"whitelists": {
78+
"pubkeys": [],
79+
"ipAddresses": [
80+
"::1",
81+
"::ffff:10.10.10.1"
82+
]
83+
}
7784
},
7885
"client": {
7986
"subscription": {

src/@types/settings.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,19 @@ export interface ContentLimits {
5252
maxLength?: number
5353
}
5454

55+
export interface EventWhitelists {
56+
pubkeys?: Pubkey[]
57+
ipAddresses?: string[]
58+
}
59+
5560
export interface EventLimits {
5661
eventId?: EventIdLimits
5762
pubkey?: PubkeyLimits
5863
kind?: KindLimits
5964
createdAt?: CreatedAtLimits
6065
content?: ContentLimits
6166
rateLimits?: EventRateLimit[]
67+
whitelists?: EventWhitelists
6268
}
6369

6470
export interface ClientSubscriptionLimits {

0 commit comments

Comments
 (0)