fusio icon indicating copy to clipboard operation
fusio copied to clipboard

Set default rate limit during deploy

Open christoph-bessei opened this issue 7 years ago • 4 comments

It would be nice, if we could overwrite the default rate limit in .fusio.yaml (or configuration.php). The set values should override the default values during fusio deploy

christoph-bessei avatar May 19 '18 02:05 christoph-bessei

Hi, so in general it is possible to add or update new rate limits through the .fusio.yml file i.e.:

rate:
  Default-Anonymous:
    priority: 8
    rateLimit: 180
    timespan: "PT1H"
    allocation:
      - authenticated: true
        parameters: "level=anonymous"
  Default:
    priority: 2
    rateLimit: 1400
    timespan: "PT1H"
    allocation:
      - authenticated: true
        parameters: "level=default"

but it is only possible to add or edit existing entries, it is not possible to delete an entry.

chriskapp avatar May 26 '18 17:05 chriskapp

Thanks for your feedback, that's good enough for my current use case. I'm just updating the default entries with rateLimit 9999999.

Maybe it would be cleaner, if rateLimit would allow "null" which would translate to "unlimited"?

christoph-bessei avatar Jun 01 '18 21:06 christoph-bessei

Currently, we can define the rate limits as mentioned in the comment above but there is still a problem if we want to set a rate limit for a specific route. In this case we need to define a routeId, which we dont have at deployment. So we would need to specify an actual "path" and transform this path to an id on deployment.

chriskapp avatar Nov 16 '18 22:11 chriskapp

Just an idea: FOSRestBundle of Symfony allows to define a name for each route: https://symfony.com/doc/master/bundles/FOSRestBundle/7-manual-route-definition.html

The name has to be unique so it could be used as identifier which is available during deployment. If the user doesn't need a name it could be generated by the path.

christoph-bessei avatar Nov 18 '18 11:11 christoph-bessei