dry-monitor 0.1.0 → 0.1.1

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
- SHA1:
3
- metadata.gz: ea5ea283589f7fcf5e657a51044c7085348464de
4
- data.tar.gz: 70cb63d6bea9a42c7002b90cd994bd4a6cc549d9
2
+ SHA256:
3
+ metadata.gz: 8efc7beb94cb02a20c12514ad8beea5914a069d957b48f7c089b588fce4c8bf1
4
+ data.tar.gz: ad200194b170bfdfdb8f3fe473078c6b309fc73170203deb27b61b1ace4afad4
5
5
  SHA512:
6
- metadata.gz: 5383bf2d033695ea44b7404bbc04f59bb412bf0cde5449e1b279aa9be147044205ab1d027b746345f837db25d9975975068c0a2e041cb580cfeccaa3205e25d1
7
- data.tar.gz: 1b3952264e029600d2aba9baf9c96bae93766a420c87492f31c0734a8e479a00879cf796467bccac584f4d809482b4e73ea4500e4a42fd70e25ff490648f0b1f
6
+ metadata.gz: bd7e41300b4ea1c908719cd69efd6e9bd357978af9c5ae71a39a38dde35c59c5f989d26208fa56763854dcd6f7b581d87782eb26baf65ea00a944f182151767e
7
+ data.tar.gz: fc6c2027758916b5447648c176f1a839fa172f1f2e0561b8c471bbcdfb79f670f5dfcab1588f7cac1d46978e118f14869f297d8211a24f3fa0992f7d5a26cabb
@@ -1,3 +1,9 @@
1
+ # v0.1.1 2018-01-03
2
+
3
+ ### Fixed
4
+
5
+ * Query params containing arrays of primitives (e.g. `?ids[]=1&ids[]=2`) no longer crash the logger (timriley)
6
+
1
7
  # v0.1.0 2018-01-02
2
8
 
3
9
  ### Fixed
@@ -91,12 +91,12 @@ module Dry
91
91
 
92
92
  def filter_params(params)
93
93
  params.each_with_object({}) do |(k, v), h|
94
- if v.is_a?(Hash)
94
+ if config.filtered_params.include?(k)
95
+ h.update(k => FILTERED)
96
+ elsif v.is_a?(Hash)
95
97
  h.update(k => filter_params(v))
96
98
  elsif v.is_a?(Array)
97
- h.update(k => v.map { |m| filter_params(m) })
98
- elsif config.filtered_params.include?(k)
99
- h.update(k => FILTERED)
99
+ h.update(k => v.map { |m| m.is_a?(Hash) ? filter_params(m) : m })
100
100
  else
101
101
  h[k] = v
102
102
  end
@@ -1,5 +1,5 @@
1
1
  module Dry
2
2
  module Monitor
3
- VERSION = '0.1.0'.freeze
3
+ VERSION = '0.1.1'.freeze
4
4
  end
5
5
  end
@@ -1,5 +1,3 @@
1
- require 'spec_helper'
2
-
3
1
  RSpec.describe 'Subscribing to instrumentation events' do
4
2
  subject(:notifications) { Dry::Monitor::Notifications.new(:app) }
5
3
 
@@ -1,5 +1,3 @@
1
- require 'spec_helper'
2
-
3
1
  RSpec.describe Dry::Monitor::Logger do
4
2
  subject(:logger) do
5
3
  Dry::Monitor::Logger.new($stdout)
@@ -1,5 +1,3 @@
1
- require 'spec_helper'
2
-
3
1
  RSpec.describe Dry::Monitor::Rack::Middleware do
4
2
  subject(:middleware) { Dry::Monitor::Rack::Middleware.new(notifications).new(rack_app) }
5
3
 
@@ -25,7 +23,17 @@ RSpec.describe Dry::Monitor::Rack::Middleware do
25
23
  end
26
24
 
27
25
  let(:query_params) do
28
- '_csrf=123456&password=secret&user[password]=secret&other[][password]=secret&other[][password]=secret&foo=bar&one=1'
26
+ %w[
27
+ _csrf=123456
28
+ password=secret
29
+ user[password]=secret
30
+ others[][password]=secret1
31
+ others[][password]=secret2
32
+ foo=bar
33
+ one=1
34
+ ids[]=1
35
+ ids[]=2
36
+ ].join('&')
29
37
  end
30
38
 
31
39
  before do
@@ -45,7 +53,7 @@ RSpec.describe Dry::Monitor::Rack::Middleware do
45
53
 
46
54
  expect(log_file_content).to include('Started GET "/hello-world"')
47
55
  expect(log_file_content).to include('Finished GET "/hello-world"')
48
- expect(log_file_content).to include('Query parameters {"_csrf"=>"[FILTERED]", "password"=>"[FILTERED]", "user"=>{"password"=>"[FILTERED]"}, "other"=>[{"password"=>"[FILTERED]"}, {"password"=>"[FILTERED]"}], "foo"=>"bar", "one"=>"1"}')
56
+ expect(log_file_content).to include('Query parameters {"_csrf"=>"[FILTERED]", "password"=>"[FILTERED]", "user"=>{"password"=>"[FILTERED]"}, "others"=>[{"password"=>"[FILTERED]"}, {"password"=>"[FILTERED]"}], "foo"=>"bar", "one"=>"1", "ids"=>["1", "2"]}')
49
57
  end
50
58
  end
51
59
 
@@ -1,5 +1,3 @@
1
- require 'spec_helper'
2
-
3
1
  RSpec.describe Dry::Monitor::SQL::Logger do
4
2
  subject(:logger) { sql_logger.new(Dry::Monitor::Logger.new(log_file_path)) }
5
3
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dry-monitor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotr Solnica
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-02 00:00:00.000000000 Z
11
+ date: 2018-01-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rouge
@@ -168,7 +168,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
168
168
  version: '0'
169
169
  requirements: []
170
170
  rubyforge_project:
171
- rubygems_version: 2.6.11
171
+ rubygems_version: 2.7.3
172
172
  signing_key:
173
173
  specification_version: 4
174
174
  summary: Monitoring and instrumentation APIs