rack-attack 6.3.0 → 6.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cba47e380843d184fd3df1af08b252aca3fc2411de7ccbd62a9b7da6ee933b72
4
- data.tar.gz: 0dc5300a553830ca7e1cfa84de814fd743e608b9ec0140fd6b1145c421085ba7
3
+ metadata.gz: 3735d065000def3fce68a51f86fd46eec60d8ce8aac80991bd4c1fd05cf2babd
4
+ data.tar.gz: def7883dbc56f61163d54104e6a9b1aa87a93f47cdfefe60bb81880a7237aa8b
5
5
  SHA512:
6
- metadata.gz: 71fd5eace9c851dab06317f3f4f4f28a2cbc20dd20c663228fbd073a052b4f30c4de87a06109ce9cf6b7395fc547b0c99b6f4e579285a699be40a93a9511452f
7
- data.tar.gz: 5139f0be932f94273dba2d8d59ccbcb0e14ca92656b68d126099a124f04160c2c426e72f330b9e3c5dd8ed560f2fb292aa68dde2c32f2238d36c8c7e95422d01
6
+ metadata.gz: 4c40ef6a1a7f2c1692b5bf3c46cb4f7e25bec5f413c9f96ee8b37b62e67b9f2e31e3c8067c9ecf19af4be16bbc01e016a3921052ed08c42c8a72b8a7696653e1
7
+ data.tar.gz: 3bb4d54e791d056a5e905e72b325a1eb733a6f3b660601f4d4ac39aa1b46cf480879bfae72575ce8ed8420961166ef3273cbe3590f60efa552946fbfb20cd7c2
data/README.md CHANGED
@@ -37,6 +37,7 @@ See the [Backing & Hacking blog post](https://www.kickstarter.com/backing-and-ha
37
37
  - [Customizing responses](#customizing-responses)
38
38
  - [RateLimit headers for well-behaved clients](#ratelimit-headers-for-well-behaved-clients)
39
39
  - [Logging & Instrumentation](#logging--instrumentation)
40
+ - [Testing](#testing)
40
41
  - [How it works](#how-it-works)
41
42
  - [About Tracks](#about-tracks)
42
43
  - [Testing](#testing)
@@ -398,6 +399,16 @@ ActiveSupport::Notifications.subscribe(/rack_attack/) do |name, start, finish, r
398
399
  end
399
400
  ```
400
401
 
402
+ ## Testing
403
+
404
+ ### Disabling
405
+
406
+ `Rack::Attack.enabled = false` can be used to either completely disable Rack::Attack in your tests, or to disable/enable for specific test cases only.
407
+
408
+ ### Test case isolation
409
+
410
+ `Rack::Attack.reset!` can be used in your test suite to clear any Rack::Attack state between different test cases.
411
+
401
412
  ## How it works
402
413
 
403
414
  The Rack::Attack middleware compares each request against *safelists*, *blocklists*, *throttles*, and *tracks* that you define. There are none by default.
@@ -24,6 +24,10 @@ module Rack
24
24
  end
25
25
  end
26
26
 
27
+ def read(name, options = {})
28
+ super(name, options.merge!(raw: true))
29
+ end
30
+
27
31
  def write(name, value, options = {})
28
32
  super(name, value, options.merge!(raw: true))
29
33
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Rack
4
4
  class Attack
5
- VERSION = '6.3.0'
5
+ VERSION = '6.3.1'
6
6
  end
7
7
  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.3.0
4
+ version: 6.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Suggs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-26 00:00:00.000000000 Z
11
+ date: 2020-05-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
@@ -291,7 +291,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
291
291
  - !ruby/object:Gem::Version
292
292
  version: '0'
293
293
  requirements: []
294
- rubygems_version: 3.1.2
294
+ rubygems_version: 3.1.3
295
295
  signing_key:
296
296
  specification_version: 4
297
297
  summary: Block & throttle abusive requests