sqreen 1.18.3 → 1.18.4

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: f332381788705ff90de8cf2f0b3955ace893140821e77ba7cb4d07c2f1e0c06f
4
- data.tar.gz: 8553b7fc6cfc0f363599518b95ca78142ec21b6c85d34c68b106129a196f3a68
3
+ metadata.gz: c45fb1ef0cc0144c31a590a99efd24dc36224425e3eaa03702d7f04337437c80
4
+ data.tar.gz: 6d0c44ddafa3547a74ffdbd1123d9f17d33a54699203baa7f4cbec91a3fd5bc3
5
5
  SHA512:
6
- metadata.gz: 35640b7a9a1bcebec2db55feaf2df1b79ed0cba99c1f39b3427a8383b25bf4f61172ca71ba9700eb37c85f9194467179913fb690beb8bec0e7db0a5426258f7c
7
- data.tar.gz: fca777b7585ed34bcd8a9f8c4a0f4708b0ece8e0a9c81bdbb2c33f9bc3814b09027462af6697c4578f5751b77be8822df5c075ef5e5ead082ee656f10c743e87
6
+ metadata.gz: b6104a3ec75fce7d9e4bfc5c75a106f536dcaa103c7350560713aae37820baead05d81f037d56133a5913620004f46611addf61bfe76a4868ac9407ba5b5d56f
7
+ data.tar.gz: f11adaa346fe2296289483c7d958a9ab7f67aebd01a22c8848f77fbb0d79dec2f9088f346d30a712472b2d4e783ea3cc7da66cb4944341419434bb4ef363ca99
@@ -1,3 +1,9 @@
1
+ ## 1.18.4
2
+
3
+ * Fix instrumentation conflict when a class defines a send method
4
+ * Fix compatibility with Sorbet type checker
5
+ * Improve WAF time budget handling
6
+
1
7
  ## 1.18.3
2
8
 
3
9
  * Improve PII protection
@@ -1,3 +1,5 @@
1
+ # typed: ignore
2
+
1
3
  # Copyright (c) 2015 Sqreen. All Rights Reserved.
2
4
  # Please refer to our terms for more information: https://www.sqreen.com/terms.html
3
5
 
@@ -237,7 +237,7 @@ module Sqreen
237
237
  key = [method]
238
238
  args.each { |e| key.push(e.object_id) }
239
239
  if key && @sqreen_multi_instr && @sqreen_multi_instr[instance.object_id].member?(key)
240
- return instance.send(original_method, *args, &block)
240
+ return instance.__send__(original_method, *args, &block)
241
241
  end
242
242
  @sqreen_multi_instr ||= Hash.new { |h, k| h[k] = Set.new } # TODO: this should probably be a thread local
243
243
  @sqreen_multi_instr[instance.object_id].add(key)
@@ -273,7 +273,7 @@ module Sqreen
273
273
  skip_call = true
274
274
  end
275
275
  # If we are already overbudget let's not work at all
276
- return send(original_meth, *args, &block) if skip_call
276
+ return __send__(original_meth, *args, &block) if skip_call
277
277
  Instrumentation.guard_multi_call(self, meth, original_meth, args, block) do
278
278
  precbs, postcbs, failcbs = Instrumentation.callbacks.get(klass_name, meth)
279
279
  Thread.current[:sqreen_in_use] = true
@@ -328,7 +328,7 @@ module Sqreen
328
328
  Thread.current[:sqreen_in_use] = false
329
329
  return result if skip
330
330
  begin
331
- result = send(original_meth, *args, &block)
331
+ result = __send__(original_meth, *args, &block)
332
332
  rescue StandardError => e
333
333
  Thread.current[:sqreen_in_use] = true
334
334
  budget = Sqreen.performance_budget && framework && framework.remaining_perf_budget
@@ -401,7 +401,7 @@ module Sqreen
401
401
  Sqreen::PerformanceNotifications::BinnedMetrics.start_request if has_notifications
402
402
 
403
403
  begin
404
- send(original_meth, *args, &block)
404
+ __send__(original_meth, *args, &block)
405
405
  ensure
406
406
  if has_notifications
407
407
  Sqreen::PerformanceNotifications.instrument('next_req_notifs', PRE_CB) do
@@ -437,7 +437,7 @@ module Sqreen
437
437
  end
438
438
 
439
439
  alias_method original, new_method
440
- send(method_kind, original)
440
+ __send__(method_kind, original)
441
441
  private saved_meth_name
442
442
  end
443
443
  end
@@ -456,7 +456,7 @@ module Sqreen
456
456
  method_kind = :private
457
457
  end
458
458
  alias_method meth, saved_meth_name
459
- send(method_kind, meth)
459
+ __send__(method_kind, meth)
460
460
 
461
461
  remove_method saved_meth_name
462
462
  end
@@ -503,7 +503,7 @@ module Sqreen
503
503
  alias_method meth, new_method
504
504
  private saved_meth_name
505
505
  private new_method
506
- send(method_kind, meth)
506
+ __send__(method_kind, meth)
507
507
  end
508
508
  saved_meth_name
509
509
  end
@@ -522,7 +522,7 @@ module Sqreen
522
522
  method_kind = :private
523
523
  end
524
524
  alias_method meth.to_sym, saved_meth_name.to_sym
525
- send(method_kind, meth.to_sym)
525
+ __send__(method_kind, meth.to_sym)
526
526
  end
527
527
  end
528
528
 
@@ -57,7 +57,7 @@ module Sqreen
57
57
  ObjectSpace.define_finalizer(self, WAFCB.finalizer(@waf_rule_name.dup))
58
58
  end
59
59
 
60
- def pre(instance, args, _budget)
60
+ def pre(instance, args, budget)
61
61
  return unless WAFCB.libsqreen? && WAFCB.waf?
62
62
 
63
63
  request = framework.request
@@ -70,6 +70,7 @@ module Sqreen
70
70
  h[e] = capper.call(b.resolve(*env))
71
71
  end
72
72
  waf_args = Sqreen::EncodingSanitizer.sanitize(waf_args)
73
+ budget = [self.budget, budget].compact.min
73
74
  action, data = ::LibSqreen::WAF.run(waf_rule_name, waf_args, budget)
74
75
 
75
76
  case action
@@ -2,5 +2,5 @@
2
2
  # Please refer to our terms for more information: https://www.sqreen.com/terms.html
3
3
 
4
4
  module Sqreen
5
- VERSION = '1.18.3'.freeze
5
+ VERSION = '1.18.4'.freeze
6
6
  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.18.3
4
+ version: 1.18.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sqreen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-12-19 00:00:00.000000000 Z
11
+ date: 2020-02-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sq_mini_racer