bmx-event_hook_client_server 1.0.16 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Gemfile.lock +14 -16
- data/event_hook_client_server.gemspec +3 -2
- data/lib/event_hook_client_server/client/models/integration.rb +3 -0
- data/lib/event_hook_client_server/client.rb +14 -5
- data/lib/event_hook_client_server/protobuf/event_hook_client_server/v1/enums/integrator_pb.rb +1 -0
- data/lib/event_hook_client_server/protobuf/event_hook_client_server/v1/messages/integration_pb.rb +7 -0
- data/lib/event_hook_client_server/server.rb +7 -2
- data/lib/event_hook_client_server/version.rb +2 -2
- metadata +10 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 65f5db2708169020749675c25acc1e2667ef71ced128f7425b587d72d95fcc9a
|
4
|
+
data.tar.gz: 9afb75af27e4e750c5c03deb9ac031e187e80c645a5f75f61743fc98d58b9226
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ebb32fac1060f42430883b9d40a12306a1b4bbdaa7b524b85aa02c1d24cc876d7093ceb39594b15930866c2e078c92916a8414a6b4b0534fdefa8617becd7e56
|
7
|
+
data.tar.gz: bb5c45221e429c82ebe67796cc3c338b4217a94d58ea25afab7dfd3c8f90d6398235d37eefff21ca273ac35df84f09c8fc3e6102337bd776b872f4006ab4795a
|
data/Gemfile.lock
CHANGED
@@ -1,33 +1,31 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
bmx-event_hook_client_server (1.
|
4
|
+
bmx-event_hook_client_server (1.1.1)
|
5
5
|
dry-struct (~> 1.0)
|
6
|
-
google-protobuf (~> 3.
|
7
|
-
grpc (~> 1.
|
6
|
+
google-protobuf (~> 3.14)
|
7
|
+
grpc (~> 1.34)
|
8
8
|
retriable (~> 3.1.2)
|
9
9
|
|
10
10
|
GEM
|
11
11
|
remote: https://rubygems.org/
|
12
12
|
specs:
|
13
13
|
coderay (1.1.2)
|
14
|
-
concurrent-ruby (1.1.
|
14
|
+
concurrent-ruby (1.1.7)
|
15
15
|
diff-lcs (1.3)
|
16
|
-
dry-configurable (0.
|
16
|
+
dry-configurable (0.12.0)
|
17
17
|
concurrent-ruby (~> 1.0)
|
18
|
-
dry-core (~> 0.
|
19
|
-
dry-equalizer (~> 0.2)
|
18
|
+
dry-core (~> 0.5, >= 0.5.0)
|
20
19
|
dry-container (0.7.2)
|
21
20
|
concurrent-ruby (~> 1.0)
|
22
21
|
dry-configurable (~> 0.1, >= 0.1.3)
|
23
|
-
dry-core (0.
|
22
|
+
dry-core (0.5.0)
|
24
23
|
concurrent-ruby (~> 1.0)
|
25
24
|
dry-equalizer (0.3.0)
|
26
25
|
dry-inflector (0.2.0)
|
27
|
-
dry-logic (1.0
|
26
|
+
dry-logic (1.1.0)
|
28
27
|
concurrent-ruby (~> 1.0)
|
29
|
-
dry-core (~> 0.
|
30
|
-
dry-equalizer (~> 0.2)
|
28
|
+
dry-core (~> 0.5, >= 0.5)
|
31
29
|
dry-struct (1.3.0)
|
32
30
|
dry-core (~> 0.4, >= 0.4.4)
|
33
31
|
dry-equalizer (~> 0.3)
|
@@ -40,11 +38,11 @@ GEM
|
|
40
38
|
dry-equalizer (~> 0.3)
|
41
39
|
dry-inflector (~> 0.1, >= 0.1.2)
|
42
40
|
dry-logic (~> 1.0, >= 1.0.2)
|
43
|
-
google-protobuf (3.
|
44
|
-
googleapis-common-protos-types (1.0.
|
45
|
-
google-protobuf (~> 3.
|
46
|
-
grpc (1.
|
47
|
-
google-protobuf (~> 3.
|
41
|
+
google-protobuf (3.14.0)
|
42
|
+
googleapis-common-protos-types (1.0.5)
|
43
|
+
google-protobuf (~> 3.11)
|
44
|
+
grpc (1.34.0)
|
45
|
+
google-protobuf (~> 3.13)
|
48
46
|
googleapis-common-protos-types (~> 1.0)
|
49
47
|
grpc-tools (1.27.0)
|
50
48
|
ice_nine (0.11.2)
|
@@ -57,9 +57,10 @@ Gem::Specification.new do |spec|
|
|
57
57
|
spec.require_paths = ['lib']
|
58
58
|
|
59
59
|
spec.add_dependency 'dry-struct', '~> 1.0'
|
60
|
-
spec.add_dependency 'google-protobuf', '~> 3.
|
61
|
-
spec.add_dependency 'grpc', '~> 1.
|
60
|
+
spec.add_dependency 'google-protobuf', '~> 3.14'
|
61
|
+
spec.add_dependency 'grpc', '~> 1.34'
|
62
62
|
spec.add_dependency 'retriable', '~> 3.1.2'
|
63
|
+
# spec.add_dependency 'zeitwerk'
|
63
64
|
|
64
65
|
spec.add_development_dependency 'bundler', '~> 2.0'
|
65
66
|
spec.add_development_dependency 'rake', '~> 10.0'
|
@@ -17,9 +17,12 @@ module EventHookClientServer
|
|
17
17
|
attribute :building_id, Types::Strict::String.optional
|
18
18
|
attribute :tenant_id, Types::Strict::String.optional
|
19
19
|
attribute :company_id, Types::Strict::String.optional
|
20
|
+
attribute :unit_id, Types::Strict::String.optional
|
20
21
|
attribute :integrator, Types::Strict::Symbol
|
21
22
|
attribute :config, Types::Strict::Hash
|
22
23
|
attribute :bindings, Types::Array.of(Binding)
|
24
|
+
attribute :created_by_id, Types::Strict::String
|
25
|
+
attribute :oauth_client_id, Types::Strict::String
|
23
26
|
end
|
24
27
|
end
|
25
28
|
end
|
@@ -40,10 +40,14 @@ module EventHookClientServer
|
|
40
40
|
'grpc.http2.max_ping_strikes': 0,
|
41
41
|
'grpc.http2.min_time_between_pings_ms': 75 * 100,
|
42
42
|
'grpc.http2.min_ping_interval_without_data_ms': 75 * 100
|
43
|
-
}
|
43
|
+
},
|
44
|
+
interceptors: []
|
44
45
|
}.freeze
|
45
46
|
private_constant :DEFAULT_CONFIG
|
46
47
|
|
48
|
+
NON_STUB_OPTIONS = %i[host channel_mode].freeze
|
49
|
+
private_constant :NON_STUB_OPTIONS
|
50
|
+
|
47
51
|
RETRIABLE_ERRORS = [
|
48
52
|
GRPC::DeadlineExceeded, GRPC::Unavailable, GRPC::ResourceExhausted,
|
49
53
|
GRPC::Unknown
|
@@ -58,7 +62,11 @@ module EventHookClientServer
|
|
58
62
|
end
|
59
63
|
|
60
64
|
def self.default_config
|
61
|
-
@default_config ||= DEFAULT_CONFIG.dup
|
65
|
+
@default_config ||= DEFAULT_CONFIG.dup.tap do |config|
|
66
|
+
if defined?(ElasticAPM::GRPC::ClientInterceptor)
|
67
|
+
config[:interceptors] << ElasticAPM::GRPC::ClientInterceptor.new
|
68
|
+
end
|
69
|
+
end
|
62
70
|
end
|
63
71
|
|
64
72
|
attr_reader :hosts
|
@@ -91,11 +99,12 @@ module EventHookClientServer
|
|
91
99
|
end
|
92
100
|
|
93
101
|
def recreate_grpc_client!
|
102
|
+
grpc_options = options.reject { |k, _| NON_STUB_OPTIONS.include?(k) }
|
103
|
+
|
94
104
|
@grpc_client = GRPC_CLIENT_CLASS.new(
|
95
105
|
hosts.next,
|
96
106
|
options[:channel_mode],
|
97
|
-
|
98
|
-
channel_args: options[:channel_args]
|
107
|
+
grpc_options
|
99
108
|
)
|
100
109
|
end
|
101
110
|
|
@@ -211,7 +220,7 @@ module EventHookClientServer
|
|
211
220
|
|
212
221
|
def retry_on_failure(&block)
|
213
222
|
Retriable
|
214
|
-
.retriable(on: RETRIABLE_ERRORS, on_retry:
|
223
|
+
.retriable(on: RETRIABLE_ERRORS, on_retry: proc { rotate_host! }) do
|
215
224
|
block.call
|
216
225
|
end
|
217
226
|
end
|
data/lib/event_hook_client_server/protobuf/event_hook_client_server/v1/messages/integration_pb.rb
CHANGED
@@ -18,6 +18,9 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
18
18
|
optional :building_id, :message, 10, "google.protobuf.StringValue"
|
19
19
|
optional :tenant_id, :message, 11, "google.protobuf.StringValue"
|
20
20
|
optional :company_id, :message, 12, "google.protobuf.StringValue"
|
21
|
+
optional :unit_id, :message, 13, "google.protobuf.StringValue"
|
22
|
+
optional :oauth_client_id, :message, 14, "google.protobuf.StringValue"
|
23
|
+
optional :created_by_id, :message, 15, "google.protobuf.StringValue"
|
21
24
|
end
|
22
25
|
add_message "event_hook_client_server.v1.messages.IntegrationConfiguration" do
|
23
26
|
optional :type, :enum, 1, "event_hook_client_server.v1.enums.Integrator"
|
@@ -34,6 +37,9 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
34
37
|
optional :building_id, :message, 10, "google.protobuf.StringValue"
|
35
38
|
optional :tenant_id, :message, 11, "google.protobuf.StringValue"
|
36
39
|
optional :company_id, :message, 12, "google.protobuf.StringValue"
|
40
|
+
optional :unit_id, :message, 13, "google.protobuf.StringValue"
|
41
|
+
optional :oauth_client_id, :message, 14, "google.protobuf.StringValue"
|
42
|
+
optional :created_by_id, :message, 15, "google.protobuf.StringValue"
|
37
43
|
end
|
38
44
|
add_message "event_hook_client_server.v1.messages.IntegrationInputConfiguration" do
|
39
45
|
optional :type, :enum, 1, "event_hook_client_server.v1.enums.Integrator"
|
@@ -80,6 +86,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
80
86
|
optional :building_id, :message, 10, "google.protobuf.StringValue"
|
81
87
|
optional :tenant_id, :message, 11, "google.protobuf.StringValue"
|
82
88
|
optional :company_id, :message, 12, "google.protobuf.StringValue"
|
89
|
+
optional :unit_id, :message, 13, "google.protobuf.StringValue"
|
83
90
|
end
|
84
91
|
end
|
85
92
|
end
|
@@ -28,12 +28,17 @@ module EventHookClientServer
|
|
28
28
|
'grpc.http2.max_ping_strikes': 0,
|
29
29
|
'grpc.http2.min_time_between_pings_ms': 75 * 100,
|
30
30
|
'grpc.http2.min_ping_interval_without_data_ms': 75 * 100
|
31
|
-
}
|
31
|
+
},
|
32
|
+
interceptors: []
|
32
33
|
}.freeze
|
33
34
|
private_constant :DEFAULT_CONFIG
|
34
35
|
|
35
36
|
def self.default_config
|
36
|
-
@default_config ||= DEFAULT_CONFIG.dup
|
37
|
+
@default_config ||= DEFAULT_CONFIG.dup.tap do |config|
|
38
|
+
if defined?(ElasticAPM::GRPC::ClientInterceptor)
|
39
|
+
config[:interceptors] << ElasticAPM::GRPC::ClientInterceptor.new
|
40
|
+
end
|
41
|
+
end
|
37
42
|
end
|
38
43
|
|
39
44
|
attr_writer :logger
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bmx-event_hook_client_server
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stanko K.R.
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-struct
|
@@ -30,28 +30,28 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 3.
|
33
|
+
version: '3.14'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 3.
|
40
|
+
version: '3.14'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: grpc
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 1.
|
47
|
+
version: '1.34'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 1.
|
54
|
+
version: '1.34'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: retriable
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -150,7 +150,7 @@ metadata:
|
|
150
150
|
homepage_uri: https://github.com/runslikebutter/event_hook_client_server
|
151
151
|
source_code_uri: https://github.com/runslikebutter/event_hook_client_server
|
152
152
|
changelog_uri: https://github.com/runslikebutter/event_hook_client_server/blob/master/CHANGELOG.md
|
153
|
-
post_install_message:
|
153
|
+
post_install_message:
|
154
154
|
rdoc_options: []
|
155
155
|
require_paths:
|
156
156
|
- lib
|
@@ -165,9 +165,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
165
165
|
- !ruby/object:Gem::Version
|
166
166
|
version: '0'
|
167
167
|
requirements: []
|
168
|
-
|
169
|
-
|
170
|
-
signing_key:
|
168
|
+
rubygems_version: 3.1.6
|
169
|
+
signing_key:
|
171
170
|
specification_version: 4
|
172
171
|
summary: Client and server implementation for the Webhook Configurator service.
|
173
172
|
test_files: []
|