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

rate limited for route #8

Closed
ducthanh200398 opened this issue Aug 13, 2020 · 3 comments
Closed

rate limited for route #8

ducthanh200398 opened this issue Aug 13, 2020 · 3 comments

Comments

@ducthanh200398
Copy link

image
in flask-limiter we can use limiter.exempt(...) for blueprint or bluprint route. can i do any thing like that at the moment

@laurentS
Copy link
Owner

Hi @ducthanh200398, thanks for your interest!
As far as I know, FastAPI doesn't have anythling like blueprints, but once I merge #7 you should be able to use the exempt() decorator. Note however that right now, there is no default limit, so you can positively mark the routes you want limited with the decorator, and just not decorate the routes you don't want limited.
After the PR is merged, this will still work, or you'll be able to add the middleware as a default limit, and use exempt().
I will update this ticket once this is merged.

@laurentS
Copy link
Owner

laurentS commented Oct 1, 2020

Just a heads up that #7 is now merged, and released in 0.1.2. Hope that it works for you!

@laurentS
Copy link
Owner

I think the middleware (see https://slowapi.readthedocs.io/en/latest/examples/) does what you describe here. If not, feel free to reopen and clarify what you need.

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

2 participants