grpc 1.26.0 → 1.27.0.pre1
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/Makefile +1654 -1519
- data/etc/roots.pem +44 -0
- data/include/grpc/grpc_security.h +37 -15
- data/include/grpc/grpc_security_constants.h +27 -0
- data/include/grpc/impl/codegen/grpc_types.h +14 -0
- data/include/grpc/impl/codegen/port_platform.h +1 -1
- data/src/core/ext/filters/client_channel/client_channel.cc +0 -20
- data/src/core/ext/filters/client_channel/http_proxy.cc +4 -4
- data/src/core/ext/filters/client_channel/lb_policy.cc +4 -3
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +191 -201
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.cc +89 -0
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.h +40 -0
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc +3 -2
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc +88 -121
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h +28 -57
- data/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +0 -7
- data/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc +8 -9
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds.cc +53 -34
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc +18 -5
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc +24 -19
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h +2 -1
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_fallback.cc +4 -2
- data/src/core/ext/filters/client_channel/server_address.cc +6 -9
- data/src/core/ext/filters/client_channel/server_address.h +3 -10
- data/src/core/ext/filters/client_channel/xds/xds_api.cc +394 -150
- data/src/core/ext/filters/client_channel/xds/xds_api.h +75 -35
- data/src/core/ext/filters/client_channel/xds/xds_bootstrap.cc +59 -22
- data/src/core/ext/filters/client_channel/xds/xds_bootstrap.h +13 -9
- data/src/core/ext/filters/client_channel/xds/xds_channel_secure.cc +8 -6
- data/src/core/ext/filters/client_channel/xds/xds_client.cc +456 -175
- data/src/core/ext/filters/client_channel/xds/xds_client.h +33 -21
- data/src/core/ext/filters/client_channel/xds/xds_client_stats.cc +5 -8
- data/src/core/ext/filters/client_channel/xds/xds_client_stats.h +18 -24
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +2 -2
- data/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c +13 -5
- data/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h +34 -0
- data/src/core/lib/channel/channelz.h +11 -1
- data/src/core/lib/gpr/time_precise.cc +1 -1
- data/src/core/lib/gprpp/optional.h +26 -0
- data/src/core/lib/gprpp/string_view.h +14 -10
- data/src/core/lib/iomgr/executor.cc +1 -1
- data/src/core/lib/iomgr/fork_posix.cc +4 -0
- data/src/core/lib/iomgr/poller/eventmanager_libuv.cc +87 -0
- data/src/core/lib/iomgr/poller/eventmanager_libuv.h +88 -0
- data/src/core/lib/iomgr/socket_utils_common_posix.cc +14 -0
- data/src/core/lib/iomgr/socket_utils_posix.h +12 -0
- data/src/core/lib/iomgr/tcp_custom.h +3 -0
- data/src/core/lib/iomgr/tcp_posix.cc +607 -56
- data/src/core/lib/iomgr/tcp_server_custom.cc +15 -2
- data/src/core/lib/iomgr/tcp_server_utils_posix_common.cc +8 -0
- data/src/core/lib/json/json.h +11 -1
- data/src/core/lib/json/json_reader.cc +206 -28
- data/src/core/lib/json/json_writer.cc +111 -24
- data/src/core/lib/security/credentials/composite/composite_credentials.cc +7 -0
- data/src/core/lib/security/credentials/composite/composite_credentials.h +5 -1
- data/src/core/lib/security/credentials/credentials.h +10 -1
- data/src/core/lib/security/credentials/fake/fake_credentials.h +2 -1
- data/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc +1 -1
- data/src/core/lib/security/credentials/plugin/plugin_credentials.cc +6 -4
- data/src/core/lib/security/credentials/plugin/plugin_credentials.h +2 -1
- data/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc +20 -0
- data/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h +8 -0
- data/src/core/lib/security/credentials/tls/{spiffe_credentials.cc → tls_credentials.cc} +23 -24
- data/src/core/lib/security/credentials/tls/{spiffe_credentials.h → tls_credentials.h} +9 -9
- data/src/core/lib/security/security_connector/alts/alts_security_connector.cc +13 -0
- data/src/core/lib/security/security_connector/fake/fake_security_connector.cc +22 -2
- data/src/core/lib/security/security_connector/load_system_roots_fallback.cc +2 -2
- data/src/core/lib/security/security_connector/load_system_roots_linux.cc +2 -2
- data/src/core/lib/security/security_connector/local/local_security_connector.cc +30 -3
- data/src/core/lib/security/security_connector/ssl_utils.cc +45 -3
- data/src/core/lib/security/security_connector/ssl_utils.h +12 -0
- data/src/core/lib/security/security_connector/tls/{spiffe_security_connector.cc → tls_security_connector.cc} +82 -69
- data/src/core/lib/security/security_connector/tls/{spiffe_security_connector.h → tls_security_connector.h} +17 -18
- data/src/core/lib/security/transport/client_auth_filter.cc +33 -0
- data/src/core/lib/surface/completion_queue.cc +22 -1
- data/src/core/lib/surface/version.cc +1 -1
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc +11 -1
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.h +1 -1
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.cc +3 -3
- data/src/core/tsi/fake_transport_security.cc +7 -3
- data/src/core/tsi/fake_transport_security.h +2 -0
- data/src/core/tsi/ssl_transport_security.cc +144 -8
- data/src/core/tsi/ssl_transport_security.h +15 -1
- data/src/core/tsi/transport_security.cc +13 -0
- data/src/core/tsi/transport_security_grpc.cc +2 -2
- data/src/core/tsi/transport_security_grpc.h +2 -2
- data/src/core/tsi/transport_security_interface.h +12 -0
- data/src/ruby/bin/math_pb.rb +5 -5
- data/src/ruby/ext/grpc/rb_call_credentials.c +4 -1
- 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/lib/grpc/version.rb +1 -1
- data/src/ruby/pb/grpc/health/v1/health_pb.rb +3 -3
- data/src/ruby/pb/src/proto/grpc/testing/empty_pb.rb +1 -1
- data/src/ruby/pb/src/proto/grpc/testing/messages_pb.rb +23 -13
- data/third_party/abseil-cpp/absl/algorithm/algorithm.h +159 -0
- data/third_party/abseil-cpp/absl/base/attributes.h +609 -0
- data/third_party/abseil-cpp/absl/base/call_once.h +226 -0
- data/third_party/abseil-cpp/absl/base/casts.h +184 -0
- data/third_party/abseil-cpp/absl/base/config.h +622 -0
- data/third_party/abseil-cpp/absl/base/const_init.h +76 -0
- data/third_party/abseil-cpp/absl/base/dynamic_annotations.cc +129 -0
- data/third_party/abseil-cpp/absl/base/dynamic_annotations.h +389 -0
- data/third_party/abseil-cpp/absl/base/internal/atomic_hook.h +179 -0
- data/third_party/abseil-cpp/absl/base/internal/bits.h +218 -0
- data/third_party/abseil-cpp/absl/base/internal/cycleclock.cc +107 -0
- data/third_party/abseil-cpp/absl/base/internal/cycleclock.h +94 -0
- data/third_party/abseil-cpp/absl/base/internal/endian.h +266 -0
- data/third_party/abseil-cpp/absl/base/internal/hide_ptr.h +51 -0
- data/third_party/abseil-cpp/absl/base/internal/identity.h +37 -0
- data/third_party/abseil-cpp/absl/base/internal/inline_variable.h +107 -0
- data/third_party/abseil-cpp/absl/base/internal/invoke.h +187 -0
- data/third_party/abseil-cpp/absl/base/internal/low_level_scheduling.h +107 -0
- data/third_party/abseil-cpp/absl/base/internal/per_thread_tls.h +52 -0
- data/third_party/abseil-cpp/absl/base/internal/raw_logging.cc +237 -0
- data/third_party/abseil-cpp/absl/base/internal/raw_logging.h +179 -0
- data/third_party/abseil-cpp/absl/base/internal/scheduling_mode.h +58 -0
- data/third_party/abseil-cpp/absl/base/internal/spinlock.cc +233 -0
- data/third_party/abseil-cpp/absl/base/internal/spinlock.h +243 -0
- data/third_party/abseil-cpp/absl/base/internal/spinlock_akaros.inc +35 -0
- data/third_party/abseil-cpp/absl/base/internal/spinlock_linux.inc +67 -0
- data/third_party/abseil-cpp/absl/base/internal/spinlock_posix.inc +46 -0
- data/third_party/abseil-cpp/absl/base/internal/spinlock_wait.cc +81 -0
- data/third_party/abseil-cpp/absl/base/internal/spinlock_wait.h +93 -0
- data/third_party/abseil-cpp/absl/base/internal/spinlock_win32.inc +37 -0
- data/third_party/abseil-cpp/absl/base/internal/sysinfo.cc +414 -0
- data/third_party/abseil-cpp/absl/base/internal/sysinfo.h +66 -0
- data/third_party/abseil-cpp/absl/base/internal/thread_annotations.h +271 -0
- data/third_party/abseil-cpp/absl/base/internal/thread_identity.cc +140 -0
- data/third_party/abseil-cpp/absl/base/internal/thread_identity.h +250 -0
- data/third_party/abseil-cpp/absl/base/internal/throw_delegate.cc +108 -0
- data/third_party/abseil-cpp/absl/base/internal/throw_delegate.h +75 -0
- data/third_party/abseil-cpp/absl/base/internal/tsan_mutex_interface.h +66 -0
- data/third_party/abseil-cpp/absl/base/internal/unaligned_access.h +158 -0
- data/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.cc +103 -0
- data/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.h +124 -0
- data/third_party/abseil-cpp/absl/base/log_severity.cc +27 -0
- data/third_party/abseil-cpp/absl/base/log_severity.h +121 -0
- data/third_party/abseil-cpp/absl/base/macros.h +220 -0
- data/third_party/abseil-cpp/absl/base/optimization.h +181 -0
- data/third_party/abseil-cpp/absl/base/options.h +214 -0
- data/third_party/abseil-cpp/absl/base/policy_checks.h +111 -0
- data/third_party/abseil-cpp/absl/base/port.h +26 -0
- data/third_party/abseil-cpp/absl/base/thread_annotations.h +280 -0
- data/third_party/abseil-cpp/absl/container/inlined_vector.h +848 -0
- data/third_party/abseil-cpp/absl/container/internal/compressed_tuple.h +265 -0
- data/third_party/abseil-cpp/absl/container/internal/inlined_vector.h +892 -0
- data/third_party/abseil-cpp/absl/memory/memory.h +695 -0
- data/third_party/abseil-cpp/absl/meta/type_traits.h +759 -0
- data/third_party/abseil-cpp/absl/numeric/int128.cc +404 -0
- data/third_party/abseil-cpp/absl/numeric/int128.h +1091 -0
- data/third_party/abseil-cpp/absl/numeric/int128_have_intrinsic.inc +302 -0
- data/third_party/abseil-cpp/absl/numeric/int128_no_intrinsic.inc +308 -0
- data/third_party/abseil-cpp/absl/strings/ascii.cc +200 -0
- data/third_party/abseil-cpp/absl/strings/ascii.h +241 -0
- data/third_party/abseil-cpp/absl/strings/charconv.cc +985 -0
- data/third_party/abseil-cpp/absl/strings/charconv.h +119 -0
- data/third_party/abseil-cpp/absl/strings/escaping.cc +949 -0
- data/third_party/abseil-cpp/absl/strings/escaping.h +164 -0
- data/third_party/abseil-cpp/absl/strings/internal/char_map.h +156 -0
- data/third_party/abseil-cpp/absl/strings/internal/charconv_bigint.cc +359 -0
- data/third_party/abseil-cpp/absl/strings/internal/charconv_bigint.h +421 -0
- data/third_party/abseil-cpp/absl/strings/internal/charconv_parse.cc +504 -0
- data/third_party/abseil-cpp/absl/strings/internal/charconv_parse.h +99 -0
- data/third_party/abseil-cpp/absl/strings/internal/escaping.cc +180 -0
- data/third_party/abseil-cpp/absl/strings/internal/escaping.h +58 -0
- data/third_party/abseil-cpp/absl/strings/internal/memutil.cc +112 -0
- data/third_party/abseil-cpp/absl/strings/internal/memutil.h +148 -0
- data/third_party/abseil-cpp/absl/strings/internal/ostringstream.cc +36 -0
- data/third_party/abseil-cpp/absl/strings/internal/ostringstream.h +89 -0
- data/third_party/abseil-cpp/absl/strings/internal/resize_uninitialized.h +73 -0
- data/third_party/abseil-cpp/absl/strings/internal/stl_type_traits.h +248 -0
- data/third_party/abseil-cpp/absl/strings/internal/str_join_internal.h +314 -0
- data/third_party/abseil-cpp/absl/strings/internal/str_split_internal.h +455 -0
- data/third_party/abseil-cpp/absl/strings/internal/utf8.cc +53 -0
- data/third_party/abseil-cpp/absl/strings/internal/utf8.h +50 -0
- data/third_party/abseil-cpp/absl/strings/match.cc +40 -0
- data/third_party/abseil-cpp/absl/strings/match.h +90 -0
- data/third_party/abseil-cpp/absl/strings/numbers.cc +916 -0
- data/third_party/abseil-cpp/absl/strings/numbers.h +263 -0
- data/third_party/abseil-cpp/absl/strings/str_cat.cc +246 -0
- data/third_party/abseil-cpp/absl/strings/str_cat.h +408 -0
- data/third_party/abseil-cpp/absl/strings/str_join.h +293 -0
- data/third_party/abseil-cpp/absl/strings/str_replace.cc +82 -0
- data/third_party/abseil-cpp/absl/strings/str_replace.h +219 -0
- data/third_party/abseil-cpp/absl/strings/str_split.cc +139 -0
- data/third_party/abseil-cpp/absl/strings/str_split.h +513 -0
- data/third_party/abseil-cpp/absl/strings/string_view.cc +235 -0
- data/third_party/abseil-cpp/absl/strings/string_view.h +615 -0
- data/third_party/abseil-cpp/absl/strings/strip.h +91 -0
- data/third_party/abseil-cpp/absl/strings/substitute.cc +171 -0
- data/third_party/abseil-cpp/absl/strings/substitute.h +693 -0
- data/third_party/abseil-cpp/absl/types/bad_optional_access.cc +48 -0
- data/third_party/abseil-cpp/absl/types/bad_optional_access.h +78 -0
- data/third_party/abseil-cpp/absl/types/internal/optional.h +396 -0
- data/third_party/abseil-cpp/absl/types/internal/span.h +128 -0
- data/third_party/abseil-cpp/absl/types/optional.h +776 -0
- data/third_party/abseil-cpp/absl/types/span.h +713 -0
- data/third_party/abseil-cpp/absl/utility/utility.h +350 -0
- data/third_party/upb/upb/decode.c +4 -0
- data/third_party/upb/upb/port.c +0 -1
- data/third_party/upb/upb/port_def.inc +1 -3
- data/third_party/upb/upb/table.c +2 -1
- metadata +147 -43
- data/src/core/lib/json/json_common.h +0 -34
- data/src/core/lib/json/json_reader.h +0 -146
- data/src/core/lib/json/json_string.cc +0 -367
- data/src/core/lib/json/json_writer.h +0 -84
@@ -24,6 +24,10 @@
|
|
24
24
|
#include "src/core/lib/gprpp/string_view.h"
|
25
25
|
#include "src/core/tsi/transport_security_interface.h"
|
26
26
|
|
27
|
+
extern "C" {
|
28
|
+
#include <openssl/x509.h>
|
29
|
+
}
|
30
|
+
|
27
31
|
/* Value for the TSI_CERTIFICATE_TYPE_PEER_PROPERTY property for X509 certs. */
|
28
32
|
#define TSI_X509_CERTIFICATE_TYPE "X509"
|
29
33
|
|
@@ -35,6 +39,8 @@
|
|
35
39
|
|
36
40
|
#define TSI_X509_PEM_CERT_PROPERTY "x509_pem_cert"
|
37
41
|
|
42
|
+
#define TSI_X509_PEM_CERT_CHAIN_PROPERTY "x509_pem_cert_chain"
|
43
|
+
|
38
44
|
#define TSI_SSL_ALPN_SELECTED_PROTOCOL "ssl_alpn_selected_protocol"
|
39
45
|
|
40
46
|
/* --- tsi_ssl_root_certs_store object ---
|
@@ -142,6 +148,9 @@ struct tsi_ssl_client_handshaker_options {
|
|
142
148
|
/* ssl_session_cache is a cache for reusable client-side sessions. */
|
143
149
|
tsi_ssl_session_cache* session_cache;
|
144
150
|
|
151
|
+
/* skip server certificate verification. */
|
152
|
+
bool skip_server_certificate_verification;
|
153
|
+
|
145
154
|
tsi_ssl_client_handshaker_options()
|
146
155
|
: pem_key_cert_pair(nullptr),
|
147
156
|
pem_root_certs(nullptr),
|
@@ -149,7 +158,8 @@ struct tsi_ssl_client_handshaker_options {
|
|
149
158
|
cipher_suites(nullptr),
|
150
159
|
alpn_protocols(nullptr),
|
151
160
|
num_alpn_protocols(0),
|
152
|
-
session_cache(nullptr)
|
161
|
+
session_cache(nullptr),
|
162
|
+
skip_server_certificate_verification(false) {}
|
153
163
|
};
|
154
164
|
|
155
165
|
/* Creates a client handshaker factory.
|
@@ -336,4 +346,8 @@ const tsi_ssl_handshaker_factory_vtable* tsi_ssl_handshaker_factory_swap_vtable(
|
|
336
346
|
tsi_result tsi_ssl_extract_x509_subject_names_from_pem_cert(
|
337
347
|
const char* pem_cert, tsi_peer* peer);
|
338
348
|
|
349
|
+
/* Exposed for testing only. */
|
350
|
+
tsi_result tsi_ssl_get_cert_chain_contents(STACK_OF(X509) * peer_chain,
|
351
|
+
tsi_peer_property* property);
|
352
|
+
|
339
353
|
#endif /* GRPC_CORE_TSI_SSL_TRANSPORT_SECURITY_H */
|
@@ -67,6 +67,19 @@ const char* tsi_result_to_string(tsi_result result) {
|
|
67
67
|
}
|
68
68
|
}
|
69
69
|
|
70
|
+
const char* tsi_security_level_to_string(tsi_security_level security_level) {
|
71
|
+
switch (security_level) {
|
72
|
+
case TSI_SECURITY_NONE:
|
73
|
+
return "TSI_SECURITY_NONE";
|
74
|
+
case TSI_INTEGRITY_ONLY:
|
75
|
+
return "TSI_INTEGRITY_ONLY";
|
76
|
+
case TSI_PRIVACY_AND_INTEGRITY:
|
77
|
+
return "TSI_PRIVACY_AND_INTEGRITY";
|
78
|
+
default:
|
79
|
+
return "UNKNOWN";
|
80
|
+
}
|
81
|
+
}
|
82
|
+
|
70
83
|
/* --- tsi_frame_protector common implementation. ---
|
71
84
|
|
72
85
|
Calls specific implementation after state/input validation. */
|
@@ -66,8 +66,8 @@ void tsi_zero_copy_grpc_protector_destroy(tsi_zero_copy_grpc_protector* self) {
|
|
66
66
|
}
|
67
67
|
|
68
68
|
tsi_result tsi_zero_copy_grpc_protector_max_frame_size(
|
69
|
-
tsi_zero_copy_grpc_protector* self, size_t
|
70
|
-
if (self == nullptr) return TSI_INVALID_ARGUMENT;
|
69
|
+
tsi_zero_copy_grpc_protector* self, size_t* max_frame_size) {
|
70
|
+
if (self == nullptr || max_frame_size == nullptr) return TSI_INVALID_ARGUMENT;
|
71
71
|
if (self->vtable->max_frame_size == nullptr) return TSI_UNIMPLEMENTED;
|
72
72
|
return self->vtable->max_frame_size(self, max_frame_size);
|
73
73
|
}
|
@@ -58,7 +58,7 @@ void tsi_zero_copy_grpc_protector_destroy(tsi_zero_copy_grpc_protector* self);
|
|
58
58
|
|
59
59
|
/* Returns value of max protected frame size. Useful for testing. */
|
60
60
|
tsi_result tsi_zero_copy_grpc_protector_max_frame_size(
|
61
|
-
tsi_zero_copy_grpc_protector* self, size_t
|
61
|
+
tsi_zero_copy_grpc_protector* self, size_t* max_frame_size);
|
62
62
|
|
63
63
|
/* Base for tsi_zero_copy_grpc_protector implementations. */
|
64
64
|
typedef struct {
|
@@ -70,7 +70,7 @@ typedef struct {
|
|
70
70
|
grpc_slice_buffer* unprotected_slices);
|
71
71
|
void (*destroy)(tsi_zero_copy_grpc_protector* self);
|
72
72
|
tsi_result (*max_frame_size)(tsi_zero_copy_grpc_protector* self,
|
73
|
-
size_t
|
73
|
+
size_t* max_frame_size);
|
74
74
|
} tsi_zero_copy_grpc_protector_vtable;
|
75
75
|
|
76
76
|
struct tsi_zero_copy_grpc_protector {
|
@@ -46,6 +46,14 @@ typedef enum {
|
|
46
46
|
TSI_HANDSHAKE_SHUTDOWN = 14,
|
47
47
|
} tsi_result;
|
48
48
|
|
49
|
+
typedef enum {
|
50
|
+
TSI_SECURITY_MIN,
|
51
|
+
TSI_SECURITY_NONE = TSI_SECURITY_MIN,
|
52
|
+
TSI_INTEGRITY_ONLY,
|
53
|
+
TSI_PRIVACY_AND_INTEGRITY,
|
54
|
+
TSI_SECURITY_MAX = TSI_PRIVACY_AND_INTEGRITY,
|
55
|
+
} tsi_security_level;
|
56
|
+
|
49
57
|
typedef enum {
|
50
58
|
// Default option
|
51
59
|
TSI_DONT_REQUEST_CLIENT_CERTIFICATE,
|
@@ -56,6 +64,7 @@ typedef enum {
|
|
56
64
|
} tsi_client_certificate_request_type;
|
57
65
|
|
58
66
|
const char* tsi_result_to_string(tsi_result result);
|
67
|
+
const char* tsi_security_level_to_string(tsi_security_level security_level);
|
59
68
|
|
60
69
|
/* --- tsi tracing --- */
|
61
70
|
|
@@ -185,6 +194,9 @@ void tsi_frame_protector_destroy(tsi_frame_protector* self);
|
|
185
194
|
/* This property is of type TSI_PEER_PROPERTY_STRING. */
|
186
195
|
#define TSI_CERTIFICATE_TYPE_PEER_PROPERTY "certificate_type"
|
187
196
|
|
197
|
+
/* This property represents security level of a channel. */
|
198
|
+
#define TSI_SECURITY_LEVEL_PEER_PROPERTY "security_level"
|
199
|
+
|
188
200
|
/* Property values may contain NULL characters just like C++ strings.
|
189
201
|
The length field gives the length of the string. */
|
190
202
|
typedef struct tsi_peer_property {
|
data/src/ruby/bin/math_pb.rb
CHANGED
@@ -26,9 +26,9 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
26
26
|
end
|
27
27
|
|
28
28
|
module Math
|
29
|
-
DivArgs = Google::Protobuf::DescriptorPool.generated_pool.lookup("math.DivArgs").msgclass
|
30
|
-
DivReply = Google::Protobuf::DescriptorPool.generated_pool.lookup("math.DivReply").msgclass
|
31
|
-
FibArgs = Google::Protobuf::DescriptorPool.generated_pool.lookup("math.FibArgs").msgclass
|
32
|
-
Num = Google::Protobuf::DescriptorPool.generated_pool.lookup("math.Num").msgclass
|
33
|
-
FibReply = Google::Protobuf::DescriptorPool.generated_pool.lookup("math.FibReply").msgclass
|
29
|
+
DivArgs = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("math.DivArgs").msgclass
|
30
|
+
DivReply = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("math.DivReply").msgclass
|
31
|
+
FibArgs = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("math.FibArgs").msgclass
|
32
|
+
Num = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("math.Num").msgclass
|
33
|
+
FibReply = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("math.FibReply").msgclass
|
34
34
|
end
|
@@ -229,7 +229,10 @@ static VALUE grpc_rb_call_credentials_init(VALUE self, VALUE proc) {
|
|
229
229
|
plugin.state = (void*)proc;
|
230
230
|
plugin.type = "";
|
231
231
|
|
232
|
-
|
232
|
+
// TODO(yihuazhang): Expose min_security_level via the Ruby API so that
|
233
|
+
// applications can decide what minimum security level their plugins require.
|
234
|
+
creds = grpc_metadata_credentials_create_from_plugin(
|
235
|
+
plugin, GRPC_PRIVACY_AND_INTEGRITY, NULL);
|
233
236
|
if (creds == NULL) {
|
234
237
|
rb_raise(rb_eRuntimeError, "could not create a credentials, not sure why");
|
235
238
|
return Qnil;
|
@@ -159,6 +159,7 @@ grpc_local_credentials_create_type grpc_local_credentials_create_import;
|
|
159
159
|
grpc_local_server_credentials_create_type grpc_local_server_credentials_create_import;
|
160
160
|
grpc_tls_credentials_options_create_type grpc_tls_credentials_options_create_import;
|
161
161
|
grpc_tls_credentials_options_set_cert_request_type_type grpc_tls_credentials_options_set_cert_request_type_import;
|
162
|
+
grpc_tls_credentials_options_set_server_verification_option_type grpc_tls_credentials_options_set_server_verification_option_import;
|
162
163
|
grpc_tls_credentials_options_set_key_materials_config_type grpc_tls_credentials_options_set_key_materials_config_import;
|
163
164
|
grpc_tls_credentials_options_set_credential_reload_config_type grpc_tls_credentials_options_set_credential_reload_config_import;
|
164
165
|
grpc_tls_credentials_options_set_server_authorization_check_config_type grpc_tls_credentials_options_set_server_authorization_check_config_import;
|
@@ -430,6 +431,7 @@ void grpc_rb_load_imports(HMODULE library) {
|
|
430
431
|
grpc_local_server_credentials_create_import = (grpc_local_server_credentials_create_type) GetProcAddress(library, "grpc_local_server_credentials_create");
|
431
432
|
grpc_tls_credentials_options_create_import = (grpc_tls_credentials_options_create_type) GetProcAddress(library, "grpc_tls_credentials_options_create");
|
432
433
|
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");
|
434
|
+
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");
|
433
435
|
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");
|
434
436
|
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");
|
435
437
|
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");
|
@@ -380,7 +380,7 @@ extern grpc_google_iam_credentials_create_type grpc_google_iam_credentials_creat
|
|
380
380
|
typedef grpc_call_credentials*(*grpc_sts_credentials_create_type)(const grpc_sts_credentials_options* options, void* reserved);
|
381
381
|
extern grpc_sts_credentials_create_type grpc_sts_credentials_create_import;
|
382
382
|
#define grpc_sts_credentials_create grpc_sts_credentials_create_import
|
383
|
-
typedef grpc_call_credentials*(*grpc_metadata_credentials_create_from_plugin_type)(grpc_metadata_credentials_plugin plugin, void* reserved);
|
383
|
+
typedef grpc_call_credentials*(*grpc_metadata_credentials_create_from_plugin_type)(grpc_metadata_credentials_plugin plugin, grpc_security_level min_security_level, void* reserved);
|
384
384
|
extern grpc_metadata_credentials_create_from_plugin_type grpc_metadata_credentials_create_from_plugin_import;
|
385
385
|
#define grpc_metadata_credentials_create_from_plugin grpc_metadata_credentials_create_from_plugin_import
|
386
386
|
typedef grpc_channel*(*grpc_secure_channel_create_type)(grpc_channel_credentials* creds, const char* target, const grpc_channel_args* args, void* reserved);
|
@@ -452,6 +452,9 @@ extern grpc_tls_credentials_options_create_type grpc_tls_credentials_options_cre
|
|
452
452
|
typedef int(*grpc_tls_credentials_options_set_cert_request_type_type)(grpc_tls_credentials_options* options, grpc_ssl_client_certificate_request_type type);
|
453
453
|
extern grpc_tls_credentials_options_set_cert_request_type_type grpc_tls_credentials_options_set_cert_request_type_import;
|
454
454
|
#define grpc_tls_credentials_options_set_cert_request_type grpc_tls_credentials_options_set_cert_request_type_import
|
455
|
+
typedef int(*grpc_tls_credentials_options_set_server_verification_option_type)(grpc_tls_credentials_options* options, grpc_tls_server_verification_option server_verification_option);
|
456
|
+
extern grpc_tls_credentials_options_set_server_verification_option_type grpc_tls_credentials_options_set_server_verification_option_import;
|
457
|
+
#define grpc_tls_credentials_options_set_server_verification_option grpc_tls_credentials_options_set_server_verification_option_import
|
455
458
|
typedef int(*grpc_tls_credentials_options_set_key_materials_config_type)(grpc_tls_credentials_options* options, grpc_tls_key_materials_config* config);
|
456
459
|
extern grpc_tls_credentials_options_set_key_materials_config_type grpc_tls_credentials_options_set_key_materials_config_import;
|
457
460
|
#define grpc_tls_credentials_options_set_key_materials_config grpc_tls_credentials_options_set_key_materials_config_import
|
@@ -23,9 +23,9 @@ end
|
|
23
23
|
module Grpc
|
24
24
|
module Health
|
25
25
|
module V1
|
26
|
-
HealthCheckRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.health.v1.HealthCheckRequest").msgclass
|
27
|
-
HealthCheckResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.health.v1.HealthCheckResponse").msgclass
|
28
|
-
HealthCheckResponse::ServingStatus = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.health.v1.HealthCheckResponse.ServingStatus").enummodule
|
26
|
+
HealthCheckRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.health.v1.HealthCheckRequest").msgclass
|
27
|
+
HealthCheckResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.health.v1.HealthCheckResponse").msgclass
|
28
|
+
HealthCheckResponse::ServingStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.health.v1.HealthCheckResponse.ServingStatus").enummodule
|
29
29
|
end
|
30
30
|
end
|
31
31
|
end
|
@@ -25,11 +25,15 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
25
25
|
optional :response_compressed, :message, 6, "grpc.testing.BoolValue"
|
26
26
|
optional :response_status, :message, 7, "grpc.testing.EchoStatus"
|
27
27
|
optional :expect_compressed, :message, 8, "grpc.testing.BoolValue"
|
28
|
+
optional :fill_server_id, :bool, 9
|
29
|
+
optional :fill_grpclb_route_type, :bool, 10
|
28
30
|
end
|
29
31
|
add_message "grpc.testing.SimpleResponse" do
|
30
32
|
optional :payload, :message, 1, "grpc.testing.Payload"
|
31
33
|
optional :username, :string, 2
|
32
34
|
optional :oauth_scope, :string, 3
|
35
|
+
optional :server_id, :string, 4
|
36
|
+
optional :grpclb_route_type, :enum, 5, "grpc.testing.GrpclbRouteType"
|
33
37
|
end
|
34
38
|
add_message "grpc.testing.StreamingInputCallRequest" do
|
35
39
|
optional :payload, :message, 1, "grpc.testing.Payload"
|
@@ -62,23 +66,29 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
62
66
|
add_enum "grpc.testing.PayloadType" do
|
63
67
|
value :COMPRESSABLE, 0
|
64
68
|
end
|
69
|
+
add_enum "grpc.testing.GrpclbRouteType" do
|
70
|
+
value :GRPCLB_ROUTE_TYPE_UNKNOWN, 0
|
71
|
+
value :GRPCLB_ROUTE_TYPE_FALLBACK, 1
|
72
|
+
value :GRPCLB_ROUTE_TYPE_BACKEND, 2
|
73
|
+
end
|
65
74
|
end
|
66
75
|
end
|
67
76
|
|
68
77
|
module Grpc
|
69
78
|
module Testing
|
70
|
-
BoolValue = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.BoolValue").msgclass
|
71
|
-
Payload = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.Payload").msgclass
|
72
|
-
EchoStatus = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.EchoStatus").msgclass
|
73
|
-
SimpleRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.SimpleRequest").msgclass
|
74
|
-
SimpleResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.SimpleResponse").msgclass
|
75
|
-
StreamingInputCallRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.StreamingInputCallRequest").msgclass
|
76
|
-
StreamingInputCallResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.StreamingInputCallResponse").msgclass
|
77
|
-
ResponseParameters = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ResponseParameters").msgclass
|
78
|
-
StreamingOutputCallRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.StreamingOutputCallRequest").msgclass
|
79
|
-
StreamingOutputCallResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.StreamingOutputCallResponse").msgclass
|
80
|
-
ReconnectParams = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ReconnectParams").msgclass
|
81
|
-
ReconnectInfo = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ReconnectInfo").msgclass
|
82
|
-
PayloadType = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.PayloadType").enummodule
|
79
|
+
BoolValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.BoolValue").msgclass
|
80
|
+
Payload = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.Payload").msgclass
|
81
|
+
EchoStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.EchoStatus").msgclass
|
82
|
+
SimpleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.SimpleRequest").msgclass
|
83
|
+
SimpleResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.SimpleResponse").msgclass
|
84
|
+
StreamingInputCallRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.StreamingInputCallRequest").msgclass
|
85
|
+
StreamingInputCallResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.StreamingInputCallResponse").msgclass
|
86
|
+
ResponseParameters = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ResponseParameters").msgclass
|
87
|
+
StreamingOutputCallRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.StreamingOutputCallRequest").msgclass
|
88
|
+
StreamingOutputCallResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.StreamingOutputCallResponse").msgclass
|
89
|
+
ReconnectParams = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ReconnectParams").msgclass
|
90
|
+
ReconnectInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ReconnectInfo").msgclass
|
91
|
+
PayloadType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.PayloadType").enummodule
|
92
|
+
GrpclbRouteType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.GrpclbRouteType").enummodule
|
83
93
|
end
|
84
94
|
end
|
@@ -0,0 +1,159 @@
|
|
1
|
+
// Copyright 2017 The Abseil 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
|
+
// https://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
|
+
// -----------------------------------------------------------------------------
|
16
|
+
// File: algorithm.h
|
17
|
+
// -----------------------------------------------------------------------------
|
18
|
+
//
|
19
|
+
// This header file contains Google extensions to the standard <algorithm> C++
|
20
|
+
// header.
|
21
|
+
|
22
|
+
#ifndef ABSL_ALGORITHM_ALGORITHM_H_
|
23
|
+
#define ABSL_ALGORITHM_ALGORITHM_H_
|
24
|
+
|
25
|
+
#include <algorithm>
|
26
|
+
#include <iterator>
|
27
|
+
#include <type_traits>
|
28
|
+
|
29
|
+
#include "absl/base/config.h"
|
30
|
+
|
31
|
+
namespace absl {
|
32
|
+
ABSL_NAMESPACE_BEGIN
|
33
|
+
|
34
|
+
namespace algorithm_internal {
|
35
|
+
|
36
|
+
// Performs comparisons with operator==, similar to C++14's `std::equal_to<>`.
|
37
|
+
struct EqualTo {
|
38
|
+
template <typename T, typename U>
|
39
|
+
bool operator()(const T& a, const U& b) const {
|
40
|
+
return a == b;
|
41
|
+
}
|
42
|
+
};
|
43
|
+
|
44
|
+
template <typename InputIter1, typename InputIter2, typename Pred>
|
45
|
+
bool EqualImpl(InputIter1 first1, InputIter1 last1, InputIter2 first2,
|
46
|
+
InputIter2 last2, Pred pred, std::input_iterator_tag,
|
47
|
+
std::input_iterator_tag) {
|
48
|
+
while (true) {
|
49
|
+
if (first1 == last1) return first2 == last2;
|
50
|
+
if (first2 == last2) return false;
|
51
|
+
if (!pred(*first1, *first2)) return false;
|
52
|
+
++first1;
|
53
|
+
++first2;
|
54
|
+
}
|
55
|
+
}
|
56
|
+
|
57
|
+
template <typename InputIter1, typename InputIter2, typename Pred>
|
58
|
+
bool EqualImpl(InputIter1 first1, InputIter1 last1, InputIter2 first2,
|
59
|
+
InputIter2 last2, Pred&& pred, std::random_access_iterator_tag,
|
60
|
+
std::random_access_iterator_tag) {
|
61
|
+
return (last1 - first1 == last2 - first2) &&
|
62
|
+
std::equal(first1, last1, first2, std::forward<Pred>(pred));
|
63
|
+
}
|
64
|
+
|
65
|
+
// When we are using our own internal predicate that just applies operator==, we
|
66
|
+
// forward to the non-predicate form of std::equal. This enables an optimization
|
67
|
+
// in libstdc++ that can result in std::memcmp being used for integer types.
|
68
|
+
template <typename InputIter1, typename InputIter2>
|
69
|
+
bool EqualImpl(InputIter1 first1, InputIter1 last1, InputIter2 first2,
|
70
|
+
InputIter2 last2, algorithm_internal::EqualTo /* unused */,
|
71
|
+
std::random_access_iterator_tag,
|
72
|
+
std::random_access_iterator_tag) {
|
73
|
+
return (last1 - first1 == last2 - first2) &&
|
74
|
+
std::equal(first1, last1, first2);
|
75
|
+
}
|
76
|
+
|
77
|
+
template <typename It>
|
78
|
+
It RotateImpl(It first, It middle, It last, std::true_type) {
|
79
|
+
return std::rotate(first, middle, last);
|
80
|
+
}
|
81
|
+
|
82
|
+
template <typename It>
|
83
|
+
It RotateImpl(It first, It middle, It last, std::false_type) {
|
84
|
+
std::rotate(first, middle, last);
|
85
|
+
return std::next(first, std::distance(middle, last));
|
86
|
+
}
|
87
|
+
|
88
|
+
} // namespace algorithm_internal
|
89
|
+
|
90
|
+
// equal()
|
91
|
+
//
|
92
|
+
// Compares the equality of two ranges specified by pairs of iterators, using
|
93
|
+
// the given predicate, returning true iff for each corresponding iterator i1
|
94
|
+
// and i2 in the first and second range respectively, pred(*i1, *i2) == true
|
95
|
+
//
|
96
|
+
// This comparison takes at most min(`last1` - `first1`, `last2` - `first2`)
|
97
|
+
// invocations of the predicate. Additionally, if InputIter1 and InputIter2 are
|
98
|
+
// both random-access iterators, and `last1` - `first1` != `last2` - `first2`,
|
99
|
+
// then the predicate is never invoked and the function returns false.
|
100
|
+
//
|
101
|
+
// This is a C++11-compatible implementation of C++14 `std::equal`. See
|
102
|
+
// https://en.cppreference.com/w/cpp/algorithm/equal for more information.
|
103
|
+
template <typename InputIter1, typename InputIter2, typename Pred>
|
104
|
+
bool equal(InputIter1 first1, InputIter1 last1, InputIter2 first2,
|
105
|
+
InputIter2 last2, Pred&& pred) {
|
106
|
+
return algorithm_internal::EqualImpl(
|
107
|
+
first1, last1, first2, last2, std::forward<Pred>(pred),
|
108
|
+
typename std::iterator_traits<InputIter1>::iterator_category{},
|
109
|
+
typename std::iterator_traits<InputIter2>::iterator_category{});
|
110
|
+
}
|
111
|
+
|
112
|
+
// Overload of equal() that performs comparison of two ranges specified by pairs
|
113
|
+
// of iterators using operator==.
|
114
|
+
template <typename InputIter1, typename InputIter2>
|
115
|
+
bool equal(InputIter1 first1, InputIter1 last1, InputIter2 first2,
|
116
|
+
InputIter2 last2) {
|
117
|
+
return absl::equal(first1, last1, first2, last2,
|
118
|
+
algorithm_internal::EqualTo{});
|
119
|
+
}
|
120
|
+
|
121
|
+
// linear_search()
|
122
|
+
//
|
123
|
+
// Performs a linear search for `value` using the iterator `first` up to
|
124
|
+
// but not including `last`, returning true if [`first`, `last`) contains an
|
125
|
+
// element equal to `value`.
|
126
|
+
//
|
127
|
+
// A linear search is of O(n) complexity which is guaranteed to make at most
|
128
|
+
// n = (`last` - `first`) comparisons. A linear search over short containers
|
129
|
+
// may be faster than a binary search, even when the container is sorted.
|
130
|
+
template <typename InputIterator, typename EqualityComparable>
|
131
|
+
bool linear_search(InputIterator first, InputIterator last,
|
132
|
+
const EqualityComparable& value) {
|
133
|
+
return std::find(first, last, value) != last;
|
134
|
+
}
|
135
|
+
|
136
|
+
// rotate()
|
137
|
+
//
|
138
|
+
// Performs a left rotation on a range of elements (`first`, `last`) such that
|
139
|
+
// `middle` is now the first element. `rotate()` returns an iterator pointing to
|
140
|
+
// the first element before rotation. This function is exactly the same as
|
141
|
+
// `std::rotate`, but fixes a bug in gcc
|
142
|
+
// <= 4.9 where `std::rotate` returns `void` instead of an iterator.
|
143
|
+
//
|
144
|
+
// The complexity of this algorithm is the same as that of `std::rotate`, but if
|
145
|
+
// `ForwardIterator` is not a random-access iterator, then `absl::rotate`
|
146
|
+
// performs an additional pass over the range to construct the return value.
|
147
|
+
template <typename ForwardIterator>
|
148
|
+
ForwardIterator rotate(ForwardIterator first, ForwardIterator middle,
|
149
|
+
ForwardIterator last) {
|
150
|
+
return algorithm_internal::RotateImpl(
|
151
|
+
first, middle, last,
|
152
|
+
std::is_same<decltype(std::rotate(first, middle, last)),
|
153
|
+
ForwardIterator>());
|
154
|
+
}
|
155
|
+
|
156
|
+
ABSL_NAMESPACE_END
|
157
|
+
} // namespace absl
|
158
|
+
|
159
|
+
#endif // ABSL_ALGORITHM_ALGORITHM_H_
|