From 6894107a80c0dc68839bbd78db25b1e5a775b7eb Mon Sep 17 00:00:00 2001 From: "data-plane-api(CircleCI)" Date: Thu, 21 May 2020 15:40:05 +0000 Subject: [PATCH] ratelimit: allow header descriptors to be skipped (#11153) Resolves #10124 indirectly by adding an extra config flag to RequestHeaders through which it is possible for descriptors to be sent on a partial match. Signed-off-by: Rohan Seth Mirrored from https://github.com/envoyproxy/envoy @ 77e436f9eb39863a4a425bbca9026c86740b36cd --- envoy/config/route/v3/route_components.proto | 5 +++++ envoy/config/route/v4alpha/route_components.proto | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/envoy/config/route/v3/route_components.proto b/envoy/config/route/v3/route_components.proto index 9be58f96..f927f582 100644 --- a/envoy/config/route/v3/route_components.proto +++ b/envoy/config/route/v3/route_components.proto @@ -1395,6 +1395,11 @@ message RateLimit { // The key to use in the descriptor entry. string descriptor_key = 2 [(validate.rules).string = {min_bytes: 1}]; + + // If set to true, Envoy skips the descriptor while calling rate limiting service + // when header is not present in the request. By default it skips calling the + // rate limiting service if this header is not present in the request. + bool skip_if_absent = 3; } // The following descriptor entry is appended to the descriptor and is populated using the diff --git a/envoy/config/route/v4alpha/route_components.proto b/envoy/config/route/v4alpha/route_components.proto index 7b49aca5..b23efe34 100644 --- a/envoy/config/route/v4alpha/route_components.proto +++ b/envoy/config/route/v4alpha/route_components.proto @@ -1376,6 +1376,11 @@ message RateLimit { // The key to use in the descriptor entry. string descriptor_key = 2 [(validate.rules).string = {min_bytes: 1}]; + + // If set to true, Envoy skips the descriptor while calling rate limiting service + // when header is not present in the request. By default it skips calling the + // rate limiting service if this header is not present in the request. + bool skip_if_absent = 3; } // The following descriptor entry is appended to the descriptor and is populated using the