sqreen-alt 1.10.4 → 1.10.5

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: 108f6d9415e8b862b6ef5cc4648caaa8076ed43656b9615ba20271797fb3727f
4
- data.tar.gz: eed9b5aaa1e04b51f8916d08d55ae0269bbfe4db6ad8dfd987152baa35bbb30e
3
+ metadata.gz: 8a4975dc5339714706fc3d1824334be01f31540056b5600c86f271efc5018d2d
4
+ data.tar.gz: 214bf815ec5796b22b31be9d4fb019c084056e5afe354168b9c92ca9354614a7
5
5
  SHA512:
6
- metadata.gz: cbad8b759a30845212a46e136c7a3c7d94ab16855679f292859a404cbeacd8a508d9b6c67c0083083e3092b970779c17f8da87afea97c49099c93509b75b91dd
7
- data.tar.gz: b22f651949de69a085170e4381827d6ed2b7425315939f0fd7ac528ab82a239e1ad77f72c8c35c0b110cf9e4b5d3b9c2c6cef17ecf96284719e3eeb36f123e56
6
+ metadata.gz: d0e41e8615f24bf5dfc3295042911adfbf6e5af51ee7b61f462436b685ad3afcd3a642fd1777d1c5d6060e1223f3feba84bb9b3d1189af96a12780099ddd5d5c
7
+ data.tar.gz: 66dd7c02b7f0de073cd62a2dad7f3f18f2c3a7c22251ff54eb26b1021ab62213a9494f5c0cb18e621e8b60e8c711d281de17a25d349363561ffd0f2ec9730250
@@ -41,32 +41,28 @@ module Sqreen
41
41
  def get(klass, method, type = nil)
42
42
  k = @by_class[klass]
43
43
  unless k
44
- log(format('Error: no cb registered for class %s (%s)', klass.inspect, klass.class))
45
- log(inspect)
44
+ Sqreen.log.debug { format('Error: no cb registered for class %s (%s)', klass.inspect, klass.class) }
45
+ Sqreen.log.debug { inspect }
46
46
  return []
47
47
  end
48
48
  cbs = k[method]
49
49
  unless cbs
50
- log(format('Error: no cbs registered for method %s.%s', klass, method))
51
- log(inspect)
50
+ Sqreen.log.debug { format('Error: no cbs registered for method %s.%s', klass, method) }
51
+ Sqreen.log.debug { log(inspect) }
52
52
  return []
53
53
  end
54
54
 
55
- if type.nil?
56
- res = Set.new
57
- cbs.values.each do |v|
58
- res += v
59
- end
60
- return res.to_a
61
- else
62
- return cbs[type]
63
- end
55
+ return cbs[type] unless type.nil?
56
+
57
+ res = Set.new
58
+ cbs.each_value { |v| res += v }
59
+ res.to_a
64
60
  end
65
61
 
66
62
  def each
67
- @by_class.each do |_klass, values|
68
- values.each do |_method, cbs|
69
- cbs.values.each do |cb_ary|
63
+ @by_class.each_value do |values|
64
+ values.each_value do |cbs|
65
+ cbs.each_value do |cb_ary|
70
66
  cb_ary.each do |cb|
71
67
  yield cb
72
68
  end
@@ -104,6 +104,7 @@ module Sqreen
104
104
 
105
105
  # SQREEN-880 - prevent Sqreen startup on Sidekiq workers
106
106
  return :sidekiq_cli if defined?(Sidekiq::CLI)
107
+ return :delayed_job if defined?(Delayed::Command)
107
108
 
108
109
  # Prevent Sqreen startup on rake tasks - unless this is a Sqreen test
109
110
  return :rake if !run_in_test && $0.end_with?('rake')
@@ -9,6 +9,7 @@ module Sqreen
9
9
  module Rules
10
10
  # Callback that match on a list or matcher+binding accessor
11
11
  class BindingAccessorMatcherCB < RuleCB
12
+ MAX_LENGTH = 1024 * 128
12
13
  attr_reader :rules
13
14
 
14
15
  # matcher on one elem
@@ -58,6 +59,7 @@ module Sqreen
58
59
  next if val.respond_to?(:seek)
59
60
  val.each do |v|
60
61
  next if !v.is_a?(String) || (!matcher.min_size.nil? && v.size < matcher.min_size)
62
+ next if v.size > MAX_LENGTH
61
63
  next if matcher.match(v).nil?
62
64
  infos = {
63
65
  'id' => id,
@@ -1,5 +1,5 @@
1
1
  # Copyright (c) 2015 Sqreen. All Rights Reserved.
2
2
  # Please refer to our terms for more information: https://www.sqreen.io/terms.html
3
3
  module Sqreen
4
- VERSION = '1.10.4'.freeze
4
+ VERSION = '1.10.5'.freeze
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sqreen-alt
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.10.4
4
+ version: 1.10.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sqreen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-02-20 00:00:00.000000000 Z
11
+ date: 2018-02-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: execjs