grpc 1.0.1.pre1-x86-mingw32 → 1.0.1-x86-mingw32

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fd6270974867ec346fd82bf4f216fb36b79ca1db
4
- data.tar.gz: e26efc586e8754b7b7aafd0dec9859b2451c05d0
3
+ metadata.gz: 82e2b5e58eec18801b5c3d211c750dc0b3b6f6fb
4
+ data.tar.gz: dd36ea6d9b94488ce3c1325543594ca9fab370ee
5
5
  SHA512:
6
- metadata.gz: d5e9c4ee49485c5f9a6ecdf07dc0457e370b4f7092966e39104949aa0d4fe4ab9da8ee40b7027b9fafd3e7652d7a4b5ae04e422df8d14ca0e9b015deec3dc137
7
- data.tar.gz: 43b0bb05d69acf6ad431f545f47760de2c0696dfeeeb3ba1c75fb9d560e83103dd5a9a72f55dcea7c85e73094ad402abafcc6be1653b364ad3f0ee577bffd868
6
+ metadata.gz: 6ee665b55a5f0c062b5f4b06d225aecda023484a3e7bf43de289cb1ca9503cd36545ded5a863c3f3d51774e5b0c54448f693d4d8d1a6b9c53f5fdc8584f7bdfa
7
+ data.tar.gz: 465457447dd8d76890adeb6e421baa0d720def58a5c500b424784c91f1b51ebbfcf9ce6de1410a079ec2f4b98363ca80035d76dfd37debf7fc3518a9be3316f1
Binary file
Binary file
@@ -86,19 +86,16 @@ static VALUE grpc_rb_call_credentials_callback_rescue(VALUE args,
86
86
  rb_funcall(exception_object, rb_intern("backtrace"), 0),
87
87
  rb_intern("join"),
88
88
  1, rb_str_new2("\n\tfrom "));
89
- VALUE rb_exception_info = rb_funcall(exception_object, rb_intern("to_s"), 0);
90
- const char *exception_classname = rb_obj_classname(exception_object);
89
+ VALUE rb_exception_info = rb_funcall(exception_object, rb_intern("inspect"), 0);
91
90
  (void)args;
92
- gpr_log(GPR_INFO, "Call credentials callback failed: %s: %s\n%s",
93
- exception_classname, StringValueCStr(rb_exception_info),
91
+ gpr_log(GPR_INFO, "Call credentials callback failed: %s\n%s",
92
+ StringValueCStr(rb_exception_info),
94
93
  StringValueCStr(backtrace));
95
94
  rb_hash_aset(result, rb_str_new2("metadata"), Qnil);
96
- /* Currently only gives the exception class name. It should be possible get
97
- more details */
98
95
  rb_hash_aset(result, rb_str_new2("status"),
99
- INT2NUM(GRPC_STATUS_PERMISSION_DENIED));
96
+ INT2NUM(GRPC_STATUS_UNAUTHENTICATED));
100
97
  rb_hash_aset(result, rb_str_new2("details"),
101
- rb_str_new2(exception_classname));
98
+ rb_exception_info);
102
99
  return result;
103
100
  }
104
101
 
Binary file
@@ -29,5 +29,5 @@
29
29
 
30
30
  # GRPC contains the General RPC module.
31
31
  module GRPC
32
- VERSION = '1.0.1.pre1'
32
+ VERSION = '1.0.1'
33
33
  end
@@ -168,23 +168,61 @@ describe 'ClientStub' do
168
168
  expect(&blk).to raise_error(GRPC::BadStatus)
169
169
  th.join
170
170
  end
171
+
172
+ it 'should receive UNAUTHENTICATED if call credentials plugin fails' do
173
+ server_port = create_secure_test_server
174
+ th = run_request_response(@sent_msg, @resp, @pass)
175
+
176
+ certs = load_test_certs
177
+ secure_channel_creds = GRPC::Core::ChannelCredentials.new(
178
+ certs[0], nil, nil)
179
+ secure_stub_opts = {
180
+ channel_args: {
181
+ GRPC::Core::Channel::SSL_TARGET => 'foo.test.google.fr'
182
+ }
183
+ }
184
+ stub = GRPC::ClientStub.new("localhost:#{server_port}",
185
+ secure_channel_creds, **secure_stub_opts)
186
+
187
+ error_message = 'Failing call credentials callback'
188
+ failing_auth = proc do
189
+ fail error_message
190
+ end
191
+ creds = GRPC::Core::CallCredentials.new(failing_auth)
192
+
193
+ error_occured = false
194
+ begin
195
+ get_response(stub, credentials: creds)
196
+ rescue GRPC::BadStatus => e
197
+ error_occured = true
198
+ expect(e.code).to eq(GRPC::Core::StatusCodes::UNAUTHENTICATED)
199
+ expect(e.details.include?(error_message)).to be true
200
+ end
201
+ expect(error_occured).to eq(true)
202
+
203
+ # Kill the server thread so tests can complete
204
+ th.kill
205
+ end
171
206
  end
172
207
 
173
208
  describe 'without a call operation' do
174
- def get_response(stub)
209
+ def get_response(stub, credentials: nil)
210
+ puts credentials.inspect
175
211
  stub.request_response(@method, @sent_msg, noop, noop,
176
- metadata: { k1: 'v1', k2: 'v2' })
212
+ metadata: { k1: 'v1', k2: 'v2' },
213
+ credentials: credentials)
177
214
  end
178
215
 
179
216
  it_behaves_like 'request response'
180
217
  end
181
218
 
182
219
  describe 'via a call operation' do
183
- def get_response(stub)
220
+ def get_response(stub, credentials: nil)
184
221
  op = stub.request_response(@method, @sent_msg, noop, noop,
185
222
  return_op: true,
186
223
  metadata: { k1: 'v1', k2: 'v2' },
187
- deadline: from_relative_time(2))
224
+ deadline: from_relative_time(2),
225
+ credentials: credentials)
188
226
  expect(op).to be_a(GRPC::ActiveCall::Operation)
189
227
  op.execute
190
228
  end
@@ -441,6 +479,15 @@ describe 'ClientStub' do
441
479
  end
442
480
  end
443
481
 
482
+ def create_secure_test_server
483
+ certs = load_test_certs
484
+ secure_credentials = GRPC::Core::ServerCredentials.new(
485
+ nil, [{ private_key: certs[1], cert_chain: certs[2] }], false)
486
+
487
+ @server = GRPC::Core::Server.new(nil)
488
+ @server.add_http2_port('0.0.0.0:0', secure_credentials)
489
+ end
490
+
444
491
  def create_test_server
445
492
  @server = GRPC::Core::Server.new(nil)
446
493
  @server.add_http2_port('0.0.0.0:0', :this_port_is_insecure)
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.0.1.pre1
4
+ version: 1.0.1
5
5
  platform: x86-mingw32
6
6
  authors:
7
7
  - gRPC Authors
8
8
  autorequire:
9
9
  bindir: src/ruby/bin
10
10
  cert_chain: []
11
- date: 2016-10-06 00:00:00.000000000 Z
11
+ date: 2016-10-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-protobuf
@@ -294,9 +294,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
294
294
  version: 2.0.0
295
295
  required_rubygems_version: !ruby/object:Gem::Requirement
296
296
  requirements:
297
- - - ">"
297
+ - - ">="
298
298
  - !ruby/object:Gem::Version
299
- version: 1.3.1
299
+ version: '0'
300
300
  requirements: []
301
301
  rubyforge_project:
302
302
  rubygems_version: 2.5.1