local ratelimit support virtualhost config (#22895)

Signed-off-by: wangkai19 <wangkai19@corp.netease.com>

Mirrored from https://github.com/envoyproxy/envoy @ 53837e6c91f39242bb569ca59fc6d9662ae6977c
pull/626/head
data-plane-api(Azure Pipelines) 3 years ago
parent 67baaf143c
commit 475b83877e
  1. 11
      envoy/extensions/common/ratelimit/v3/ratelimit.proto
  2. 6
      envoy/extensions/filters/http/local_ratelimit/v3/local_rate_limit.proto
  3. 2
      envoy/extensions/filters/http/ratelimit/v3/rate_limit.proto

@ -34,6 +34,17 @@ enum XRateLimitHeadersRFCVersion {
DRAFT_VERSION_03 = 1;
}
enum VhRateLimitsOptions {
// Use the virtual host rate limits unless the route has a rate limit policy.
OVERRIDE = 0;
// Use the virtual host rate limits even if the route has a rate limit policy.
INCLUDE = 1;
// Ignore the virtual host rate limits even if the route does not have a rate limit policy.
IGNORE = 2;
}
// A RateLimitDescriptor is a list of hierarchical entries that are used by the service to
// determine the final rate limit key and overall allowed limit. Here are some examples of how
// they might be used for the domain "envoy".

@ -20,7 +20,7 @@ option (udpa.annotations.file_status).package_version_status = ACTIVE;
// Local Rate limit :ref:`configuration overview <config_http_filters_local_rate_limit>`.
// [#extension: envoy.filters.http.local_ratelimit]
// [#next-free-field: 13]
// [#next-free-field: 14]
message LocalRateLimit {
// The human readable prefix to use when emitting stats.
string stat_prefix = 1 [(validate.rules).string = {min_len: 1}];
@ -113,4 +113,8 @@ message LocalRateLimit {
// Disabled by default.
common.ratelimit.v3.XRateLimitHeadersRFCVersion enable_x_ratelimit_headers = 12
[(validate.rules).enum = {defined_only: true}];
// Specifies if the local rate limit filter should include the virtual host rate limits.
common.ratelimit.v3.VhRateLimitsOptions vh_rate_limits = 13
[(validate.rules).enum = {defined_only: true}];
}

@ -337,6 +337,7 @@ message RateLimitConfig {
}
message RateLimitPerRoute {
// [#next-major-version: unify with local ratelimit, should use common.ratelimit.v3.VhRateLimitsOptions instead.]
enum VhRateLimitsOptions {
// Use the virtual host rate limits unless the route has a rate limit policy.
OVERRIDE = 0;
@ -365,6 +366,7 @@ message RateLimitPerRoute {
}
// Specifies if the rate limit filter should include the virtual host rate limits.
// [#next-major-version: unify with local ratelimit, should use common.ratelimit.v3.VhRateLimitsOptions instead.]
VhRateLimitsOptions vh_rate_limits = 1 [(validate.rules).enum = {defined_only: true}];
// Specifies if the rate limit filter should include the lower levels (route level, virtual host level or cluster weight level) rate limits override options.

Loading…
Cancel
Save