grpc 1.35.0.pre1-universal-darwin → 1.37.1-universal-darwin
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of grpc might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/src/ruby/ext/grpc/extconf.rb +9 -1
- data/src/ruby/ext/grpc/rb_channel.c +10 -1
- data/src/ruby/ext/grpc/rb_channel_credentials.c +11 -1
- data/src/ruby/ext/grpc/rb_channel_credentials.h +4 -0
- data/src/ruby/ext/grpc/rb_compression_options.c +1 -1
- data/src/ruby/ext/grpc/rb_enable_cpp.cc +1 -1
- data/src/ruby/ext/grpc/rb_grpc.c +4 -0
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.c +2 -0
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +4 -1
- data/src/ruby/ext/grpc/rb_server.c +13 -1
- data/src/ruby/ext/grpc/rb_server_credentials.c +19 -3
- data/src/ruby/ext/grpc/rb_server_credentials.h +4 -0
- data/src/ruby/ext/grpc/rb_xds_channel_credentials.c +215 -0
- data/src/ruby/ext/grpc/rb_xds_channel_credentials.h +35 -0
- data/src/ruby/ext/grpc/rb_xds_server_credentials.c +169 -0
- data/src/ruby/ext/grpc/rb_xds_server_credentials.h +35 -0
- data/src/ruby/lib/grpc/2.4/grpc_c.bundle +0 -0
- data/src/ruby/lib/grpc/2.5/grpc_c.bundle +0 -0
- data/src/ruby/lib/grpc/2.6/grpc_c.bundle +0 -0
- data/src/ruby/lib/grpc/2.7/grpc_c.bundle +0 -0
- data/src/ruby/lib/grpc/3.0/grpc_c.bundle +0 -0
- data/src/ruby/lib/grpc/generic/client_stub.rb +4 -2
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/src/ruby/pb/src/proto/grpc/testing/messages_pb.rb +7 -0
- data/src/ruby/pb/test/xds_client.rb +41 -27
- data/src/ruby/spec/call_spec.rb +1 -1
- data/src/ruby/spec/channel_credentials_spec.rb +32 -0
- data/src/ruby/spec/channel_spec.rb +17 -6
- data/src/ruby/spec/client_auth_spec.rb +27 -1
- data/src/ruby/spec/errors_spec.rb +1 -1
- data/src/ruby/spec/generic/active_call_spec.rb +2 -2
- data/src/ruby/spec/generic/client_stub_spec.rb +4 -4
- data/src/ruby/spec/generic/rpc_server_spec.rb +1 -1
- data/src/ruby/spec/server_credentials_spec.rb +25 -0
- data/src/ruby/spec/server_spec.rb +22 -0
- metadata +13 -9
- data/src/ruby/lib/grpc/2.3/grpc_c.bundle +0 -0
data/src/ruby/spec/call_spec.rb
CHANGED
@@ -60,6 +60,38 @@ describe GRPC::Core::ChannelCredentials do
|
|
60
60
|
blk = proc { GRPC::Core::ChannelCredentials.new(nil, '', nil) }
|
61
61
|
expect(&blk).to raise_error
|
62
62
|
end
|
63
|
+
|
64
|
+
it 'can be constructed with a fallback credential' do
|
65
|
+
blk = proc {
|
66
|
+
fallback = GRPC::Core::ChannelCredentials.new
|
67
|
+
GRPC::Core::XdsChannelCredentials.new(fallback)
|
68
|
+
}
|
69
|
+
expect(&blk).not_to raise_error
|
70
|
+
end
|
71
|
+
|
72
|
+
it 'fails gracefully constructed with nil' do
|
73
|
+
blk = proc {
|
74
|
+
GRPC::Core::XdsChannelCredentials.new(nil)
|
75
|
+
}
|
76
|
+
expect(&blk).to raise_error TypeError, /expected grpc_channel_credentials/
|
77
|
+
end
|
78
|
+
|
79
|
+
it 'fails gracefully constructed with a non-C-extension object' do
|
80
|
+
blk = proc {
|
81
|
+
not_a_fallback = 100
|
82
|
+
GRPC::Core::XdsChannelCredentials.new(not_a_fallback)
|
83
|
+
}
|
84
|
+
expect(&blk).to raise_error TypeError, /expected grpc_channel_credentials/
|
85
|
+
end
|
86
|
+
|
87
|
+
it 'fails gracefully constructed with a non-ChannelCredentials object' do
|
88
|
+
blk = proc {
|
89
|
+
not_a_fallback = GRPC::Core::Channel.new('dummy_host', nil,
|
90
|
+
:this_channel_is_insecure)
|
91
|
+
GRPC::Core::XdsChannelCredentials.new(not_a_fallback)
|
92
|
+
}
|
93
|
+
expect(&blk).to raise_error TypeError, /expected grpc_channel_credentials/
|
94
|
+
end
|
63
95
|
end
|
64
96
|
|
65
97
|
describe '#compose' do
|
@@ -53,7 +53,7 @@ describe GRPC::Core::Channel do
|
|
53
53
|
shared_examples '#new' do
|
54
54
|
it 'take a host name without channel args' do
|
55
55
|
blk = proc do
|
56
|
-
GRPC::Core::Channel.new('
|
56
|
+
GRPC::Core::Channel.new('phony_host', nil, :this_channel_is_insecure)
|
57
57
|
end
|
58
58
|
expect(&blk).not_to raise_error
|
59
59
|
end
|
@@ -114,7 +114,7 @@ describe GRPC::Core::Channel do
|
|
114
114
|
|
115
115
|
describe '#new for secure channels' do
|
116
116
|
def construct_with_args(a)
|
117
|
-
proc { GRPC::Core::Channel.new('
|
117
|
+
proc { GRPC::Core::Channel.new('phony_host', a, create_test_cert) }
|
118
118
|
end
|
119
119
|
|
120
120
|
it_behaves_like '#new'
|
@@ -125,7 +125,18 @@ describe GRPC::Core::Channel do
|
|
125
125
|
|
126
126
|
def construct_with_args(a)
|
127
127
|
proc do
|
128
|
-
GRPC::Core::Channel.new('
|
128
|
+
GRPC::Core::Channel.new('phony_host', a, :this_channel_is_insecure)
|
129
|
+
end
|
130
|
+
end
|
131
|
+
end
|
132
|
+
|
133
|
+
describe '#new for XDS channels' do
|
134
|
+
it_behaves_like '#new'
|
135
|
+
|
136
|
+
def construct_with_args(a)
|
137
|
+
proc do
|
138
|
+
xds_creds = GRPC::Core::XdsChannelCredentials.new(create_test_cert)
|
139
|
+
GRPC::Core::Channel.new('dummy_host', a, xds_creds)
|
129
140
|
end
|
130
141
|
end
|
131
142
|
end
|
@@ -137,7 +148,7 @@ describe GRPC::Core::Channel do
|
|
137
148
|
deadline = Time.now + 5
|
138
149
|
|
139
150
|
blk = proc do
|
140
|
-
ch.create_call(nil, nil, '
|
151
|
+
ch.create_call(nil, nil, 'phony_method', nil, deadline)
|
141
152
|
end
|
142
153
|
expect(&blk).to_not raise_error
|
143
154
|
end
|
@@ -148,7 +159,7 @@ describe GRPC::Core::Channel do
|
|
148
159
|
|
149
160
|
deadline = Time.now + 5
|
150
161
|
blk = proc do
|
151
|
-
ch.create_call(nil, nil, '
|
162
|
+
ch.create_call(nil, nil, 'phony_method', nil, deadline)
|
152
163
|
end
|
153
164
|
expect(&blk).to raise_error(RuntimeError)
|
154
165
|
end
|
@@ -160,7 +171,7 @@ describe GRPC::Core::Channel do
|
|
160
171
|
|
161
172
|
blk = proc do
|
162
173
|
fork_with_propagated_error_message do
|
163
|
-
ch.create_call(nil, nil, '
|
174
|
+
ch.create_call(nil, nil, 'phony_method', nil, deadline)
|
164
175
|
end
|
165
176
|
end
|
166
177
|
expect(&blk).to raise_error(RuntimeError, 'grpc cannot be used before and after forking')
|
@@ -85,7 +85,10 @@ describe 'client-server auth' do
|
|
85
85
|
poll_period: 1
|
86
86
|
}
|
87
87
|
@srv = new_rpc_server_for_testing(**server_opts)
|
88
|
-
|
88
|
+
ssl_creds = create_server_creds
|
89
|
+
xds_creds = GRPC::Core::XdsServerCredentials.new(ssl_creds)
|
90
|
+
port = @srv.add_http2_port('0.0.0.0:0', ssl_creds)
|
91
|
+
xds_port = @srv.add_http2_port('0.0.0.0:0', xds_creds)
|
89
92
|
@srv.handle(SslTestService)
|
90
93
|
@srv_thd = Thread.new { @srv.run }
|
91
94
|
@srv.wait_till_running
|
@@ -98,6 +101,11 @@ describe 'client-server auth' do
|
|
98
101
|
@stub = SslTestServiceStub.new("localhost:#{port}",
|
99
102
|
create_channel_creds,
|
100
103
|
**client_opts)
|
104
|
+
# auth should success as the fallback creds wil be used
|
105
|
+
xds_channel_creds = GRPC::Core::XdsChannelCredentials.new(create_channel_creds)
|
106
|
+
@xds_stub = SslTestServiceStub.new("localhost:#{xds_port}",
|
107
|
+
xds_channel_creds,
|
108
|
+
**client_opts)
|
101
109
|
end
|
102
110
|
|
103
111
|
after(:all) do
|
@@ -123,4 +131,22 @@ describe 'client-server auth' do
|
|
123
131
|
responses = @stub.a_bidi_rpc([EchoMsg.new, EchoMsg.new])
|
124
132
|
responses.each { |r| GRPC.logger.info(r) }
|
125
133
|
end
|
134
|
+
|
135
|
+
it 'xds_client-xds_server ssl fallback auth with unary RPCs' do
|
136
|
+
@xds_stub.an_rpc(EchoMsg.new)
|
137
|
+
end
|
138
|
+
|
139
|
+
it 'xds_client-xds_server ssl fallback auth with client streaming RPCs' do
|
140
|
+
@xds_stub.a_client_streaming_rpc([EchoMsg.new, EchoMsg.new])
|
141
|
+
end
|
142
|
+
|
143
|
+
it 'xds_client-xds_server ssl fallback auth with server streaming RPCs' do
|
144
|
+
responses = @xds_stub.a_server_streaming_rpc(EchoMsg.new)
|
145
|
+
responses.each { |r| GRPC.logger.info(r) }
|
146
|
+
end
|
147
|
+
|
148
|
+
it 'xds_client-xds_server ssl fallback auth with bidi RPCs' do
|
149
|
+
responses = @xds_stub.a_bidi_rpc([EchoMsg.new, EchoMsg.new])
|
150
|
+
responses.each { |r| GRPC.logger.info(r) }
|
151
|
+
end
|
126
152
|
end
|
@@ -131,7 +131,7 @@ describe GRPC::BadStatus do
|
|
131
131
|
|
132
132
|
error_msg = 'parse error: to_rpc_status failed'
|
133
133
|
error_desc = '<Google::Protobuf::ParseError> ' \
|
134
|
-
'Error occurred during parsing
|
134
|
+
'Error occurred during parsing'
|
135
135
|
|
136
136
|
# Check that the parse error was logged correctly
|
137
137
|
log_contents = @log_output.read
|
@@ -198,11 +198,11 @@ describe GRPC::ActiveCall do
|
|
198
198
|
deadline,
|
199
199
|
started: false)
|
200
200
|
|
201
|
-
metadata = { key: '
|
201
|
+
metadata = { key: 'phony_val', other: 'other_val' }
|
202
202
|
expect(@client_call.metadata_sent).to eq(false)
|
203
203
|
@client_call.merge_metadata_to_send(metadata)
|
204
204
|
|
205
|
-
message = '
|
205
|
+
message = 'phony message'
|
206
206
|
|
207
207
|
expect(call).to(
|
208
208
|
receive(:run_batch)
|
@@ -304,7 +304,7 @@ describe 'ClientStub' do # rubocop:disable Metrics/BlockLength
|
|
304
304
|
|
305
305
|
describe 'via a call operation' do
|
306
306
|
after(:each) do
|
307
|
-
# make sure op.wait doesn't
|
307
|
+
# make sure op.wait doesn't freeze, even if there's a bad status
|
308
308
|
@op.wait
|
309
309
|
end
|
310
310
|
def get_response(stub, run_start_call_first: false, credentials: nil)
|
@@ -406,7 +406,7 @@ describe 'ClientStub' do # rubocop:disable Metrics/BlockLength
|
|
406
406
|
|
407
407
|
describe 'via a call operation' do
|
408
408
|
after(:each) do
|
409
|
-
# make sure op.wait doesn't
|
409
|
+
# make sure op.wait doesn't freeze, even if there's a bad status
|
410
410
|
@op.wait
|
411
411
|
end
|
412
412
|
def get_response(stub, run_start_call_first: false)
|
@@ -547,7 +547,7 @@ describe 'ClientStub' do # rubocop:disable Metrics/BlockLength
|
|
547
547
|
|
548
548
|
describe 'via a call operation' do
|
549
549
|
after(:each) do
|
550
|
-
@op.wait # make sure wait doesn't
|
550
|
+
@op.wait # make sure wait doesn't freeze
|
551
551
|
end
|
552
552
|
def get_responses(stub, run_start_call_first: false, unmarshal: noop)
|
553
553
|
@op = stub.server_streamer(@method, @sent_msg, noop, unmarshal,
|
@@ -865,7 +865,7 @@ describe 'ClientStub' do # rubocop:disable Metrics/BlockLength
|
|
865
865
|
|
866
866
|
describe 'via a call operation' do
|
867
867
|
after(:each) do
|
868
|
-
@op.wait # make sure wait doesn't
|
868
|
+
@op.wait # make sure wait doesn't freeze
|
869
869
|
end
|
870
870
|
def get_responses(stub, run_start_call_first: false, deadline: nil,
|
871
871
|
marshal_proc: noop)
|
@@ -104,7 +104,7 @@ end
|
|
104
104
|
|
105
105
|
SynchronizedCancellationStub = SynchronizedCancellationService.rpc_stub_class
|
106
106
|
|
107
|
-
# a test service that
|
107
|
+
# a test service that holds onto call objects
|
108
108
|
# and uses them after the server-side call has been
|
109
109
|
# finished
|
110
110
|
class CheckCallAfterFinishedService
|
@@ -23,6 +23,7 @@ end
|
|
23
23
|
|
24
24
|
describe GRPC::Core::ServerCredentials do
|
25
25
|
Creds = GRPC::Core::ServerCredentials
|
26
|
+
XdsCreds = GRPC::Core::XdsServerCredentials
|
26
27
|
|
27
28
|
describe '#new' do
|
28
29
|
it 'can be constructed from a fake CA PEM, server PEM and a server key' do
|
@@ -75,5 +76,29 @@ describe GRPC::Core::ServerCredentials do
|
|
75
76
|
blk = proc { Creds.new(nil, cert_pairs, false) }
|
76
77
|
expect(&blk).to_not raise_error
|
77
78
|
end
|
79
|
+
|
80
|
+
it 'can be constructed with a fallback credential' do
|
81
|
+
_, cert_pairs, _ = load_test_certs
|
82
|
+
fallback = Creds.new(nil, cert_pairs, false)
|
83
|
+
blk = proc { XdsCreds.new(fallback) }
|
84
|
+
expect(&blk).to_not raise_error
|
85
|
+
end
|
86
|
+
|
87
|
+
it 'cannot be constructed with nil' do
|
88
|
+
blk = proc { XdsCreds.new(nil) }
|
89
|
+
expect(&blk).to raise_error TypeError, /expected grpc_server_credentials/
|
90
|
+
end
|
91
|
+
|
92
|
+
it 'cannot be constructed with a non-C-extension object' do
|
93
|
+
not_a_fallback = 100
|
94
|
+
blk = proc { XdsCreds.new(not_a_fallback) }
|
95
|
+
expect(&blk).to raise_error TypeError, /expected grpc_server_credentials/
|
96
|
+
end
|
97
|
+
|
98
|
+
it 'cannot be constructed with a non-ServerCredentials object' do
|
99
|
+
not_a_fallback = GRPC::Core::ChannelCredentials.new
|
100
|
+
blk = proc { XdsCreds.new(not_a_fallback) }
|
101
|
+
expect(&blk).to raise_error TypeError, /expected grpc_server_credentials/
|
102
|
+
end
|
78
103
|
end
|
79
104
|
end
|
@@ -139,6 +139,28 @@ describe Server do
|
|
139
139
|
expect(&blk).to raise_error(RuntimeError)
|
140
140
|
end
|
141
141
|
end
|
142
|
+
|
143
|
+
describe 'for xds servers' do
|
144
|
+
let(:cert) { create_test_cert }
|
145
|
+
let(:xds) { GRPC::Core::XdsServerCredentials.new(cert) }
|
146
|
+
it 'runs without failing' do
|
147
|
+
blk = proc do
|
148
|
+
s = new_core_server_for_testing(nil)
|
149
|
+
s.add_http2_port('localhost:0', xds)
|
150
|
+
s.shutdown_and_notify(nil)
|
151
|
+
s.close
|
152
|
+
end
|
153
|
+
expect(&blk).to_not raise_error
|
154
|
+
end
|
155
|
+
|
156
|
+
it 'fails if the server is closed' do
|
157
|
+
s = new_core_server_for_testing(nil)
|
158
|
+
s.shutdown_and_notify(nil)
|
159
|
+
s.close
|
160
|
+
blk = proc { s.add_http2_port('localhost:0', xds) }
|
161
|
+
expect(&blk).to raise_error(RuntimeError)
|
162
|
+
end
|
163
|
+
end
|
142
164
|
end
|
143
165
|
|
144
166
|
shared_examples '#new' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: grpc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.37.1
|
5
5
|
platform: universal-darwin
|
6
6
|
authors:
|
7
7
|
- gRPC Authors
|
8
8
|
autorequire:
|
9
9
|
bindir: src/ruby/bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-04-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: google-protobuf
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '3.
|
19
|
+
version: '3.15'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '3.
|
26
|
+
version: '3.15'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: googleapis-common-protos-types
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -245,12 +245,16 @@ files:
|
|
245
245
|
- src/ruby/ext/grpc/rb_server.h
|
246
246
|
- src/ruby/ext/grpc/rb_server_credentials.c
|
247
247
|
- src/ruby/ext/grpc/rb_server_credentials.h
|
248
|
+
- src/ruby/ext/grpc/rb_xds_channel_credentials.c
|
249
|
+
- src/ruby/ext/grpc/rb_xds_channel_credentials.h
|
250
|
+
- src/ruby/ext/grpc/rb_xds_server_credentials.c
|
251
|
+
- src/ruby/ext/grpc/rb_xds_server_credentials.h
|
248
252
|
- src/ruby/lib/grpc.rb
|
249
|
-
- src/ruby/lib/grpc/2.3/grpc_c.bundle
|
250
253
|
- src/ruby/lib/grpc/2.4/grpc_c.bundle
|
251
254
|
- src/ruby/lib/grpc/2.5/grpc_c.bundle
|
252
255
|
- src/ruby/lib/grpc/2.6/grpc_c.bundle
|
253
256
|
- src/ruby/lib/grpc/2.7/grpc_c.bundle
|
257
|
+
- src/ruby/lib/grpc/3.0/grpc_c.bundle
|
254
258
|
- src/ruby/lib/grpc/core/status_codes.rb
|
255
259
|
- src/ruby/lib/grpc/core/time_consts.rb
|
256
260
|
- src/ruby/lib/grpc/errors.rb
|
@@ -340,17 +344,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
340
344
|
requirements:
|
341
345
|
- - ">="
|
342
346
|
- !ruby/object:Gem::Version
|
343
|
-
version: '2.
|
347
|
+
version: '2.4'
|
344
348
|
- - "<"
|
345
349
|
- !ruby/object:Gem::Version
|
346
350
|
version: 3.1.dev
|
347
351
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
348
352
|
requirements:
|
349
|
-
- - "
|
353
|
+
- - ">="
|
350
354
|
- !ruby/object:Gem::Version
|
351
|
-
version:
|
355
|
+
version: '0'
|
352
356
|
requirements: []
|
353
|
-
rubygems_version: 3.2.
|
357
|
+
rubygems_version: 3.2.16
|
354
358
|
signing_key:
|
355
359
|
specification_version: 4
|
356
360
|
summary: GRPC system in Ruby
|
Binary file
|