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

Switch RateLimit headers spec version to latest #12493

Merged
merged 1 commit into from
Aug 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ message RateLimit {
// X-RateLimit headers disabled.
OFF = 0;

// Use `draft RFC Version 02 <https://tools.ietf.org/id/draft-polli-ratelimit-headers-02.html>`_.
DRAFT_VERSION_02 = 1;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this is just added in the previous PR, right?

Copy link
Contributor Author

@Pchelolo Pchelolo Aug 5, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. All the code/docs touched here were added in #12410

// Use `draft RFC Version 03 <https://tools.ietf.org/id/draft-polli-ratelimit-headers-03.html>`_.
DRAFT_VERSION_03 = 1;
}

// The rate limit domain to use when calling the rate limit service.
Expand Down Expand Up @@ -94,7 +94,7 @@ message RateLimit {
// above represent the window that is closest to reaching its limit.
//
// For more information about the headers specification see selected version of
// the `draft RFC <https://tools.ietf.org/id/draft-polli-ratelimit-headers-02.html>`_.
// the `draft RFC <https://tools.ietf.org/id/draft-polli-ratelimit-headers-03.html>`_.
//
// Disabled by default.
XRateLimitHeadersRFCVersion enable_x_ratelimit_headers = 8
Expand Down
2 changes: 1 addition & 1 deletion docs/root/version_history/current.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ New Features
* load balancer: added a :ref:`configuration<envoy_v3_api_msg_config.cluster.v3.Cluster.LeastRequestLbConfig>` option to specify the active request bias used by the least request load balancer.
* lua: added Lua APIs to access :ref:`SSL connection info <config_http_filters_lua_ssl_socket_info>` object.
* postgres network filter: :ref:`metadata <config_network_filters_postgres_proxy_dynamic_metadata>` is produced based on SQL query.
* ratelimit: added :ref:`enable_x_ratelimit_headers <envoy_v3_api_msg_extensions.filters.http.ratelimit.v3.RateLimit>` option to enable `X-RateLimit-*` headers as defined in `draft RFC <https://tools.ietf.org/id/draft-polli-ratelimit-headers-02.html>`_.
* ratelimit: added :ref:`enable_x_ratelimit_headers <envoy_v3_api_msg_extensions.filters.http.ratelimit.v3.RateLimit>` option to enable `X-RateLimit-*` headers as defined in `draft RFC <https://tools.ietf.org/id/draft-polli-ratelimit-headers-03.html>`_.
* router: added new
:ref:`envoy-ratelimited<config_http_filters_router_retry_policy-envoy-ratelimited>`
retry policy, which allows retrying envoy's own rate limited responses.
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion source/extensions/filters/http/ratelimit/ratelimit.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class FilterConfig {
failure_mode_deny_(config.failure_mode_deny()),
enable_x_ratelimit_headers_(
config.enable_x_ratelimit_headers() ==
envoy::extensions::filters::http::ratelimit::v3::RateLimit::DRAFT_VERSION_02),
envoy::extensions::filters::http::ratelimit::v3::RateLimit::DRAFT_VERSION_03),
rate_limited_grpc_status_(
config.rate_limited_as_resource_exhausted()
? absl::make_optional(Grpc::Status::WellKnownGrpcStatus::ResourceExhausted)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ class RatelimitFilterHeadersEnabledIntegrationTest : public RatelimitIntegration
public:
RatelimitFilterHeadersEnabledIntegrationTest() {
enable_x_ratelimit_headers_ =
envoy::extensions::filters::http::ratelimit::v3::RateLimit::DRAFT_VERSION_02;
envoy::extensions::filters::http::ratelimit::v3::RateLimit::DRAFT_VERSION_03;
}
};

Expand Down
2 changes: 1 addition & 1 deletion test/extensions/filters/http/ratelimit/ratelimit_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class HttpRateLimitFilterTest : public testing::Test {

const std::string enable_x_ratelimit_headers_config_ = R"EOF(
domain: foo
enable_x_ratelimit_headers: DRAFT_VERSION_02
enable_x_ratelimit_headers: DRAFT_VERSION_03
)EOF";

const std::string filter_config_ = R"EOF(
Expand Down