-
Notifications
You must be signed in to change notification settings - Fork 384
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
enable rate limit for month and year
Signed-off-by: Rico Pahlisch <[email protected]>
- Loading branch information
Showing
7 changed files
with
108 additions
and
7 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
47 changes: 47 additions & 0 deletions
47
internal/xds/translator/testdata/in/ratelimit-config/month-year-rule.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,47 @@ | ||
name: "first-listener" | ||
address: "0.0.0.0" | ||
port: 10080 | ||
hostnames: | ||
- "*" | ||
path: | ||
mergeSlashes: true | ||
escapedSlashesAction: UnescapeAndRedirect | ||
routes: | ||
- name: "first-route" | ||
traffic: | ||
rateLimit: | ||
global: | ||
rules: | ||
- headerMatches: | ||
- name: "x-user-id" | ||
exact: "one" | ||
limit: | ||
requests: 5 | ||
unit: month | ||
pathMatch: | ||
exact: "foo/bar" | ||
destination: | ||
name: "first-route-dest" | ||
settings: | ||
- endpoints: | ||
- host: "1.2.3.4" | ||
port: 50000 | ||
- name: "second-route" | ||
traffic: | ||
rateLimit: | ||
global: | ||
rules: | ||
- headerMatches: | ||
Check failure on line 34 in internal/xds/translator/testdata/in/ratelimit-config/month-year-rule.yaml GitHub Actions / lint
|
||
- name: "x-user-id" | ||
Check failure on line 35 in internal/xds/translator/testdata/in/ratelimit-config/month-year-rule.yaml GitHub Actions / lint
|
||
exact: "two" | ||
limit: | ||
requests: 1 | ||
unit: year | ||
pathMatch: | ||
exact: "foo/foo" | ||
destination: | ||
name: "second-route-dest" | ||
settings: | ||
- endpoints: | ||
Check failure on line 45 in internal/xds/translator/testdata/in/ratelimit-config/month-year-rule.yaml GitHub Actions / lint
|
||
- host: "1.2.3.4" | ||
Check failure on line 46 in internal/xds/translator/testdata/in/ratelimit-config/month-year-rule.yaml GitHub Actions / lint
|
||
port: 50000 |
37 changes: 37 additions & 0 deletions
37
internal/xds/translator/testdata/out/ratelimit-config/month-year-rule.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,37 @@ | ||
name: first-listener | ||
domain: first-listener | ||
descriptors: | ||
- key: first-route | ||
value: first-route | ||
rate_limit: null | ||
descriptors: | ||
- key: rule-0-match-0 | ||
value: rule-0-match-0 | ||
rate_limit: | ||
requests_per_unit: 5 | ||
unit: MONTH | ||
unlimited: false | ||
name: "" | ||
replaces: [] | ||
descriptors: [] | ||
shadow_mode: false | ||
detailed_metric: false | ||
shadow_mode: false | ||
detailed_metric: false | ||
- key: second-route | ||
value: second-route | ||
rate_limit: null | ||
descriptors: | ||
- key: rule-0-match-0 | ||
value: rule-0-match-0 | ||
rate_limit: | ||
requests_per_unit: 1 | ||
unit: YEAR | ||
unlimited: false | ||
name: "" | ||
replaces: [] | ||
descriptors: [] | ||
shadow_mode: false | ||
detailed_metric: false | ||
shadow_mode: false | ||
detailed_metric: false |
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