sentry-sanitizer 0.8.1 → 0.8.3
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/.github/workflows/ci-linux.yml +8 -7
- data/.github/workflows/ci-macos.yml +8 -8
- data/CHANGELOG.md +4 -0
- data/Gemfile +7 -0
- data/Gemfile.lock +11 -5
- data/README.md +14 -7
- data/lib/sentry/sanitizer/cleaner.rb +14 -2
- data/lib/sentry/sanitizer/version.rb +1 -1
- data/sentry-sanitizer.gemspec +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a7bc289ffde1f50c00d106f61043ad632a52ecd968a7bf71bdafd547e5cb2925
|
|
4
|
+
data.tar.gz: 4b73825010b886929ff60d7700691dfb37ee2fc0c7e732ff676e07dbf89a399d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6e406797082235874ef3d9cdcfa7c969309931793c95150731f5ccedfece04b60e82b16395a34a51f93677ee768eb5500aeda889f0895a2c7778b326f1e7bf18
|
|
7
|
+
data.tar.gz: 4d287d7119d61cebfdc72203268e6d6c4c1668822a829025031b03dbc289e74913b538b9e0d64711143d34e6dd830d565dbd322a456cf71d6718dd678e5a211a
|
|
@@ -10,13 +10,14 @@ jobs:
|
|
|
10
10
|
strategy:
|
|
11
11
|
matrix:
|
|
12
12
|
include:
|
|
13
|
-
- { ruby_version:
|
|
14
|
-
- { ruby_version: 3.0 }
|
|
15
|
-
- { ruby_version: 3.
|
|
16
|
-
- { ruby_version:
|
|
17
|
-
- { ruby_version:
|
|
18
|
-
- { ruby_version:
|
|
19
|
-
|
|
13
|
+
- { ruby_version: 3.3, sentry_version: "~> 6.0" }
|
|
14
|
+
- { ruby_version: 3.4, sentry_version: "~> 6.0" }
|
|
15
|
+
- { ruby_version: 3.4, sentry_version: "~> 7.0" }
|
|
16
|
+
- { ruby_version: 4.0, sentry_version: "~> 6.0" }
|
|
17
|
+
- { ruby_version: 4.0, sentry_version: "~> 7.0" }
|
|
18
|
+
- { ruby_version: jruby, sentry_version: "~> 6.0" }
|
|
19
|
+
env:
|
|
20
|
+
SENTRY_VERSION: ${{ matrix.sentry_version }}
|
|
20
21
|
steps:
|
|
21
22
|
- uses: actions/checkout@v1
|
|
22
23
|
|
|
@@ -10,13 +10,14 @@ jobs:
|
|
|
10
10
|
strategy:
|
|
11
11
|
matrix:
|
|
12
12
|
include:
|
|
13
|
-
- { ruby_version:
|
|
14
|
-
- { ruby_version: 3.0 }
|
|
15
|
-
- { ruby_version: 3.
|
|
16
|
-
- { ruby_version:
|
|
17
|
-
- { ruby_version:
|
|
18
|
-
- { ruby_version:
|
|
19
|
-
|
|
13
|
+
- { ruby_version: 3.3, sentry_version: "~> 6.0" }
|
|
14
|
+
- { ruby_version: 3.4, sentry_version: "~> 6.0" }
|
|
15
|
+
- { ruby_version: 3.4, sentry_version: "~> 7.0" }
|
|
16
|
+
- { ruby_version: 4.0, sentry_version: "~> 6.0" }
|
|
17
|
+
- { ruby_version: 4.0, sentry_version: "~> 7.0" }
|
|
18
|
+
- { ruby_version: jruby, sentry_version: "~> 6.0" }
|
|
19
|
+
env:
|
|
20
|
+
SENTRY_VERSION: ${{ matrix.sentry_version }}
|
|
20
21
|
steps:
|
|
21
22
|
- uses: actions/checkout@v1
|
|
22
23
|
|
|
@@ -37,4 +38,3 @@ jobs:
|
|
|
37
38
|
with:
|
|
38
39
|
flag-name: ruby-${{ join(matrix.*, '-') }}
|
|
39
40
|
parallel: true
|
|
40
|
-
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
|
@@ -7,7 +7,14 @@ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
|
|
|
7
7
|
# Specify your gem's dependencies in sentry-sanitizer.gemspec
|
|
8
8
|
gemspec
|
|
9
9
|
|
|
10
|
+
gem "sentry-ruby", ENV.fetch("SENTRY_VERSION", "~> 6.0")
|
|
11
|
+
# sentry-ruby requires "logger" internally but only declares it as a dependency
|
|
12
|
+
# itself from ~6.3.1/7.0 onwards; older sentry-ruby versions rely on it being a
|
|
13
|
+
# stdlib default gem, which Ruby 4.0 no longer bundles by default.
|
|
14
|
+
gem "logger"
|
|
15
|
+
|
|
10
16
|
gem "base64"
|
|
17
|
+
gem "cgi"
|
|
11
18
|
gem "rubocop", "~> 1.28.2"
|
|
12
19
|
gem "simplecov", require: false, group: :test
|
|
13
20
|
|
data/Gemfile.lock
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
sentry-sanitizer (0.8.
|
|
5
|
-
sentry-ruby (>= 5.3, <
|
|
4
|
+
sentry-sanitizer (0.8.3)
|
|
5
|
+
sentry-ruby (>= 5.3, < 8.0.0)
|
|
6
6
|
|
|
7
7
|
GEM
|
|
8
8
|
remote: https://rubygems.org/
|
|
9
9
|
specs:
|
|
10
10
|
ast (2.4.3)
|
|
11
11
|
base64 (0.3.0)
|
|
12
|
-
bigdecimal (
|
|
13
|
-
|
|
12
|
+
bigdecimal (4.1.3)
|
|
13
|
+
cgi (0.5.2)
|
|
14
|
+
concurrent-ruby (1.3.8)
|
|
14
15
|
diff-lcs (1.5.0)
|
|
15
16
|
docile (1.4.0)
|
|
17
|
+
logger (1.7.0)
|
|
16
18
|
parallel (1.27.0)
|
|
17
19
|
parser (3.3.10.0)
|
|
18
20
|
ast (~> 2.4.1)
|
|
@@ -50,9 +52,10 @@ GEM
|
|
|
50
52
|
parser (>= 3.3.7.2)
|
|
51
53
|
prism (~> 1.4)
|
|
52
54
|
ruby-progressbar (1.13.0)
|
|
53
|
-
sentry-ruby (6.
|
|
55
|
+
sentry-ruby (6.7.0)
|
|
54
56
|
bigdecimal
|
|
55
57
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
58
|
+
logger
|
|
56
59
|
simplecov (0.18.5)
|
|
57
60
|
docile (~> 1.1)
|
|
58
61
|
simplecov-html (~> 0.11)
|
|
@@ -65,10 +68,13 @@ PLATFORMS
|
|
|
65
68
|
DEPENDENCIES
|
|
66
69
|
base64
|
|
67
70
|
bundler (>= 2.3)
|
|
71
|
+
cgi
|
|
72
|
+
logger
|
|
68
73
|
rack
|
|
69
74
|
rake (~> 12)
|
|
70
75
|
rspec (~> 3.0)
|
|
71
76
|
rubocop (~> 1.28.2)
|
|
77
|
+
sentry-ruby (~> 6.0)
|
|
72
78
|
sentry-sanitizer!
|
|
73
79
|
simplecov
|
|
74
80
|
|
data/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
](https://github.com/mrexox/sentry-sanitizer/actions/workflows/ci-linux.yml)
|
|
2
2
|
[](https://badge.fury.io/rb/sentry-sanitizer)
|
|
3
3
|
[](https://coveralls.io/github/mrexox/sentry-sanitizer?branch=master)
|
|
4
4
|
|
|
@@ -14,11 +14,10 @@ Currently this gem provides following features
|
|
|
14
14
|
- [x] Sanitizing cookies
|
|
15
15
|
- [x] Sanitizing query string
|
|
16
16
|
- [x] Sanitizing extras ([see](https://docs.sentry.io/platforms/ruby/enriching-events/context/#additional-data) `Sentry.set_extras`)
|
|
17
|
+
- [x] Sanitizing breadcrumb data fields
|
|
17
18
|
|
|
18
19
|
## Installation
|
|
19
20
|
|
|
20
|
-
:warning: Please, don't use `0.1.*` version as it was experimental and not usable at all.
|
|
21
|
-
|
|
22
21
|
Add this line to your application's Gemfile:
|
|
23
22
|
|
|
24
23
|
```ruby
|
|
@@ -66,15 +65,23 @@ Sentry.init do |config|
|
|
|
66
65
|
end
|
|
67
66
|
```
|
|
68
67
|
|
|
69
|
-
## Development
|
|
68
|
+
## Development hints
|
|
69
|
+
|
|
70
|
+
Install dependencies
|
|
71
|
+
|
|
72
|
+
$ bin/setup
|
|
73
|
+
|
|
74
|
+
Experiment with the code in IRB
|
|
75
|
+
|
|
76
|
+
$ bin/console
|
|
70
77
|
|
|
71
|
-
|
|
78
|
+
Run tests
|
|
72
79
|
|
|
73
|
-
|
|
80
|
+
$ bin/rake test
|
|
74
81
|
|
|
75
82
|
## Contributing
|
|
76
83
|
|
|
77
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/mrexox/sentry-sanitizer.
|
|
84
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/mrexox/sentry-sanitizer/issues.
|
|
78
85
|
|
|
79
86
|
## License
|
|
80
87
|
|
|
@@ -65,7 +65,7 @@ module Sentry
|
|
|
65
65
|
|
|
66
66
|
def sanitize_breadcrumb!(breadcrumb)
|
|
67
67
|
return unless breadcrumbs_json_data_fields.size.positive?
|
|
68
|
-
return unless breadcrumb.data
|
|
68
|
+
return unless breadcrumb.data.is_a? Hash
|
|
69
69
|
|
|
70
70
|
breadcrumbs_json_data_fields.each do |field|
|
|
71
71
|
next unless breadcrumb.data.key?(field)
|
|
@@ -125,8 +125,20 @@ module Sentry
|
|
|
125
125
|
|
|
126
126
|
def sanitize_query_string(query_string)
|
|
127
127
|
return query_string unless do_query_string
|
|
128
|
-
return query_string unless query_string.is_a? String
|
|
129
128
|
|
|
129
|
+
case query_string
|
|
130
|
+
when String
|
|
131
|
+
sanitize_query_string_from_string(query_string)
|
|
132
|
+
when Hash
|
|
133
|
+
sanitize_data(query_string)
|
|
134
|
+
else
|
|
135
|
+
query_string
|
|
136
|
+
end
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
# sentry-ruby >= 7 populates Request#query_string as a Hash (from Rack's
|
|
140
|
+
# parsed request.GET) instead of the raw query string.
|
|
141
|
+
def sanitize_query_string_from_string(query_string)
|
|
130
142
|
sanitized_array = query_string.split("&").map do |kv_pair|
|
|
131
143
|
k, v = kv_pair.split("=")
|
|
132
144
|
new_v = sanitize_string(k, v)
|
data/sentry-sanitizer.gemspec
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: sentry-sanitizer
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.8.
|
|
4
|
+
version: 0.8.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Valentine Kiselev
|
|
@@ -18,7 +18,7 @@ dependencies:
|
|
|
18
18
|
version: '5.3'
|
|
19
19
|
- - "<"
|
|
20
20
|
- !ruby/object:Gem::Version
|
|
21
|
-
version:
|
|
21
|
+
version: 8.0.0
|
|
22
22
|
type: :runtime
|
|
23
23
|
prerelease: false
|
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -28,7 +28,7 @@ dependencies:
|
|
|
28
28
|
version: '5.3'
|
|
29
29
|
- - "<"
|
|
30
30
|
- !ruby/object:Gem::Version
|
|
31
|
-
version:
|
|
31
|
+
version: 8.0.0
|
|
32
32
|
description: Add missing sanitizing support for sentry-ruby (previous sentry-raven)
|
|
33
33
|
email:
|
|
34
34
|
- mrexox@outlook.com
|