sentry-sanitizer 0.10.0 → 0.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/Gemfile.lock +1 -1
- data/README.md +13 -9
- data/lib/sentry/sanitizer/cleaner.rb +10 -1
- data/lib/sentry/sanitizer/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e4b230cb2834f352d6ab8f0004fb4102203855c8a13177df9da84742314c566d
|
|
4
|
+
data.tar.gz: af4c8a31e8a80404d3134626005fc37a0db364dc82f18074da1f1b5b62973a5f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4adc8db3eca4d2e2dcc849736e129b9a521d42336fad9808128fae2a87afd8923a7c5db505c26b21434cfdebfaec352d7e43a6a07d5ff516477ef196b8386254
|
|
7
|
+
data.tar.gz: d17e3f76516cd0bc1b6911a5a4adc9fdf5a1712f5f2cd5cc543812f0051e954c77603d5249627807f701d33d440aaae33e33cb83db3d14c5d047789e5ea8b883
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.10.2
|
|
4
|
+
|
|
5
|
+
- Fix span sanitizing with custom filter (ActiveSupport::ParameterFilter) [#28](https://github.com/mrexox/sentry-sanitizer/pull/28)
|
|
6
|
+
|
|
7
|
+
## 0.10.1
|
|
8
|
+
|
|
9
|
+
- Sanitize `Sentry::TransactionEvent#spans` [#27](https://github.com/mrexox/sentry-sanitizer/pull/27)
|
|
10
|
+
|
|
3
11
|
## 0.10.0
|
|
4
12
|
|
|
5
13
|
- Sanitize transaction events (`before_send_transaction`) and check-in events (`before_send_check_in`). Only `request` and `extra` are sanitized; span data is not
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
|
@@ -21,16 +21,20 @@ Currently this gem provides following features
|
|
|
21
21
|
Add this line to your application's Gemfile:
|
|
22
22
|
|
|
23
23
|
```ruby
|
|
24
|
-
gem 'sentry-sanitizer', '
|
|
24
|
+
gem 'sentry-sanitizer', '~> 0.10.2'
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
-
And then
|
|
27
|
+
And then in the terminal:
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
```sh
|
|
30
|
+
bundle install
|
|
31
|
+
```
|
|
30
32
|
|
|
31
|
-
Or
|
|
33
|
+
Or alternatively:
|
|
32
34
|
|
|
33
|
-
|
|
35
|
+
```sh
|
|
36
|
+
gem install sentry-sanitizer
|
|
37
|
+
```
|
|
34
38
|
|
|
35
39
|
## Usage
|
|
36
40
|
|
|
@@ -46,7 +50,7 @@ Sentry.init do |config|
|
|
|
46
50
|
config.sanitize.fields = %w[password super_secret_token]
|
|
47
51
|
|
|
48
52
|
# Use custom filter (e.g. from activesupport).
|
|
49
|
-
# Must implement #filter(
|
|
53
|
+
# Must implement #filter(hash) and #filter_param(key, value)
|
|
50
54
|
# Don't set 'config.sanitize.fields' if using this.
|
|
51
55
|
config.sanitize.filter = ActiveSupport::ParameterFilter.new(
|
|
52
56
|
Rails.application.config.filter_parameters, mask: "[FILTERED]"
|
|
@@ -74,15 +78,15 @@ end
|
|
|
74
78
|
|
|
75
79
|
Install dependencies
|
|
76
80
|
|
|
77
|
-
|
|
81
|
+
bin/setup
|
|
78
82
|
|
|
79
83
|
Experiment with the code in IRB
|
|
80
84
|
|
|
81
|
-
|
|
85
|
+
bin/console
|
|
82
86
|
|
|
83
87
|
Run tests
|
|
84
88
|
|
|
85
|
-
|
|
89
|
+
bin/rake test
|
|
86
90
|
|
|
87
91
|
## Contributing
|
|
88
92
|
|
|
@@ -46,6 +46,7 @@ module Sentry
|
|
|
46
46
|
event.request.query_string = sanitize_query_string(event.request.query_string)
|
|
47
47
|
end
|
|
48
48
|
event.extra = sanitize_data(event.extra)
|
|
49
|
+
event.spans = sanitize_data(event.spans) if event.is_a?(Sentry::TransactionEvent)
|
|
49
50
|
end
|
|
50
51
|
|
|
51
52
|
def sanitize_hash!(event)
|
|
@@ -66,6 +67,12 @@ module Sentry
|
|
|
66
67
|
elsif event[:extra]
|
|
67
68
|
event[:extra] = sanitize_data(event[:extra])
|
|
68
69
|
end
|
|
70
|
+
|
|
71
|
+
if event["spans"]
|
|
72
|
+
event["spans"] = sanitize_data(event["spans"])
|
|
73
|
+
elsif event[:spans]
|
|
74
|
+
event[:spans] = sanitize_data(event[:spans])
|
|
75
|
+
end
|
|
69
76
|
end
|
|
70
77
|
|
|
71
78
|
def sanitize_breadcrumb!(breadcrumb)
|
|
@@ -86,8 +93,10 @@ module Sentry
|
|
|
86
93
|
|
|
87
94
|
def sanitize_data(data)
|
|
88
95
|
case data
|
|
89
|
-
when Hash
|
|
96
|
+
when Hash
|
|
90
97
|
filter.filter(data)
|
|
98
|
+
when Array
|
|
99
|
+
data.map { |element| sanitize_data(element) }
|
|
91
100
|
else
|
|
92
101
|
data
|
|
93
102
|
end
|