Skip to content

Commit

Permalink
feat: add rate limit whitelists for pubkeys/ips
Browse files Browse the repository at this point in the history
  • Loading branch information
cameri committed Dec 27, 2022
1 parent 792d45d commit 3620026
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
9 changes: 8 additions & 1 deletion settings.sample.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,14 @@
"period": 86400000,
"rate": 2880
}
]
],
"whitelists": {
"pubkeys": [],
"ipAddresses": [
"::1",
"::ffff:10.10.10.1"
]
}
},
"client": {
"subscription": {
Expand Down
6 changes: 6 additions & 0 deletions src/@types/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,19 @@ export interface ContentLimits {
maxLength?: number
}

export interface EventWhitelists {
pubkeys?: Pubkey[]
ipAddresses?: string[]
}

export interface EventLimits {
eventId?: EventIdLimits
pubkey?: PubkeyLimits
kind?: KindLimits
createdAt?: CreatedAtLimits
content?: ContentLimits
rateLimits?: EventRateLimit[]
whitelists?: EventWhitelists
}

export interface ClientSubscriptionLimits {
Expand Down

0 comments on commit 3620026

Please # to comment.