From d7d515caf0a0329fa4020cbe86fc1c617e12454e Mon Sep 17 00:00:00 2001 From: craig Date: Thu, 10 Oct 2024 15:06:07 +0100 Subject: [PATCH 1/2] find and replace v1beta2 rlp Signed-off-by: craig rh-pre-commit.version: 2.2.0 rh-pre-commit.check-secrets: ENABLED --- .../toystore/ratelimitpolicy_gateway.yaml | 24 +++++------ .../toystore/ratelimitpolicy_httproute.yaml | 40 +++++++++++++++++-- 2 files changed, 49 insertions(+), 15 deletions(-) diff --git a/examples/toystore/ratelimitpolicy_gateway.yaml b/examples/toystore/ratelimitpolicy_gateway.yaml index 5635c163a..a37342f34 100644 --- a/examples/toystore/ratelimitpolicy_gateway.yaml +++ b/examples/toystore/ratelimitpolicy_gateway.yaml @@ -11,20 +11,20 @@ spec: limits: "expensive-operation": rates: - - limit: 2 - duration: 30 - unit: second + - limit: 2 + duration: 30 + unit: second when: - - selector: request.method - operator: eq - value: POST + - selector: request.method + operator: eq + value: POST "limit-per-ip": rates: - - limit: 5 - duration: 30 - unit: second + - limit: 5 + duration: 30 + unit: second when: - - selector: source.ip - operator: eq - value: source.address + - selector: source.ip + operator: eq + value: source.address diff --git a/examples/toystore/ratelimitpolicy_httproute.yaml b/examples/toystore/ratelimitpolicy_httproute.yaml index eeb6c732b..e118ecb85 100644 --- a/examples/toystore/ratelimitpolicy_httproute.yaml +++ b/examples/toystore/ratelimitpolicy_httproute.yaml @@ -10,9 +10,16 @@ spec: limits: "global": rates: +<<<<<<< HEAD - limit: 6 duration: 30 unit: second +======= + - limit: 6 + duration: 30 + unit: second + +>>>>>>> 8996d6dd (find and replace v1beta2 rlp) "get-toy": when: - selector: request.method @@ -22,15 +29,24 @@ spec: operator: eq value: "/toy" rates: +<<<<<<< HEAD - limit: 5 duration: 30 unit: second "admin-post-toy-per-user": +======= + - limit: 5 + duration: 30 + unit: second + + "admin-post-or-delete-toy-per-user": +>>>>>>> 8996d6dd (find and replace v1beta2 rlp) rates: - - limit: 2 - duration: 30 - unit: second + - limit: 2 + duration: 30 + unit: second counters: +<<<<<<< HEAD - metadata.filter_metadata.envoy\.filters\.http\.ext_authz.username when: - selector: request.method @@ -59,3 +75,21 @@ spec: - selector: metadata.filter_metadata.envoy\.filters\.http\.ext_authz.admin operator: eq value: "true" +======= + - metadata.filter_metadata.envoy\.filters\.http\.ext_authz.username + routeSelectors: + - matches: + - path: + type: Exact + value: "/admin/toy" + method: POST + - matches: + - path: + type: Exact + value: "/admin/toy" + method: DELETE + when: + - selector: metadata.filter_metadata.envoy\.filters\.http\.ext_authz.admin + operator: eq + value: "true" +>>>>>>> 8996d6dd (find and replace v1beta2 rlp) From a2ed0beb948fe23c2053fd8926b472488300dc0f Mon Sep 17 00:00:00 2001 From: craig Date: Tue, 15 Oct 2024 08:47:10 +0100 Subject: [PATCH 2/2] update RLP version rh-pre-commit.version: 2.2.0 rh-pre-commit.check-secrets: ENABLED --- .../toystore/ratelimitpolicy_httproute.yaml | 94 ++++++------------- 1 file changed, 30 insertions(+), 64 deletions(-) diff --git a/examples/toystore/ratelimitpolicy_httproute.yaml b/examples/toystore/ratelimitpolicy_httproute.yaml index e118ecb85..3d66c91c3 100644 --- a/examples/toystore/ratelimitpolicy_httproute.yaml +++ b/examples/toystore/ratelimitpolicy_httproute.yaml @@ -8,88 +8,54 @@ spec: kind: HTTPRoute name: toystore limits: - "global": + 'global': rates: -<<<<<<< HEAD - - limit: 6 - duration: 30 - unit: second -======= - limit: 6 duration: 30 unit: second - ->>>>>>> 8996d6dd (find and replace v1beta2 rlp) - "get-toy": + 'get-toy': when: - - selector: request.method - operator: eq - value: "GET" - - selector: request.path - operator: eq - value: "/toy" + - selector: request.method + operator: eq + value: 'GET' + - selector: request.path + operator: eq + value: '/toy' rates: -<<<<<<< HEAD - - limit: 5 - duration: 30 - unit: second - "admin-post-toy-per-user": -======= - limit: 5 duration: 30 unit: second - - "admin-post-or-delete-toy-per-user": ->>>>>>> 8996d6dd (find and replace v1beta2 rlp) + 'admin-post-toy-per-user': rates: - limit: 2 duration: 30 unit: second counters: -<<<<<<< HEAD - - metadata.filter_metadata.envoy\.filters\.http\.ext_authz.username + - metadata.filter_metadata.envoy\.filters\.http\.ext_authz.username when: - - selector: request.method - operator: eq - value: "GET" - - selector: request.path - operator: eq - value: "/admin/toy" - - selector: metadata.filter_metadata.envoy\.filters\.http\.ext_authz.admin - operator: eq - value: "true" - "admin-delete-per-user": + - selector: request.method + operator: eq + value: 'GET' + - selector: request.path + operator: eq + value: '/admin/toy' + - selector: metadata.filter_metadata.envoy\.filters\.http\.ext_authz.admin + operator: eq + value: 'true' + 'admin-delete-per-user': rates: - - limit: 2 - duration: 30 - unit: second + - limit: 2 + duration: 30 + unit: second counters: - - metadata.filter_metadata.envoy\.filters\.http\.ext_authz.username - when: - - selector: request.method - operator: eq - value: "DELETE" - - selector: request.path - operator: eq - value: "/admin/toy" - - selector: metadata.filter_metadata.envoy\.filters\.http\.ext_authz.admin - operator: eq - value: "true" -======= - metadata.filter_metadata.envoy\.filters\.http\.ext_authz.username - routeSelectors: - - matches: - - path: - type: Exact - value: "/admin/toy" - method: POST - - matches: - - path: - type: Exact - value: "/admin/toy" - method: DELETE when: + - selector: request.method + operator: eq + value: 'DELETE' + - selector: request.path + operator: eq + value: '/admin/toy' - selector: metadata.filter_metadata.envoy\.filters\.http\.ext_authz.admin operator: eq - value: "true" ->>>>>>> 8996d6dd (find and replace v1beta2 rlp) + value: 'true'