Skip to content

Instantly share code, notes, and snippets.

@thewisenerd
Created January 6, 2023 05:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thewisenerd/eaa48b86409bdffb623dd4a778e3eb18 to your computer and use it in GitHub Desktop.
Save thewisenerd/eaa48b86409bdffb623dd4a778e3eb18 to your computer and use it in GitHub Desktop.
// https://github.com/envoyproxy/data-plane-api/blob/main/envoy/service/ratelimit/v3/rls.proto
syntax = "proto3";
package envoy.service.ratelimit.v3;
service RateLimitService {
rpc ShouldRateLimit(RateLimitRequest) returns (RateLimitResponse) {}
}
message RateLimitRequest {
enum RateLimitUnit {
UNKNOWN = 0;
SECOND = 1;
MINUTE = 2;
HOUR = 3;
DAY = 4;
MONTH = 5;
YEAR = 6;
}
message RateLimitDescriptor {
message Entry {
string key = 1;
string value = 2;
}
message RateLimitOverride {
uint32 requests_per_unit = 1;
RateLimitUnit unit = 2;
}
repeated Entry entries = 1;
RateLimitOverride limit = 2;
}
string domain = 1;
repeated RateLimitDescriptor descriptors = 2;
uint32 hits_addend = 3;
}
message RateLimitResponse {
enum Code {
UNKNOWN = 0;
OK = 1;
OVER_LIMIT = 2;
}
Code overall_code = 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment