Tags: TylerRick/rack_attack_admin
Tags
Make it work when Rack::Attack.cache.store is set to an instance of A… …ctiveSupport::Cache::RedisCacheStore (from rails) Before it was only tested with cache.store set to an instance of Redis::Store from redis-store gem. (Used by ActiveSupport::Cache::RedisStore (from redis-activesupport gem)) Resolves error: undefined method `keys' for #<Rack::Attack::StoreProxy::RedisCacheStoreProxy> It is still recommended to use Redis::Store though, especially if using a namespace, because its `keys` method automatically strips out the namespace, whereas when Redis#keys (used by ActiveSupport::Cache::RedisCacheStore) does not.
discard: strip namespace instead, use redis-store
discard: strip namespace instead, use redis-store
Include cache store namespace as part of prefix I don't think the namespace was part of the actual key when you specified a namespace with ActiveSupport::Cache::RedisStore (from redis-rails), but with ActiveSupport::Cache::RedisCacheStore (from rails), it very unfortunately is adding the namespace as part of the key, which means we have to include it when filtering keys or unprefixing key.
PreviousNext