TerminalWitchcraft / actix-ratelimit

Rate limiter framework for Actix web
MIT License
127 stars 25 forks source link

Updates for Actix4 latest beta (4.0.0-beta.20) #21

Open poisson-fish opened 2 years ago

poisson-fish commented 2 years ago

Compiles, no warnings, seems to work fine. Updated deps and migrated failure crate to thiserror. Redis store crate is untouched and requires more work. Don't hesitate to let me know if there's problems.

kmindi commented 2 years ago

@udidifier maybe a fork is needed? @TerminalWitchcraft seems to be not active anymore?

tglman commented 2 years ago

This looks good, hope a fork is not needed, let's see if @TerminalWitchcraft wake up :), otherwise happy to support the fork.

Or maybe is possible to handle over the crates.io crate

jacob-pro commented 2 years ago

This PR looks good to me, just needs changing to the actual actix 4 release version.

~~But if the crate is dead as a whole I think I'm going to look at moving to the actix-limitation which seems to be an officially maintained actix crate: https://github.com/actix/actix-extras/tree/master/actix-limitation~~ Or maybe not, it looks incredibly lacking in functionality :(

tglman commented 2 years ago

Yep,

I was thinking about it, anyway I think we can port some functionality there and give up on this one, for myself i use the "memorystore" for the rate limiting, that should be seamless to port, and not add a big burden in maintenance, not sure about other implementations that require additional external server like memcache.

Regards

jacob-pro commented 2 years ago

@tglman For me the major issue with actix_limitation is as far as I can see there doesn't seem to be any way of providing your own function to retrieve the rate-limiting key from a request - instead it forces you to use cookies which is completely in-appropriate for my use case

jacob-pro commented 2 years ago

@tglman I have had a go at writing my own rate limiter that works with actix web 4: https://github.com/jacob-pro/actix-extensible-rate-limit Maybe it might be useful to you?

tglman commented 2 years ago

@jacob-pro saw it, trying to use it !