hermes-rb 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Changelog.md +3 -0
- data/Gemfile.lock +12 -12
- data/README.md +6 -6
- data/lib/hermes/logger/params_filter.rb +1 -1
- data/lib/hermes/rb/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8d9a8e1af4d989ab98014db38015a8a00f24c2c7a4ab0d7724c849e092812855
|
4
|
+
data.tar.gz: 7038b16132b50567e00ebd2398054907f8e17dccc6e15652a7367f1dbd76299e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 432bfa0092f9dbeaad563aadea388c542a8daf06c4708dca3df620806b8c678350c88b27838d2c6fd06eda9ce84398c5eb3d770efca21eff63a528161e46a3d9
|
7
|
+
data.tar.gz: ba182e98338361a3024829c2e7872bf935d28769a3c69f373ecbd4a3f6676040f6a2ecd3b2753f7683e0e799484dbbd178d695679a36fb0440a25575015f12f3
|
data/Changelog.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
hermes-rb (0.6.
|
4
|
+
hermes-rb (0.6.1)
|
5
5
|
activerecord (>= 5)
|
6
6
|
activesupport (>= 5)
|
7
7
|
dry-container (~> 0)
|
@@ -12,12 +12,12 @@ PATH
|
|
12
12
|
GEM
|
13
13
|
remote: https://rubygems.org/
|
14
14
|
specs:
|
15
|
-
activemodel (6.1.3)
|
16
|
-
activesupport (= 6.1.3)
|
17
|
-
activerecord (6.1.3)
|
18
|
-
activemodel (= 6.1.3)
|
19
|
-
activesupport (= 6.1.3)
|
20
|
-
activesupport (6.1.3)
|
15
|
+
activemodel (6.1.3.2)
|
16
|
+
activesupport (= 6.1.3.2)
|
17
|
+
activerecord (6.1.3.2)
|
18
|
+
activemodel (= 6.1.3.2)
|
19
|
+
activesupport (= 6.1.3.2)
|
20
|
+
activesupport (6.1.3.2)
|
21
21
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
22
22
|
i18n (>= 1.6, < 2)
|
23
23
|
minitest (>= 5.1)
|
@@ -28,20 +28,20 @@ GEM
|
|
28
28
|
amq-protocol (~> 2.3, >= 2.3.1)
|
29
29
|
carrot-top (0.0.7)
|
30
30
|
json
|
31
|
-
concurrent-ruby (1.1.
|
31
|
+
concurrent-ruby (1.1.9)
|
32
32
|
ddtrace (0.45.0)
|
33
33
|
msgpack
|
34
34
|
diff-lcs (1.4.4)
|
35
35
|
dry-configurable (0.12.1)
|
36
36
|
concurrent-ruby (~> 1.0)
|
37
37
|
dry-core (~> 0.5, >= 0.5.0)
|
38
|
-
dry-container (0.
|
38
|
+
dry-container (0.8.0)
|
39
39
|
concurrent-ruby (~> 1.0)
|
40
40
|
dry-configurable (~> 0.1, >= 0.1.3)
|
41
|
-
dry-core (0.
|
41
|
+
dry-core (0.6.0)
|
42
42
|
concurrent-ruby (~> 1.0)
|
43
43
|
dry-inflector (0.2.0)
|
44
|
-
dry-logic (1.
|
44
|
+
dry-logic (1.2.0)
|
45
45
|
concurrent-ruby (~> 1.0)
|
46
46
|
dry-core (~> 0.5, >= 0.5)
|
47
47
|
dry-struct (1.4.0)
|
@@ -59,7 +59,7 @@ GEM
|
|
59
59
|
bunny (>= 2.15, < 2.16)
|
60
60
|
carrot-top (~> 0.0.7)
|
61
61
|
multi_json (~> 1.14)
|
62
|
-
i18n (1.8.
|
62
|
+
i18n (1.8.10)
|
63
63
|
concurrent-ruby (~> 1.0)
|
64
64
|
ice_nine (0.11.2)
|
65
65
|
json (2.5.1)
|
data/README.md
CHANGED
@@ -37,8 +37,8 @@ Rails.application.config.to_prepare do
|
|
37
37
|
config.configure_hutch do |hutch|
|
38
38
|
hutch.uri = ENV.fetch("HUTCH_URI")
|
39
39
|
hutch.force_publisher_confirms = true
|
40
|
-
hutch.enable_http_api_use = false
|
41
|
-
hutch.tracer = MyOwnCustomTracerIfIWantToDoSomethingCrazy
|
40
|
+
hutch.enable_http_api_use = false
|
41
|
+
hutch.tracer = MyOwnCustomTracerIfIWantToDoSomethingCrazy
|
42
42
|
end
|
43
43
|
config.distributed_tracing_database_uri = ENV.fetch("DISTRIBUTED_TRACING_DATABASE_URI", nil)
|
44
44
|
config.error_notification_service = Raven
|
@@ -47,7 +47,7 @@ Rails.application.config.to_prepare do
|
|
47
47
|
event_handler.handle_events do
|
48
48
|
handle Events::Example::Happened, with: Example::HappenedHandler
|
49
49
|
handle Events::Example::SyncCallHappened, with: Example::SyncCallHappenedHandler, async: false
|
50
|
-
|
50
|
+
|
51
51
|
extra_consumer_config = -> do
|
52
52
|
classic_queue
|
53
53
|
quorum_queue initial_group_size: 3
|
@@ -148,7 +148,7 @@ If you don't care about it, you can leave it empty.
|
|
148
148
|
|
149
149
|
12. `distributed_tracing_database_table` - Table name for storing traces, by default it's `hermes_distributed_traces`. Optional.
|
150
150
|
|
151
|
-
13. `distributes_tracing_mapper` - an object responding to `call` method taking one argument (a hash of attributes) which must return a hash as well. This hash will be used for assigning attributes when creating `Hermes::DistributedTrace`. It defaults to `Hermes::DistributedTrace::Mapper`, which uses `logger_params_filter` to remove sensitive info (this config option is covered below). You can either provide a custom mapper or pass a custom params filter, for example: `Hermes::DistributedTrace::Mapper.new(params_filter: custom_params_filter)`
|
151
|
+
13. `distributes_tracing_mapper` - an object responding to `call` method taking one argument (a hash of attributes) which must return a hash as well. This hash will be used for assigning attributes when creating `Hermes::DistributedTrace`. It defaults to `Hermes::DistributedTrace::Mapper`, which uses `logger_params_filter` to remove sensitive info (this config option is covered below). You can either provide a custom mapper or pass a custom params filter, for example: `Hermes::DistributedTrace::Mapper.new(params_filter: custom_params_filter)`
|
152
152
|
|
153
153
|
14. `error_notification_service` - an object responding to `capture_exception` method taking one argument (error). Its interface is based on `Raven` from [Sentry Raven](https://github.com/getsentry/sentry-ruby/tree/master/sentry-raven). By default `Hermes::NullErrorNotificationService` is used, which does nothing. Optional.
|
154
154
|
|
@@ -160,7 +160,7 @@ If you don't care about it, you can leave it empty.
|
|
160
160
|
|
161
161
|
18. `logger_params_filter` - a service used as params filter for logger, to make sure no sensitive data will be logged. It defaults to `Hermes::Logger::ParamsFilter` which already performs some filtering but it might not be enough in your case. If you are not satisfied with the defaults, you have 2 options, which are especially simple in Rails apps:
|
162
162
|
- provide custom array of sensitive attributes and still use a default filter: `Hermes::Logger::ParamsFilter.new(sensitive_keywords: Rails.application.config.filter_parameters)`.
|
163
|
-
- provide custom filter object, which responds to `call` method and takes 2 arguments: attribute name and its value and performs mutation by using `gsub!` (don't worry, the entire body is cloned before passing it to the filter, so nothing unexpected will happen). This is compatible with the interface of `Rails.application.config.filter_parameters` when you use a custom filter there. In such case, you can do something like this: `Rails.application.config.filter_parameters = [Proc.new { |k, v| do_something_custom_here(k, v) }]` and then just assign `Rails.application.config.filter_parameters.first` in the Hermes config.
|
163
|
+
- provide custom filter object, which responds to `call` method and takes 2 arguments: attribute name and its value and performs mutation by using `gsub!` (don't worry, the entire body is cloned before passing it to the filter, so nothing unexpected will happen). This is compatible with the interface of `Rails.application.config.filter_parameters` when you use a custom filter there. In such case, you can do something like this: `Rails.application.config.filter_parameters = [Proc.new { |k, v| do_something_custom_here(k, v) }]` and then just assign `Rails.application.config.filter_parameters.first` in the Hermes config.
|
164
164
|
## RPC
|
165
165
|
|
166
166
|
If you want to handle RPC call, you need to add `rpc: true` flag. Keep in mind that RPC requires a synchronous processing and response, so you also need to set `async: false`. The routing key and correlation ID will be resolved based on the message that is published by the client. The payload that is sent back will be what event handler reutrns, so it might be a good idea to just return a hash so that you can operate on JSON easily.
|
@@ -483,7 +483,7 @@ curl -v localhost:3000/health_check/hermes.json
|
|
483
483
|
2. Via binary:
|
484
484
|
|
485
485
|
```
|
486
|
-
|
486
|
+
bundle exec hermes_health_check
|
487
487
|
```
|
488
488
|
|
489
489
|
## CircleCI config for installing RabbitMQ
|
@@ -2,7 +2,7 @@ module Hermes
|
|
2
2
|
class Logger
|
3
3
|
class ParamsFilter
|
4
4
|
SENSITIVE_ATTRIBUTES_KEYWORDS = %w(token password credit_card card_number security_code verification_value
|
5
|
-
private_key signature api_key secret_key publishable_key).freeze
|
5
|
+
private_key signature api_key secret_key publishable_key client_key client_secret secret).freeze
|
6
6
|
STRIPPED_VALUE = "[STRIPPED]".freeze
|
7
7
|
|
8
8
|
private_constant :SENSITIVE_ATTRIBUTES_KEYWORDS, :STRIPPED_VALUE
|
data/lib/hermes/rb/version.rb
CHANGED
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.6.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Karol Galanciak
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-06-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-struct
|