sqreen 1.18.3-java → 1.18.4-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
  SHA256:
3
- metadata.gz: e5177255c97d442d2af7974527feed94c317d277b602938b242f7c21f4a4cc35
4
- data.tar.gz: c14efef9d6a6c2c89549e0cb4d56e9be5a47f4e80a5369f6488014da06d21822
3
+ metadata.gz: 43b9ddb790f25ff47df2953ec789110bc2273fa02fe632b76c36066da880ad9a
4
+ data.tar.gz: 05544de42de06ad978ea9dfe330b330a090eff0ae8661bdfa8509251cf57d9ce
5
5
  SHA512:
6
- metadata.gz: 713c71161a1b89545404f23a779e49a15428ffb32403677ae668648c1c03639ed434e422e00ac01213a6415b5355f04049c4b16975d9ed0ba1bbdbf666a014b1
7
- data.tar.gz: d9b60a660bfca8b12c3abd4711c9364cd1ac11660fc1df5bfb079a4cfeecb28ea529de49f29da3dcd8f465b9284b280da3ba1d793dface374859a9c4f8a92a79
6
+ metadata.gz: e3ba0e41808617dddbfc03d2f8807fa8039ad1ad40ac6a8b815082986ac8ef39aae795e1867faa685625c5a048f36a44beb4e29092528f7cb28aa087bd3a8034
7
+ data.tar.gz: b7f7b42ea91a2a9ece4e660485dac8aa65c4dfa635241f9e685b3ff855d21f68c091260814a9c7a14f3ecd9c6fe92f03824f084c718e8cb27691569537e5c011
@@ -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: java
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
  requirement: !ruby/object:Gem::Requirement