immunio 1.0.8 → 1.0.9

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: 99a30833d9388d3c2cf12a21d209c81983f69958
4
- data.tar.gz: be529e5b823a1f0db90a4d058ba2af2f5327d2fb
3
+ metadata.gz: 707599380d8fefd64b7025d8529745af7ed07df2
4
+ data.tar.gz: 294b3c9d179e6943f88f3d7b8a0db6d72c3fd1bc
5
5
  SHA512:
6
- metadata.gz: 581d82074c288618bec64dd899fde256d601d2703d3da32f86436cc92e1e53545cd209935bcc3989f2d895171b2401f5705795149c4680972daa91a0b353b660
7
- data.tar.gz: 8b226690a97a6984025d96c57d3322d5c6790fe9fde2723ba690946be942dab9349ab3595f4c25ad0984df4790bc3c177b8a8681985c4ae149c67a6d43598d55
6
+ metadata.gz: 0c8b6e5455a9806041a0049414561ee8e70161cd85f64ab7c0041cdd82cf70350a85ec83ab0a62a3d58c038dd530ebd36ca446afc09d290f64609d4d14d080f2
7
+ data.tar.gz: cff8a8c2d49cff6bdf635918fa94dca3fe4db3ed70d02fc937c914f1420050dfebe58bc12b515fe5dcd449eb8a87b098c482d914c9e2048e1d6a327aaa1d694e
@@ -1,6 +1,10 @@
1
1
  module Immunio
2
2
  module Context
3
- RAILS_TEMPLATE_FILTER = Regexp.new("(.*(_erb|_haml))__+\\d+_\\d+(.*)")
3
+ RAILS_TEMPLATE_FILTER = /(.*(_erb|_haml))__+\d+_\d+(.*)/
4
+
5
+ # https://github.com/rails/rails/blob/v3.2.21/activesupport/lib/active_support/callbacks.rb#L414
6
+ ACTIVESUPPORT_FILTER = /(.+)_run__\d+__(.+)__\d+__callbacks(.*)/
7
+
4
8
  # Cache for contexts (named in tribute to our buddy Adam Back who invented proof of work)
5
9
  @@hash_cache = {}
6
10
  FILE_CHECKSUM_CACHE = Hash.new do |cache, filepath|
@@ -43,10 +47,12 @@ module Immunio
43
47
  locations.each do |frame|
44
48
 
45
49
  # Filter frame names from template rendering to remove generated random bits
46
- matchdata = RAILS_TEMPLATE_FILTER.match(frame[:label])
47
- if matchdata != nil then
48
- frame[:label] = matchdata[1] + matchdata[3]
49
- end
50
+ template_match = RAILS_TEMPLATE_FILTER.match(frame[:label])
51
+ frame[:label] = template_match[1] + template_match[3] if template_match
52
+
53
+ # Filter frame names from activesupport generated callback methods
54
+ callback_match = ACTIVESUPPORT_FILTER.match(frame[:label])
55
+ frame[:label] = callback_match[1] + callback_match[2] + callback_match[3] if callback_match
50
56
 
51
57
  # Reduce paths to be relative to root if possible, to allow
52
58
  # relocation. If there's no rails root, or the path doesn't start with
@@ -113,7 +119,7 @@ module Immunio
113
119
  end
114
120
 
115
121
  # Mix in additional context data
116
- unless additional_data.nil?
122
+ if additional_data
117
123
  if Immunio.agent.config.log_context_data
118
124
  Immunio.logger.info {"Additional context data:\n#{additional_data}"}
119
125
  end
@@ -1,5 +1,5 @@
1
1
  module Immunio
2
2
  AGENT_TYPE = "agent-ruby"
3
- VERSION = "1.0.8"
3
+ VERSION = "1.0.9"
4
4
  VM_VERSION = "2.2.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: immunio
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.8
4
+ version: 1.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Immunio
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-23 00:00:00.000000000 Z
11
+ date: 2016-01-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -438,7 +438,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
438
438
  version: '0'
439
439
  requirements: []
440
440
  rubyforge_project:
441
- rubygems_version: 2.4.5.1
441
+ rubygems_version: 2.5.1
442
442
  signing_key:
443
443
  specification_version: 4
444
444
  summary: Immunio Ruby agent