sqreen 1.21.0-java → 1.21.1-java

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
  SHA1:
3
- metadata.gz: d55430d1415f21ee90558cf45a461137b79b06a4
4
- data.tar.gz: 159b44e8ec7cd0c1409033a51121fa53166bbf4e
3
+ metadata.gz: 7da0143942d8b7ab1904204694ff425b28063c4a
4
+ data.tar.gz: 9c18ce7181ba9e6d059f7265108fa1abbc8d9c99
5
5
  SHA512:
6
- metadata.gz: b1927c86d04f84f532666a40d785d4ad8cdb7c411b17d3bd07e98e3423f9bae2ed7fe83a713ef9a6b9866021067016336d7550324006ddd59800c38939f5967c
7
- data.tar.gz: 997507ff2042ffebf01b1820d08f3d6fb8458ef3a63c086e66a3f46d009a901537cd0e26a974c01365213bef26a22138d624b79e2d573cd12e0168ad3fcea885
6
+ metadata.gz: 54eba17e83cb41dd546c16caa7543da24b72b7c2768e782a667278a0ce7d07c18cbd6477fa72f71530e0fe34cf64e1a691ed179a6c07c9d883030560791f7659
7
+ data.tar.gz: 3e716230761babffbe1abe97d18062887ea371800d98c5a6a85a92970c61b59cf7d2ca2d99f3947be54b1e6ef99ed19e557b8c39a662bdaeefaebec8e148f937
@@ -1,3 +1,7 @@
1
+ ## 1.21.1
2
+
3
+ * Work around NewRelic initialisation (see https://github.com/newrelic/newrelic-ruby-agent/issues/461)
4
+
1
5
  ## 1.21.0
2
6
 
3
7
  * Add support for transport and tracing facilities
@@ -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 defined?(NewRelic::Agent::Agent)
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}"
@@ -4,5 +4,5 @@
4
4
  # Please refer to our terms for more information: https://www.sqreen.com/terms.html
5
5
 
6
6
  module Sqreen
7
- VERSION = '1.21.0'.freeze
7
+ VERSION = '1.21.1'.freeze
8
8
  end
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.0
4
+ version: 1.21.1
5
5
  platform: java
6
6
  authors:
7
7
  - Sqreen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-25 00:00:00.000000000 Z
11
+ date: 2020-10-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement