mirror of
https://github.com/samsonjs/rack-attack.git
synced 2026-03-25 09:25:49 +00:00
21 lines
433 B
Ruby
21 lines
433 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Rack
|
|
class Attack
|
|
module StoreProxy
|
|
PROXIES = [
|
|
DalliProxy,
|
|
MemCacheStoreProxy,
|
|
RedisStoreProxy,
|
|
RedisProxy,
|
|
RedisCacheStoreProxy,
|
|
ActiveSupportRedisStoreProxy
|
|
].freeze
|
|
|
|
def self.build(store)
|
|
klass = PROXIES.find { |proxy| proxy.handle?(store) }
|
|
klass ? klass.new(store) : store
|
|
end
|
|
end
|
|
end
|
|
end
|