diff --git a/docs/BUILD b/docs/BUILD index 8aacb315..bca5ebfb 100644 --- a/docs/BUILD +++ b/docs/BUILD @@ -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", diff --git a/envoy/config/ratelimit/v2/rls.proto b/envoy/config/ratelimit/v2/rls.proto index 3a0f5dbe..b84d530a 100644 --- a/envoy/config/ratelimit/v2/rls.proto +++ b/envoy/config/ratelimit/v2/rls.proto @@ -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 `_ - // supports the data-plane-api version as of v1.1.0. - bool use_data_plane_proto = 3 [deprecated = true]; + reserved 3; } diff --git a/envoy/service/ratelimit/v2/rls.proto b/envoy/service/ratelimit/v2/rls.proto index ebaf5435..6ebea2b4 100644 --- a/envoy/service/ratelimit/v2/rls.proto +++ b/envoy/service/ratelimit/v2/rls.proto @@ -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; }