Skip to content

Commit d9b6c6f

Browse files
committed
docs: update rate limiting configuration options
1 parent c8336ab commit d9b6c6f

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

content/security/rate-limiting.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,10 @@ The following options are valid for the object passed to the array of the `Throt
203203
<td><code>limit</code></td>
204204
<td>the maximum number of requests within the TTL limit</td>
205205
</tr>
206+
<tr>
207+
<td><code>blockDuration</code></td>
208+
<td>the number of milliseconds that request will be blocked for that time</td>
209+
</tr>
206210
<tr>
207211
<td><code>ignoreUserAgents</code></td>
208212
<td>an array of regular expressions of user-agents to ignore when it comes to throttling requests</td>
@@ -232,6 +236,18 @@ If you need to set up storage instead, or want to use some of the above options
232236
<td><code>throttlers</code></td>
233237
<td>an array of throttler sets, defined using the table above</td>
234238
</tr>
239+
<tr>
240+
<td><code>errorMessage</code></td>
241+
<td>a <code>string</code> OR a function that takes in the <code>ExecutionContext</code> and the <code>ThrottlerLimitDetail</code> and returns a <code>string</code> which overrides the default throttler error message</td>
242+
</tr>
243+
<tr>
244+
<td><code>getTracker</code></td>
245+
<td>a function that takes in the <code>Request</code> and returns a <code>string</code> to override the default logic of the <code>getTracker</code> method</td>
246+
</tr>
247+
<tr>
248+
<td><code>generateKey</code></td>
249+
<td>a function that takes in the <code>ExecutionContext</code>, the tacker <code>string</code> and the throttler name as a <code>string</code> and returns a <code>string</code> to override the final key which will be used to store the rate limit value. This overrides the default logic of the <code>generateKey</code> method</td>
250+
</tr>
235251
</table>
236252

237253
#### Async Configuration

0 commit comments

Comments
 (0)