-
Notifications
You must be signed in to change notification settings - Fork 337
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
rack-attack-4.3.1 RedisStoreProxy does not accept plain redis #213
Comments
Ran into the same issue. And rack-attack-4.2 has a CVE. |
I'm getting this error using rack-attack 4.4.1 and redis gem v3.3.5. I'm not sure but per @ryandv comment, I would have to update my config file to fix the error? This is how it is currently set up in my initializer: Rack::Attack.cache.store = Rack::Attack::StoreProxy::RedisStoreProxy.new(Redis.current) Here is the backtrace:
|
anyone ever figured out the fix for this issue? |
I'm still facing this issue with rack-attack version 5.0.1 and redis-server 2.8.4. |
This app reproduces this issue. As @ryandv pointed out, #118 introduced this bug in order to fix some issues discussed in #113. I'm only seeing two options right now:
Option 1Fixes this issue by reverting the contract back to what it was. Users of Redis 3.2 will be able to keep upgrading rack-attack 4. Users that relied on fix #118 won't be able to keep upgrading rack-attack 4. However, #118 was meant to allow this kind of code: Option 2Does not fix this issue. Users of Redis 3.2 won't be able to keep upgrading rack-attack 4. Users that relied on fix #118 won't be affected. What do you think, @grzuy ? |
There is a third option, which I've submitted as a pull request. |
Hi @ryandv, thank you very much for detailed issue report. From what I understand That said, I'll tag this |
closed by #280 |
For the record, plain |
@grzuy , I am using a config similar to the above, and am getting the same error message. I can reproduce the last four lines of the traceback in both version 4.3.0 and 5.4.0 from a rails console, as well, with the following:
Is this the expected behavior? |
OK, I get it: the correct way to interact with a "Redis" instance (vs. Redis::Store) is to use the new Rack::Attack::StoreProxy::RedisProxy class, as this class drops the fourth argument (i.e. "raw: true" that caused @ryandv's configuration above to throw the "wrong number of arguments" (see this commit) @grzuy, thanks for merging this in! Hopefully this will help any others who stumble across this issue. |
We are experiencing breakage after upgrading from
rack-attack-4.2.0
torack-attack-4.3.1
, due to what appears to be an API incompatibility withredis
:Previously, we were able to pass an instance of
Redis
from version3.2.0
of theredis
gemto
Rack::Attack
, which satisfies the version constraint provided in the README:The above configuration appears to have been recommended by others in a previous issue.
However, after this commit, it appears that the contract of
RedisStoreProxy
was changed to now depend on an instance ofRedis::Store
and notRedis
, as onlyRedis::Store
from theredis-store-1.1.5
gemsupports the fourth
raw: true
parameter introduced by the aforementioned commit.This issue has been reported previously (see #136 and #190).
It appears that
rack-attack
now depends onredis-store
extensions to the interface, which is breaking older configurations that pass a plainredis
instance. Canredis
be preserved as a valid store for theRedisStoreProxy
, to support these pre-existing configurations?Thanks!
The text was updated successfully, but these errors were encountered: