contrast-agent 3.10.1 → 3.10.2

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: 3dac320eaefdcac8df279a6eadaf45867ca88bba6b4b794b26bf0c88866876bf
4
- data.tar.gz: 97d23d3733959386ed7c5c4a5d4258e59a0685addf81eebbf667d5eee9dc8f44
3
+ metadata.gz: 820720cd5c39b14ced3612d327179d48901c63fc196a9f8c99716d35f53115e4
4
+ data.tar.gz: b7a25f4bb481df7bade588d2d7cf7cc70024176d48b9c76a0b65bed99bc49e78
5
5
  SHA512:
6
- metadata.gz: fb4fb1a3360742a868705b906fd6cc6479d4a7ca4568456d1a0bda1f18736f54554a393afdbe6aa678570be936a4181c3ba744796f94d6d110d40bb0c8e30620
7
- data.tar.gz: d68db12785d7bdf50e49b1fe6df5022f8eca35f60c66fcea3c5572452188f4d8ab757129ca31b1e530c80f56f4f7e6cbc25ee04f404927f89dbe5264c7fa06ae
6
+ metadata.gz: 24a2efa0ed4aab95794c773220f90895a584fc60c8eac499d9789e1e0c9138d4ea12cc33a482227ceb7226e03a9b98801b37070d60f93dc92f84f54636b3ff43
7
+ data.tar.gz: 5d7ee9d12c77e0c5242b31f0b4f09efec75b969ef02b9c6ec915d9ae06dc393824b9de1f0cbb40ea7aef1aa4b9793550564e70a4d7448ba8f5485930ccd1fbeb
@@ -14,64 +14,64 @@
14
14
  'configure.ac'
15
15
  ],
16
16
  {
17
- 'AM_PROG_AR' => 1,
18
- 'LT_CONFIG_LTDL_DIR' => 1,
19
- 'm4_pattern_forbid' => 1,
20
- 'AM_NLS' => 1,
21
- 'AC_REQUIRE_AUX_FILE' => 1,
22
- 'AM_PATH_GUILE' => 1,
23
- 'AC_FC_PP_SRCEXT' => 1,
24
- 'm4_pattern_allow' => 1,
25
- 'AM_MAKEFILE_INCLUDE' => 1,
26
- '_m4_warn' => 1,
27
- 'AC_CONFIG_FILES' => 1,
28
- 'AC_INIT' => 1,
29
- 'AM_XGETTEXT_OPTION' => 1,
17
+ 'AM_ENABLE_MULTILIB' => 1,
18
+ 'AC_SUBST' => 1,
19
+ 'AC_CONFIG_HEADERS' => 1,
20
+ 'AC_SUBST_TRACE' => 1,
21
+ 'AM_PROG_F77_C_O' => 1,
22
+ 'AC_CONFIG_AUX_DIR' => 1,
30
23
  'm4_include' => 1,
31
- 'AC_FC_SRCEXT' => 1,
32
- 'LT_SUPPORTED_TAG' => 1,
33
- 'AM_CONDITIONAL' => 1,
24
+ '_AM_MAKEFILE_INCLUDE' => 1,
25
+ 'AM_MAINTAINER_MODE' => 1,
26
+ '_AM_SUBST_NOTMAKE' => 1,
27
+ 'AM_SILENT_RULES' => 1,
28
+ 'm4_pattern_forbid' => 1,
34
29
  '_AM_COND_ENDIF' => 1,
35
- 'AM_INIT_AUTOMAKE' => 1,
36
- 'AC_CANONICAL_SYSTEM' => 1,
37
- 'AC_FC_PP_DEFINE' => 1,
30
+ 'AM_GNU_GETTEXT' => 1,
38
31
  'AH_OUTPUT' => 1,
39
- '_AM_SUBST_NOTMAKE' => 1,
40
- 'AM_AUTOMAKE_VERSION' => 1,
41
- '_AM_COND_IF' => 1,
42
- 'AM_GNU_GETTEXT_INTL_SUBDIR' => 1,
43
- 'AC_CONFIG_LINKS' => 1,
44
32
  '_AM_COND_ELSE' => 1,
45
- 'AM_PROG_CXX_C_O' => 1,
46
- 'AC_CANONICAL_BUILD' => 1,
33
+ 'AC_CONFIG_SUBDIRS' => 1,
34
+ '_m4_warn' => 1,
35
+ 'AM_PROG_LIBTOOL' => 1,
36
+ 'AM_PATH_GUILE' => 1,
37
+ 'AC_CONFIG_LINKS' => 1,
38
+ 'AC_PROG_LIBTOOL' => 1,
39
+ 'AM_INIT_AUTOMAKE' => 1,
40
+ 'AM_NLS' => 1,
41
+ 'm4_sinclude' => 1,
47
42
  '_LT_AC_TAGCONFIG' => 1,
48
- 'AM_ENABLE_MULTILIB' => 1,
49
- 'AC_FC_FREEFORM' => 1,
50
- 'AM_GNU_GETTEXT' => 1,
51
- 'AM_PROG_MOC' => 1,
52
43
  'AC_LIBSOURCE' => 1,
53
- '_AM_MAKEFILE_INCLUDE' => 1,
54
- 'AC_CANONICAL_TARGET' => 1,
55
- 'AM_SILENT_RULES' => 1,
44
+ 'AC_CANONICAL_SYSTEM' => 1,
56
45
  'LT_INIT' => 1,
46
+ 'AC_CANONICAL_BUILD' => 1,
47
+ 'AM_PROG_AR' => 1,
48
+ '_AM_COND_IF' => 1,
49
+ 'AM_PROG_FC_C_O' => 1,
50
+ 'AC_CONFIG_FILES' => 1,
57
51
  'AC_CANONICAL_HOST' => 1,
58
- 'AC_CONFIG_AUX_DIR' => 1,
59
- 'm4_sinclude' => 1,
52
+ 'LT_SUPPORTED_TAG' => 1,
53
+ 'AC_FC_SRCEXT' => 1,
54
+ 'AM_PROG_CXX_C_O' => 1,
55
+ 'LT_CONFIG_LTDL_DIR' => 1,
56
+ 'AM_XGETTEXT_OPTION' => 1,
57
+ 'AM_PROG_MOC' => 1,
58
+ 'AC_CANONICAL_TARGET' => 1,
59
+ 'AC_FC_FREEFORM' => 1,
60
+ 'AM_POT_TOOLS' => 1,
61
+ 'AC_REQUIRE_AUX_FILE' => 1,
62
+ 'm4_pattern_allow' => 1,
63
+ 'AM_MAKEFILE_INCLUDE' => 1,
64
+ 'sinclude' => 1,
60
65
  'AM_PROG_CC_C_O' => 1,
66
+ 'AC_INIT' => 1,
61
67
  'AC_DEFINE_TRACE_LITERAL' => 1,
62
- 'AM_PROG_LIBTOOL' => 1,
63
- 'AC_CONFIG_HEADERS' => 1,
64
- 'AM_MAINTAINER_MODE' => 1,
65
- 'include' => 1,
66
- 'sinclude' => 1,
67
- 'AM_POT_TOOLS' => 1,
68
- 'AC_PROG_LIBTOOL' => 1,
68
+ 'AM_CONDITIONAL' => 1,
69
69
  'AC_CONFIG_LIBOBJ_DIR' => 1,
70
- 'AC_CONFIG_SUBDIRS' => 1,
71
- 'AM_PROG_FC_C_O' => 1,
72
- 'AM_PROG_F77_C_O' => 1,
73
- 'AC_SUBST_TRACE' => 1,
74
- 'AC_SUBST' => 1
70
+ 'AC_FC_PP_DEFINE' => 1,
71
+ 'AC_FC_PP_SRCEXT' => 1,
72
+ 'AM_GNU_GETTEXT_INTL_SUBDIR' => 1,
73
+ 'include' => 1,
74
+ 'AM_AUTOMAKE_VERSION' => 1
75
75
  }
76
76
  ], 'Autom4te::Request' )
77
77
  );
data/funchook/config.log CHANGED
@@ -10,7 +10,7 @@ generated by GNU Autoconf 2.69. Invocation command line was
10
10
  ## Platform. ##
11
11
  ## --------- ##
12
12
 
