ratelimit icon indicating copy to clipboard operation
ratelimit copied to clipboard

Method to clear rate limits?

Open vincentjames501 opened this issue 4 years ago • 3 comments

I think it would be neat for the /json API route to accept a DELETE request which clears the matching Redis keys. For example, when a user successfully enters their password correctly, we reset the rate limits for that user. I realize this wouldn't be something Envoy would call directly, but something a different service could call directly.

vincentjames501 avatar Nov 16 '20 19:11 vincentjames501

@vincentjames501 I've been working on this over here and with the proto definitions here as I also required resetting a rate. On calling the /json endpoint with the DELETE HTTP verb it will reset the local in memory cache, memcached or redis for a given set of descriptors. Resets can also be done via gRPC and I've included a new flag in the gRPC client to do the reset.

patramsey avatar Apr 27 '21 20:04 patramsey

@mattklein123 I've reused the RateLimitResponse type for the ResetRateLimit response. https://github.com/patramsey/go-control-plane/blob/main/envoy/service/ratelimit/v3/rls.pb.go#L739

Should that call have its own response type instead? ResetRateLimitResponse ?

patramsey avatar May 06 '21 20:05 patramsey

Is there any update on this issue. Does the above branch implementation work

damonavi avatar May 11 '23 07:05 damonavi