wafris 2.0.4 → 2.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/wafris/middleware.rb +8 -4
- data/lib/wafris/version.rb +1 -1
- metadata +18 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0526847233d7c6d16c4c437e3e76027820b992e2a2973742d375b75f482d3597'
|
4
|
+
data.tar.gz: 39b2d2396ce30df2cd1705fe1b9716d1e8f39e41acd5efbc0d825da026c3e548
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6beef692dfedb3bb7d59c78467f8203e72b1dc437f6f9c72ea1f4ef91f4bbc85fbea253a84d3225a437b3094343829c14599d4cab3a3fbcc58f56bf05542237d
|
7
|
+
data.tar.gz: bcea98d516104532ac58875f408969e207e221abe3658b9c0ab07f90d6132dbb0e3145d8e17c99621c702257fd7badfbd999493f86ff73429b7640268f644494
|
data/lib/wafris/middleware.rb
CHANGED
@@ -4,16 +4,20 @@ module Wafris
|
|
4
4
|
class Middleware
|
5
5
|
def initialize(app)
|
6
6
|
@app = app
|
7
|
+
@notifier = ActiveSupport::Notifications if defined?(ActiveSupport::Notifications)
|
7
8
|
ProxyFilter.set_filter
|
8
9
|
end
|
9
10
|
|
10
11
|
def call(env)
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
WafrisRequest.new(request, env)
|
12
|
+
wafris_request = WafrisRequest.new(
|
13
|
+
Rack::Request.new(env),
|
14
|
+
env
|
15
15
|
)
|
16
16
|
|
17
|
+
treatment = Wafris.evaluate(wafris_request)
|
18
|
+
|
19
|
+
@notifier&.instrument("#{treatment}.wafris", request: wafris_request, treatment: treatment)
|
20
|
+
|
17
21
|
# These values match what the client tests expect (200, 404, 403, 500)
|
18
22
|
if treatment == "Allowed" || treatment == "Passed"
|
19
23
|
@app.call(env)
|
data/lib/wafris/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wafris
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Buckbee
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2024-10-
|
12
|
+
date: 2024-10-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rack
|
@@ -45,14 +45,14 @@ dependencies:
|
|
45
45
|
requirements:
|
46
46
|
- - ">="
|
47
47
|
- !ruby/object:Gem::Version
|
48
|
-
version:
|
48
|
+
version: 0.21.0
|
49
49
|
type: :runtime
|
50
50
|
prerelease: false
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
53
|
- - ">="
|
54
54
|
- !ruby/object:Gem::Version
|
55
|
-
version:
|
55
|
+
version: 0.21.0
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
57
|
name: ipaddr
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
@@ -81,6 +81,20 @@ dependencies:
|
|
81
81
|
- - ">="
|
82
82
|
- !ruby/object:Gem::Version
|
83
83
|
version: '0'
|
84
|
+
- !ruby/object:Gem::Dependency
|
85
|
+
name: debug
|
86
|
+
requirement: !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
88
|
+
- - ">="
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: 1.0.0
|
91
|
+
type: :development
|
92
|
+
prerelease: false
|
93
|
+
version_requirements: !ruby/object:Gem::Requirement
|
94
|
+
requirements:
|
95
|
+
- - ">="
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: 1.0.0
|
84
98
|
- !ruby/object:Gem::Dependency
|
85
99
|
name: minitest
|
86
100
|
requirement: !ruby/object:Gem::Requirement
|