Skip to content
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

configuration by path with path_limits is not working #104

Open
Snowbaha opened this issue Mar 11, 2020 · 5 comments
Open

configuration by path with path_limits is not working #104

Snowbaha opened this issue Mar 11, 2020 · 5 comments

Comments

@Snowbaha
Copy link

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?

@goetas
Copy link
Collaborator

goetas commented Mar 12, 2020

Paths are not regular expressions, but just simple prefixes

@Snowbaha
Copy link
Author

Snowbaha commented Mar 12, 2020

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

@goetas
Copy link
Collaborator

goetas commented Mar 12, 2020

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

@Snowbaha
Copy link
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)

@kgpanteon
Copy link

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants