hermes-rb 0.7.4 → 0.8.0

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: 433cc1a9749f827d101d9294283011975311319379d6d074ae721e0b85e2f99f
4
+ data.tar.gz: bbec7e7bde055e3bfdc636c036dca46e48e3bd3f9ada9d87cfe7b9ae263f6bc2
5
5
  SHA512:
6
- metadata.gz: 631b9f899d6da6843fe5d31ceef76dc722c2dacaa035d8fbc1de2ff09cebe677b0aa5c607bdb104dce8c4407dfb53a53a5bbd5bd05530466b48808e30bc72db0
7
- data.tar.gz: '0547960e1b5a139f5cc6415a344ccd927b5c2ddd5f4de9b4148d40b307fdd92eff9fd6d817e4a57b2b53c5f97a693b632ba33d76d90a2c12f210c657e038ac87'
6
+ metadata.gz: 21a8cad1f51fbdff6104312154a4e9145b9385d005ac8194b1fbba54c28ff1bfb5f75938c359c7617b68b8b41eeb330689472f344c0a303aeb544694794ec4c3
7
+ data.tar.gz: 0e725e42455d602480c07160e69039c945c90510e3fe23f2cfdd69fd5dc5e29565a21206307eceaa3a0e84aacd49efdac125d353a855993032ac7fec66a072a0
data/Changelog.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  ## Master
4
4
 
5
+ ## 0.8.0
6
+
7
+ - Fix `database_connection_provider` config option: avoid calling connection on app initialization
8
+
9
+ ## 0.7.5
10
+
11
+ - Make `Hermes::Logger::ParamsFilter` correctly handle regexps
12
+
5
13
  ## 0.7.4
6
14
 
7
15
  - 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.8.0)
5
5
  activerecord (>= 5)
6
6
  activesupport (>= 5)
7
7
  dry-container (~> 0)
data/README.md CHANGED
@@ -30,7 +30,7 @@ Rails.application.config.to_prepare do
30
30
  config.adapter = Rails.application.config.async_messaging_adapter
31
31
  config.application_prefix = "my_app"
32
32
  config.background_processor = HermesHandlerJob
33
- config.database_connection_provider = ActiveRecord::Base.connection
33
+ config.database_connection_provider = ActiveRecord::Base
34
34
  config.enqueue_method = :perform_async
35
35
  config.event_handler = event_handler
36
36
  config.clock = Time.zone
@@ -88,7 +88,7 @@ end
88
88
 
89
89
  If you know what you are doing, you don't necessarily have to process things in the background. As long as the class implements the expected interface, you can do anything you want.
90
90
 
91
- 5. `database_connection_provider` - an object responding to `reconnect!`. It is used during synchronous flow to ensure a valid connection. Optional.
91
+ 5. `database_connection_provider` - an object responding to `connection`. It is used during synchronous flow to ensure a valid connection. Optional.
92
92
  6. `event_handler` - an instance of event handler/storage, just use what is shown in the example. Notice that you can also pass extra consumer config lambda that will be evaluated within the context of Hutch consumer.
93
93
  7. `clock` - a clock object that is time-zone aware, implementing `now` method.
94
94
  8. `configure_hutch` - a way to configure Hutch:
@@ -4,6 +4,6 @@ source "https://rubygems.org"
4
4
 
5
5
  gem "activesupport", "~> 6.1.0"
6
6
  gem "activerecord", "~> 6.1.0"
7
- gem "ddtrace", "> 1.0"
7
+ gem "ddtrace", git: "https://github.com/DataDog/dd-trace-rb.git", branch: "master"
8
8
 
9
9
  gemspec path: "../"
@@ -4,6 +4,6 @@ source "https://rubygems.org"
4
4
 
5
5
  gem "activesupport", "~> 7.0.0"
6
6
  gem "activerecord", "~> 7.0.0"
7
- gem "ddtrace", "> 1.0"
7
+ gem "ddtrace", git: "https://github.com/DataDog/dd-trace-rb.git", branch: "master"
8
8
 
9
9
  gemspec path: "../"
@@ -61,7 +61,7 @@ module Hermes
61
61
  end
62
62
 
63
63
  def ensure_database_connection!
64
- config.database_connection_provider.reconnect! if config.database_connection_provider
64
+ config.database_connection_provider.connection.reconnect! if config.database_connection_provider
65
65
  end
66
66
  end
67
67
 
@@ -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.8.0"
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.8.0
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-04-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-struct