rack-attack 6.2.1 → 6.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rack/attack/store_proxy/redis_proxy.rb +2 -6
- data/lib/rack/attack/version.rb +1 -1
- data/spec/integration/offline_spec.rb +12 -0
- metadata +31 -32
- data/bin/setup +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5479926deb14a57eebadf44bc0450c119c10c57844e6e887a6536a0dd79ddcc3
|
4
|
+
data.tar.gz: a7c6d3162887c8d7e29b7ba390c281be9757c7f9a022c7e705e2029f3d51d091
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ff52d16e17933058af32dbe0aeeb704914fb28331f9df3b2bd90fc1820f32f7cd60c9f254506fea6bf1845f850fa72f77dff57fb4a5ecaf4ce619497688bb00
|
7
|
+
data.tar.gz: 6f9a3f5adfddc7cd55274c24a7c9a4ff5e498324421abd3ef43cc5707f478a79824c0a5fb14d2a189128a22f42ffc1b144e06bd3bfbfb9e35de60f406edf6793
|
@@ -31,16 +31,12 @@ module Rack
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def increment(key, amount, options = {})
|
34
|
-
count = nil
|
35
|
-
|
36
34
|
rescuing do
|
37
35
|
pipelined do
|
38
|
-
|
36
|
+
incrby(key, amount)
|
39
37
|
expire(key, options[:expires_in]) if options[:expires_in]
|
40
|
-
end
|
38
|
+
end.first
|
41
39
|
end
|
42
|
-
|
43
|
-
count.value if count
|
44
40
|
end
|
45
41
|
|
46
42
|
def delete(key, _options = {})
|
data/lib/rack/attack/version.rb
CHANGED
@@ -45,3 +45,15 @@ if defined?(::Dalli)
|
|
45
45
|
end
|
46
46
|
end
|
47
47
|
end
|
48
|
+
|
49
|
+
if defined?(Redis)
|
50
|
+
describe 'when Redis is offline' do
|
51
|
+
include OfflineExamples
|
52
|
+
|
53
|
+
before do
|
54
|
+
@cache = Rack::Attack::Cache.new
|
55
|
+
# Use presumably unused port for Redis client
|
56
|
+
@cache.store = Redis.new(host: '127.0.0.1', port: 3333)
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-attack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.2.
|
4
|
+
version: 6.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aaron Suggs
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-12-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|
@@ -204,7 +204,6 @@ extra_rdoc_files: []
|
|
204
204
|
files:
|
205
205
|
- README.md
|
206
206
|
- Rakefile
|
207
|
-
- bin/setup
|
208
207
|
- lib/rack/attack.rb
|
209
208
|
- lib/rack/attack/allow2ban.rb
|
210
209
|
- lib/rack/attack/blocklist.rb
|
@@ -290,50 +289,50 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
290
289
|
- !ruby/object:Gem::Version
|
291
290
|
version: '0'
|
292
291
|
requirements: []
|
293
|
-
rubygems_version: 3.
|
292
|
+
rubygems_version: 3.1.1
|
294
293
|
signing_key:
|
295
294
|
specification_version: 4
|
296
295
|
summary: Block & throttle abusive requests
|
297
296
|
test_files:
|
297
|
+
- spec/rack_attack_spec.rb
|
298
|
+
- spec/fail2ban_spec.rb
|
299
|
+
- spec/allow2ban_spec.rb
|
300
|
+
- spec/support/cache_store_helper.rb
|
301
|
+
- spec/rack_attack_instrumentation_spec.rb
|
302
|
+
- spec/rack_attack_throttle_spec.rb
|
298
303
|
- spec/integration/offline_spec.rb
|
299
|
-
- spec/
|
300
|
-
- spec/acceptance/
|
304
|
+
- spec/rack_attack_dalli_proxy_spec.rb
|
305
|
+
- spec/acceptance/fail2ban_spec.rb
|
306
|
+
- spec/acceptance/allow2ban_spec.rb
|
301
307
|
- spec/acceptance/rails_middleware_spec.rb
|
308
|
+
- spec/acceptance/throttling_spec.rb
|
302
309
|
- spec/acceptance/track_throttle_spec.rb
|
303
|
-
- spec/acceptance/cache_store_config_for_fail2ban_spec.rb
|
304
|
-
- spec/acceptance/cache_store_config_with_rails_spec.rb
|
305
|
-
- spec/acceptance/cache_store_config_for_allow2ban_spec.rb
|
306
|
-
- spec/acceptance/safelisting_ip_spec.rb
|
307
|
-
- spec/acceptance/track_spec.rb
|
308
310
|
- spec/acceptance/blocking_subnet_spec.rb
|
309
311
|
- spec/acceptance/blocking_ip_spec.rb
|
310
|
-
- spec/acceptance/
|
311
|
-
- spec/acceptance/
|
312
|
-
- spec/acceptance/
|
313
|
-
- spec/acceptance/customizing_throttled_response_spec.rb
|
312
|
+
- spec/acceptance/cache_store_config_with_rails_spec.rb
|
313
|
+
- spec/acceptance/cache_store_config_for_fail2ban_spec.rb
|
314
|
+
- spec/acceptance/safelisting_subnet_spec.rb
|
314
315
|
- spec/acceptance/extending_request_object_spec.rb
|
315
316
|
- spec/acceptance/safelisting_spec.rb
|
317
|
+
- spec/acceptance/customizing_throttled_response_spec.rb
|
318
|
+
- spec/acceptance/safelisting_ip_spec.rb
|
319
|
+
- spec/acceptance/cache_store_config_for_allow2ban_spec.rb
|
320
|
+
- spec/acceptance/customizing_blocked_response_spec.rb
|
316
321
|
- spec/acceptance/cache_store_config_for_throttle_spec.rb
|
317
|
-
- spec/acceptance/
|
318
|
-
- spec/acceptance/stores/
|
319
|
-
- spec/acceptance/stores/active_support_redis_cache_store_spec.rb
|
320
|
-
- spec/acceptance/stores/active_support_memory_store_spec.rb
|
321
|
-
- spec/acceptance/stores/active_support_redis_store_spec.rb
|
322
|
-
- spec/acceptance/stores/active_support_mem_cache_store_spec.rb
|
322
|
+
- spec/acceptance/blocking_spec.rb
|
323
|
+
- spec/acceptance/stores/redis_spec.rb
|
323
324
|
- spec/acceptance/stores/active_support_redis_cache_store_pooled_spec.rb
|
325
|
+
- spec/acceptance/stores/active_support_memory_store_spec.rb
|
324
326
|
- spec/acceptance/stores/connection_pool_dalli_client_spec.rb
|
327
|
+
- spec/acceptance/stores/active_support_redis_cache_store_spec.rb
|
325
328
|
- spec/acceptance/stores/active_support_dalli_store_spec.rb
|
326
|
-
- spec/acceptance/stores/
|
329
|
+
- spec/acceptance/stores/active_support_mem_cache_store_pooled_spec.rb
|
330
|
+
- spec/acceptance/stores/active_support_mem_cache_store_spec.rb
|
327
331
|
- spec/acceptance/stores/dalli_client_spec.rb
|
328
|
-
- spec/acceptance/stores/
|
329
|
-
- spec/acceptance/
|
330
|
-
- spec/
|
331
|
-
- spec/
|
332
|
-
- spec/rack_attack_instrumentation_spec.rb
|
333
|
-
- spec/rack_attack_dalli_proxy_spec.rb
|
334
|
-
- spec/rack_attack_spec.rb
|
335
|
-
- spec/rack_attack_throttle_spec.rb
|
332
|
+
- spec/acceptance/stores/redis_store_spec.rb
|
333
|
+
- spec/acceptance/stores/active_support_redis_store_spec.rb
|
334
|
+
- spec/acceptance/track_spec.rb
|
335
|
+
- spec/rack_attack_path_normalizer_spec.rb
|
336
336
|
- spec/rack_attack_request_spec.rb
|
337
|
-
- spec/fail2ban_spec.rb
|
338
337
|
- spec/rack_attack_track_spec.rb
|
339
|
-
- spec/
|
338
|
+
- spec/spec_helper.rb
|