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

How to setup a request limit per user #899

Closed
Krazybug opened this issue Jul 19, 2020 · 1 comment
Closed

How to setup a request limit per user #899

Krazybug opened this issue Jul 19, 2020 · 1 comment
Labels

Comments

@Krazybug
Copy link

Hello,

Until now I'm using datasette without any authentication system but I would like to setup a configuration or limiting the number of requests per user (eventually by IP or with a cookie mechanism) and eventually allowing me to ban specific users/IPs.

Is there a plugin available for this use case ?
If not what are your insights regarding this UC ?

Should I write a plugin ? Should I deploy datasette behind a reverse proxy to manage this ?

@simonw simonw added the support label Jul 31, 2020
@simonw
Copy link
Owner

simonw commented Jul 31, 2020

There's no mechanism that can do this at the moment.

You could absolutely support this with a plugin, probably using the asgi_wrapper plugin hook. There's an existing package at https://pypi.org/project/asgi-ratelimit/ which may be usable for this - it may even be possible to configure that using https://github.com/simonw/datasette-configure-asgi rather than using it to write a custom plugin.

Using a separate revers proxy would also be a good way to solve this. It depends which option would work best in your environment.

@simonw simonw closed this as completed Jul 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants