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.
* Translates Xds IR into ratelimit service config https://github.com/envoyproxy/ratelimit#configuration Relates to envoyproxy#670 Signed-off-by: Arko Dasgupta <arko@tetrate.io>
- Loading branch information
Showing
16 changed files
with
408 additions
and
23 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
21 changes: 21 additions & 0 deletions
21
internal/xds/translator/testdata/in/ratelimit-config/distinct-match.yaml
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,21 @@ | ||
name: "first-listener" | ||
address: "0.0.0.0" | ||
port: 10080 | ||
hostnames: | ||
- "*" | ||
routes: | ||
- name: "first-route" | ||
rateLimit: | ||
global: | ||
rules: | ||
- headerMatches: | ||
- name: "x-user-id" | ||
distinct: true | ||
limit: | ||
requests: 5 | ||
unit: second | ||
pathMatch: | ||
exact: "foo/bar" | ||
destinations: | ||
- host: "1.2.3.4" | ||
port: 50000 |
18 changes: 18 additions & 0 deletions
18
internal/xds/translator/testdata/in/ratelimit-config/empty-header-matches.yaml
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,18 @@ | ||
name: "first-listener" | ||
address: "0.0.0.0" | ||
port: 10080 | ||
hostnames: | ||
- "*" | ||
routes: | ||
- name: "first-route" | ||
rateLimit: | ||
global: | ||
rules: | ||
- limit: | ||
requests: 5 | ||
unit: second | ||
pathMatch: | ||
exact: "foo/bar" | ||
destinations: | ||
- host: "1.2.3.4" | ||
port: 50000 |
23 changes: 23 additions & 0 deletions
23
internal/xds/translator/testdata/in/ratelimit-config/multiple-matches.yaml
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,23 @@ | ||
name: "first-listener" | ||
address: "0.0.0.0" | ||
port: 10080 | ||
hostnames: | ||
- "*" | ||
routes: | ||
- name: "first-route" | ||
rateLimit: | ||
global: | ||
rules: | ||
- headerMatches: | ||
- name: "x-user-id" | ||
exact: "one" | ||
- name: "x-user-id" | ||
exact: "two" | ||
limit: | ||
requests: 5 | ||
unit: second | ||
pathMatch: | ||
exact: "foo/bar" | ||
destinations: | ||
- host: "1.2.3.4" | ||
port: 50000 |
33 changes: 33 additions & 0 deletions
33
internal/xds/translator/testdata/in/ratelimit-config/multiple-routes.yaml
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,33 @@ | ||
name: "first-listener" | ||
address: "0.0.0.0" | ||
port: 10080 | ||
hostnames: | ||
- "*" | ||
routes: | ||
- name: "first-route" | ||
rateLimit: | ||
global: | ||
rules: | ||
- headerMatches: | ||
- name: "x-user-id" | ||
exact: "one" | ||
limit: | ||
requests: 5 | ||
unit: second | ||
pathMatch: | ||
exact: "foo/baz" | ||
- name: "second-route" | ||
rateLimit: | ||
global: | ||
rules: | ||
- headerMatches: | ||
- name: "x-user-id" | ||
exact: "two" | ||
limit: | ||
requests: 10 | ||
unit: second | ||
pathMatch: | ||
exact: "foo/bar" | ||
destinations: | ||
- host: "1.2.3.4" | ||
port: 50000 |
27 changes: 27 additions & 0 deletions
27
internal/xds/translator/testdata/in/ratelimit-config/multiple-rules.yaml
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,27 @@ | ||
name: "first-listener" | ||
address: "0.0.0.0" | ||
port: 10080 | ||
hostnames: | ||
- "*" | ||
routes: | ||
- name: "first-route" | ||
rateLimit: | ||
global: | ||
rules: | ||
- headerMatches: | ||
- name: "x-user-id" | ||
exact: "one" | ||
limit: | ||
requests: 5 | ||
unit: second | ||
- headerMatches: | ||
- name: "x-user-id" | ||
exact: "two" | ||
limit: | ||
requests: 10 | ||
unit: second | ||
pathMatch: | ||
exact: "foo/bar" | ||
destinations: | ||
- host: "1.2.3.4" | ||
port: 50000 |
Oops, something went wrong.