forked from envoyproxy/gateway
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: ensure ANDed matches for ratelimit rules (envoyproxy#2607)
* move route descriptor to first and add e2e test for this Signed-off-by: shawnh2 <[email protected]> * rename global ratelimit e2e test name Signed-off-by: shawnh2 <[email protected]> * address comments Signed-off-by: shawnh2 <[email protected]> * correct comments Signed-off-by: shawnh2 <[email protected]> * fix failed ratelimit e2e test case Signed-off-by: shawnh2 <[email protected]> --------- Signed-off-by: shawnh2 <[email protected]>
- Loading branch information
Showing
4 changed files
with
150 additions
and
17 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
apiVersion: gateway.envoyproxy.io/v1alpha1 | ||
kind: BackendTrafficPolicy | ||
metadata: | ||
name: ratelimit-anded-headers | ||
namespace: gateway-conformance-infra | ||
spec: | ||
targetRef: | ||
group: gateway.networking.k8s.io | ||
kind: HTTPRoute | ||
name: header-ratelimit | ||
namespace: gateway-conformance-infra | ||
rateLimit: | ||
type: Global | ||
global: | ||
rules: | ||
- clientSelectors: | ||
- headers: | ||
- name: x-user-id | ||
type: Exact | ||
value: one | ||
- name: x-user-org | ||
type: Exact | ||
value: acme | ||
limit: | ||
requests: 3 | ||
unit: Hour | ||
--- | ||
apiVersion: gateway.networking.k8s.io/v1 | ||
kind: HTTPRoute | ||
metadata: | ||
name: header-ratelimit | ||
namespace: gateway-conformance-infra | ||
spec: | ||
parentRefs: | ||
- name: same-namespace | ||
rules: | ||
- matches: | ||
- path: | ||
type: PathPrefix | ||
value: /get | ||
backendRefs: | ||
- name: infra-backend-v1 | ||
port: 8080 |
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