{"action":"created","issue":{"url":"https://api.github.com/repos/kickstarter/rack-attack/issues/213","repository_url":"https://api.github.com/repos/kickstarter/rack-attack","labels_url":"https://api.github.com/repos/kickstarter/rack-attack/issues/213/labels{/name}","comments_url":"https://api.github.com/repos/kickstarter/rack-attack/issues/213/comments","events_url":"https://api.github.com/repos/kickstarter/rack-attack/issues/213/events","html_url":"https://github.com/kickstarter/rack-attack/issues/213","id":199672335,"node_id":"MDU6SXNzdWUxOTk2NzIzMzU=","number":213,"title":"rack-attack-4.3.1 RedisStoreProxy does not accept plain redis","user":{"login":"ryandv","id":4021050,"node_id":"MDQ6VXNlcjQwMjEwNTA=","avatar_url":"https://avatars2.githubusercontent.com/u/4021050?v=4","gravatar_id":"","url":"https://api.github.com/users/ryandv","html_url":"https://github.com/ryandv","followers_url":"https://api.github.com/users/ryandv/followers","following_url":"https://api.github.com/users/ryandv/following{/other_user}","gists_url":"https://api.github.com/users/ryandv/gists{/gist_id}","starred_url":"https://api.github.com/users/ryandv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ryandv/subscriptions","organizations_url":"https://api.github.com/users/ryandv/orgs","repos_url":"https://api.github.com/users/ryandv/repos","events_url":"https://api.github.com/users/ryandv/events{/privacy}","received_events_url":"https://api.github.com/users/ryandv/received_events","type":"User","site_admin":false},"labels":[{"id":872592236,"node_id":"MDU6TGFiZWw4NzI1OTIyMzY=","url":"https://api.github.com/repos/kickstarter/rack-attack/labels/area:%20cache%20store","name":"area: cache store","color":"bfd4f2","default":false},{"id":860703580,"node_id":"MDU6TGFiZWw4NjA3MDM1ODA=","url":"https://api.github.com/repos/kickstarter/rack-attack/labels/area:%20cache%20store%20-%20redis","name":"area: cache store - redis","color":"bfd4f2","default":false},{"id":10404861,"node_id":"MDU6TGFiZWwxMDQwNDg2MQ==","url":"https://api.github.com/repos/kickstarter/rack-attack/labels/type:%20feature%20request","name":"type: feature request","color":"c2e0c6","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/kickstarter/rack-attack/milestones/8","html_url":"https://github.com/kickstarter/rack-attack/milestone/8","labels_url":"https://api.github.com/repos/kickstarter/rack-attack/milestones/8/labels","id":3453746,"node_id":"MDk6TWlsZXN0b25lMzQ1Mzc0Ng==","number":8,"title":"5.4.0","description":"","creator":{"login":"grzuy","id":456459,"node_id":"MDQ6VXNlcjQ1NjQ1OQ==","avatar_url":"https://avatars0.githubusercontent.com/u/456459?v=4","gravatar_id":"","url":"https://api.github.com/users/grzuy","html_url":"https://github.com/grzuy","followers_url":"https://api.github.com/users/grzuy/followers","following_url":"https://api.github.com/users/grzuy/following{/other_user}","gists_url":"https://api.github.com/users/grzuy/gists{/gist_id}","starred_url":"https://api.github.com/users/grzuy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grzuy/subscriptions","organizations_url":"https://api.github.com/users/grzuy/orgs","repos_url":"https://api.github.com/users/grzuy/repos","events_url":"https://api.github.com/users/grzuy/events{/privacy}","received_events_url":"https://api.github.com/users/grzuy/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":2,"state":"closed","created_at":"2018-06-26T16:40:14Z","updated_at":"2018-07-02T17:33:30Z","due_on":null,"closed_at":"2018-07-02T17:33:30Z"},"comments":10,"created_at":"2017-01-09T21:52:24Z","updated_at":"2018-09-14T13:02:01Z","closed_at":"2018-06-29T20:24:46Z","author_association":"NONE","body":"We are experiencing breakage after upgrading from `rack-attack-4.2.0` to `rack-attack-4.3.1`, due to what appears to be an API incompatibility with `redis`:\r\n\r\n```\r\napp error: wrong number of arguments (4 for 3) (ArgumentError)\r\n[...]/bundled_gems/ruby/2.1.0/gems/redis-3.2.0/lib/redis.rb:689:in `setex'\r\n[...]/bundled_gems/ruby/2.1.0/gems/rack-attack-4.3.1/lib/rack/attack/store_proxy/redis_store_proxy.rb:22:in `write'\r\n[...]/bundled_gems/ruby/2.1.0/gems/rack-attack-4.3.1/lib/rack/attack/cache.rb:53:in `do_count'\r\n[...]/bundled_gems/ruby/2.1.0/gems/rack-attack-4.3.1/lib/rack/attack/cache.rb:19:in `count'\r\n[...]/bundled_gems/ruby/2.1.0/gems/rack-attack-4.3.1/lib/rack/attack/throttle.rb:27:in `[]'\r\n[...]/bundled_gems/ruby/2.1.0/gems/rack-attack-4.3.1/lib/rack/attack.rb:58:in `block in throttled?'\r\n[...]/bundled_gems/ruby/2.1.0/gems/rack-attack-4.3.1/lib/rack/attack.rb:57:in `each'\r\n[...]/bundled_gems/ruby/2.1.0/gems/rack-attack-4.3.1/lib/rack/attack.rb:57:in `any?'\r\n[...]/bundled_gems/ruby/2.1.0/gems/rack-attack-4.3.1/lib/rack/attack.rb:57:in `throttled?'\r\n[...]/bundled_gems/ruby/2.1.0/gems/rack-attack-4.3.1/lib/rack/attack.rb:102:in `call'\r\n\r\n```\r\n\r\nPreviously, we were able to pass an instance of `Redis` from version `3.2.0` of the `redis` gem\r\nto `Rack::Attack`, which satisfies the version constraint provided in the [README](https://github.com/kickstarter/rack-attack/blob/v4.3.1/README.md):\r\n\r\n```rb\r\nRack::Attack.cache.store = Rack::Attack::StoreProxy::RedisStoreProxy.new(\r\n  Redis.new(some_redis_config)\r\n)\r\n```\r\n\r\nThe above configuration appears to have been recommended by others in a previous [issue](https://github.com/kickstarter/rack-attack/issues/102#issuecomment-66176688).\r\n\r\nHowever, after [this commit](https://github.com/kickstarter/rack-attack/commit/dc1b6bf687bbb6c93a3f5b790eb9a0083a1e6bc0#diff-3d0e57d4b76fc949e3de00ea0a5bed8f), it appears that the contract of `RedisStoreProxy` was changed to now depend on an instance of `Redis::Store` and not `Redis`, as only `Redis::Store` from the `redis-store-1.1.5` gem\r\nsupports the fourth `raw: true` parameter introduced by the aforementioned commit.\r\n\r\nThis issue has been reported previously (see https://github.com/kickstarter/rack-attack/issues/136 and https://github.com/kickstarter/rack-attack/issues/190). \r\n\r\nIt appears that `rack-attack` now depends on `redis-store` extensions to the interface, which is breaking older configurations that pass a plain `redis` instance. Can `redis` be preserved as a valid store for the `RedisStoreProxy`, to support these pre-existing configurations?\r\n\r\nThanks!"},"comment":{"url":"https://api.github.com/repos/kickstarter/rack-attack/issues/comments/421351233","html_url":"https://github.com/kickstarter/rack-attack/issues/213#issuecomment-421351233","issue_url":"https://api.github.com/repos/kickstarter/rack-attack/issues/213","id":421351233,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMTM1MTIzMw==","user":{"login":"laneystroup","id":2554691,"node_id":"MDQ6VXNlcjI1NTQ2OTE=","avatar_url":"https://avatars1.githubusercontent.com/u/2554691?v=4","gravatar_id":"","url":"https://api.github.com/users/laneystroup","html_url":"https://github.com/laneystroup","followers_url":"https://api.github.com/users/laneystroup/followers","following_url":"https://api.github.com/users/laneystroup/following{/other_user}","gists_url":"https://api.github.com/users/laneystroup/gists{/gist_id}","starred_url":"https://api.github.com/users/laneystroup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/laneystroup/subscriptions","organizations_url":"https://api.github.com/users/laneystroup/orgs","repos_url":"https://api.github.com/users/laneystroup/repos","events_url":"https://api.github.com/users/laneystroup/events{/privacy}","received_events_url":"https://api.github.com/users/laneystroup/received_events","type":"User","site_admin":false},"created_at":"2018-09-14T13:02:01Z","updated_at":"2018-09-14T13:02:01Z","author_association":"NONE","body":"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 causes the original configuration above to throw the \"wrong number of arguments\" (see [this commit](https://github.com/kickstarter/rack-attack/commits/0f6ef47683c4dbcabc94007391e3900f214c8e7d))\r\n\r\n@grzuy, thanks for merging this in! Hopefully this will help any others who stumble across this issue."}}
{"actor":{"display_login":"laneystroup"}}