grpc 1.31.0.pre2-x64-mingw32 → 1.34.0-x64-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
  SHA256:
3
- metadata.gz: 36a46616383c1b9068b36522fbfe46c855fa92eb7070f0de94479bbcfdf820d7
4
- data.tar.gz: 7a4ad110f02ba73a117d3186c9eb04eb34ee75e58117a80dde9ec881730fdfd4
3
+ metadata.gz: 5eb9029a032d08945f90a7d7ba90198b0b71810e76f2e558eb8b433838dbcd42
4
+ data.tar.gz: a37424f91908253302783bb0b4091e39d3f8b4bc65cc34e7261f168f4cb7ff29
5
5
  SHA512:
6
- metadata.gz: 1077700b2e2edb53096d5d52453c52c78af258c3292f98af9fd953131fd407b1a45c2e03c3a35e20edf0234e08c61ed8496c573556c54d2d435f8de9ee531fa7
7
- data.tar.gz: 461b6de6d6beb7d056587d2153a51672b6a18db2c7a327eb680f50eb5f245e2b333ef8015c087f7ab640789a1f34b36a7d493506df87321d66eebb8ba6334e44
6
+ metadata.gz: aca11cc94e5ace2f77ff331478c1a03c07071141c5e5ee4cc168eea910407f7a9cf506ca2b873391bd5d4bb280012c0d321673c68bd3d5177d1afb0a5c0fe270
7
+ data.tar.gz: f38af790f55ab8cf199965e5a7b94bb82e85ecde2a9f94f379cfcf7f95c290d03eb3e8fd1237d21b78cf8d293c7465f5e8f46597494a3bce834a5a4ee7666c6d
Binary file
Binary file
@@ -31,19 +31,19 @@ module Math
31
31
 
32
32
  # Div divides DivArgs.dividend by DivArgs.divisor and returns the quotient
33
33
  # and remainder.
34
- rpc :Div, DivArgs, DivReply
34
+ rpc :Div, ::Math::DivArgs, ::Math::DivReply
35
35
  # DivMany accepts an arbitrary number of division args from the client stream
36
36
  # and sends back the results in the reply stream. The stream continues until
37
37
  # the client closes its end; the server does the same after sending all the
38
38
  # replies. The stream ends immediately if either end aborts.
39
- rpc :DivMany, stream(DivArgs), stream(DivReply)
39
+ rpc :DivMany, stream(::Math::DivArgs), stream(::Math::DivReply)
40
40
  # Fib generates numbers in the Fibonacci sequence. If FibArgs.limit > 0, Fib
41
41
  # generates up to limit numbers; otherwise it continues until the call is
42
42
  # canceled. Unlike Fib above, Fib has no final FibReply.
43
- rpc :Fib, FibArgs, stream(Num)
43
+ rpc :Fib, ::Math::FibArgs, stream(::Math::Num)
44
44
  # Sum sums a stream of numbers, returning the final result once the stream
45
45
  # is closed.
46
- rpc :Sum, stream(Num), Num
46
+ rpc :Sum, stream(::Math::Num), ::Math::Num
47
47
  end
48
48
 
49
49
  Stub = Service.rpc_stub_class
@@ -22,7 +22,7 @@ grpc_root = File.expand_path(File.join(File.dirname(__FILE__), '../../../..'))
22
22
 
23
23
  grpc_config = ENV['GRPC_CONFIG'] || 'opt'
24
24
 
25
- ENV['MACOSX_DEPLOYMENT_TARGET'] = '10.7'
25
+ ENV['MACOSX_DEPLOYMENT_TARGET'] = '10.10'
26
26
 
27
27
  if ENV['AR'].nil? || ENV['AR'].size == 0
28
28
  ENV['AR'] = RbConfig::CONFIG['AR']
