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 +5 -5
- data/CHANGELOG.md +6 -0
- data/lib/dry/monitor/rack/logger.rb +4 -4
- data/lib/dry/monitor/version.rb +1 -1
- data/spec/integration/instrumentation_spec.rb +0 -2
- data/spec/integration/logger_spec.rb +0 -2
- data/spec/integration/rack_middleware_spec.rb +12 -4
- data/spec/integration/sql_logger_spec.rb +0 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 8efc7beb94cb02a20c12514ad8beea5914a069d957b48f7c089b588fce4c8bf1
|
4
|
+
data.tar.gz: ad200194b170bfdfdb8f3fe473078c6b309fc73170203deb27b61b1ace4afad4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bd7e41300b4ea1c908719cd69efd6e9bd357978af9c5ae71a39a38dde35c59c5f989d26208fa56763854dcd6f7b581d87782eb26baf65ea00a944f182151767e
|
7
|
+
data.tar.gz: fc6c2027758916b5447648c176f1a839fa172f1f2e0561b8c471bbcdfb79f670f5dfcab1588f7cac1d46978e118f14869f297d8211a24f3fa0992f7d5a26cabb
|
data/CHANGELOG.md
CHANGED
@@ -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
|
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
|
data/lib/dry/monitor/version.rb
CHANGED
@@ -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
|
-
|
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]"}, "
|
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
|
|
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.
|
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-
|
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.
|
171
|
+
rubygems_version: 2.7.3
|
172
172
|
signing_key:
|
173
173
|
specification_version: 4
|
174
174
|
summary: Monitoring and instrumentation APIs
|