13
- hostname = cc581e4e-56c0-47a6-adc9-1640568f2129-b5bh6
13
+ hostname = 4130b02c-90d4-4e19-922d-61e69e36360b-fj5m5
14
14
  uname -m = x86_64
15
15
  uname -r = 4.19.95-flatcar
16
16
  uname -s = Linux
@@ -326,7 +326,7 @@ generated by GNU Autoconf 2.69. Invocation command line was
326
326
  CONFIG_COMMANDS =
327
327
  $ ./config.status
328
328
 
329
- on cc581e4e-56c0-47a6-adc9-1640568f2129-b5bh6
329
+ on 4130b02c-90d4-4e19-922d-61e69e36360b-fj5m5
330
330
 
331
331
  config.status:822: creating Makefile
332
332
  config.status:822: creating src/Makefile
@@ -59,7 +59,7 @@ module Contrast
59
59
  end
60
60
 
61
61
  def scan_response?
62
- true?(CONFIG.root.assess.enable_scan_response)
62
+ !false?(CONFIG.root.assess.enable_scan_response)
63
63
  end
64
64
 
65
65
  def omit_body?
@@ -254,7 +254,7 @@ module Contrast
254
254
  cas = CONFIG.root.assess&.sampling
255
255
 
256
256
  {
257
- enabled: [cas&.enable, settings&.enabled, DEFAULT_SAMPLING_ENABLED] .reject(&:nil?).first,
257
+ enabled: true?([cas&.enable, settings&.enabled, DEFAULT_SAMPLING_ENABLED] .reject(&:nil?).first),
258
258
  baseline: [cas&.baseline, settings&.baseline, DEFAULT_SAMPLING_BASELINE] .map(&:to_i).find(&:positive?),
259
259
  request_frequency: [cas&.request_frequency, settings&.request_frequency, DEFAULT_SAMPLING_REQUEST_FREQUENCY] .map(&:to_i).find(&:positive?),
260
260
  response_frequency: [cas&.response_frequency, settings&.response_frequency, DEFAULT_SAMPLING_RESPONSE_FREQUENCY].map(&:to_i).find(&:positive?),
@@ -51,8 +51,8 @@ module Contrast
51
51
  end
52
52
  context_response.parsed_response_headers = true
53
53
 
54
- context_response.response_body = Contrast::Utils::StringUtils.force_utf8(body)
55
- context_response.parsed_response_body = true
54
+ context_response.response_body_binary = Contrast::Utils::StringUtils.force_utf8(body)
55
+ context_response.parsed_response_body = false
56
56
 
57
57
  doc_type = document_type
58
58
  context_response.document_type = doc_type if doc_type
@@ -120,15 +120,12 @@ module Contrast
120
120
 
121
121
  # The response body can change during the request lifecycle
122
122
  # We should not extract it out as a variable here, or we'll miss those
123
- # changes. (headdesk)
123
+ # changes.
124
124
  def body
125
125
  return unless @rack_response
126
126
 
127
- if @is_array
128
- extract_body(@rack_response[2])
129
- elsif Contrast::Utils::DuckUtils.quacks_to?(@rack_response, :body)
130
- extract_body(@rack_response.body)
131
- end
127
+ body_content = @is_array ? @rack_response[2] : @rack_response.body
128
+ extract_body(body_content)
132
129
  end
133
130
 
134
131
  def update_body body_string
@@ -184,16 +181,38 @@ module Contrast
184
181
  true
185
182
  end
186
183
 
184
+ # Given some holder of the content of the response's body, extract that
185
+ # content and return it as a String
186
+ #
187
+ # @param body [String, Rack::File, Rack::BodyProxy,
188
+ # ActionDispatch::Response::RackBody, Rack::Response] Something that
189
+ # holds, wraps, or is the body of the Response
190
+ # @return [nil, String] the content of the body
187
191
  def extract_body body
188
192
  return nil unless body
189
193
 
190
194
  if defined?(Rack::File) && body.is_a?(Rack::File)
191
195
  # not sure what to do in this situation, so don't do anything.
192
196
  nil
197
+ elsif body.is_a?(Rack::BodyProxy)
198
+ next_body = body.instance_variable_get(:@body)
199
+ case next_body
200
+ when Array
201
+ extract_body(next_body[0])
202
+ else
203
+ extract_body(next_body)
204
+ end
205
+ elsif defined?(ActionDispatch::Response::RackBody) && body.is_a?(ActionDispatch::Response::RackBody)
206
+ extract_body(body.body)
207
+ elsif body.is_a?(Rack::Response)
208
+ extract_body(body.body)
193
209
  elsif Contrast::Utils::DuckUtils.quacks_to?(body, :each)
194
210
  acc = []
195
211
  body.each { |tmp| acc << read_or_string(tmp) }
196
212
  acc.compact.join(Contrast::Utils::ObjectShare::NEW_LINE)
213
+ elsif ActionView::OutputBuffer
214
+ # https://stackoverflow.com/questions/15654676/how-to-convert-activesupportsafebuffer-to-string
215
+ body.to_str
197
216
  else
198
217
  read_or_string(body)
199
218
  end
@@ -3,6 +3,6 @@
3
3
 
4
4
  module Contrast
5
5
  module Agent
6
- VERSION = '3.10.1'
6
+ VERSION = '3.10.2'
7
7
  end
8
8
  end
@@ -23,7 +23,7 @@ module Contrast
23
23
  cas = CONFIG.root.assess&.sampling
24
24
 
25
25
  {
26
- enabled: [cas&.enable, settings&.enabled, DEFAULT_SAMPLING_ENABLED] .reject(&:nil?).first,
26
+ enabled: true?([cas&.enable, settings&.enabled, DEFAULT_SAMPLING_ENABLED] .reject(&:nil?).first),
27
27
  baseline: [cas&.baseline, settings&.baseline, DEFAULT_SAMPLING_BASELINE] .map(&:to_i).find(&:positive?),
28
28
  request_frequency: [cas&.request_frequency, settings&.request_frequency, DEFAULT_SAMPLING_REQUEST_FREQUENCY] .map(&:to_i).find(&:positive?),
29
29
  response_frequency: [cas&.response_frequency, settings&.response_frequency, DEFAULT_SAMPLING_RESPONSE_FREQUENCY].map(&:to_i).find(&:positive?),
@@ -1 +1 @@
1
- 2.6.2
1
+ 2.6.4
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: contrast-agent
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.10.1
4
+ version: 3.10.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - galen.palmer@contrastsecurity.com
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: exe
14
14
  cert_chain: []
15
- date: 2020-04-30 00:00:00.000000000 Z
15
+ date: 2020-05-05 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: bundler
@@ -420,21 +420,21 @@ executables:
420
420
  - contrast_service
421
421
  extensions:
422
422
  - ext/cs__common/extconf.rb
423
- - ext/cs__assess_yield_track/extconf.rb
424
- - ext/cs__assess_string_interpolation26/extconf.rb
425
- - ext/cs__contrast_patch/extconf.rb
426
- - ext/cs__assess_hash/extconf.rb
427
- - ext/cs__assess_basic_object/extconf.rb
428
- - ext/cs__assess_regexp/extconf.rb
429
- - ext/cs__assess_array/extconf.rb
430
423
  - ext/cs__assess_fiber_track/extconf.rb
424
+ - ext/cs__assess_active_record_named/extconf.rb
431
425
  - ext/cs__protect_kernel/extconf.rb
426
+ - ext/cs__assess_string_interpolation26/extconf.rb
427
+ - ext/cs__contrast_patch/extconf.rb
432
428
  - ext/cs__assess_kernel/extconf.rb
433
- - ext/cs__assess_regexp_track/extconf.rb
434
- - ext/cs__assess_active_record_named/extconf.rb
429
+ - ext/cs__assess_regexp/extconf.rb
435
430
  - ext/cs__assess_module/extconf.rb
431
+ - ext/cs__assess_array/extconf.rb
436
432
  - ext/cs__assess_string/extconf.rb
433
+ - ext/cs__assess_basic_object/extconf.rb
437
434
  - ext/cs__assess_marshal_module/extconf.rb
435
+ - ext/cs__assess_yield_track/extconf.rb
436
+ - ext/cs__assess_regexp_track/extconf.rb
437
+ - ext/cs__assess_hash/extconf.rb
438
438
  extra_rdoc_files: []
439
439
  files:
440
440
  - ".clang-format"