rack-dedos 0.4.2 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 13b363d6e2ef672affc0c451da8b7209cba8dcf99922ecf4ee852df9f72f2427
4
- data.tar.gz: ccd78d96fd078ecb549778809abc85cc8063d0ec0018fa111484e4571158751b
3
+ metadata.gz: ec975fa6b00c228589811832180fae90d61ba898ef4b08881c9f7897d06ee4d1
4
+ data.tar.gz: 51d214aa83afb5fb9c3d1397be8ef7ba35c26bf9dfc77a0dd1d9ea3b69864558
5
5
  SHA512:
6
- metadata.gz: 21cc53bde60003177c38cf0db3ea19b83a6cd47ca4b23cc0d3b40fac43e13b141b8d4186eef7fc6feecde39a9733fa5af621ba4cad1521d381c25166d2dc251d
7
- data.tar.gz: 1976ab0c669f8e222759251a45e502b2e7e62419bdfef21e7f184bb58dd7d23088a03e9ea3ab4fde20b70b1d651161923e448d9ed98ae14f1edb702098ebd5aa
6
+ metadata.gz: 20594ffae8646abd32f009a6bf203cc464720489e60885e1ebd60e60054c84c0ad0563c3f50dc7e248277bbc239db8592c699faf1e5c395f71572da4ef08ff78
7
+ data.tar.gz: 859501a8bb90c6823c413b4bc30bb597491699eb009820e9d61875eee15e4e4f970225bd66b8206cd81c78f24fa8f1cd97a355b070222dee78db0e7543833290
data/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  Nothing so far
4
4
 
5
+ ## 0.5.0
6
+
7
+ ### Changes
8
+ * Update to Ruby 4.0
9
+ * Require Minitest >= 6
10
+
5
11
  ## 0.4.2
6
12
 
7
13
  ### Changes
data/README.md CHANGED
@@ -94,11 +94,11 @@ Given the drastic nature of the filters, you should use this middleware for prod
94
94
 
95
95
  ### Request
96
96
 
97
- By default, filters are applied to all request paths. You can norrow this to only certain request paths:
97
+ By default, filters are applied to all request paths. You can norrow this to only certain matching request paths:
98
98
 
99
99
  ```ruby
100
100
  use Rack::Dedos,
101
- only_paths: [%r(^/search), %r(%r(\.xml)$)]
101
+ only_paths: [%r(^/search), %r(\.xml$)]
102
102
 
103
103
  use Rack::Dedos,
104
104
  except_paths: [%r(^/$)]
@@ -30,7 +30,7 @@ module Rack
30
30
  if !apply?(request) || allowed?(request, ip)
31
31
  app.call(env)
32
32
  else
33
- message = "rack-dedos: request #{request.path} from #{ip} blocked by #{self.class}"
33
+ message = "rack-dedos: request #{request.path} from #{ip} blocked by #{name}"
34
34
  warn([message, details].compact.join(": "))
35
35
  [options[:status], { 'Content-Type' => 'text/plain' }, [options[:text]]]
36
36
  end
@@ -7,6 +7,10 @@ module Rack
7
7
  module Filters
8
8
  class Country < Base
9
9
 
10
+ def name
11
+ :country
12
+ end
13
+
10
14
  # @option options [String] :maxmind_db_file MaxMind database file
11
15
  # @option options [Symbol, Array<Symbol>] :allowed_countries ISO 3166-1 alpha 2
12
16
  # @option options [Symbol, Array<Symbol>] :denied_countries ISO 3166-1 alpha 2
@@ -5,6 +5,10 @@ module Rack
5
5
  module Filters
6
6
  class UserAgent < Base
7
7
 
8
+ def name
9
+ :user_agent
10
+ end
11
+
8
12
  # @option options [String] :cache_url URL of the cache backend
9
13
  # @option options [Integer] :cache_period how long to retain cached IP
10
14
  # addresses in seconds (default: 900)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Rack
4
4
  module Dedos
5
- VERSION = "0.4.2"
5
+ VERSION = "0.5.0"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-dedos
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sven Schwyn
@@ -85,16 +85,16 @@ dependencies:
85
85
  requirements:
86
86
  - - ">="
87
87
  - !ruby/object:Gem::Version
88
- version: '0'
88
+ version: 6.0.0
89
89
  type: :development
90
90
  prerelease: false
91
91
  version_requirements: !ruby/object:Gem::Requirement
92
92
  requirements:
93
93
  - - ">="
94
94
  - !ruby/object:Gem::Version
95
- version: '0'
95
+ version: 6.0.0
96
96
  - !ruby/object:Gem::Dependency
97
- name: minitest-flash
97
+ name: minitest-mock
98
98
  requirement: !ruby/object:Gem::Requirement
99
99
  requirements:
100
100
  - - ">="
@@ -108,7 +108,7 @@ dependencies:
108
108
  - !ruby/object:Gem::Version
109
109
  version: '0'
110
110
  - !ruby/object:Gem::Dependency
111
- name: minitest-focus
111
+ name: minitest-flash
112
112
  requirement: !ruby/object:Gem::Requirement
113
113
  requirements:
114
114
  - - ">="
@@ -223,7 +223,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
223
223
  - !ruby/object:Gem::Version
224
224
  version: '0'
225
225
  requirements: []
226
- rubygems_version: 3.6.9
226
+ rubygems_version: 4.0.3
227
227
  specification_version: 4
228
228
  summary: Radical filters to block denial-of-service (DoS) requests.
229
229
  test_files: []