hermes-rb 0.7.4 → 0.7.5

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
2
  SHA256:
3
- metadata.gz: 94187b0dbacdc8b471962dd95e728a6656b09a700b58d28fb5dbdabb7f8f29e6
4
- data.tar.gz: fd3a5be4f4f9ab8c15b45398644cb0e88f17e1e2326ffd6156b98883c073fd9c
3
+ metadata.gz: c586c6b4d8703a646bf4be6b1145afd38a5921994a6fc2fc0d399bf0652af216
4
+ data.tar.gz: 343f3da81e31571f3c3d70459d1820964404662216e067a660d721cc2d030f7b
5
5
  SHA512:
6
- metadata.gz: 631b9f899d6da6843fe5d31ceef76dc722c2dacaa035d8fbc1de2ff09cebe677b0aa5c607bdb104dce8c4407dfb53a53a5bbd5bd05530466b48808e30bc72db0
7
- data.tar.gz: '0547960e1b5a139f5cc6415a344ccd927b5c2ddd5f4de9b4148d40b307fdd92eff9fd6d817e4a57b2b53c5f97a693b632ba33d76d90a2c12f210c657e038ac87'
6
+ metadata.gz: edddadf124f234e4a5ca107f268d40c84df75c5cae9d09992d91dc9329152454d0bb838ceb5edd3c8697618b5477c6b8898fa0869a2dfa4e387e24d5be60ab08
7
+ data.tar.gz: 1547023b70a7c298c4247fba604bf2d4420a9335c9966dd3944049f667aa0815737925f60357190a9a511011d22c1b6690d63a8a000f5f4209fa812989d12527
data/Changelog.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## Master
4
4
 
5
+ ## 0.7.5
6
+
7
+ - Make `Hermes::Logger::ParamsFilter` correctly handle regexps
8
+
5
9
  ## 0.7.4
6
10
 
7
11
  - Make `Hermes::Logger::ParamsFilter` handle case-insensitive matches
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- hermes-rb (0.7.4)
4
+ hermes-rb (0.7.5)
5
5
  activerecord (>= 5)
6
6
  activesupport (>= 5)
7
7
  dry-container (~> 0)
@@ -11,15 +11,25 @@ module Hermes
11
11
  private :sensitive_keywords, :stripped_value
12
12
 
13
13
  def initialize(sensitive_keywords: SENSITIVE_ATTRIBUTES_KEYWORDS, stripped_value: STRIPPED_VALUE)
14
- @sensitive_keywords = sensitive_keywords.map(&:to_s)
14
+ @sensitive_keywords = sensitive_keywords
15
15
  @stripped_value = stripped_value
16
16
  end
17
17
 
18
18
  def call(attribute, value)
19
- if sensitive_keywords.any? { |sensitive_attribute| attribute.to_s.downcase.match(sensitive_attribute.to_s.downcase) } && value.respond_to?(:to_str)
19
+ if sensitive_keywords.any? { |sensitive_attribute| match?(sensitive_attribute, attribute) } && value.respond_to?(:to_str)
20
20
  value.gsub!(value, stripped_value)
21
21
  end
22
22
  end
23
+
24
+ private
25
+
26
+ def match?(sensitive_attribute, attribute)
27
+ if Regexp === sensitive_attribute
28
+ attribute.to_s.match(sensitive_attribute)
29
+ else
30
+ attribute.to_s.downcase.match(sensitive_attribute.to_s.downcase)
31
+ end
32
+ end
23
33
  end
24
34
  end
25
35
  end
@@ -1,5 +1,5 @@
1
1
  module Hermes
2
2
  module Rb
3
- VERSION = "0.7.4"
3
+ VERSION = "0.7.5"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hermes-rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.4
4
+ version: 0.7.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Karol Galanciak
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-09 00:00:00.000000000 Z
11
+ date: 2023-01-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-struct