Skip to content

Commit 752c825

Browse files
docs: add more infos to match conditions docs (#288)
Signed-off-by: Charles-Edouard Brétéché <[email protected]> Co-authored-by: Vishal Choudhary <[email protected]>
1 parent dd1dc36 commit 752c825

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

website/docs/policies/match-conditions.md

+14-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ You can define match conditions if you need fine-grained request filtering.
44

55
Match conditions are **CEL expressions**. All match conditions must evaluate to `true` for the request to be evaluated.
66

7+
!!!info
8+
9+
Match conditions have access to the same CEL variables as validation expressions.
10+
711
## Example
812

913
```yaml
@@ -24,4 +28,13 @@ spec:
2428
In the policy above, the `matchConditions` will be used to deny all requests having the `x-force-deny` header.
2529

2630
- If an incoming request doesn't have the `x-force-deny` header, then the condition will return `false` and the policy won't apply
27-
- If an incoming request has the `x-force-deny` header, then the condition will return `true` and the `deny` rule will deny the request with status code `403`
31+
- If an incoming request has the `x-force-deny` header, then the condition will return `true` and the `deny` rule will deny the request with status code `403`
32+
33+
## Error handling
34+
35+
In the event of an error evaluating a match condition the policy is not evaluated. Whether to reject the request is determined as follows:
36+
37+
1. If any match condition evaluated to `false` (regardless of other errors), then the policy is skipped.
38+
1. Otherwise:
39+
- for `failurePolicy: Fail`, reject the request (without evaluating the policy).
40+
- for `failurePolicy: Ignore`, proceed with the request but skip the policy.

0 commit comments

Comments
 (0)