@@ -165,6 +165,15 @@ static VALUE grpc_rb_channel_credentials_init(int argc, VALUE* argv,
165
165
  if (pem_private_key == Qnil && pem_cert_chain == Qnil) {
166
166
  creds = grpc_ssl_credentials_create(pem_root_certs_cstr, NULL, NULL, NULL);
167
167
  } else {
168
+ if (pem_private_key == Qnil) {
169
+ rb_raise(
170
+ rb_eRuntimeError,
171
+ "could not create a credentials because pem_private_key is NULL");
172
+ }
173
+ if (pem_cert_chain == Qnil) {
174
+ rb_raise(rb_eRuntimeError,
175
+ "could not create a credentials because pem_cert_chain is NULL");
176
+ }
168
177
  key_cert_pair.private_key = RSTRING_PTR(pem_private_key);
169
178
  key_cert_pair.cert_chain = RSTRING_PTR(pem_cert_chain);
170
179
  creds = grpc_ssl_credentials_create(pem_root_certs_cstr, &key_cert_pair,
@@ -58,7 +58,6 @@ grpc_channel_num_external_connectivity_watchers_type grpc_channel_num_external_c
58
58
  grpc_channel_watch_connectivity_state_type grpc_channel_watch_connectivity_state_import;
59
59
  grpc_channel_support_connectivity_watcher_type grpc_channel_support_connectivity_watcher_import;
60
60
  grpc_channel_create_call_type grpc_channel_create_call_import;
61
- grpc_channel_ping_type grpc_channel_ping_import;
62
61
  grpc_channel_register_call_type grpc_channel_register_call_import;
63
62
  grpc_channel_create_registered_call_type grpc_channel_create_registered_call_import;
64
63
  grpc_call_arena_alloc_type grpc_call_arena_alloc_import;
@@ -120,12 +119,12 @@ grpc_auth_context_set_peer_identity_property_name_type grpc_auth_context_set_pee
120
119
  grpc_ssl_session_cache_create_lru_type grpc_ssl_session_cache_create_lru_import;
121
120
  grpc_ssl_session_cache_destroy_type grpc_ssl_session_cache_destroy_import;
122
121
  grpc_ssl_session_cache_create_channel_arg_type grpc_ssl_session_cache_create_channel_arg_import;
122
+ grpc_call_credentials_release_type grpc_call_credentials_release_import;
123
123
  grpc_channel_credentials_release_type grpc_channel_credentials_release_import;
124
124
  grpc_google_default_credentials_create_type grpc_google_default_credentials_create_import;
125
125
  grpc_set_ssl_roots_override_callback_type grpc_set_ssl_roots_override_callback_import;
126
126
  grpc_ssl_credentials_create_type grpc_ssl_credentials_create_import;
127
127
  grpc_ssl_credentials_create_ex_type grpc_ssl_credentials_create_ex_import;
128
- grpc_call_credentials_release_type grpc_call_credentials_release_import;
129
128
  grpc_composite_channel_credentials_create_type grpc_composite_channel_credentials_create_import;
130
129
  grpc_composite_call_credentials_create_type grpc_composite_call_credentials_create_import;
131
130
  grpc_google_compute_engine_credentials_create_type grpc_google_compute_engine_credentials_create_import;
@@ -159,18 +158,23 @@ grpc_alts_credentials_create_type grpc_alts_credentials_create_import;
159
158
  grpc_alts_server_credentials_create_type grpc_alts_server_credentials_create_import;
160
159
  grpc_local_credentials_create_type grpc_local_credentials_create_import;
161
160
  grpc_local_server_credentials_create_type grpc_local_server_credentials_create_import;
161
+ grpc_tls_identity_pairs_create_type grpc_tls_identity_pairs_create_import;
162
+ grpc_tls_identity_pairs_add_pair_type grpc_tls_identity_pairs_add_pair_import;
163
+ grpc_tls_identity_pairs_destroy_type grpc_tls_identity_pairs_destroy_import;
164
+ grpc_tls_certificate_provider_static_data_create_type grpc_tls_certificate_provider_static_data_create_import;
165
+ grpc_tls_certificate_provider_release_type grpc_tls_certificate_provider_release_import;
162
166
  grpc_tls_credentials_options_create_type grpc_tls_credentials_options_create_import;
163
167
  grpc_tls_credentials_options_set_cert_request_type_type grpc_tls_credentials_options_set_cert_request_type_import;
164
168
  grpc_tls_credentials_options_set_server_verification_option_type grpc_tls_credentials_options_set_server_verification_option_import;
165
- grpc_tls_credentials_options_set_key_materials_config_type grpc_tls_credentials_options_set_key_materials_config_import;
166
- grpc_tls_credentials_options_set_credential_reload_config_type grpc_tls_credentials_options_set_credential_reload_config_import;
169
+ grpc_tls_credentials_options_set_certificate_provider_type grpc_tls_credentials_options_set_certificate_provider_import;
170
+ grpc_tls_credentials_options_watch_root_certs_type grpc_tls_credentials_options_watch_root_certs_import;
171
+ grpc_tls_credentials_options_set_root_cert_name_type grpc_tls_credentials_options_set_root_cert_name_import;
172
+ grpc_tls_credentials_options_watch_identity_key_cert_pairs_type grpc_tls_credentials_options_watch_identity_key_cert_pairs_import;
173
+ grpc_tls_credentials_options_set_identity_cert_name_type grpc_tls_credentials_options_set_identity_cert_name_import;
167
174
  grpc_tls_credentials_options_set_server_authorization_check_config_type grpc_tls_credentials_options_set_server_authorization_check_config_import;
168
- grpc_tls_key_materials_config_create_type grpc_tls_key_materials_config_create_import;
169
- grpc_tls_key_materials_config_set_key_materials_type grpc_tls_key_materials_config_set_key_materials_import;
170
- grpc_tls_key_materials_config_set_version_type grpc_tls_key_materials_config_set_version_import;
171
- grpc_tls_key_materials_config_get_version_type grpc_tls_key_materials_config_get_version_import;
172
- grpc_tls_credential_reload_config_create_type grpc_tls_credential_reload_config_create_import;
173
175
  grpc_tls_server_authorization_check_config_create_type grpc_tls_server_authorization_check_config_create_import;
176
+ grpc_tls_server_authorization_check_config_release_type grpc_tls_server_authorization_check_config_release_import;
177
+ grpc_xds_credentials_create_type grpc_xds_credentials_create_import;
174
178
  grpc_raw_byte_buffer_create_type grpc_raw_byte_buffer_create_import;
175
179
  grpc_raw_compressed_byte_buffer_create_type grpc_raw_compressed_byte_buffer_create_import;
176
180
  grpc_byte_buffer_copy_type grpc_byte_buffer_copy_import;
@@ -332,7 +336,6 @@ void grpc_rb_load_imports(HMODULE library) {
332
336
  grpc_channel_watch_connectivity_state_import = (grpc_channel_watch_connectivity_state_type) GetProcAddress(library, "grpc_channel_watch_connectivity_state");
333
337
  grpc_channel_support_connectivity_watcher_import = (grpc_channel_support_connectivity_watcher_type) GetProcAddress(library, "grpc_channel_support_connectivity_watcher");
334
338
  grpc_channel_create_call_import = (grpc_channel_create_call_type) GetProcAddress(library, "grpc_channel_create_call");
335
- grpc_channel_ping_import = (grpc_channel_ping_type) GetProcAddress(library, "grpc_channel_ping");
336
339
  grpc_channel_register_call_import = (grpc_channel_register_call_type) GetProcAddress(library, "grpc_channel_register_call");
337
340
  grpc_channel_create_registered_call_import = (grpc_channel_create_registered_call_type) GetProcAddress(library, "grpc_channel_create_registered_call");
338
341
  grpc_call_arena_alloc_import = (grpc_call_arena_alloc_type) GetProcAddress(library, "grpc_call_arena_alloc");
@@ -394,12 +397,12 @@ void grpc_rb_load_imports(HMODULE library) {
394
397
  grpc_ssl_session_cache_create_lru_import = (grpc_ssl_session_cache_create_lru_type) GetProcAddress(library, "grpc_ssl_session_cache_create_lru");
395
398
  grpc_ssl_session_cache_destroy_import = (grpc_ssl_session_cache_destroy_type) GetProcAddress(library, "grpc_ssl_session_cache_destroy");
396
399
  grpc_ssl_session_cache_create_channel_arg_import = (grpc_ssl_session_cache_create_channel_arg_type) GetProcAddress(library, "grpc_ssl_session_cache_create_channel_arg");
400
+ grpc_call_credentials_release_import = (grpc_call_credentials_release_type) GetProcAddress(library, "grpc_call_credentials_release");
397
401
  grpc_channel_credentials_release_import = (grpc_channel_credentials_release_type) GetProcAddress(library, "grpc_channel_credentials_release");
398
402
  grpc_google_default_credentials_create_import = (grpc_google_default_credentials_create_type) GetProcAddress(library, "grpc_google_default_credentials_create");
399
403
  grpc_set_ssl_roots_override_callback_import = (grpc_set_ssl_roots_override_callback_type) GetProcAddress(library, "grpc_set_ssl_roots_override_callback");
400
404
  grpc_ssl_credentials_create_import = (grpc_ssl_credentials_create_type) GetProcAddress(library, "grpc_ssl_credentials_create");
401
405
  grpc_ssl_credentials_create_ex_import = (grpc_ssl_credentials_create_ex_type) GetProcAddress(library, "grpc_ssl_credentials_create_ex");
402
- grpc_call_credentials_release_import = (grpc_call_credentials_release_type) GetProcAddress(library, "grpc_call_credentials_release");
403
406
  grpc_composite_channel_credentials_create_import = (grpc_composite_channel_credentials_create_type) GetProcAddress(library, "grpc_composite_channel_credentials_create");
404
407
  grpc_composite_call_credentials_create_import = (grpc_composite_call_credentials_create_type) GetProcAddress(library, "grpc_composite_call_credentials_create");
405
408
  grpc_google_compute_engine_credentials_create_import = (grpc_google_compute_engine_credentials_create_type) GetProcAddress(library, "grpc_google_compute_engine_credentials_create");
@@ -433,18 +436,23 @@ void grpc_rb_load_imports(HMODULE library) {
433
436
  grpc_alts_server_credentials_create_import = (grpc_alts_server_credentials_create_type) GetProcAddress(library, "grpc_alts_server_credentials_create");
434
437
  grpc_local_credentials_create_import = (grpc_local_credentials_create_type) GetProcAddress(library, "grpc_local_credentials_create");
435
438
  grpc_local_server_credentials_create_import = (grpc_local_server_credentials_create_type) GetProcAddress(library, "grpc_local_server_credentials_create");
439
+ grpc_tls_identity_pairs_create_import = (grpc_tls_identity_pairs_create_type) GetProcAddress(library, "grpc_tls_identity_pairs_create");
440
+ grpc_tls_identity_pairs_add_pair_import = (grpc_tls_identity_pairs_add_pair_type) GetProcAddress(library, "grpc_tls_identity_pairs_add_pair");
441
+ grpc_tls_identity_pairs_destroy_import = (grpc_tls_identity_pairs_destroy_type) GetProcAddress(library, "grpc_tls_identity_pairs_destroy");
442
+ grpc_tls_certificate_provider_static_data_create_import = (grpc_tls_certificate_provider_static_data_create_type) GetProcAddress(library, "grpc_tls_certificate_provider_static_data_create");
443
+ grpc_tls_certificate_provider_release_import = (grpc_tls_certificate_provider_release_type) GetProcAddress(library, "grpc_tls_certificate_provider_release");
436
444
  grpc_tls_credentials_options_create_import = (grpc_tls_credentials_options_create_type) GetProcAddress(library, "grpc_tls_credentials_options_create");
437
445
  grpc_tls_credentials_options_set_cert_request_type_import = (grpc_tls_credentials_options_set_cert_request_type_type) GetProcAddress(library, "grpc_tls_credentials_options_set_cert_request_type");
438
446
  grpc_tls_credentials_options_set_server_verification_option_import = (grpc_tls_credentials_options_set_server_verification_option_type) GetProcAddress(library, "grpc_tls_credentials_options_set_server_verification_option");
439
- grpc_tls_credentials_options_set_key_materials_config_import = (grpc_tls_credentials_options_set_key_materials_config_type) GetProcAddress(library, "grpc_tls_credentials_options_set_key_materials_config");
440
- grpc_tls_credentials_options_set_credential_reload_config_import = (grpc_tls_credentials_options_set_credential_reload_config_type) GetProcAddress(library, "grpc_tls_credentials_options_set_credential_reload_config");
447
+ grpc_tls_credentials_options_set_certificate_provider_import = (grpc_tls_credentials_options_set_certificate_provider_type) GetProcAddress(library, "grpc_tls_credentials_options_set_certificate_provider");
448
+ grpc_tls_credentials_options_watch_root_certs_import = (grpc_tls_credentials_options_watch_root_certs_type) GetProcAddress(library, "grpc_tls_credentials_options_watch_root_certs");
449
+ grpc_tls_credentials_options_set_root_cert_name_import = (grpc_tls_credentials_options_set_root_cert_name_type) GetProcAddress(library, "grpc_tls_credentials_options_set_root_cert_name");
450
+ grpc_tls_credentials_options_watch_identity_key_cert_pairs_import = (grpc_tls_credentials_options_watch_identity_key_cert_pairs_type) GetProcAddress(library, "grpc_tls_credentials_options_watch_identity_key_cert_pairs");
451
+ grpc_tls_credentials_options_set_identity_cert_name_import = (grpc_tls_credentials_options_set_identity_cert_name_type) GetProcAddress(library, "grpc_tls_credentials_options_set_identity_cert_name");
441
452
  grpc_tls_credentials_options_set_server_authorization_check_config_import = (grpc_tls_credentials_options_set_server_authorization_check_config_type) GetProcAddress(library, "grpc_tls_credentials_options_set_server_authorization_check_config");
442
- grpc_tls_key_materials_config_create_import = (grpc_tls_key_materials_config_create_type) GetProcAddress(library, "grpc_tls_key_materials_config_create");
443
- grpc_tls_key_materials_config_set_key_materials_import = (grpc_tls_key_materials_config_set_key_materials_type) GetProcAddress(library, "grpc_tls_key_materials_config_set_key_materials");
444
- grpc_tls_key_materials_config_set_version_import = (grpc_tls_key_materials_config_set_version_type) GetProcAddress(library, "grpc_tls_key_materials_config_set_version");
445
- grpc_tls_key_materials_config_get_version_import = (grpc_tls_key_materials_config_get_version_type) GetProcAddress(library, "grpc_tls_key_materials_config_get_version");
446
- grpc_tls_credential_reload_config_create_import = (grpc_tls_credential_reload_config_create_type) GetProcAddress(library, "grpc_tls_credential_reload_config_create");
447
453
  grpc_tls_server_authorization_check_config_create_import = (grpc_tls_server_authorization_check_config_create_type) GetProcAddress(library, "grpc_tls_server_authorization_check_config_create");
454
+ grpc_tls_server_authorization_check_config_release_import = (grpc_tls_server_authorization_check_config_release_type) GetProcAddress(library, "grpc_tls_server_authorization_check_config_release");
455
+ grpc_xds_credentials_create_import = (grpc_xds_credentials_create_type) GetProcAddress(library, "grpc_xds_credentials_create");
448
456
  grpc_raw_byte_buffer_create_import = (grpc_raw_byte_buffer_create_type) GetProcAddress(library, "grpc_raw_byte_buffer_create");
449
457
  grpc_raw_compressed_byte_buffer_create_import = (grpc_raw_compressed_byte_buffer_create_type) GetProcAddress(library, "grpc_raw_compressed_byte_buffer_create");
450
458
  grpc_byte_buffer_copy_import = (grpc_byte_buffer_copy_type) GetProcAddress(library, "grpc_byte_buffer_copy");
@@ -149,9 +149,6 @@ extern grpc_channel_support_connectivity_watcher_type grpc_channel_support_conne
149
149
  typedef grpc_call*(*grpc_channel_create_call_type)(grpc_channel* channel, grpc_call* parent_call, uint32_t propagation_mask, grpc_completion_queue* completion_queue, grpc_slice method, const grpc_slice* host, gpr_timespec deadline, void* reserved);
150
150
  extern grpc_channel_create_call_type grpc_channel_create_call_import;
151
151
  #define grpc_channel_create_call grpc_channel_create_call_import
152
- typedef void(*grpc_channel_ping_type)(grpc_channel* channel, grpc_completion_queue* cq, void* tag, void* reserved);
153
- extern grpc_channel_ping_type grpc_channel_ping_import;
154
- #define grpc_channel_ping grpc_channel_ping_import
155
152
  typedef void*(*grpc_channel_register_call_type)(grpc_channel* channel, const char* method, const char* host, void* reserved);
156
153
  extern grpc_channel_register_call_type grpc_channel_register_call_import;
157
154
  #define grpc_channel_register_call grpc_channel_register_call_import
@@ -335,10 +332,13 @@ extern grpc_ssl_session_cache_destroy_type grpc_ssl_session_cache_destroy_import
335
332
  typedef grpc_arg(*grpc_ssl_session_cache_create_channel_arg_type)(grpc_ssl_session_cache* cache);
336
333
  extern grpc_ssl_session_cache_create_channel_arg_type grpc_ssl_session_cache_create_channel_arg_import;
337
334
  #define grpc_ssl_session_cache_create_channel_arg grpc_ssl_session_cache_create_channel_arg_import
335
+ typedef void(*grpc_call_credentials_release_type)(grpc_call_credentials* creds);
336
+ extern grpc_call_credentials_release_type grpc_call_credentials_release_import;
337
+ #define grpc_call_credentials_release grpc_call_credentials_release_import
338
338
  typedef void(*grpc_channel_credentials_release_type)(grpc_channel_credentials* creds);
339
339
  extern grpc_channel_credentials_release_type grpc_channel_credentials_release_import;
340
340
  #define grpc_channel_credentials_release grpc_channel_credentials_release_import
341
- typedef grpc_channel_credentials*(*grpc_google_default_credentials_create_type)(void);
341
+ typedef grpc_channel_credentials*(*grpc_google_default_credentials_create_type)(grpc_call_credentials* call_credentials);
342
342
  extern grpc_google_default_credentials_create_type grpc_google_default_credentials_create_import;
343
343
  #define grpc_google_default_credentials_create grpc_google_default_credentials_create_import
344
344
  typedef void(*grpc_set_ssl_roots_override_callback_type)(grpc_ssl_roots_override_callback cb);
@@ -350,9 +350,6 @@ extern grpc_ssl_credentials_create_type grpc_ssl_credentials_create_import;
350
350
  typedef grpc_channel_credentials*(*grpc_ssl_credentials_create_ex_type)(const char* pem_root_certs, grpc_ssl_pem_key_cert_pair* pem_key_cert_pair, const grpc_ssl_verify_peer_options* verify_options, void* reserved);
351
351
  extern grpc_ssl_credentials_create_ex_type grpc_ssl_credentials_create_ex_import;
352
352
  #define grpc_ssl_credentials_create_ex grpc_ssl_credentials_create_ex_import
353
- typedef void(*grpc_call_credentials_release_type)(grpc_call_credentials* creds);
354
- extern grpc_call_credentials_release_type grpc_call_credentials_release_import;
355
- #define grpc_call_credentials_release grpc_call_credentials_release_import
356
353
  typedef grpc_channel_credentials*(*grpc_composite_channel_credentials_create_type)(grpc_channel_credentials* channel_creds, grpc_call_credentials* call_creds, void* reserved);
357
354
  extern grpc_composite_channel_credentials_create_type grpc_composite_channel_credentials_create_import;
358
355
  #define grpc_composite_channel_credentials_create grpc_composite_channel_credentials_create_import
@@ -452,42 +449,57 @@ extern grpc_local_credentials_create_type grpc_local_credentials_create_import;
452
449
  typedef grpc_server_credentials*(*grpc_local_server_credentials_create_type)(grpc_local_connect_type type);
453
450
  extern grpc_local_server_credentials_create_type grpc_local_server_credentials_create_import;
454
451
  #define grpc_local_server_credentials_create grpc_local_server_credentials_create_import
452
+ typedef grpc_tls_identity_pairs*(*grpc_tls_identity_pairs_create_type)();
453
+ extern grpc_tls_identity_pairs_create_type grpc_tls_identity_pairs_create_import;
454
+ #define grpc_tls_identity_pairs_create grpc_tls_identity_pairs_create_import
455
+ typedef void(*grpc_tls_identity_pairs_add_pair_type)(grpc_tls_identity_pairs* pairs, const char* private_key, const char* cert_chain);
456
+ extern grpc_tls_identity_pairs_add_pair_type grpc_tls_identity_pairs_add_pair_import;
457
+ #define grpc_tls_identity_pairs_add_pair grpc_tls_identity_pairs_add_pair_import
458
+ typedef void(*grpc_tls_identity_pairs_destroy_type)(grpc_tls_identity_pairs* pairs);
459
+ extern grpc_tls_identity_pairs_destroy_type grpc_tls_identity_pairs_destroy_import;
460
+ #define grpc_tls_identity_pairs_destroy grpc_tls_identity_pairs_destroy_import
461
+ typedef grpc_tls_certificate_provider*(*grpc_tls_certificate_provider_static_data_create_type)(const char* root_certificate, grpc_tls_identity_pairs* pem_key_cert_pairs);
462
+ extern grpc_tls_certificate_provider_static_data_create_type grpc_tls_certificate_provider_static_data_create_import;
463
+ #define grpc_tls_certificate_provider_static_data_create grpc_tls_certificate_provider_static_data_create_import
464
+ typedef void(*grpc_tls_certificate_provider_release_type)(grpc_tls_certificate_provider* provider);
465
+ extern grpc_tls_certificate_provider_release_type grpc_tls_certificate_provider_release_import;
466
+ #define grpc_tls_certificate_provider_release grpc_tls_certificate_provider_release_import
455
467
  typedef grpc_tls_credentials_options*(*grpc_tls_credentials_options_create_type)(void);
456
468
  extern grpc_tls_credentials_options_create_type grpc_tls_credentials_options_create_import;
457
469
  #define grpc_tls_credentials_options_create grpc_tls_credentials_options_create_import
458
- typedef int(*grpc_tls_credentials_options_set_cert_request_type_type)(grpc_tls_credentials_options* options, grpc_ssl_client_certificate_request_type type);
470
+ typedef void(*grpc_tls_credentials_options_set_cert_request_type_type)(grpc_tls_credentials_options* options, grpc_ssl_client_certificate_request_type type);
459
471
  extern grpc_tls_credentials_options_set_cert_request_type_type grpc_tls_credentials_options_set_cert_request_type_import;
460
472
  #define grpc_tls_credentials_options_set_cert_request_type grpc_tls_credentials_options_set_cert_request_type_import
461
- typedef int(*grpc_tls_credentials_options_set_server_verification_option_type)(grpc_tls_credentials_options* options, grpc_tls_server_verification_option server_verification_option);
473
+ typedef void(*grpc_tls_credentials_options_set_server_verification_option_type)(grpc_tls_credentials_options* options, grpc_tls_server_verification_option server_verification_option);
462
474
  extern grpc_tls_credentials_options_set_server_verification_option_type grpc_tls_credentials_options_set_server_verification_option_import;
463
475
  #define grpc_tls_credentials_options_set_server_verification_option grpc_tls_credentials_options_set_server_verification_option_import
464
- typedef int(*grpc_tls_credentials_options_set_key_materials_config_type)(grpc_tls_credentials_options* options, grpc_tls_key_materials_config* config);
465
- extern grpc_tls_credentials_options_set_key_materials_config_type grpc_tls_credentials_options_set_key_materials_config_import;
466
- #define grpc_tls_credentials_options_set_key_materials_config grpc_tls_credentials_options_set_key_materials_config_import
467
- typedef int(*grpc_tls_credentials_options_set_credential_reload_config_type)(grpc_tls_credentials_options* options, grpc_tls_credential_reload_config* config);
468
- extern grpc_tls_credentials_options_set_credential_reload_config_type grpc_tls_credentials_options_set_credential_reload_config_import;
469
- #define grpc_tls_credentials_options_set_credential_reload_config grpc_tls_credentials_options_set_credential_reload_config_import
470
- typedef int(*grpc_tls_credentials_options_set_server_authorization_check_config_type)(grpc_tls_credentials_options* options, grpc_tls_server_authorization_check_config* config);
476
+ typedef void(*grpc_tls_credentials_options_set_certificate_provider_type)(grpc_tls_credentials_options* options, grpc_tls_certificate_provider* provider);
477
+ extern grpc_tls_credentials_options_set_certificate_provider_type grpc_tls_credentials_options_set_certificate_provider_import;
478
+ #define grpc_tls_credentials_options_set_certificate_provider grpc_tls_credentials_options_set_certificate_provider_import
479
+ typedef void(*grpc_tls_credentials_options_watch_root_certs_type)(grpc_tls_credentials_options* options);
480
+ extern grpc_tls_credentials_options_watch_root_certs_type grpc_tls_credentials_options_watch_root_certs_import;
481
+ #define grpc_tls_credentials_options_watch_root_certs grpc_tls_credentials_options_watch_root_certs_import
482
+ typedef void(*grpc_tls_credentials_options_set_root_cert_name_type)(grpc_tls_credentials_options* options, const char* root_cert_name);
483
+ extern grpc_tls_credentials_options_set_root_cert_name_type grpc_tls_credentials_options_set_root_cert_name_import;
484
+ #define grpc_tls_credentials_options_set_root_cert_name grpc_tls_credentials_options_set_root_cert_name_import
485
+ typedef void(*grpc_tls_credentials_options_watch_identity_key_cert_pairs_type)(grpc_tls_credentials_options* options);
486
+ extern grpc_tls_credentials_options_watch_identity_key_cert_pairs_type grpc_tls_credentials_options_watch_identity_key_cert_pairs_import;
487
+ #define grpc_tls_credentials_options_watch_identity_key_cert_pairs grpc_tls_credentials_options_watch_identity_key_cert_pairs_import
488
+ typedef void(*grpc_tls_credentials_options_set_identity_cert_name_type)(grpc_tls_credentials_options* options, const char* identity_cert_name);
489
+ extern grpc_tls_credentials_options_set_identity_cert_name_type grpc_tls_credentials_options_set_identity_cert_name_import;
490
+ #define grpc_tls_credentials_options_set_identity_cert_name grpc_tls_credentials_options_set_identity_cert_name_import
491
+ typedef void(*grpc_tls_credentials_options_set_server_authorization_check_config_type)(grpc_tls_credentials_options* options, grpc_tls_server_authorization_check_config* config);
471
492
  extern grpc_tls_credentials_options_set_server_authorization_check_config_type grpc_tls_credentials_options_set_server_authorization_check_config_import;
472
493
  #define grpc_tls_credentials_options_set_server_authorization_check_config grpc_tls_credentials_options_set_server_authorization_check_config_import
473
- typedef grpc_tls_key_materials_config*(*grpc_tls_key_materials_config_create_type)(void);
474
- extern grpc_tls_key_materials_config_create_type grpc_tls_key_materials_config_create_import;
475
- #define grpc_tls_key_materials_config_create grpc_tls_key_materials_config_create_import
476
- typedef int(*grpc_tls_key_materials_config_set_key_materials_type)(grpc_tls_key_materials_config* config, const char* pem_root_certs, const grpc_ssl_pem_key_cert_pair** pem_key_cert_pairs, size_t num_key_cert_pairs);
477
- extern grpc_tls_key_materials_config_set_key_materials_type grpc_tls_key_materials_config_set_key_materials_import;
478
- #define grpc_tls_key_materials_config_set_key_materials grpc_tls_key_materials_config_set_key_materials_import
479
- typedef int(*grpc_tls_key_materials_config_set_version_type)(grpc_tls_key_materials_config* config, int version);
480
- extern grpc_tls_key_materials_config_set_version_type grpc_tls_key_materials_config_set_version_import;
481
- #define grpc_tls_key_materials_config_set_version grpc_tls_key_materials_config_set_version_import
482
- typedef int(*grpc_tls_key_materials_config_get_version_type)(grpc_tls_key_materials_config* config);
483
- extern grpc_tls_key_materials_config_get_version_type grpc_tls_key_materials_config_get_version_import;
484
- #define grpc_tls_key_materials_config_get_version grpc_tls_key_materials_config_get_version_import
485
- typedef grpc_tls_credential_reload_config*(*grpc_tls_credential_reload_config_create_type)(const void* config_user_data, int (*schedule)(void* config_user_data, grpc_tls_credential_reload_arg* arg), void (*cancel)(void* config_user_data, grpc_tls_credential_reload_arg* arg), void (*destruct)(void* config_user_data));
486
- extern grpc_tls_credential_reload_config_create_type grpc_tls_credential_reload_config_create_import;
487
- #define grpc_tls_credential_reload_config_create grpc_tls_credential_reload_config_create_import
488
494
  typedef grpc_tls_server_authorization_check_config*(*grpc_tls_server_authorization_check_config_create_type)(const void* config_user_data, int (*schedule)(void* config_user_data, grpc_tls_server_authorization_check_arg* arg), void (*cancel)(void* config_user_data, grpc_tls_server_authorization_check_arg* arg), void (*destruct)(void* config_user_data));
489
495
  extern grpc_tls_server_authorization_check_config_create_type grpc_tls_server_authorization_check_config_create_import;
490
496
  #define grpc_tls_server_authorization_check_config_create grpc_tls_server_authorization_check_config_create_import
497
+ typedef void(*grpc_tls_server_authorization_check_config_release_type)(grpc_tls_server_authorization_check_config* config);
498
+ extern grpc_tls_server_authorization_check_config_release_type grpc_tls_server_authorization_check_config_release_import;
499
+ #define grpc_tls_server_authorization_check_config_release grpc_tls_server_authorization_check_config_release_import
500
+ typedef grpc_channel_credentials*(*grpc_xds_credentials_create_type)(grpc_channel_credentials* fallback_credentials);
501
+ extern grpc_xds_credentials_create_type grpc_xds_credentials_create_import;
502
+ #define grpc_xds_credentials_create grpc_xds_credentials_create_import
491
503
  typedef grpc_byte_buffer*(*grpc_raw_byte_buffer_create_type)(grpc_slice* slices, size_t nslices);
492
504
  extern grpc_raw_byte_buffer_create_type grpc_raw_byte_buffer_create_import;
493
505
  #define grpc_raw_byte_buffer_create grpc_raw_byte_buffer_create_import
@@ -100,7 +100,7 @@ module GRPC
100
100
  channel_args: {},
101
101
  interceptors: [])
102
102
  @ch = ClientStub.setup_channel(channel_override, host, creds,
103
- channel_args)
103
+ channel_args.dup)
104
104
  alt_host = channel_args[Core::Channel::SSL_TARGET]
105
105
  @host = alt_host.nil? ? host : alt_host
106
106
  @propagate_mask = propagate_mask
@@ -14,5 +14,5 @@
14
14
 
15
15
  # GRPC contains the General RPC module.
16
16
  module GRPC
17
- VERSION = '1.31.0.pre2'
17
+ VERSION = '1.34.0'
18
18
  end
@@ -36,7 +36,7 @@ module Grpc
36
36
 
37
37
  # If the requested service is unknown, the call will fail with status
38
38
  # NOT_FOUND.
39
- rpc :Check, HealthCheckRequest, HealthCheckResponse
39
+ rpc :Check, ::Grpc::Health::V1::HealthCheckRequest, ::Grpc::Health::V1::HealthCheckResponse
40
40
  # Performs a watch for the serving status of the requested service.
41
41
  # The server will immediately send back a message indicating the current
42
42
  # serving status. It will then subsequently send a new message whenever
@@ -52,7 +52,7 @@ module Grpc
52
52
  # should assume this method is not supported and should not retry the
53
53
  # call. If the call terminates with any other status (including OK),
54
54
  # clients should retry the call with appropriate exponential backoff.
55
- rpc :Watch, HealthCheckRequest, stream(HealthCheckResponse)
55
+ rpc :Watch, ::Grpc::Health::V1::HealthCheckRequest, stream(::Grpc::Health::V1::HealthCheckResponse)
56
56
  end
57
57
 
58
58
  Stub = Service.rpc_stub_class
@@ -71,6 +71,10 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
71
71
  add_message "grpc.testing.LoadBalancerStatsResponse" do
72
72
  map :rpcs_by_peer, :string, :int32, 1
73
73
  optional :num_failures, :int32, 2
74
+ map :rpcs_by_method, :string, :message, 3, "grpc.testing.LoadBalancerStatsResponse.RpcsByPeer"
75
+ end
76
+ add_message "grpc.testing.LoadBalancerStatsResponse.RpcsByPeer" do
77
+ map :rpcs_by_peer, :string, :int32, 1
74
78
  end
75
79
  add_enum "grpc.testing.PayloadType" do
76
80
  value :COMPRESSABLE, 0
@@ -99,6 +103,7 @@ module Grpc
99
103
  ReconnectInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ReconnectInfo").msgclass
100
104
  LoadBalancerStatsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.LoadBalancerStatsRequest").msgclass
101
105
  LoadBalancerStatsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.LoadBalancerStatsResponse").msgclass
106
+ LoadBalancerStatsResponse::RpcsByPeer = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.LoadBalancerStatsResponse.RpcsByPeer").msgclass
102
107
  PayloadType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.PayloadType").enummodule
103
108
  GrpclbRouteType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.GrpclbRouteType").enummodule
104
109
  end
@@ -36,31 +36,31 @@ module Grpc
36
36
  self.service_name = 'grpc.testing.TestService'
37
37
 
38
38
  # One empty request followed by one empty response.
39
- rpc :EmptyCall, Empty, Empty
39
+ rpc :EmptyCall, ::Grpc::Testing::Empty, ::Grpc::Testing::Empty
40
40
  # One request followed by one response.
41
- rpc :UnaryCall, SimpleRequest, SimpleResponse
41
+ rpc :UnaryCall, ::Grpc::Testing::SimpleRequest, ::Grpc::Testing::SimpleResponse
42
42
  # One request followed by one response. Response has cache control
43
43
  # headers set such that a caching HTTP proxy (such as GFE) can
44
44
  # satisfy subsequent requests.
45
- rpc :CacheableUnaryCall, SimpleRequest, SimpleResponse
45
+ rpc :CacheableUnaryCall, ::Grpc::Testing::SimpleRequest, ::Grpc::Testing::SimpleResponse
46
46
  # One request followed by a sequence of responses (streamed download).
47
47
  # The server returns the payload with client desired type and sizes.
48
- rpc :StreamingOutputCall, StreamingOutputCallRequest, stream(StreamingOutputCallResponse)
48
+ rpc :StreamingOutputCall, ::Grpc::Testing::StreamingOutputCallRequest, stream(::Grpc::Testing::StreamingOutputCallResponse)
49
49
  # A sequence of requests followed by one response (streamed upload).
50
50
  # The server returns the aggregated size of client payload as the result.
51
- rpc :StreamingInputCall, stream(StreamingInputCallRequest), StreamingInputCallResponse
51
+ rpc :StreamingInputCall, stream(::Grpc::Testing::StreamingInputCallRequest), ::Grpc::Testing::StreamingInputCallResponse
52
52
  # A sequence of requests with each request served by the server immediately.
53
53
  # As one request could lead to multiple responses, this interface
54
54
  # demonstrates the idea of full duplexing.
55
- rpc :FullDuplexCall, stream(StreamingOutputCallRequest), stream(StreamingOutputCallResponse)
55
+ rpc :FullDuplexCall, stream(::Grpc::Testing::StreamingOutputCallRequest), stream(::Grpc::Testing::StreamingOutputCallResponse)
56
56
  # A sequence of requests followed by a sequence of responses.
57
57
  # The server buffers all the client requests and then serves them in order. A
58
58
  # stream of responses are returned to the client when the server starts with
59
59
  # first request.
60
- rpc :HalfDuplexCall, stream(StreamingOutputCallRequest), stream(StreamingOutputCallResponse)
60
+ rpc :HalfDuplexCall, stream(::Grpc::Testing::StreamingOutputCallRequest), stream(::Grpc::Testing::StreamingOutputCallResponse)
61
61
  # The test server will not implement this method. It will be used
62
62
  # to test the behavior when clients call unimplemented methods.
63
- rpc :UnimplementedCall, Empty, Empty
63
+ rpc :UnimplementedCall, ::Grpc::Testing::Empty, ::Grpc::Testing::Empty
64
64
  end
65
65
 
66
66
  Stub = Service.rpc_stub_class
@@ -77,7 +77,7 @@ module Grpc
77
77
  self.service_name = 'grpc.testing.UnimplementedService'
78
78
 
79
79
  # A call that no server should implement
80
- rpc :UnimplementedCall, Empty, Empty
80
+ rpc :UnimplementedCall, ::Grpc::Testing::Empty, ::Grpc::Testing::Empty
81
81
  end
82
82
 
83
83
  Stub = Service.rpc_stub_class
@@ -92,8 +92,8 @@ module Grpc
92
92
  self.unmarshal_class_method = :decode
93
93
  self.service_name = 'grpc.testing.ReconnectService'
94
94
 
95
- rpc :Start, ReconnectParams, Empty
96
- rpc :Stop, Empty, ReconnectInfo
95
+ rpc :Start, ::Grpc::Testing::ReconnectParams, ::Grpc::Testing::Empty
96
+ rpc :Stop, ::Grpc::Testing::Empty, ::Grpc::Testing::ReconnectInfo
97
97
  end
98
98
 
99
99
  Stub = Service.rpc_stub_class
@@ -109,7 +109,23 @@ module Grpc
109
109
  self.service_name = 'grpc.testing.LoadBalancerStatsService'
110
110
 
111
111
  # Gets the backend distribution for RPCs sent by a test client.
112
- rpc :GetClientStats, LoadBalancerStatsRequest, LoadBalancerStatsResponse
112
+ rpc :GetClientStats, ::Grpc::Testing::LoadBalancerStatsRequest, ::Grpc::Testing::LoadBalancerStatsResponse
113
+ end
114
+
115
+ Stub = Service.rpc_stub_class
116
+ end
117
+ module XdsUpdateHealthService
118
+ # A service to remotely control health status of an xDS test server.
119
+ class Service
120
+
121
+ include GRPC::GenericService
122
+
123
+ self.marshal_class_method = :encode
124
+ self.unmarshal_class_method = :decode
125
+ self.service_name = 'grpc.testing.XdsUpdateHealthService'
126
+
127
+ rpc :SetServing, ::Grpc::Testing::Empty, ::Grpc::Testing::Empty
128
+ rpc :SetNotServing, ::Grpc::Testing::Empty, ::Grpc::Testing::Empty
113
129
  end
114
130
 
115
131
  Stub = Service.rpc_stub_class
@@ -81,6 +81,7 @@ class TestTarget < Grpc::Testing::LoadBalancerStatsService::Service
81
81
  watcher = {}
82
82
  $watchers_mutex.synchronize do
83
83
  watcher = {
84
+ "rpcs_by_method" => Hash.new(),
84
85
  "rpcs_by_peer" => Hash.new(0),
85
86
  "rpcs_needed" => req['num_rpcs'],
86
87
  "no_remote_peer" => 0
@@ -95,17 +96,45 @@ class TestTarget < Grpc::Testing::LoadBalancerStatsService::Service
95
96
  end
96
97
  $watchers.delete_at($watchers.index(watcher))
97
98
  end
99
+ # convert results into proper proto object
100
+ rpcs_by_method = {}
101
+ watcher['rpcs_by_method'].each do |rpc_name, rpcs_by_peer|
102
+ rpcs_by_method[rpc_name] = LoadBalancerStatsResponse::RpcsByPeer.new(
103
+ rpcs_by_peer: rpcs_by_peer
104
+ )
105
+ end
98
106
  LoadBalancerStatsResponse.new(
107
+ rpcs_by_method: rpcs_by_method,
99
108
  rpcs_by_peer: watcher['rpcs_by_peer'],
100
109
  num_failures: watcher['no_remote_peer'] + watcher['rpcs_needed']
101
110
  );
102
111
  end
103
112
  end
104
113
 
114
+ # execute 1 RPC and return remote hostname
115
+ def execute_rpc(op, fail_on_failed_rpcs)
116
+ remote_peer = ""
117
+ begin
118
+ op.execute
119
+ if op.metadata.key?('hostname')
120
+ remote_peer = op.metadata['hostname']
121
+ end
122
+ rescue GRPC::BadStatus => e
123
+ GRPC.logger.info("ruby xds: rpc failed:|#{e.message}|, " \
124
+ "this may or may not be expected")
125
+ if fail_on_failed_rpcs
126
+ raise e
127
+ end
128
+ end
129
+ remote_peer
130
+ end
131
+
105
132
  # send 1 rpc every 1/qps second
106
- def run_test_loop(stub, target_seconds_between_rpcs, fail_on_failed_rpcs)
133
+ def run_test_loop(stub, target_seconds_between_rpcs, fail_on_failed_rpcs,
134
+ rpcs_to_send, metadata_to_send)
107
135
  include Grpc::Testing
108
- req = SimpleRequest.new()
136
+ simple_req = SimpleRequest.new()
137
+ empty_req = Empty.new()
109
138
  target_next_start = Process.clock_gettime(Process::CLOCK_MONOTONIC)
110
139
  while !$shutdown
111
140
  now = Process.clock_gettime(Process::CLOCK_MONOTONIC)
@@ -121,25 +150,42 @@ def run_test_loop(stub, target_seconds_between_rpcs, fail_on_failed_rpcs)
121
150
  target_next_start += target_seconds_between_rpcs
122
151
  sleep(sleep_seconds)
123
152
  end
124
- begin
125
- deadline = GRPC::Core::TimeConsts::from_relative_time(30) # 30 seconds
126
- resp = stub.unary_call(req, deadline: deadline)
127
- remote_peer = resp.hostname
128
- rescue GRPC::BadStatus => e
129
- remote_peer = ""
130
- GRPC.logger.info("ruby xds: rpc failed:|#{e.message}|, " \
131
- "this may or may not be expected")
132
- if fail_on_failed_rpcs
133
- raise e
153
+ deadline = GRPC::Core::TimeConsts::from_relative_time(30) # 30 seconds
154
+ results = {}
155
+ rpcs_to_send.each do |rpc|
156
+ metadata = metadata_to_send.key?(rpc) ? metadata_to_send[rpc] : {}
157
+ if rpc == 'UnaryCall'
158
+ op = stub.unary_call(simple_req,
159
+ metadata: metadata,
160
+ deadline: deadline,
161
+ return_op: true)
162
+ elsif rpc == 'EmptyCall'
163
+ op = stub.empty_call(empty_req,
164
+ metadata: metadata,
165
+ deadline: deadline,
166
+ return_op: true)
167
+ else
168
+ raise "Unsupported rpc %s" % [rpc]
134
169
  end
170
+ results[rpc] = execute_rpc(op, fail_on_failed_rpcs)
135
171
  end
136
172
  $watchers_mutex.synchronize do
137
173
  $watchers.each do |watcher|
174
+ # this is counted once when each group of all rpcs_to_send were done
138
175
  watcher['rpcs_needed'] -= 1
139
- if remote_peer.strip.empty?
140
- watcher['no_remote_peer'] += 1
141
- else
142
- watcher['rpcs_by_peer'][remote_peer] += 1
176
+ results.each do |rpc_name, remote_peer|
177
+ if remote_peer.strip.empty?
178
+ # error is counted per individual RPC
179
+ watcher['no_remote_peer'] += 1
180
+ else
181
+ if not watcher['rpcs_by_method'].key?(rpc_name)
182
+ watcher['rpcs_by_method'][rpc_name] = Hash.new(0)
183
+ end
184
+ # increment the remote hostname distribution histogram
185
+ # both by overall, and broken down per RPC
186
+ watcher['rpcs_by_method'][rpc_name][remote_peer] += 1
187
+ watcher['rpcs_by_peer'][remote_peer] += 1
188
+ end
143
189
  end
144
190
  end
145
191
  $watchers_cv.broadcast
@@ -149,6 +195,7 @@ end
149
195
 
150
196
  # Args is used to hold the command line info.
151
197
  Args = Struct.new(:fail_on_failed_rpcs, :num_channels,
198
+ :rpc, :metadata,
152
199
  :server, :stats_port, :qps)
153
200
 
154
201
  # validates the command line options, returning them as a Hash.
@@ -156,6 +203,8 @@ def parse_args
156
203
  args = Args.new
157
204
  args['fail_on_failed_rpcs'] = false
158
205
  args['num_channels'] = 1
206
+ args['rpc'] = 'UnaryCall'
207
+ args['metadata'] = ''
159
208
  OptionParser.new do |opts|
160
209
  opts.on('--fail_on_failed_rpcs BOOL', ['false', 'true']) do |v|
161
210
  args['fail_on_failed_rpcs'] = v == 'true'
@@ -163,6 +212,12 @@ def parse_args
163
212
  opts.on('--num_channels CHANNELS', 'number of channels') do |v|
164
213
  args['num_channels'] = v.to_i
165
214
  end
215
+ opts.on('--rpc RPCS_TO_SEND', 'list of RPCs to send') do |v|
216
+ args['rpc'] = v
217
+ end
218
+ opts.on('--metadata METADATA_TO_SEND', 'metadata to send per RPC') do |v|
219
+ args['metadata'] = v
220
+ end
166
221
  opts.on('--server SERVER_HOST', 'server hostname') do |v|
167
222
  GRPC.logger.info("ruby xds: server address is #{v}")
168
223
  args['server'] = v
@@ -195,11 +250,40 @@ def main
195
250
  # The client just sends unary rpcs continuously in a regular interval
196
251
  stub = create_stub(opts)
197
252
  target_seconds_between_rpcs = (1.0 / opts['qps'].to_f)
253
+ rpcs_to_send = []
254
+ if opts['rpc']
255
+ rpcs_to_send = opts['rpc'].split(',')
256
+ end
257
+ # Convert 'metadata' input in the form of
258
+ # rpc1:k1:v1,rpc2:k2:v2,rpc1:k3:v3
259
+ # into
260
+ # {
261
+ # 'rpc1' => {
262
+ # 'k1' => 'v1',
263
+ # 'k3' => 'v3',
264
+ # },
265
+ # 'rpc2' => {
266
+ # 'k2' => 'v2'
267
+ # },
268
+ # }
269
+ metadata_to_send = {}
270
+ if opts['metadata']
271
+ metadata_entries = opts['metadata'].split(',')
272
+ metadata_entries.each do |e|
273
+ (rpc_name, metadata_key, metadata_value) = e.split(':')
274
+ # initialize if we haven't seen this rpc_name yet
275
+ if !metadata_to_send.key?(rpc_name)
276
+ metadata_to_send[rpc_name] = {}
277
+ end
278
+ metadata_to_send[rpc_name][metadata_key] = metadata_value
279
+ end
280
+ end
198
281
  client_threads = Array.new
199
282
  opts['num_channels'].times {
200
283
  client_threads << Thread.new {
201
284
  run_test_loop(stub, target_seconds_between_rpcs,
202
- opts['fail_on_failed_rpcs'])
285
+ opts['fail_on_failed_rpcs'],
286
+ rpcs_to_send, metadata_to_send)
203
287
  }
204
288
  }
205
289
 
@@ -50,6 +50,16 @@ describe GRPC::Core::ChannelCredentials do
50
50
  blk = proc { ChannelCredentials.new(nil) }
51
51
  expect(&blk).not_to raise_error
52
52
  end
53
+
54
+ it 'fails gracefully with constructed with a nil private key' do
55
+ blk = proc { GRPC::Core::ChannelCredentials.new(nil, nil, '') }
56
+ expect(&blk).to raise_error
57
+ end
58
+
59
+ it 'fails gracefully with constructed with a nil cert chain' do
60
+ blk = proc { GRPC::Core::ChannelCredentials.new(nil, '', nil) }
61
+ expect(&blk).to raise_error
62
+ end
53
63
  end
54
64
 
55
65
  describe '#compose' do
@@ -43,6 +43,16 @@ describe GRPC::ActiveCall do
43
43
  @server = new_core_server_for_testing(nil)
44
44
  server_port = @server.add_http2_port(host, :this_port_is_insecure)
45
45
  @server.start
46
+ @received_rpcs_queue = Queue.new
47
+ @server_thread = Thread.new do
48
+ begin
49
+ received_rpc = @server.request_call
50
+ rescue GRPC::Core::CallError, StandardError => e
51
+ # enqueue the exception in this case as a way to indicate the error
52
+ received_rpc = e
53
+ end
54
+ @received_rpcs_queue.push(received_rpc)
55
+ end
46
56
  @ch = GRPC::Core::Channel.new("0.0.0.0:#{server_port}", nil,
47
57
  :this_channel_is_insecure)
48
58
  end
@@ -50,6 +60,7 @@ describe GRPC::ActiveCall do
50
60
  after(:each) do
51
61
  @server.shutdown_and_notify(deadline)
52
62
  @server.close
63
+ @server_thread.join
53
64
  end
54
65
 
55
66
  describe 'restricted view methods' do
@@ -105,7 +116,7 @@ describe GRPC::ActiveCall do
105
116
  client_call.remote_send(msg)
106
117
 
107
118
  # check that server rpc new was received
108
- recvd_rpc = @server.request_call
119
+ recvd_rpc = @received_rpcs_queue.pop
109
120
  expect(recvd_rpc).to_not eq nil
110
121
  recvd_call = recvd_rpc.call
111
122
 
@@ -130,7 +141,7 @@ describe GRPC::ActiveCall do
130
141
  client_call.remote_send(msg)
131
142
 
132
143
  # confirm that the message was marshalled
133
- recvd_rpc = @server.request_call
144
+ recvd_rpc = @received_rpcs_queue.pop
134
145
  recvd_call = recvd_rpc.call
135
146
  server_ops = {
136
147
  CallOps::SEND_INITIAL_METADATA => nil
@@ -160,7 +171,7 @@ describe GRPC::ActiveCall do
160
171
  call.run_batch(CallOps::SEND_CLOSE_FROM_CLIENT => nil) if f == 1
161
172
 
162
173
  # confirm that the message was marshalled
163
- recvd_rpc = @server.request_call
174
+ recvd_rpc = @received_rpcs_queue.pop
164
175
  recvd_call = recvd_rpc.call
165
176
  server_ops = {
166
177
  CallOps::SEND_INITIAL_METADATA => nil
@@ -321,7 +332,7 @@ describe GRPC::ActiveCall do
321
332
  call = make_test_call
322
333
  metadata = { k1: 'v1', k2: 'v2' }
323
334
  ActiveCall.client_invoke(call, metadata)
324
- recvd_rpc = @server.request_call
335
+ recvd_rpc = @received_rpcs_queue.pop
325
336
  recvd_call = recvd_rpc.call
326
337
  expect(recvd_call).to_not be_nil
327
338
  expect(recvd_rpc.metadata).to_not be_nil
@@ -339,7 +350,7 @@ describe GRPC::ActiveCall do
339
350
  call = make_test_call
340
351
  ActiveCall.client_invoke(call)
341
352
 
342
- recvd_rpc = @server.request_call
353
+ recvd_rpc = @received_rpcs_queue.pop
343
354
  server_call = ActiveCall.new(
344
355
  recvd_rpc.call,
345
356
  @pass_through,
@@ -405,7 +416,7 @@ describe GRPC::ActiveCall do
405
416
  client_call = make_test_call
406
417
  ActiveCall.client_invoke(client_call)
407
418
 
408
- recvd_rpc = @server.request_call
419
+ recvd_rpc = @received_rpcs_queue.pop
409
420
  recvd_call = recvd_rpc.call
410
421
 
411
422
  server_call = ActiveCall.new(
@@ -575,7 +586,7 @@ describe GRPC::ActiveCall do
575
586
  @client_call = make_test_call
576
587
  @client_call.run_batch(CallOps::SEND_INITIAL_METADATA => {})
577
588
 
578
- recvd_rpc = @server.request_call
589
+ recvd_rpc = @received_rpcs_queue.pop
579
590
  recvd_call = recvd_rpc.call
580
591
  @server_call = ActiveCall.new(
581
592
  recvd_call,
@@ -654,7 +665,7 @@ describe GRPC::ActiveCall do
654
665
  end
655
666
 
656
667
  def expect_server_to_be_invoked(**kw)
657
- recvd_rpc = @server.request_call
668
+ recvd_rpc = @received_rpcs_queue.pop
658
669
  expect(recvd_rpc).to_not eq nil
659
670
  recvd_call = recvd_rpc.call
660
671
  recvd_call.run_batch(CallOps::SEND_INITIAL_METADATA => kw)
@@ -0,0 +1,27 @@
1
+ // Copyright 2020 gRPC authors.
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+
15
+ syntax = "proto3";
16
+
17
+ package same_name;
18
+
19
+ service SameName {
20
+ rpc Health(Request) returns (Status);
21
+ }
22
+
23
+ message Status {
24
+ string msg = 1;
25
+ }
26
+
27
+ message Request {}
@@ -0,0 +1,29 @@
1
+ // Copyright 2020 gRPC authors.
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+
15
+ syntax = "proto3";
16
+
17
+ package other_name;
18
+
19
+ option ruby_package = "SameName2";
20
+
21
+ service SameName2 {
22
+ rpc Health(Request) returns (Status);
23
+ }
24
+
25
+ message Status {
26
+ string msg = 1;
27
+ }
28
+
29
+ message Request {}
@@ -48,6 +48,26 @@ describe 'Code Generation Options' do
48
48
  expect(services[:NestedMessageTest].output).to eq(RPC::Test::New::Package::Options::Bar::Baz)
49
49
  end
50
50
  end
51
+
52
+ it 'should generate when package and service has same name' do
53
+ with_protos(['grpc/testing/same_package_service_name.proto']) do
54
+ expect { SameName::SameName::Service }.to raise_error(NameError)
55
+ expect(require('grpc/testing/same_package_service_name_services_pb')).to be_truthy
56
+ expect { SameName::SameName::Service }.to_not raise_error
57
+ expect { SameName::Request }.to_not raise_error
58
+ expect { SameName::Status }.to_not raise_error
59
+ end
60
+ end
61
+
62
+ it 'should generate when ruby_package and service has same name' do
63
+ with_protos(['grpc/testing/same_ruby_package_service_name.proto']) do
64
+ expect { SameName2::SameName2::Service }.to raise_error(NameError)
65
+ expect(require('grpc/testing/same_ruby_package_service_name_services_pb')).to be_truthy
66
+ expect { SameName2::SameName2::Service }.to_not raise_error
67
+ expect { SameName2::Request }.to_not raise_error
68
+ expect { SameName2::Status }.to_not raise_error
69
+ end
70
+ end
51
71
  end
52
72
 
53
73
  def with_protos(file_paths)
@@ -0,0 +1,74 @@
1
+ # Copyright 2020 gRPC authors.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'spec_helper'
16
+
17
+ # a test service that checks the cert of its peer
18
+ class UserAgentEchoService
19
+ include GRPC::GenericService
20
+ rpc :an_rpc, EchoMsg, EchoMsg
21
+
22
+ def an_rpc(_req, call)
23
+ EchoMsg.new(msg: call.metadata['user-agent'])
24
+ end
25
+ end
26
+
27
+ UserAgentEchoServiceStub = UserAgentEchoService.rpc_stub_class
28
+
29
+ describe 'user agent' do
30
+ RpcServer = GRPC::RpcServer
31
+
32
+ before(:all) do
33
+ server_opts = {
34
+ poll_period: 1
35
+ }
36
+ @srv = new_rpc_server_for_testing(**server_opts)
37
+ @port = @srv.add_http2_port('0.0.0.0:0', :this_port_is_insecure)
38
+ @srv.handle(UserAgentEchoService)
39
+ @srv_thd = Thread.new { @srv.run }
40
+ @srv.wait_till_running
41
+ end
42
+
43
+ after(:all) do
44
+ expect(@srv.stopped?).to be(false)
45
+ @srv.stop
46
+ @srv_thd.join
47
+ end
48
+
49
+ it 'client sends expected user agent' do
50
+ stub = UserAgentEchoServiceStub.new("localhost:#{@port}",
51
+ :this_channel_is_insecure,
52
+ {})
53
+ response = stub.an_rpc(EchoMsg.new)
54
+ expected_user_agent_prefix = "grpc-ruby/#{GRPC::VERSION}"
55
+ expect(response.msg.start_with?(expected_user_agent_prefix)).to be true
56
+ # check that the expected user agent prefix occurs in the real user agent exactly once
57
+ expect(response.msg.split(expected_user_agent_prefix).size).to eq 2
58
+ end
59
+
60
+ it 'user agent header does not grow when the same channel args hash is used across multiple stubs' do
61
+ shared_channel_args_hash = {}
62
+ 10.times do
63
+ stub = UserAgentEchoServiceStub.new("localhost:#{@port}",
64
+ :this_channel_is_insecure,
65
+ channel_args: shared_channel_args_hash)
66
+ response = stub.an_rpc(EchoMsg.new)
67
+ puts "got echo response: #{response.msg}"
68
+ expected_user_agent_prefix = "grpc-ruby/#{GRPC::VERSION}"
69
+ expect(response.msg.start_with?(expected_user_agent_prefix)).to be true
70
+ # check that the expected user agent prefix occurs in the real user agent exactly once
71
+ expect(response.msg.split(expected_user_agent_prefix).size).to eq 2
72
+ end
73
+ end
74
+ end
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.31.0.pre2
4
+ version: 1.34.0
5
5
  platform: x64-mingw32
6
6
  authors:
7
7
  - gRPC Authors
8
8
  autorequire:
9
9
  bindir: src/ruby/bin
10
10
  cert_chain: []
11
- date: 2020-07-28 00:00:00.000000000 Z
11
+ date: 2020-12-02 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.12'
19
+ version: '3.13'
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.12'
26
+ version: '3.13'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: googleapis-common-protos-types
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -308,6 +308,8 @@ files:
308
308
  - src/ruby/spec/pb/codegen/grpc/testing/package_options_import.proto
309
309
  - src/ruby/spec/pb/codegen/grpc/testing/package_options_import2.proto
310
310
  - src/ruby/spec/pb/codegen/grpc/testing/package_options_ruby_style.proto
311
+ - src/ruby/spec/pb/codegen/grpc/testing/same_package_service_name.proto
312
+ - src/ruby/spec/pb/codegen/grpc/testing/same_ruby_package_service_name.proto
311
313
  - src/ruby/spec/pb/codegen/package_option_spec.rb
312
314
  - src/ruby/spec/pb/duplicate/codegen_spec.rb
313
315
  - src/ruby/spec/pb/health/checker_spec.rb
@@ -323,6 +325,7 @@ files:
323
325
  - src/ruby/spec/testdata/server1.key
324
326
  - src/ruby/spec/testdata/server1.pem
325
327
  - src/ruby/spec/time_consts_spec.rb
328
+ - src/ruby/spec/user_agent_spec.rb
326
329
  homepage: https://github.com/google/grpc/tree/master/src/ruby
327
330
  licenses:
328
331
  - Apache-2.0
@@ -343,52 +346,55 @@ required_ruby_version: !ruby/object:Gem::Requirement
343
346
  version: 2.8.dev
344
347
  required_rubygems_version: !ruby/object:Gem::Requirement
345
348
  requirements:
346
- - - ">"
349
+ - - ">="
347
350
  - !ruby/object:Gem::Version
348
- version: 1.3.1
351
+ version: '0'
349
352
  requirements: []
350
353
  rubygems_version: 3.1.4
351
354
  signing_key:
352
355
  specification_version: 4
353
356
  summary: GRPC system in Ruby
354
357
  test_files:
355
- - src/ruby/spec/server_spec.rb
358
+ - src/ruby/spec/spec_helper.rb
356
359
  - src/ruby/spec/call_spec.rb
357
- - src/ruby/spec/compression_options_spec.rb
358
- - src/ruby/spec/pb/duplicate/codegen_spec.rb
359
- - src/ruby/spec/pb/codegen/package_option_spec.rb
360
- - src/ruby/spec/pb/codegen/grpc/testing/package_options_ruby_style.proto
361
- - src/ruby/spec/pb/codegen/grpc/testing/package_options_import.proto
362
- - src/ruby/spec/pb/codegen/grpc/testing/package_options_import2.proto
363
- - src/ruby/spec/pb/codegen/grpc/testing/package_options.proto
364
- - src/ruby/spec/pb/health/checker_spec.rb
360
+ - src/ruby/spec/google_rpc_status_utils_spec.rb
361
+ - src/ruby/spec/testdata/server1.key
362
+ - src/ruby/spec/testdata/client.pem
363
+ - src/ruby/spec/testdata/ca.pem
364
+ - src/ruby/spec/testdata/server1.pem
365
+ - src/ruby/spec/testdata/README
366
+ - src/ruby/spec/testdata/client.key
367
+ - src/ruby/spec/channel_credentials_spec.rb
368
+ - src/ruby/spec/support/helpers.rb
369
+ - src/ruby/spec/support/services.rb
365
370
  - src/ruby/spec/channel_spec.rb
366
- - src/ruby/spec/spec_helper.rb
371
+ - src/ruby/spec/user_agent_spec.rb
372
+ - src/ruby/spec/compression_options_spec.rb
373
+ - src/ruby/spec/client_auth_spec.rb
367
374
  - src/ruby/spec/errors_spec.rb
368
- - src/ruby/spec/debug_message_spec.rb
375
+ - src/ruby/spec/server_credentials_spec.rb
369
376
  - src/ruby/spec/time_consts_spec.rb
370
- - src/ruby/spec/client_auth_spec.rb
377
+ - src/ruby/spec/pb/health/checker_spec.rb
378
+ - src/ruby/spec/pb/codegen/grpc/testing/same_ruby_package_service_name.proto
379
+ - src/ruby/spec/pb/codegen/grpc/testing/package_options_import2.proto
380
+ - src/ruby/spec/pb/codegen/grpc/testing/same_package_service_name.proto
381
+ - src/ruby/spec/pb/codegen/grpc/testing/package_options_ruby_style.proto
382
+ - src/ruby/spec/pb/codegen/grpc/testing/package_options.proto
383
+ - src/ruby/spec/pb/codegen/grpc/testing/package_options_import.proto
384
+ - src/ruby/spec/pb/codegen/package_option_spec.rb
385
+ - src/ruby/spec/pb/duplicate/codegen_spec.rb
386
+ - src/ruby/spec/channel_connection_spec.rb
371
387
  - src/ruby/spec/client_server_spec.rb
372
- - src/ruby/spec/generic/rpc_server_spec.rb
388
+ - src/ruby/spec/server_spec.rb
389
+ - src/ruby/spec/error_sanity_spec.rb
390
+ - src/ruby/spec/debug_message_spec.rb
391
+ - src/ruby/spec/generic/rpc_desc_spec.rb
373
392
  - src/ruby/spec/generic/server_interceptors_spec.rb
374
- - src/ruby/spec/generic/client_stub_spec.rb
375
- - src/ruby/spec/generic/active_call_spec.rb
376
- - src/ruby/spec/generic/interceptor_registry_spec.rb
377
- - src/ruby/spec/generic/service_spec.rb
378
393
  - src/ruby/spec/generic/client_interceptors_spec.rb
379
394
  - src/ruby/spec/generic/rpc_server_pool_spec.rb
380
- - src/ruby/spec/generic/rpc_desc_spec.rb
381
- - src/ruby/spec/google_rpc_status_utils_spec.rb
395
+ - src/ruby/spec/generic/interceptor_registry_spec.rb
396
+ - src/ruby/spec/generic/service_spec.rb
397
+ - src/ruby/spec/generic/client_stub_spec.rb
398
+ - src/ruby/spec/generic/active_call_spec.rb
399
+ - src/ruby/spec/generic/rpc_server_spec.rb
382
400
  - src/ruby/spec/call_credentials_spec.rb
383
- - src/ruby/spec/channel_credentials_spec.rb
384
- - src/ruby/spec/error_sanity_spec.rb
385
- - src/ruby/spec/channel_connection_spec.rb
386
- - src/ruby/spec/testdata/ca.pem
387
- - src/ruby/spec/testdata/client.pem
388
- - src/ruby/spec/testdata/server1.key
389
- - src/ruby/spec/testdata/README
390
- - src/ruby/spec/testdata/client.key
391
- - src/ruby/spec/testdata/server1.pem
392
- - src/ruby/spec/support/services.rb
393
- - src/ruby/spec/support/helpers.rb
394
- - src/ruby/spec/server_credentials_spec.rb