Skip to content

configuration by path with path_limits is not working #104

Description

@Snowbaha

I don't understand why the limit path defined in the configuration is not working whereas it is working with annotation in the controller.

i set
path_limits: - { path: '^/api', limit: 1, period: 3600 }
and nothing in the header with an /api/* url :
image

whereas is it working with the controller if defined for a specific one :
image

Do you have an idea?

Activity

  1. goetas commented on Mar 12, 2020

    @goetas
    Collaborator

    Paths are not regular expressions, but just simple prefixes

  2. Snowbaha commented on Mar 12, 2020

    @Snowbaha
    Author

    In the config example, there is :
    # - { path: /api, limit: 1000, period: 3600 }
    Does it mean all routes begin with /api are under this limit or I am wrong?

    ex: http//:mysite.com/api/user ; http//:mysite.com/api/cars ; http//:mysite.com/api/whateveryouwant

    EDIT:
    I think I understood my issue was with 2 rules likes this
    image

    and it does not work for the api/login_check, maybe because it is in security.yaml

  3. goetas commented on Mar 12, 2020

    @goetas
    Collaborator

    In the description of the issue you have '^/api', but should just be '/api'

  4. Snowbaha commented on Mar 12, 2020

    @Snowbaha
    Author

    Yes thank you for your answer!
    The only route what I don't understand it is not working now is the login_check (to create the JTW)

  5. kgpanteon commented on Apr 26, 2022

    @kgpanteon

    I have same issue. I am using lexik JWT token generator. Default login_check route not using ratelimit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions