appmap 0.83.6 → 0.84.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +19 -0
- data/appmap.gemspec +2 -1
- data/lib/appmap/agent.rb +6 -0
- data/lib/appmap/{gem_hooks → builtin_hooks}/activesupport.yml +6 -0
- data/lib/appmap/builtin_hooks/net/http.yml +1 -1
- data/lib/appmap/builtin_hooks/openssl.yml +34 -0
- data/lib/appmap/builtin_hooks/ruby.yml +1 -1
- data/lib/appmap/config.rb +3 -3
- data/lib/appmap/event.rb +2 -2
- data/lib/appmap/gem_hooks/actionpack.yml +2 -0
- data/lib/appmap/gem_hooks/random.yml +12 -0
- data/lib/appmap/handler/{eval.rb → eval_handler.rb} +4 -4
- data/lib/appmap/handler/{function.rb → function_handler.rb} +1 -1
- data/lib/appmap/handler/{net_http.rb → net_http_handler.rb} +3 -3
- data/lib/appmap/handler/open_ssl_handler.rb +16 -0
- data/lib/appmap/handler/rails/render_handler.rb +2 -2
- data/lib/appmap/handler/rails/template.rb +2 -2
- data/lib/appmap/hook/method.rb +1 -1
- data/lib/appmap/util.rb +1 -0
- data/lib/appmap/version.rb +1 -1
- data/lib/appmap.rb +0 -7
- metadata +12 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bc5d48a877bd0953d1d374fcabfa23bf584ac81bd4f303d4f759fb531a778b22
|
4
|
+
data.tar.gz: 6fe7282152760a910275176ea36987747671e4d06d3983b41ac04edfc217d22c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3385416af1ca8318f5e08fe8edc242be03e7e40b8c15a5a68e6ec0678915cd3ca37a3948bf2651db20f2d56dc3b9ba93dda777a5d21ebcd134de252c78d5af91
|
7
|
+
data.tar.gz: 67ee12c6708a5e29e86462d086b0509db2d4c0b05643182b9ea5209d4acfe792d52532bb3314a48911c07e7d1891a2a32868a55feb13455172e7571c1b7a3570
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,22 @@
|
|
1
|
+
# [0.84.0](https://github.com/applandinc/appmap-ruby/compare/v0.83.6...v0.84.0) (2022-08-04)
|
2
|
+
|
3
|
+
|
4
|
+
### Bug Fixes
|
5
|
+
|
6
|
+
* Address stack overflow error with tracing? ([f426210](https://github.com/applandinc/appmap-ruby/commit/f426210b8dfb48987f2b6c1b5e57e80e3a2c921d))
|
7
|
+
* Handle nil class names ([263f2fc](https://github.com/applandinc/appmap-ruby/commit/263f2fc97b716f1a8205a3e85292c59ee19bc6bc))
|
8
|
+
|
9
|
+
|
10
|
+
### Features
|
11
|
+
|
12
|
+
* Label ActiveSupport::MessageEncryptor ([38a7aeb](https://github.com/applandinc/appmap-ruby/commit/38a7aeb446a2baa63f6724eea8dcf36276d336c9))
|
13
|
+
* Label crypto function with algorithm name ([a7a9c61](https://github.com/applandinc/appmap-ruby/commit/a7a9c6145790fc5bc425e413d56984ef777f9fd1))
|
14
|
+
* Label EncryptedKeyRotatingCookieJar.commit ([8e1d015](https://github.com/applandinc/appmap-ruby/commit/8e1d0158d25f2cc386c32ba899085fd21fadafcb))
|
15
|
+
* Label OpenSSL::Random ([5c947a9](https://github.com/applandinc/appmap-ruby/commit/5c947a90037300639a94ab89d9e1a4dca26265bc))
|
16
|
+
* Label Random ([7572803](https://github.com/applandinc/appmap-ruby/commit/7572803991693ad80f8526c44056133cca13d4b8))
|
17
|
+
* Label the rest of OpenSSL::Cipher ([7863b7b](https://github.com/applandinc/appmap-ruby/commit/7863b7b3fcf2ecccda16b80e637e216c06a95108))
|
18
|
+
* Make activesupport a runtime dependency ([140a674](https://github.com/applandinc/appmap-ruby/commit/140a6744be2abf47d01e880a98f1dd06c8a505b1))
|
19
|
+
|
1
20
|
## [0.83.6](https://github.com/applandinc/appmap-ruby/compare/v0.83.5...v0.83.6) (2022-08-01)
|
2
21
|
|
3
22
|
|
data/appmap.gemspec
CHANGED
@@ -27,11 +27,12 @@ Gem::Specification.new do |spec|
|
|
27
27
|
spec.extensions << "ext/appmap/extconf.rb"
|
28
28
|
spec.require_paths = ['lib']
|
29
29
|
|
30
|
-
spec.add_dependency 'activesupport'
|
31
30
|
spec.add_dependency 'method_source'
|
32
31
|
spec.add_dependency 'rack'
|
33
32
|
spec.add_dependency 'reverse_markdown'
|
34
33
|
|
34
|
+
spec.add_runtime_dependency 'activesupport'
|
35
|
+
|
35
36
|
spec.add_development_dependency 'bundler', '>= 1.16'
|
36
37
|
spec.add_development_dependency 'minitest', '~> 5.15'
|
37
38
|
spec.add_development_dependency 'pry-byebug'
|
data/lib/appmap/agent.rb
CHANGED
@@ -14,3 +14,9 @@
|
|
14
14
|
label: deserialize.safe
|
15
15
|
require_name: active_support/lazy_load_hooks
|
16
16
|
force: true
|
17
|
+
- method: ActiveSupport::MessageEncryptor#encrypt_and_sign
|
18
|
+
require_name: active_support/message_encryptor
|
19
|
+
force: true
|
20
|
+
- method: ActiveSupport::MessageEncryptor#decrypt_and_verifdy
|
21
|
+
require_name: active_support/message_encryptor
|
22
|
+
force: true
|
@@ -12,5 +12,39 @@
|
|
12
12
|
label: crypto.pkcs5
|
13
13
|
- method: OpenSSL::Cipher#encrypt
|
14
14
|
label: crypto.encrypt
|
15
|
+
handler_class: AppMap::Handler::OpenSSLHandler
|
15
16
|
- method: OpenSSL::Cipher#decrypt
|
16
17
|
label: crypto.decrypt
|
18
|
+
handler_class: AppMap::Handler::OpenSSLHandler
|
19
|
+
- method: OpenSSL::Cipher#auth_data=
|
20
|
+
label: crypto.set_auth_data
|
21
|
+
- method: OpenSSL::Cipher#auth_tag=
|
22
|
+
label: crypto.set_auth_tag
|
23
|
+
- method: OpenSSL::Cipher#auth_tag_len=
|
24
|
+
label: crypto.set_auth_tag_len
|
25
|
+
- method: OpenSSL::Cipher#ccm_data_len=
|
26
|
+
label: crypto.set_ccm_data_len
|
27
|
+
- method: OpenSSL::Cipher#iv=
|
28
|
+
label: crypto.set_iv
|
29
|
+
- method: OpenSSL::Cipher#iv_len=
|
30
|
+
label: crypto.set_iv_len
|
31
|
+
- method: OpenSSL::Cipher#key=
|
32
|
+
label: crypto.set_key
|
33
|
+
- method: OpenSSL::Cipher#key_len=
|
34
|
+
label: crypto.set_key_len
|
35
|
+
- method: OpenSSL::Cipher#padding=
|
36
|
+
label: crypto.set_padding
|
37
|
+
- method: OpenSSL::Cipher#final
|
38
|
+
label: crypto.final
|
39
|
+
- methods:
|
40
|
+
- OpenSSL::Cipher#random_iv
|
41
|
+
- OpenSSL::Cipher#random_key
|
42
|
+
- OpenSSL::Cipher#reset
|
43
|
+
- OpenSSL::Cipher#update
|
44
|
+
- methods:
|
45
|
+
- OpenSSL::Random.random_bytes
|
46
|
+
label: random.secure
|
47
|
+
- methods:
|
48
|
+
- OpenSSL::Random#add
|
49
|
+
- OpenSSL::Random#seed
|
50
|
+
label: pseudorandom.seed
|
data/lib/appmap/config.rb
CHANGED
@@ -32,8 +32,8 @@ module AppMap
|
|
32
32
|
attr_writer :handler_class
|
33
33
|
|
34
34
|
def handler_class
|
35
|
-
require 'appmap/handler/
|
36
|
-
@handler_class || AppMap::Handler::
|
35
|
+
require 'appmap/handler/function_handler'
|
36
|
+
@handler_class || AppMap::Handler::FunctionHandler
|
37
37
|
end
|
38
38
|
|
39
39
|
# Indicates that only the entry points to a package will be recorded.
|
@@ -72,7 +72,7 @@ module AppMap
|
|
72
72
|
# Builds a package for gem. Generally corresponds to a `gem:` entry in appmap.yml. Also used when mapping
|
73
73
|
# a builtin.
|
74
74
|
def build_from_gem(gem, shallow: true, require_name: nil, exclude: [], labels: [], optional: false, force: false)
|
75
|
-
if !force && %w[method_source
|
75
|
+
if !force && %w[method_source].member?(gem)
|
76
76
|
warn "WARNING: #{gem} cannot be AppMapped because it is a dependency of the appmap gem"
|
77
77
|
return
|
78
78
|
end
|
data/lib/appmap/event.rb
CHANGED
@@ -84,10 +84,10 @@ module AppMap
|
|
84
84
|
# Heuristic for dynamically defined class whose name can be nil
|
85
85
|
def best_class_name(value)
|
86
86
|
value_cls = value.class
|
87
|
-
while value_cls.name.nil?
|
87
|
+
while value_cls && value_cls.name.nil?
|
88
88
|
value_cls = value_cls.superclass
|
89
89
|
end
|
90
|
-
value_cls
|
90
|
+
value_cls&.name || 'unknown'
|
91
91
|
end
|
92
92
|
|
93
93
|
def encode_display_string(value)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'appmap/handler/
|
3
|
+
require 'appmap/handler/function_handler'
|
4
4
|
|
5
5
|
module AppMap
|
6
6
|
module Handler
|
@@ -14,15 +14,15 @@ module AppMap
|
|
14
14
|
#
|
15
15
|
# If the binding is not provided, by default eval will run in the
|
16
16
|
# current frame. Since we call it here, this will mean the #do_call
|
17
|
-
# frame, which would make AppMap::Handler::
|
17
|
+
# frame, which would make AppMap::Handler::EvalHandler the lexical scope
|
18
18
|
# for constant lookup and definition; as a consequence
|
19
19
|
# eg. `eval "class Foo; end"` would define
|
20
|
-
# AppMap::Handler::
|
20
|
+
# AppMap::Handler::EvalHandler::Foo instead of defining it in
|
21
21
|
# the module where the original call was made.
|
22
22
|
#
|
23
23
|
# To avoid this, we explicitly substitute the correct execution
|
24
24
|
# context, up several stack frames.
|
25
|
-
class
|
25
|
+
class EvalHandler < FunctionHandler
|
26
26
|
# The depth of the frame we need to pluck out:
|
27
27
|
# 1. Hook::Method#do_call
|
28
28
|
# 2. Hook::Method#trace_call
|
@@ -6,7 +6,7 @@ require 'appmap/hook/method'
|
|
6
6
|
module AppMap
|
7
7
|
module Handler
|
8
8
|
# Base handler class, will emit method call and return events.
|
9
|
-
class
|
9
|
+
class FunctionHandler < Hook::Method
|
10
10
|
def handle_call(receiver, args)
|
11
11
|
AppMap::Event::MethodCall.build_from_invocation(defined_class, hook_method, receiver, args)
|
12
12
|
end
|
@@ -29,7 +29,7 @@ module AppMap
|
|
29
29
|
|
30
30
|
self.request_method = request.method
|
31
31
|
self.url = url
|
32
|
-
self.headers =
|
32
|
+
self.headers = NetHTTPHandler.copy_headers(request)
|
33
33
|
self.params = Rack::Utils.parse_nested_query(query)
|
34
34
|
end
|
35
35
|
|
@@ -64,7 +64,7 @@ module AppMap
|
|
64
64
|
|
65
65
|
if response
|
66
66
|
self.status = response.code.to_i
|
67
|
-
self.headers =
|
67
|
+
self.headers = NetHTTPHandler.copy_headers(response)
|
68
68
|
else
|
69
69
|
self.headers = {}
|
70
70
|
end
|
@@ -84,7 +84,7 @@ module AppMap
|
|
84
84
|
|
85
85
|
# Handler class for HTTP requests.
|
86
86
|
# Emits HTTP request events instead of method calls.
|
87
|
-
class
|
87
|
+
class NetHTTPHandler < Hook::Method
|
88
88
|
def self.copy_headers(obj)
|
89
89
|
{}.tap do |headers|
|
90
90
|
obj.each_header do |key, value|
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'appmap/handler/function_handler'
|
2
|
+
|
3
|
+
module AppMap
|
4
|
+
module Handler
|
5
|
+
class OpenSSLHandler < FunctionHandler
|
6
|
+
def handle_call(receiver, args)
|
7
|
+
super.tap do |event|
|
8
|
+
algorithm = receiver.name
|
9
|
+
event.receiver[:labels] ||= []
|
10
|
+
label = [ 'crypto.algorithm', algorithm ].join('.')
|
11
|
+
event.receiver[:labels] << label unless event.receiver[:labels].include?(label)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -1,9 +1,9 @@
|
|
1
|
-
require 'appmap/handler/
|
1
|
+
require 'appmap/handler/function_handler'
|
2
2
|
|
3
3
|
module AppMap
|
4
4
|
module Handler
|
5
5
|
module Rails
|
6
|
-
class RenderHandler < AppMap::Handler::
|
6
|
+
class RenderHandler < AppMap::Handler::FunctionHandler
|
7
7
|
def handle_call(receiver, args)
|
8
8
|
options, _ = args
|
9
9
|
# TODO: :file, :xml
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'appmap/handler/
|
3
|
+
require 'appmap/handler/function_handler'
|
4
4
|
require 'appmap/event'
|
5
5
|
|
6
6
|
module AppMap
|
@@ -110,7 +110,7 @@ module AppMap
|
|
110
110
|
# Hooks the ActionView::Resolver methods +find_all+, +find_all_anywhere+. The resolver is used
|
111
111
|
# during template rendering to lookup the template file path from parameters such as the
|
112
112
|
# template name, prefix, and partial (boolean).
|
113
|
-
class ResolverHandler < AppMap::Handler::
|
113
|
+
class ResolverHandler < AppMap::Handler::FunctionHandler
|
114
114
|
def handle_call(receiver, args)
|
115
115
|
name, prefix, partial = args
|
116
116
|
warn "Resolver: #{{ name: name, prefix: prefix, partial: partial }}" if LOG
|
data/lib/appmap/hook/method.rb
CHANGED
@@ -83,7 +83,7 @@ module AppMap
|
|
83
83
|
end
|
84
84
|
|
85
85
|
def trace?
|
86
|
-
return false unless AppMap.
|
86
|
+
return false unless AppMap.tracing_enabled?
|
87
87
|
return false if Thread.current[HOOK_DISABLE_KEY]
|
88
88
|
return false if hook_package&.shallow? && AppMap.tracing.last_package_for_current_thread == hook_package
|
89
89
|
|
data/lib/appmap/util.rb
CHANGED
data/lib/appmap/version.rb
CHANGED
data/lib/appmap.rb
CHANGED
@@ -20,13 +20,6 @@
|
|
20
20
|
# - appmap/swagger (Rake task)
|
21
21
|
# - appmap/depends (Rake task)
|
22
22
|
|
23
|
-
begin
|
24
|
-
require 'active_support'
|
25
|
-
require 'active_support/core_ext'
|
26
|
-
rescue NameError
|
27
|
-
warn 'active_support is not available. AppMap execution will continue optimistically without it...'
|
28
|
-
end
|
29
|
-
|
30
23
|
require 'appmap/version'
|
31
24
|
require 'appmap/agent'
|
32
25
|
|
metadata
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: appmap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.84.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kevin Gilpin
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-08-
|
11
|
+
date: 2022-08-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: method_source
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
@@ -25,7 +25,7 @@ dependencies:
|
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: rack
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
@@ -39,7 +39,7 @@ dependencies:
|
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: reverse_markdown
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - ">="
|
@@ -53,7 +53,7 @@ dependencies:
|
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: activesupport
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - ">="
|
@@ -353,6 +353,7 @@ files:
|
|
353
353
|
- ext/appmap/extconf.rb
|
354
354
|
- lib/appmap.rb
|
355
355
|
- lib/appmap/agent.rb
|
356
|
+
- lib/appmap/builtin_hooks/activesupport.yml
|
356
357
|
- lib/appmap/builtin_hooks/json.yml
|
357
358
|
- lib/appmap/builtin_hooks/logger.yml
|
358
359
|
- lib/appmap/builtin_hooks/net/http.yml
|
@@ -383,19 +384,20 @@ files:
|
|
383
384
|
- lib/appmap/gem_hooks/activejob-cancel.yml
|
384
385
|
- lib/appmap/gem_hooks/activejob.yml
|
385
386
|
- lib/appmap/gem_hooks/activerecord.yml
|
386
|
-
- lib/appmap/gem_hooks/activesupport.yml
|
387
387
|
- lib/appmap/gem_hooks/cancancan.yml
|
388
388
|
- lib/appmap/gem_hooks/devise.yml
|
389
389
|
- lib/appmap/gem_hooks/pandoc-ruby.yml
|
390
390
|
- lib/appmap/gem_hooks/rails.yml
|
391
391
|
- lib/appmap/gem_hooks/railties.yml
|
392
|
+
- lib/appmap/gem_hooks/random.yml
|
392
393
|
- lib/appmap/gem_hooks/resque.yml
|
393
394
|
- lib/appmap/gem_hooks/sidekiq.yml
|
394
395
|
- lib/appmap/gem_hooks/sprockets.yml
|
395
396
|
- lib/appmap/handler.rb
|
396
|
-
- lib/appmap/handler/
|
397
|
-
- lib/appmap/handler/
|
398
|
-
- lib/appmap/handler/
|
397
|
+
- lib/appmap/handler/eval_handler.rb
|
398
|
+
- lib/appmap/handler/function_handler.rb
|
399
|
+
- lib/appmap/handler/net_http_handler.rb
|
400
|
+
- lib/appmap/handler/open_ssl_handler.rb
|
399
401
|
- lib/appmap/handler/rails/render_handler.rb
|
400
402
|
- lib/appmap/handler/rails/request_handler.rb
|
401
403
|
- lib/appmap/handler/rails/sql_handler.rb
|