Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How about add HeaderMatch for http local ratelimit? #14161

Closed
ydh926 opened this issue Nov 24, 2020 · 9 comments
Closed

How about add HeaderMatch for http local ratelimit? #14161

ydh926 opened this issue Nov 24, 2020 · 9 comments
Labels
area/ratelimit stale stalebot believes this issue/PR has not been touched recently

Comments

@ydh926
Copy link

ydh926 commented Nov 24, 2020

Title: HeaderMatch for http local ratelimit

Description:

For example, limit a special user's request, we may need HeaderMatch in limit config , like this:

              stat_prefix: http_local_rate_limiter
              token_bucket:
                max_tokens: 1
                tokens_per_fill: 1
                fill_interval: 600s
              filter_enabled:
                runtime_key: local_rate_limit_enabled
                default_value:
                  numerator: 100
                  denominator: HUNDRED
              filter_enforced:
                runtime_key: local_rate_limit_enforced
                default_value:
                  numerator: 100
                  denominator: HUNDRED
              match:
                  name: x-user
                  exact_match: Bill
                  invert_match: false
@ydh926 ydh926 added enhancement Feature requests. Not bugs or questions. triage Issue requires triage labels Nov 24, 2020
@zuercher zuercher added area/ratelimit and removed triage Issue requires triage labels Nov 24, 2020
@wbpcode
Copy link
Member

wbpcode commented Dec 7, 2020

I think it's valuable. Sometimes we do need to do some extra match to decide if we need to make a flow control.
If the community approves, perhaps I can complete it.

@mattklein123 mattklein123 removed the enhancement Feature requests. Not bugs or questions. label Dec 7, 2020
@mattklein123
Copy link
Member

The goal here should be to use the new generic matching support that @snowp is working on. I think we are making good progress on that.

@wbpcode
Copy link
Member

wbpcode commented Dec 9, 2020

@mattklein123 I've been looking forward to generic matching support for a long time, where can I get the latest progress?

@mattklein123
Copy link
Member

@snowp should be able to summarize and/or point you to current status. I think we are pretty close to having something we can start to build on in different filters.

@github-actions
Copy link

github-actions bot commented Jan 8, 2021

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or "no stalebot" or other activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale stalebot believes this issue/PR has not been touched recently label Jan 8, 2021
@hania-elayoubi
Copy link

@mattklein123 with #14462 now merged, how much closer are we to be able to accomplish the request in this issue?

Could you please point to reference syntax on how to do this in the yaml config, if it is different than the one ydh926 listed?

@snowp
Copy link
Contributor

snowp commented Jan 13, 2021

With what's merged today you should be able to trigger a skip filter action based on matching on the request headers, similar to how this test works:

name: matcher
typed_config:
"@type": type.googleapis.com/envoy.extensions.common.matching.v3.ExtensionWithMatcher
extension_config:
name: set-response-code
typed_config:
"@type": type.googleapis.com/test.integration.filters.SetResponseCodeFilterConfig
code: 403
matcher:
matcher_tree:
input:
name: request-headers
typed_config:
"@type": type.googleapis.com/envoy.type.matcher.v3.HttpRequestHeaderMatchInput
header_name: match-header
exact_match_map:
map:
match:
action:
name: skip
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.common.matcher.action.v3.SkipFilter
)EOF");

Happy to answer any questions you might have

@github-actions github-actions bot removed the stale stalebot believes this issue/PR has not been touched recently label Jan 13, 2021
@github-actions
Copy link

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or "no stalebot" or other activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale stalebot believes this issue/PR has not been touched recently label Feb 22, 2021
@github-actions
Copy link

github-actions bot commented Mar 2, 2021

This issue has been automatically closed because it has not had activity in the last 37 days. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted" or "no stalebot". Thank you for your contributions.

@github-actions github-actions bot closed this as completed Mar 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ratelimit stale stalebot believes this issue/PR has not been touched recently
Projects
None yet
Development

No branches or pull requests

6 participants