From ea5bba9e8ebb84d31c4967c0ee3e16a8f36bc39d Mon Sep 17 00:00:00 2001 From: "data-plane-api(CircleCI)" Date: Thu, 16 Aug 2018 14:51:01 +0000 Subject: [PATCH] ratelimit: Add ratelimit custom response headers (#4015) - Ability to add custom response headers from ratelimit service/filter - For both (LimitStatus::OK and LimitStatus::OverLimit) custom headers are added if RLS service sends headers - For LimitStatus:OK, we temporarily store the headers and add them to the response (via Filter::encodeHeaders()) *Risk Level*: Low *Testing*: unit and integration tests added. Verified with modified github.com/lyft/ratelimit service. Passes "bazel test //test/..." in Linux Signed-off-by: Suresh Kumar Mirrored from https://github.com/envoyproxy/envoy @ 71152b710e3543732464fca57c8f07b7395de68d --- envoy/service/ratelimit/v2/BUILD | 2 ++ envoy/service/ratelimit/v2/rls.proto | 3 +++ 2 files changed, 5 insertions(+) diff --git a/envoy/service/ratelimit/v2/BUILD b/envoy/service/ratelimit/v2/BUILD index 4ee72b65..d0e114eb 100644 --- a/envoy/service/ratelimit/v2/BUILD +++ b/envoy/service/ratelimit/v2/BUILD @@ -7,6 +7,7 @@ api_proto_library_internal( srcs = ["rls.proto"], has_services = 1, deps = [ + "//envoy/api/v2/core:base", "//envoy/api/v2/core:grpc_service", "//envoy/api/v2/ratelimit", ], @@ -16,6 +17,7 @@ api_go_grpc_library( name = "rls", proto = ":rls", deps = [ + "//envoy/api/v2/core:base_go_proto", "//envoy/api/v2/core:grpc_service_go_proto", "//envoy/api/v2/ratelimit:ratelimit_go_proto", ], diff --git a/envoy/service/ratelimit/v2/rls.proto b/envoy/service/ratelimit/v2/rls.proto index c1a416fc..ebaf5435 100644 --- a/envoy/service/ratelimit/v2/rls.proto +++ b/envoy/service/ratelimit/v2/rls.proto @@ -3,6 +3,7 @@ syntax = "proto3"; package envoy.service.ratelimit.v2; option go_package = "v2"; +import "envoy/api/v2/core/base.proto"; import "envoy/api/v2/ratelimit/ratelimit.proto"; import "validate/validate.proto"; @@ -75,4 +76,6 @@ message RateLimitResponse { // in the RateLimitRequest. This can be used by the caller to determine which individual // descriptors failed and/or what the currently configured limits are for all of them. repeated DescriptorStatus statuses = 2; + // A list of headers to add to the response + repeated envoy.api.v2.core.HeaderValue headers = 3; }