sqreen 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: bdd2b054367e611564274927940b2cbc1f7d52c160b6288079a839da5a07c73a
4
- data.tar.gz: 163fa3ce8ae72fe25635c1943eea48d00e5f54b6dfd222f66051ce2032f5763d
3
+ metadata.gz: 6bae9742df8ac58f676ca59e60ab6570b34e5eb0d047d5cf92a54de5a3ad5e49
4
+ data.tar.gz: 1be42ec423e7ed92db41b14fdf3acb3827bdaa0ad0d66b9282a0d2a5ccf9bdfc
5
5
  SHA512:
6
- metadata.gz: 6b142290e1c3f3f20d9a5a37da34c906f8ad3f3da4328d16f9354a9ba15bec6e0f9997eeb9837b6584fb6bf0e58f0118b2b38ac2c58641a2df376131373607b2
7
- data.tar.gz: 2f8e8d35f50b9f4f1ef79fa7a7c695b3e816be16c422a65b21e55649991ecbd20a3f2781b891533af107e4027615f62368d609545e6a258e02b397511e0b910b
6
+ metadata.gz: 128229a04099d1e02ebc6170417f1e029831f0c4fb5396746702d212671b021632b63121059db8e742ba065e8266a426a016907b85fb3348c370664ae69bd096
7
+ data.tar.gz: 5576e98b242e0f1a117289a11f49ac486b49e34d04aafa325e237cf4f231e96aa903140aadfb712b454f38f33adb8a7a4335245fdd6a60d91decc8a7ad1174f4
@@ -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
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