-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
ldebruijn
committed
Jan 19, 2024
1 parent
9d06f0f
commit 39a78fe
Showing
4 changed files
with
48 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Max Batch | ||
|
||
Restricts the maximum number of operations inside a batched request. This helps prevent an excessive number operations reaching your landscape through minimal requests. | ||
This can be useful to prevent DDoS attacks, Heap Overflows or Server overload. | ||
|
||
<!-- TOC --> | ||
|
||
## Configuration | ||
|
||
You can configure `go-graphql-armor` to limit the maximum number of operations allowed inside a batch request. | ||
|
||
```yaml | ||
max_batch: | ||
# Enable the feature | ||
enable: "true" | ||
# The maximum number of operations within a single batched request. | ||
max: 5 | ||
# Reject the request when the rule fails. Disable this to allow the request regardless of token count. | ||
reject_on_failure: "true" | ||
``` | ||
## Metrics | ||
This rule produces metrics to help you gain insights into the behavior of the rule. | ||
``` | ||
go_graphql_armor_max_batch_results{result} | ||
``` | ||
|
||
|
||
| `result` | Description | | ||
|---------|--------------------------------------------------------------------------------------------------------------| | ||
| `allowed` | The rule condition succeeded | | ||
| `rejected` | The rule condition failed and the request was rejected | | ||
| `failed` | The rule condition failed but the request was not rejected. This happens when `reject_on_failure` is `false` | | ||
|
||
No metrics are produced when the rule is disabled. |