startback 1.2.2 → 1.2.4
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/lib/startback/support/redactor.rb +3 -2
- data/lib/startback/version.rb +1 -1
- data/spec/unit/support/test_redactor.rb +13 -0
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f2b3f5905f4ccd14455c4fdd9f75f3a5a4db8cd9d45b24489abcb36f7da2ab18
|
|
4
|
+
data.tar.gz: d3f6db4e6731c0a3f15632772c251f779c94e583e5f7717f23eeedc28daede58
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6a06c741ee36bb749bba1d36b30d31d5f6382e3389520f836a2fdf4197ac6938132e485e022c33ee87eeb056e1a27584dc0d86f2e9c99f532f501c07c0c19a7c
|
|
7
|
+
data.tar.gz: 529f3d17e7f3811daab2974879b6ae8d3f46a0c1658e623a57e2c3a11c953c25bdf257b2c51c943e6c4ede934ea90e0830d9050959612470b8288964b4069e71
|
|
@@ -21,8 +21,9 @@ module Startback
|
|
|
21
21
|
}]
|
|
22
22
|
when Enumerable
|
|
23
23
|
data.map{|elm| redact(elm) }.compact
|
|
24
|
-
when
|
|
25
|
-
data
|
|
24
|
+
when String
|
|
25
|
+
return data unless data.valid_encoding?
|
|
26
|
+
data =~ /:\/\// ? data.gsub(/:\/\/([^@]+[@])/){|m| "://--redacted--@" } : data
|
|
26
27
|
else
|
|
27
28
|
data
|
|
28
29
|
end
|
data/lib/startback/version.rb
CHANGED
|
@@ -90,6 +90,19 @@ module Startback
|
|
|
90
90
|
expect(r.redact('http://user:password@google.com/a/path')).to eql('http://--redacted--@google.com/a/path')
|
|
91
91
|
end
|
|
92
92
|
|
|
93
|
+
it 'handles strings with invalid encoding without raising' do
|
|
94
|
+
binary = "hello\x80\xFF world".dup.force_encoding('UTF-8')
|
|
95
|
+
expect(binary.valid_encoding?).to be false
|
|
96
|
+
expect { redactor.redact(binary) }.not_to raise_error
|
|
97
|
+
expect(redactor.redact(binary)).to equal(binary)
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
it 'handles binary strings in nested structures' do
|
|
101
|
+
binary = "\x80\xFF".dup.force_encoding('UTF-8')
|
|
102
|
+
data = { foo: "bar", nested: { value: binary } }
|
|
103
|
+
expect { redactor.redact(data) }.not_to raise_error
|
|
104
|
+
end
|
|
105
|
+
|
|
93
106
|
end # class Redactor
|
|
94
107
|
end # module Support
|
|
95
108
|
end # module Startback
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: startback
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.2.
|
|
4
|
+
version: 1.2.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Bernard Lambeau
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-09-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rspec
|
|
@@ -273,7 +273,7 @@ dependencies:
|
|
|
273
273
|
version: 0.21.0
|
|
274
274
|
- - "<"
|
|
275
275
|
- !ruby/object:Gem::Version
|
|
276
|
-
version: 0.
|
|
276
|
+
version: 0.25.0
|
|
277
277
|
type: :runtime
|
|
278
278
|
prerelease: false
|
|
279
279
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -283,7 +283,7 @@ dependencies:
|
|
|
283
283
|
version: 0.21.0
|
|
284
284
|
- - "<"
|
|
285
285
|
- !ruby/object:Gem::Version
|
|
286
|
-
version: 0.
|
|
286
|
+
version: 0.25.0
|
|
287
287
|
- !ruby/object:Gem::Dependency
|
|
288
288
|
name: tzinfo
|
|
289
289
|
requirement: !ruby/object:Gem::Requirement
|