-
Notifications
You must be signed in to change notification settings - Fork 15
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
rate limiter as access control #809
Comments
I like the idea. How would you define the order? We could inspect expressions (especially those using request.context), like we do to order request sequences. Or would you use the order of references in the access_control list? |
I guess that's the order in which access controls are (already) applied. |
I would apply the ordered list - no magic reordering. Should we reply with some additional headers like https://github.com/sashabaranov/go-openai/blob/master/ratelimit.go#L10 ? This could also be interesting for our BE limiters. |
See also |
Let's start with a simple implementation that just uses status 429 to communicate current overuse. |
The Without it, rate limiting is almost useless. We could even make it a mandatory field. Is it worth to provide a non-dynamic alternative to the key (which has to be evaluated in cty land) to be more efficient or make typical use-cases simpler? Example:
Anyways, we can start with the dynamic key and introduce those optimized shortcuts later once typical use is clear. |
We could implement a rate limiter as an access control, e.g.:
429
if the request is blockedbackend
key
expression value, e.g. depending onrequest.<property>
or a JWT claim (request.context.at.sub
, if used after an "at"jwt
access control)It could be handy to add more
request.
sub-properties, e.g. from goRequest.RemoteAddr
if available.The text was updated successfully, but these errors were encountered: