sqreen 1.21.0 → 1.21.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/sqreen/dependency/detector.rb +11 -3
- data/lib/sqreen/dependency/new_relic.rb +10 -1
- data/lib/sqreen/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6611caf7add24e05a248fce4026be48a4c47612335c5fc9a26c64c33cd0409e9
|
4
|
+
data.tar.gz: 8381eba611e37df32a8744848661bcf144eaffe00c818e306355508fe0267394
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 65c820c306961ed812360c2c73a1f37396433238cff8fd79e2676132d7842eaa86d3555bf860d7c2f6fd465783f8c1aeb59100c94349b8c53588d83513265d2e
|
7
|
+
data.tar.gz: 38cda532df6f1037ac243c8cd5ccaecd708b880ff377d3fcbcecad329be184d40ec9f27deb61b69124be3d37ff74a16f88a7ab1032a6e6a0f6b5387645181027
|
data/CHANGELOG.md
CHANGED
@@ -25,6 +25,14 @@ module Sqreen
|
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
|
+
def to_app_hook_strategy
|
29
|
+
if Sqreen::Dependency::NewRelic.bundled? || Sqreen::Dependency::NewRelic.required?
|
30
|
+
:chain
|
31
|
+
else
|
32
|
+
:prepend
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
28
36
|
def hook(&block)
|
29
37
|
Sqreen.log.debug "[#{Process.pid}] Startup command: #{$0}"
|
30
38
|
|
@@ -34,7 +42,7 @@ module Sqreen
|
|
34
42
|
Sqreen::Dependency::Rails.insert_sqreen_middlewares
|
35
43
|
end if Sqreen::Dependency::Rails.required?
|
36
44
|
|
37
|
-
Sqreen::Graft::Hook.add('Rack::Builder#to_app') do
|
45
|
+
Sqreen::Graft::Hook.add('Rack::Builder#to_app', to_app_hook_strategy) do
|
38
46
|
after do
|
39
47
|
Sqreen::Dependency::Rails.inspect_middlewares
|
40
48
|
end
|
@@ -48,7 +56,7 @@ module Sqreen
|
|
48
56
|
end
|
49
57
|
end.install if Sqreen::Dependency::Sinatra.required?
|
50
58
|
|
51
|
-
Sqreen::Graft::Hook.add('Rack::Builder#to_app') do
|
59
|
+
Sqreen::Graft::Hook.add('Rack::Builder#to_app', to_app_hook_strategy) do
|
52
60
|
after do |call|
|
53
61
|
builder = call.instance
|
54
62
|
|
@@ -58,7 +66,7 @@ module Sqreen
|
|
58
66
|
|
59
67
|
# ensure startup of thread in request handling processes
|
60
68
|
|
61
|
-
Sqreen::Graft::Hook.add('Rack::Builder#to_app') do
|
69
|
+
Sqreen::Graft::Hook.add('Rack::Builder#to_app', to_app_hook_strategy) do
|
62
70
|
after do |call|
|
63
71
|
callback = call.callback
|
64
72
|
|
@@ -8,8 +8,17 @@ module Sqreen
|
|
8
8
|
module NewRelic
|
9
9
|
module_function
|
10
10
|
|
11
|
+
def bundled?
|
12
|
+
defined?(Gem) && Gem.respond_to?(:loaded_specs) && !Gem.loaded_specs['newrelic_rpm'].nil?
|
13
|
+
end
|
14
|
+
|
15
|
+
def required?
|
16
|
+
Sqreen::Dependency.const_exist?('NewRelic::Agent::Agent')
|
17
|
+
end
|
18
|
+
|
11
19
|
def ignore_sqreen_exceptions
|
12
|
-
return unless
|
20
|
+
return unless required?
|
21
|
+
|
13
22
|
NewRelic::Agent::Agent.instance.error_collector.ignore(['Sqreen::AttackBlocked'])
|
14
23
|
rescue ::Exception => e # rubocop:disable Lint/RescueException
|
15
24
|
Sqreen.log.warn "Failed ignoring AttackBlocked on NewRelic: #{e.inspect}"
|
data/lib/sqreen/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sqreen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.21.
|
4
|
+
version: 1.21.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sqreen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-10-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sqreen-backport
|