rate-limit: remove legacy service support (#4881)

Signed-off-by: Venil Noronha <veniln@vmware.com>

Mirrored from https://github.com/envoyproxy/envoy @ ed3f5f48a8a5d4baf6c98ac27c1e9a79fbde4d2e
pull/620/head
data-plane-api(CircleCI) 6 years ago
parent 00d2473398
commit 6e374dce0f
  1. 1
      docs/BUILD
  2. 16
      envoy/config/ratelimit/v2/rls.proto
  3. 14
      envoy/service/ratelimit/v2/rls.proto

@ -77,6 +77,7 @@ proto_library(
"//envoy/service/discovery/v2:ads",
"//envoy/service/load_stats/v2:lrs",
"//envoy/service/metrics/v2:metrics_service",
"//envoy/service/ratelimit/v2:rls",
"//envoy/type:percent",
"//envoy/type:range",
"//envoy/type/matcher:metadata",

@ -28,19 +28,5 @@ message RateLimitServiceConfig {
envoy.api.v2.core.GrpcService grpc_service = 2;
}
// Specifies if Envoy should use the data-plane-api client
// :repo:`api/envoy/service/ratelimit/v2/rls.proto` or the legacy
// client :repo:`source/common/ratelimit/ratelimit.proto` when
// making requests to the rate limit service.
//
// .. note::
//
// The legacy client will be used by
// default until the start of the 1.9.0 release cycle. At the start of the
// 1.9.0 release cycle this field will be removed and only the data-plane-api
// proto will be supported. This means that your rate limit service needs to
// have support for the data-plane-api proto by the start of the 1.9.0 release cycle.
// Lyft's `reference implementation <https://github.com/lyft/ratelimit>`_
// supports the data-plane-api version as of v1.1.0.
bool use_data_plane_proto = 3 [deprecated = true];
reserved 3;
}

@ -8,6 +8,8 @@ import "envoy/api/v2/ratelimit/ratelimit.proto";
import "validate/validate.proto";
// [#protodoc-title: Rate Limit Service (RLS)]
service RateLimitService {
// Determine whether rate limiting should take place.
rpc ShouldRateLimit(RateLimitRequest) returns (RateLimitResponse) {
@ -21,7 +23,6 @@ service RateLimitService {
// are provided, the server will limit on *ALL* of them and return an OVER_LIMIT response if any
// of them are over limit. This enables more complex application level rate limiting scenarios
// if desired.
// [#not-implemented-hide:] Hiding API for now.
message RateLimitRequest {
// All rate limit requests must specify a domain. This enables the configuration to be per
// application without fear of overlap. E.g., "envoy".
@ -38,25 +39,34 @@ message RateLimitRequest {
}
// A response from a ShouldRateLimit call.
// [#not-implemented-hide:] Hiding API for now.
message RateLimitResponse {
enum Code {
// The response code is not known.
UNKNOWN = 0;
// The response code to notify that the number of requests are under limit.
OK = 1;
// The response code to notify that the number of requests are over limit.
OVER_LIMIT = 2;
}
// Defines an actual rate limit in terms of requests per unit of time and the unit itself.
message RateLimit {
enum Unit {
// The time unit is not known.
UNKNOWN = 0;
// The time unit representing a second.
SECOND = 1;
// The time unit representing a minute.
MINUTE = 2;
// The time unit representing an hour.
HOUR = 3;
// The time unit representing a day.
DAY = 4;
}
// The number of requests per unit of time.
uint32 requests_per_unit = 1;
// The unit of time.
Unit unit = 2;
}

Loading…
Cancel
Save