grpc 0.14.1 → 0.15.0
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 +1398 -817
- data/include/grpc/compression.h +2 -1
- data/include/grpc/grpc.h +10 -1
- data/include/grpc/grpc_cronet.h +51 -0
- data/include/grpc/grpc_posix.h +70 -0
- data/include/grpc/impl/codegen/atm.h +2 -2
- data/include/grpc/impl/codegen/{atm_win32.h → atm_windows.h} +3 -3
- data/include/grpc/impl/codegen/compression_types.h +39 -5
- data/include/grpc/impl/codegen/connectivity_state.h +1 -1
- data/include/grpc/impl/codegen/grpc_types.h +10 -0
- data/include/grpc/impl/codegen/log.h +2 -1
- data/include/grpc/impl/codegen/port_platform.h +30 -12
- data/include/grpc/impl/codegen/slice_buffer.h +2 -3
- data/include/grpc/impl/codegen/sync.h +2 -2
- data/include/grpc/impl/codegen/{sync_win32.h → sync_windows.h} +3 -3
- data/include/grpc/support/{sync_win32.h → atm_windows.h} +4 -4
- data/include/grpc/support/avl.h +5 -0
- data/include/grpc/support/{log_win32.h → log_windows.h} +3 -3
- data/include/grpc/support/string_util.h +2 -1
- data/include/grpc/support/{atm_win32.h → sync_windows.h} +4 -4
- data/src/core/ext/census/gen/census.pb.c +179 -0
- data/src/core/ext/census/gen/census.pb.h +294 -0
- data/src/core/ext/census/grpc_filter.c +11 -7
- data/src/core/ext/client_config/channel_connectivity.c +28 -14
- data/src/core/ext/client_config/client_channel.c +77 -53
- data/src/core/ext/client_config/connector.h +1 -1
- data/src/core/ext/client_config/lb_policy.c +9 -6
- data/src/core/ext/client_config/lb_policy.h +9 -5
- data/src/core/ext/client_config/subchannel.c +58 -39
- data/src/core/ext/client_config/subchannel.h +3 -2
- data/src/core/ext/client_config/subchannel_call_holder.c +34 -19
- data/src/core/ext/client_config/subchannel_call_holder.h +2 -1
- data/src/core/ext/client_config/subchannel_index.c +20 -9
- data/src/core/ext/lb_policy/grpclb/load_balancer_api.c +7 -7
- data/src/core/ext/lb_policy/grpclb/load_balancer_api.h +5 -5
- data/src/core/ext/lb_policy/grpclb/proto/grpc/lb/{v0 → v1}/load_balancer.pb.c +29 -30
- data/src/core/ext/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h +178 -0
- data/src/core/ext/lb_policy/pick_first/pick_first.c +65 -45
- data/src/core/ext/lb_policy/round_robin/round_robin.c +84 -43
- data/src/core/ext/load_reporting/load_reporting.c +133 -0
- data/src/core/ext/load_reporting/load_reporting.h +75 -0
- data/src/core/ext/load_reporting/load_reporting_filter.c +151 -0
- data/src/core/ext/load_reporting/load_reporting_filter.h +41 -0
- data/src/core/ext/resolver/dns/native/dns_resolver.c +22 -8
- data/src/core/ext/resolver/sockaddr/sockaddr_resolver.c +2 -2
- data/src/core/ext/transport/chttp2/client/insecure/channel_create.c +4 -4
- data/src/core/ext/transport/chttp2/client/insecure/channel_create_posix.c +95 -0
- data/src/core/ext/transport/chttp2/client/secure/secure_channel_create.c +14 -18
- data/src/core/ext/transport/chttp2/server/insecure/server_chttp2.c +49 -24
- data/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c +82 -0
- data/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.c +104 -60
- data/src/core/ext/transport/chttp2/transport/bin_decoder.c +232 -0
- data/src/{ruby/ext/grpc/rb_signal.c → core/ext/transport/chttp2/transport/bin_decoder.h} +27 -31
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.c +481 -260
- data/src/core/ext/transport/chttp2/transport/frame.h +1 -7
- data/src/core/ext/transport/chttp2/transport/frame_data.c +44 -27
- data/src/core/ext/transport/chttp2/transport/frame_data.h +6 -5
- data/src/core/ext/transport/chttp2/transport/frame_goaway.c +23 -17
- data/src/core/ext/transport/chttp2/transport/frame_goaway.h +2 -2
- data/src/core/ext/transport/chttp2/transport/frame_ping.c +12 -7
- data/src/core/ext/transport/chttp2/transport/frame_ping.h +3 -3
- data/src/core/ext/transport/chttp2/transport/frame_rst_stream.c +25 -12
- data/src/core/ext/transport/chttp2/transport/frame_rst_stream.h +2 -2
- data/src/core/ext/transport/chttp2/transport/frame_settings.c +23 -21
- data/src/core/ext/transport/chttp2/transport/frame_settings.h +2 -2
- data/src/core/ext/transport/chttp2/transport/frame_window_update.c +17 -9
- data/src/core/ext/transport/chttp2/transport/frame_window_update.h +2 -2
- data/src/core/ext/transport/chttp2/transport/hpack_parser.c +365 -287
- data/src/core/ext/transport/chttp2/transport/hpack_parser.h +8 -6
- data/src/core/ext/transport/chttp2/transport/hpack_table.c +24 -20
- data/src/core/ext/transport/chttp2/transport/hpack_table.h +5 -4
- data/src/core/ext/transport/chttp2/transport/incoming_metadata.c +1 -0
- data/src/core/ext/transport/chttp2/transport/incoming_metadata.h +1 -0
- data/src/core/ext/transport/chttp2/transport/internal.h +34 -32
- data/src/core/ext/transport/chttp2/transport/parsing.c +296 -212
- data/src/core/ext/transport/chttp2/transport/writing.c +12 -9
- data/src/core/lib/channel/channel_args.c +26 -12
- data/src/core/lib/channel/channel_args.h +1 -1
- data/src/core/lib/channel/channel_stack.c +12 -8
- data/src/core/lib/channel/channel_stack.h +27 -11
- data/src/core/lib/channel/channel_stack_builder.c +2 -2
- data/src/core/lib/channel/compress_filter.c +26 -31
- data/src/core/lib/channel/compress_filter.h +4 -4
- data/src/core/lib/channel/connected_channel.c +7 -5
- data/src/core/lib/channel/http_client_filter.c +34 -8
- data/src/core/lib/channel/http_client_filter.h +1 -1
- data/src/core/lib/channel/http_server_filter.c +21 -12
- data/src/core/lib/compression/{compression_algorithm.c → compression.c} +22 -21
- data/src/core/lib/http/httpcli.c +81 -59
- data/src/core/lib/http/httpcli.h +11 -15
- data/src/core/lib/http/httpcli_security_connector.c +5 -3
- data/src/core/lib/http/parser.c +127 -118
- data/src/core/lib/http/parser.h +11 -6
- data/src/core/lib/iomgr/closure.c +20 -16
- data/src/core/lib/iomgr/closure.h +19 -15
- data/src/core/lib/iomgr/endpoint.h +1 -1
- data/src/core/lib/iomgr/endpoint_pair_posix.c +2 -2
- data/src/core/lib/iomgr/error.c +535 -0
- data/src/core/lib/iomgr/error.h +192 -0
- data/src/core/lib/iomgr/ev_poll_and_epoll_posix.c +190 -83
- data/src/core/lib/iomgr/ev_poll_posix.c +1267 -0
- data/src/{ruby/ext/grpc/rb_signal.h → core/lib/iomgr/ev_poll_posix.h} +7 -5
- data/src/core/lib/iomgr/ev_posix.c +104 -14
- data/src/core/lib/iomgr/ev_posix.h +17 -7
- data/src/core/lib/iomgr/exec_ctx.c +25 -7
- data/src/core/lib/iomgr/exec_ctx.h +27 -8
- data/src/core/lib/iomgr/executor.c +2 -2
- data/src/core/lib/iomgr/executor.h +1 -1
- data/src/core/lib/iomgr/iocp_windows.c +2 -41
- data/src/core/lib/iomgr/iocp_windows.h +0 -8
- data/src/core/lib/iomgr/iomgr.c +5 -4
- data/src/core/lib/iomgr/iomgr_posix.c +5 -1
- data/src/core/lib/iomgr/iomgr_windows.c +1 -1
- data/src/core/lib/{support → iomgr}/load_file.c +15 -17
- data/src/core/lib/{support → iomgr}/load_file.h +8 -7
- data/src/core/lib/iomgr/polling_entity.c +104 -0
- data/src/core/lib/iomgr/polling_entity.h +81 -0
- data/src/core/lib/iomgr/pollset.h +6 -5
- data/src/core/lib/iomgr/pollset_set_windows.c +4 -1
- data/src/core/lib/iomgr/pollset_windows.c +10 -6
- data/src/core/lib/iomgr/resolve_address.h +5 -9
- data/src/core/lib/iomgr/resolve_address_posix.c +55 -38
- data/src/core/lib/iomgr/resolve_address_windows.c +51 -37
- data/src/core/lib/iomgr/sockaddr.h +2 -2
- data/src/core/lib/iomgr/{sockaddr_win32.h → sockaddr_windows.h} +3 -3
- data/src/core/lib/iomgr/socket_utils_common_posix.c +92 -45
- data/src/core/lib/iomgr/socket_utils_posix.h +19 -12
- data/src/core/lib/iomgr/socket_windows.c +61 -2
- data/src/core/lib/iomgr/socket_windows.h +13 -0
- data/src/core/lib/iomgr/tcp_client_posix.c +54 -39
- data/src/core/lib/iomgr/tcp_client_windows.c +34 -34
- data/src/core/lib/iomgr/tcp_posix.c +43 -39
- data/src/core/lib/iomgr/tcp_server.h +5 -3
- data/src/core/lib/iomgr/tcp_server_posix.c +103 -64
- data/src/core/lib/iomgr/tcp_server_windows.c +114 -101
- data/src/core/lib/iomgr/tcp_windows.c +45 -50
- data/src/core/lib/iomgr/tcp_windows.h +1 -1
- data/src/core/lib/iomgr/timer.c +26 -13
- data/src/core/lib/iomgr/udp_server.c +28 -4
- data/src/core/lib/iomgr/udp_server.h +5 -1
- data/src/core/lib/iomgr/unix_sockets_posix.c +8 -7
- data/src/core/lib/iomgr/unix_sockets_posix.h +2 -1
- data/src/core/lib/iomgr/unix_sockets_posix_noop.c +4 -2
- data/src/core/lib/iomgr/wakeup_fd_eventfd.c +15 -5
- data/src/core/lib/iomgr/wakeup_fd_pipe.c +13 -9
- data/src/core/lib/iomgr/wakeup_fd_posix.c +6 -6
- data/src/core/lib/iomgr/wakeup_fd_posix.h +9 -6
- data/src/core/lib/iomgr/workqueue.h +5 -4
- data/src/core/lib/iomgr/workqueue_posix.c +40 -26
- data/src/core/lib/iomgr/workqueue_windows.c +2 -2
- data/src/core/lib/profiling/basic_timers.c +2 -2
- data/src/core/lib/security/{security_context.c → context/security_context.c} +1 -1
- data/src/core/lib/security/{security_context.h → context/security_context.h} +4 -4
- data/src/core/lib/security/credentials/composite/composite_credentials.c +263 -0
- data/src/core/lib/security/credentials/composite/composite_credentials.h +72 -0
- data/src/core/lib/security/credentials/credentials.c +233 -0
- data/src/core/lib/security/{credentials.h → credentials/credentials.h} +19 -157
- data/src/core/lib/security/{credentials_metadata.c → credentials/credentials_metadata.c} +1 -1
- data/src/core/lib/security/credentials/fake/fake_credentials.c +139 -0
- data/src/core/lib/security/credentials/fake/fake_credentials.h +56 -0
- data/src/core/lib/security/{credentials_posix.c → credentials/google_default/credentials_posix.c} +1 -1
- data/src/core/lib/security/{credentials_win32.c → credentials/google_default/credentials_windows.c} +3 -3
- data/src/core/lib/security/{google_default_credentials.c → credentials/google_default/google_default_credentials.c} +93 -35
- data/src/core/lib/security/credentials/google_default/google_default_credentials.h +46 -0
- data/src/core/lib/security/credentials/iam/iam_credentials.c +85 -0
- data/src/core/lib/security/credentials/iam/iam_credentials.h +44 -0
- data/src/core/lib/security/{json_token.c → credentials/jwt/json_token.c} +10 -101
- data/src/core/lib/security/{json_token.h → credentials/jwt/json_token.h} +3 -33
- data/src/core/lib/security/credentials/jwt/jwt_credentials.c +160 -0
- data/src/core/lib/security/credentials/jwt/jwt_credentials.h +62 -0
- data/src/core/lib/security/{jwt_verifier.c → credentials/jwt/jwt_verifier.c} +35 -15
- data/src/core/lib/security/{jwt_verifier.h → credentials/jwt/jwt_verifier.h} +3 -3
- data/src/core/lib/security/credentials/oauth2/oauth2_credentials.c +433 -0
- data/src/core/lib/security/credentials/oauth2/oauth2_credentials.h +109 -0
- data/src/core/lib/security/credentials/plugin/plugin_credentials.c +129 -0
- data/src/core/lib/security/credentials/plugin/plugin_credentials.h +45 -0
- data/src/core/lib/security/credentials/ssl/ssl_credentials.c +240 -0
- data/src/core/lib/security/credentials/ssl/ssl_credentials.h +48 -0
- data/src/core/lib/security/{auth_filters.h → transport/auth_filters.h} +3 -3
- data/src/core/lib/security/{client_auth_filter.c → transport/client_auth_filter.c} +27 -20
- data/src/core/lib/security/{handshake.c → transport/handshake.c} +77 -45
- data/src/core/lib/security/{handshake.h → transport/handshake.h} +9 -11
- data/src/core/lib/security/{secure_endpoint.c → transport/secure_endpoint.c} +19 -12
- data/src/core/lib/security/{secure_endpoint.h → transport/secure_endpoint.h} +3 -3
- data/src/core/lib/security/{security_connector.c → transport/security_connector.c} +26 -17
- data/src/core/lib/security/{security_connector.h → transport/security_connector.h} +8 -8
- data/src/core/lib/security/{server_auth_filter.c → transport/server_auth_filter.c} +24 -16
- data/src/core/lib/security/transport/tsi_error.c +40 -0
- data/src/core/lib/security/transport/tsi_error.h +42 -0
- data/src/core/lib/security/{b64.c → util/b64.c} +1 -1
- data/src/core/lib/security/{b64.h → util/b64.h} +3 -3
- data/src/core/lib/security/util/json_util.c +61 -0
- data/src/core/lib/security/util/json_util.h +55 -0
- data/src/core/lib/support/avl.c +11 -0
- data/src/core/lib/support/cpu_windows.c +2 -2
- data/src/core/lib/support/{env_win32.c → env_windows.c} +3 -3
- data/src/core/lib/support/log.c +3 -1
- data/src/core/lib/support/log_linux.c +2 -2
- data/src/core/lib/support/{log_win32.c → log_windows.c} +4 -4
- data/src/core/lib/support/murmur_hash.c +3 -5
- data/src/core/lib/support/string.c +10 -0
- data/src/core/lib/support/string.h +4 -0
- data/src/core/lib/support/{string_util_win32.c → string_util_windows.c} +3 -3
- data/src/core/lib/support/{string_win32.c → string_windows.c} +2 -2
- data/src/core/lib/support/{string_win32.h → string_windows.h} +5 -5
- data/src/core/lib/support/subprocess_windows.c +1 -1
- data/src/core/lib/support/{sync_win32.c → sync_windows.c} +2 -2
- data/src/core/lib/support/{thd_win32.c → thd_windows.c} +2 -2
- data/src/core/lib/support/{time_win32.c → time_windows.c} +2 -2
- data/src/core/lib/support/tmpfile_msys.c +1 -1
- data/src/core/lib/support/{tmpfile_win32.c → tmpfile_windows.c} +3 -3
- data/src/core/lib/surface/alarm.c +2 -2
- data/src/core/lib/surface/byte_buffer_reader.c +13 -6
- data/src/core/lib/surface/call.c +323 -123
- data/src/core/lib/surface/call.h +2 -0
- data/src/core/lib/surface/call_log_batch.c +1 -1
- data/src/core/lib/surface/channel.c +64 -15
- data/src/core/lib/surface/channel.h +9 -0
- data/src/core/lib/surface/channel_ping.c +3 -3
- data/src/core/lib/surface/completion_queue.c +75 -19
- data/src/core/lib/surface/completion_queue.h +7 -2
- data/src/core/lib/surface/init.c +2 -1
- data/src/core/lib/surface/init_secure.c +4 -4
- data/src/core/lib/surface/lame_client.c +12 -8
- data/src/core/lib/surface/server.c +213 -120
- data/src/core/lib/surface/server.h +1 -0
- data/src/core/lib/surface/version.c +1 -1
- data/src/core/lib/transport/connectivity_state.c +40 -18
- data/src/core/lib/transport/connectivity_state.h +4 -1
- data/src/core/lib/transport/metadata.c +23 -23
- data/src/core/lib/transport/metadata.h +4 -0
- data/src/core/lib/transport/metadata_batch.c +9 -0
- data/src/core/lib/transport/metadata_batch.h +3 -0
- data/src/core/lib/transport/static_metadata.c +6 -5
- data/src/core/lib/transport/static_metadata.h +64 -60
- data/src/core/lib/transport/transport.c +24 -12
- data/src/core/lib/transport/transport.h +6 -5
- data/src/core/lib/transport/transport_impl.h +4 -0
- data/src/core/lib/transport/transport_op_string.c +2 -2
- data/src/core/plugin_registry/grpc_plugin_registry.c +4 -0
- data/src/ruby/bin/math_services.rb +41 -2
- data/src/ruby/ext/grpc/rb_call.c +42 -40
- data/src/ruby/ext/grpc/rb_channel.c +1 -1
- data/src/ruby/ext/grpc/rb_completion_queue.c +59 -6
- data/src/ruby/ext/grpc/rb_completion_queue.h +1 -1
- data/src/ruby/ext/grpc/rb_grpc.c +1 -3
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.c +12 -2
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +21 -5
- data/src/ruby/ext/grpc/rb_loader.c +1 -1
- data/src/ruby/ext/grpc/rb_server.c +5 -3
- data/src/ruby/lib/grpc.rb +0 -3
- data/src/ruby/lib/grpc/errors.rb +3 -2
- data/src/ruby/lib/grpc/generic/active_call.rb +32 -42
- data/src/ruby/lib/grpc/generic/bidi_call.rb +20 -0
- data/src/ruby/lib/grpc/generic/client_stub.rb +31 -54
- data/src/ruby/lib/grpc/generic/rpc_desc.rb +4 -4
- data/src/ruby/lib/grpc/generic/rpc_server.rb +12 -23
- data/src/ruby/lib/grpc/generic/service.rb +8 -8
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/src/ruby/pb/grpc/health/v1/health_services.rb +30 -2
- data/src/ruby/pb/grpc/testing/duplicate/echo_duplicate_services.rb +34 -4
- data/src/ruby/pb/grpc/testing/metrics_services.rb +39 -2
- data/src/ruby/pb/src/proto/grpc/testing/empty.rb +15 -0
- data/src/ruby/pb/src/proto/grpc/testing/messages.rb +84 -0
- data/src/ruby/pb/src/proto/grpc/testing/test.rb +14 -0
- data/src/ruby/pb/src/proto/grpc/testing/test_services.rb +110 -0
- data/src/ruby/pb/test/client.rb +5 -2
- data/src/ruby/spec/generic/active_call_spec.rb +3 -2
- data/src/ruby/spec/generic/client_stub_spec.rb +27 -24
- data/src/ruby/spec/generic/rpc_desc_spec.rb +11 -11
- data/src/ruby/spec/generic/rpc_server_spec.rb +42 -61
- data/src/ruby/spec/pb/health/checker_spec.rb +3 -5
- metadata +86 -48
- data/src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h +0 -182
- data/src/core/lib/security/credentials.c +0 -1296
- data/src/ruby/lib/grpc/signals.rb +0 -69
@@ -31,8 +31,8 @@
|
|
31
31
|
*
|
32
32
|
*/
|
33
33
|
|
34
|
-
#ifndef
|
35
|
-
#define
|
34
|
+
#ifndef GRPC_CORE_LIB_SECURITY_TRANSPORT_SECURE_ENDPOINT_H
|
35
|
+
#define GRPC_CORE_LIB_SECURITY_TRANSPORT_SECURE_ENDPOINT_H
|
36
36
|
|
37
37
|
#include <grpc/support/slice.h>
|
38
38
|
#include "src/core/lib/iomgr/endpoint.h"
|
@@ -46,4 +46,4 @@ grpc_endpoint *grpc_secure_endpoint_create(
|
|
46
46
|
struct tsi_frame_protector *protector, grpc_endpoint *to_wrap,
|
47
47
|
gpr_slice *leftover_slices, size_t leftover_nslices);
|
48
48
|
|
49
|
-
#endif /*
|
49
|
+
#endif /* GRPC_CORE_LIB_SECURITY_TRANSPORT_SECURE_ENDPOINT_H */
|
@@ -31,7 +31,7 @@
|
|
31
31
|
*
|
32
32
|
*/
|
33
33
|
|
34
|
-
#include "src/core/lib/security/security_connector.h"
|
34
|
+
#include "src/core/lib/security/transport/security_connector.h"
|
35
35
|
|
36
36
|
#include <stdbool.h>
|
37
37
|
#include <string.h>
|
@@ -43,12 +43,12 @@
|
|
43
43
|
#include <grpc/support/string_util.h>
|
44
44
|
|
45
45
|
#include "src/core/ext/transport/chttp2/alpn/alpn.h"
|
46
|
-
#include "src/core/lib/
|
47
|
-
#include "src/core/lib/security/
|
48
|
-
#include "src/core/lib/security/
|
49
|
-
#include "src/core/lib/security/
|
46
|
+
#include "src/core/lib/iomgr/load_file.h"
|
47
|
+
#include "src/core/lib/security/context/security_context.h"
|
48
|
+
#include "src/core/lib/security/credentials/credentials.h"
|
49
|
+
#include "src/core/lib/security/transport/handshake.h"
|
50
|
+
#include "src/core/lib/security/transport/secure_endpoint.h"
|
50
51
|
#include "src/core/lib/support/env.h"
|
51
|
-
#include "src/core/lib/support/load_file.h"
|
52
52
|
#include "src/core/lib/support/string.h"
|
53
53
|
#include "src/core/lib/tsi/fake_transport_security.h"
|
54
54
|
#include "src/core/lib/tsi/ssl_transport_security.h"
|
@@ -127,23 +127,25 @@ void grpc_server_security_connector_shutdown(
|
|
127
127
|
|
128
128
|
void grpc_channel_security_connector_do_handshake(
|
129
129
|
grpc_exec_ctx *exec_ctx, grpc_channel_security_connector *sc,
|
130
|
-
grpc_endpoint *nonsecure_endpoint,
|
131
|
-
void *user_data) {
|
130
|
+
grpc_endpoint *nonsecure_endpoint, gpr_timespec deadline,
|
131
|
+
grpc_security_handshake_done_cb cb, void *user_data) {
|
132
132
|
if (sc == NULL || nonsecure_endpoint == NULL) {
|
133
133
|
cb(exec_ctx, user_data, GRPC_SECURITY_ERROR, NULL, NULL);
|
134
134
|
} else {
|
135
|
-
sc->do_handshake(exec_ctx, sc, nonsecure_endpoint, cb, user_data);
|
135
|
+
sc->do_handshake(exec_ctx, sc, nonsecure_endpoint, deadline, cb, user_data);
|
136
136
|
}
|
137
137
|
}
|
138
138
|
|
139
139
|
void grpc_server_security_connector_do_handshake(
|
140
140
|
grpc_exec_ctx *exec_ctx, grpc_server_security_connector *sc,
|
141
141
|
grpc_tcp_server_acceptor *acceptor, grpc_endpoint *nonsecure_endpoint,
|
142
|
-
grpc_security_handshake_done_cb cb,
|
142
|
+
gpr_timespec deadline, grpc_security_handshake_done_cb cb,
|
143
|
+
void *user_data) {
|
143
144
|
if (sc == NULL || nonsecure_endpoint == NULL) {
|
144
145
|
cb(exec_ctx, user_data, GRPC_SECURITY_ERROR, NULL, NULL);
|
145
146
|
} else {
|
146
|
-
sc->do_handshake(exec_ctx, sc, acceptor, nonsecure_endpoint, cb,
|
147
|
+
sc->do_handshake(exec_ctx, sc, acceptor, nonsecure_endpoint, deadline, cb,
|
148
|
+
user_data);
|
147
149
|
}
|
148
150
|
}
|
149
151
|
|
@@ -310,20 +312,23 @@ static void fake_channel_check_call_host(grpc_exec_ctx *exec_ctx,
|
|
310
312
|
static void fake_channel_do_handshake(grpc_exec_ctx *exec_ctx,
|
311
313
|
grpc_channel_security_connector *sc,
|
312
314
|
grpc_endpoint *nonsecure_endpoint,
|
315
|
+
gpr_timespec deadline,
|
313
316
|
grpc_security_handshake_done_cb cb,
|
314
317
|
void *user_data) {
|
315
318
|
grpc_do_security_handshake(exec_ctx, tsi_create_fake_handshaker(1), &sc->base,
|
316
|
-
true, nonsecure_endpoint, cb, user_data);
|
319
|
+
true, nonsecure_endpoint, deadline, cb, user_data);
|
317
320
|
}
|
318
321
|
|
319
322
|
static void fake_server_do_handshake(grpc_exec_ctx *exec_ctx,
|
320
323
|
grpc_server_security_connector *sc,
|
321
324
|
grpc_tcp_server_acceptor *acceptor,
|
322
325
|
grpc_endpoint *nonsecure_endpoint,
|
326
|
+
gpr_timespec deadline,
|
323
327
|
grpc_security_handshake_done_cb cb,
|
324
328
|
void *user_data) {
|
325
329
|
grpc_do_security_handshake(exec_ctx, tsi_create_fake_handshaker(0), &sc->base,
|
326
|
-
false, nonsecure_endpoint, cb,
|
330
|
+
false, nonsecure_endpoint, deadline, cb,
|
331
|
+
user_data);
|
327
332
|
}
|
328
333
|
|
329
334
|
static grpc_security_connector_vtable fake_channel_vtable = {
|
@@ -413,6 +418,7 @@ static grpc_security_status ssl_create_handshaker(
|
|
413
418
|
static void ssl_channel_do_handshake(grpc_exec_ctx *exec_ctx,
|
414
419
|
grpc_channel_security_connector *sc,
|
415
420
|
grpc_endpoint *nonsecure_endpoint,
|
421
|
+
gpr_timespec deadline,
|
416
422
|
grpc_security_handshake_done_cb cb,
|
417
423
|
void *user_data) {
|
418
424
|
grpc_ssl_channel_security_connector *c =
|
@@ -427,7 +433,7 @@ static void ssl_channel_do_handshake(grpc_exec_ctx *exec_ctx,
|
|
427
433
|
cb(exec_ctx, user_data, status, NULL, NULL);
|
428
434
|
} else {
|
429
435
|
grpc_do_security_handshake(exec_ctx, handshaker, &sc->base, true,
|
430
|
-
nonsecure_endpoint, cb, user_data);
|
436
|
+
nonsecure_endpoint, deadline, cb, user_data);
|
431
437
|
}
|
432
438
|
}
|
433
439
|
|
@@ -435,6 +441,7 @@ static void ssl_server_do_handshake(grpc_exec_ctx *exec_ctx,
|
|
435
441
|
grpc_server_security_connector *sc,
|
436
442
|
grpc_tcp_server_acceptor *acceptor,
|
437
443
|
grpc_endpoint *nonsecure_endpoint,
|
444
|
+
gpr_timespec deadline,
|
438
445
|
grpc_security_handshake_done_cb cb,
|
439
446
|
void *user_data) {
|
440
447
|
grpc_ssl_server_security_connector *c =
|
@@ -446,7 +453,7 @@ static void ssl_server_do_handshake(grpc_exec_ctx *exec_ctx,
|
|
446
453
|
cb(exec_ctx, user_data, status, NULL, NULL);
|
447
454
|
} else {
|
448
455
|
grpc_do_security_handshake(exec_ctx, handshaker, &sc->base, false,
|
449
|
-
nonsecure_endpoint, cb, user_data);
|
456
|
+
nonsecure_endpoint, deadline, cb, user_data);
|
450
457
|
}
|
451
458
|
}
|
452
459
|
|
@@ -635,7 +642,8 @@ static gpr_slice compute_default_pem_root_certs_once(void) {
|
|
635
642
|
char *default_root_certs_path =
|
636
643
|
gpr_getenv(GRPC_DEFAULT_SSL_ROOTS_FILE_PATH_ENV_VAR);
|
637
644
|
if (default_root_certs_path != NULL) {
|
638
|
-
|
645
|
+
GRPC_LOG_IF_ERROR("load_file",
|
646
|
+
grpc_load_file(default_root_certs_path, 0, &result));
|
639
647
|
gpr_free(default_root_certs_path);
|
640
648
|
}
|
641
649
|
|
@@ -653,7 +661,8 @@ static gpr_slice compute_default_pem_root_certs_once(void) {
|
|
653
661
|
/* Fall back to installed certs if needed. */
|
654
662
|
if (GPR_SLICE_IS_EMPTY(result) &&
|
655
663
|
ovrd_res != GRPC_SSL_ROOTS_OVERRIDE_FAIL_PERMANENTLY) {
|
656
|
-
|
664
|
+
GRPC_LOG_IF_ERROR("load_file",
|
665
|
+
grpc_load_file(installed_roots_path, 0, &result));
|
657
666
|
}
|
658
667
|
return result;
|
659
668
|
}
|
@@ -31,8 +31,8 @@
|
|
31
31
|
*
|
32
32
|
*/
|
33
33
|
|
34
|
-
#ifndef
|
35
|
-
#define
|
34
|
+
#ifndef GRPC_CORE_LIB_SECURITY_TRANSPORT_SECURITY_CONNECTOR_H
|
35
|
+
#define GRPC_CORE_LIB_SECURITY_TRANSPORT_SECURITY_CONNECTOR_H
|
36
36
|
|
37
37
|
#include <grpc/grpc_security.h>
|
38
38
|
#include "src/core/lib/iomgr/endpoint.h"
|
@@ -143,7 +143,7 @@ struct grpc_channel_security_connector {
|
|
143
143
|
grpc_security_call_host_check_cb cb, void *user_data);
|
144
144
|
void (*do_handshake)(grpc_exec_ctx *exec_ctx,
|
145
145
|
grpc_channel_security_connector *sc,
|
146
|
-
grpc_endpoint *nonsecure_endpoint,
|
146
|
+
grpc_endpoint *nonsecure_endpoint, gpr_timespec deadline,
|
147
147
|
grpc_security_handshake_done_cb cb, void *user_data);
|
148
148
|
};
|
149
149
|
|
@@ -156,8 +156,8 @@ void grpc_channel_security_connector_check_call_host(
|
|
156
156
|
/* Handshake. */
|
157
157
|
void grpc_channel_security_connector_do_handshake(
|
158
158
|
grpc_exec_ctx *exec_ctx, grpc_channel_security_connector *connector,
|
159
|
-
grpc_endpoint *nonsecure_endpoint,
|
160
|
-
void *user_data);
|
159
|
+
grpc_endpoint *nonsecure_endpoint, gpr_timespec deadline,
|
160
|
+
grpc_security_handshake_done_cb cb, void *user_data);
|
161
161
|
|
162
162
|
/* --- server_security_connector object. ---
|
163
163
|
|
@@ -174,14 +174,14 @@ struct grpc_server_security_connector {
|
|
174
174
|
void (*do_handshake)(grpc_exec_ctx *exec_ctx,
|
175
175
|
grpc_server_security_connector *sc,
|
176
176
|
grpc_tcp_server_acceptor *acceptor,
|
177
|
-
grpc_endpoint *nonsecure_endpoint,
|
177
|
+
grpc_endpoint *nonsecure_endpoint, gpr_timespec deadline,
|
178
178
|
grpc_security_handshake_done_cb cb, void *user_data);
|
179
179
|
};
|
180
180
|
|
181
181
|
void grpc_server_security_connector_do_handshake(
|
182
182
|
grpc_exec_ctx *exec_ctx, grpc_server_security_connector *sc,
|
183
183
|
grpc_tcp_server_acceptor *acceptor, grpc_endpoint *nonsecure_endpoint,
|
184
|
-
grpc_security_handshake_done_cb cb, void *user_data);
|
184
|
+
gpr_timespec deadline, grpc_security_handshake_done_cb cb, void *user_data);
|
185
185
|
|
186
186
|
void grpc_server_security_connector_shutdown(
|
187
187
|
grpc_exec_ctx *exec_ctx, grpc_server_security_connector *connector);
|
@@ -263,4 +263,4 @@ tsi_peer tsi_shallow_peer_from_ssl_auth_context(
|
|
263
263
|
const grpc_auth_context *auth_context);
|
264
264
|
void tsi_shallow_peer_destruct(tsi_peer *peer);
|
265
265
|
|
266
|
-
#endif /*
|
266
|
+
#endif /* GRPC_CORE_LIB_SECURITY_TRANSPORT_SECURITY_CONNECTOR_H */
|
@@ -33,9 +33,9 @@
|
|
33
33
|
|
34
34
|
#include <string.h>
|
35
35
|
|
36
|
-
#include "src/core/lib/security/
|
37
|
-
#include "src/core/lib/security/credentials.h"
|
38
|
-
#include "src/core/lib/security/
|
36
|
+
#include "src/core/lib/security/context/security_context.h"
|
37
|
+
#include "src/core/lib/security/credentials/credentials.h"
|
38
|
+
#include "src/core/lib/security/transport/auth_filters.h"
|
39
39
|
|
40
40
|
#include <grpc/support/alloc.h>
|
41
41
|
#include <grpc/support/log.h>
|
@@ -128,7 +128,7 @@ static void on_md_processing_done(
|
|
128
128
|
grpc_metadata_batch_filter(calld->recv_initial_metadata, remove_consumed_md,
|
129
129
|
elem);
|
130
130
|
grpc_metadata_array_destroy(&calld->md);
|
131
|
-
|
131
|
+
grpc_exec_ctx_sched(&exec_ctx, calld->on_done_recv, GRPC_ERROR_NONE, NULL);
|
132
132
|
} else {
|
133
133
|
gpr_slice message;
|
134
134
|
grpc_transport_stream_op close_op;
|
@@ -146,18 +146,21 @@ static void on_md_processing_done(
|
|
146
146
|
calld->transport_op.send_trailing_metadata = NULL;
|
147
147
|
grpc_transport_stream_op_add_close(&close_op, status, &message);
|
148
148
|
grpc_call_next_op(&exec_ctx, elem, &close_op);
|
149
|
-
|
149
|
+
grpc_exec_ctx_sched(&exec_ctx, calld->on_done_recv,
|
150
|
+
grpc_error_set_int(GRPC_ERROR_CREATE(error_details),
|
151
|
+
GRPC_ERROR_INT_GRPC_STATUS, status),
|
152
|
+
NULL);
|
150
153
|
}
|
151
154
|
|
152
155
|
grpc_exec_ctx_finish(&exec_ctx);
|
153
156
|
}
|
154
157
|
|
155
158
|
static void auth_on_recv(grpc_exec_ctx *exec_ctx, void *user_data,
|
156
|
-
|
159
|
+
grpc_error *error) {
|
157
160
|
grpc_call_element *elem = user_data;
|
158
161
|
call_data *calld = elem->call_data;
|
159
162
|
channel_data *chand = elem->channel_data;
|
160
|
-
if (
|
163
|
+
if (error == GRPC_ERROR_NONE) {
|
161
164
|
if (chand->creds->processor.process != NULL) {
|
162
165
|
calld->md = metadata_batch_to_md_array(calld->recv_initial_metadata);
|
163
166
|
chand->creds->processor.process(
|
@@ -166,7 +169,8 @@ static void auth_on_recv(grpc_exec_ctx *exec_ctx, void *user_data,
|
|
166
169
|
return;
|
167
170
|
}
|
168
171
|
}
|
169
|
-
|
172
|
+
grpc_exec_ctx_sched(exec_ctx, calld->on_done_recv, GRPC_ERROR_REF(error),
|
173
|
+
NULL);
|
170
174
|
}
|
171
175
|
|
172
176
|
static void set_recv_ops_md_callbacks(grpc_call_element *elem,
|
@@ -220,12 +224,9 @@ static void init_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
|
|
220
224
|
grpc_server_security_context_destroy;
|
221
225
|
}
|
222
226
|
|
223
|
-
static void set_pollset(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
|
224
|
-
grpc_pollset *pollset) {}
|
225
|
-
|
226
227
|
/* Destructor for call_data */
|
227
228
|
static void destroy_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
|
228
|
-
void *ignored) {}
|
229
|
+
const grpc_call_stats *stats, void *ignored) {}
|
229
230
|
|
230
231
|
/* Constructor for channel_data */
|
231
232
|
static void init_channel_elem(grpc_exec_ctx *exec_ctx,
|
@@ -258,7 +259,14 @@ static void destroy_channel_elem(grpc_exec_ctx *exec_ctx,
|
|
258
259
|
}
|
259
260
|
|
260
261
|
const grpc_channel_filter grpc_server_auth_filter = {
|
261
|
-
auth_start_transport_op,
|
262
|
-
|
263
|
-
sizeof(
|
264
|
-
|
262
|
+
auth_start_transport_op,
|
263
|
+
grpc_channel_next_op,
|
264
|
+
sizeof(call_data),
|
265
|
+
init_call_elem,
|
266
|
+
grpc_call_stack_ignore_set_pollset_or_pollset_set,
|
267
|
+
destroy_call_elem,
|
268
|
+
sizeof(channel_data),
|
269
|
+
init_channel_elem,
|
270
|
+
destroy_channel_elem,
|
271
|
+
grpc_call_next_get_peer,
|
272
|
+
"server-auth"};
|
@@ -0,0 +1,40 @@
|
|
1
|
+
/*
|
2
|
+
*
|
3
|
+
* Copyright 2015, Google Inc.
|
4
|
+
* All rights reserved.
|
5
|
+
*
|
6
|
+
* Redistribution and use in source and binary forms, with or without
|
7
|
+
* modification, are permitted provided that the following conditions are
|
8
|
+
* met:
|
9
|
+
*
|
10
|
+
* * Redistributions of source code must retain the above copyright
|
11
|
+
* notice, this list of conditions and the following disclaimer.
|
12
|
+
* * Redistributions in binary form must reproduce the above
|
13
|
+
* copyright notice, this list of conditions and the following disclaimer
|
14
|
+
* in the documentation and/or other materials provided with the
|
15
|
+
* distribution.
|
16
|
+
* * Neither the name of Google Inc. nor the names of its
|
17
|
+
* contributors may be used to endorse or promote products derived from
|
18
|
+
* this software without specific prior written permission.
|
19
|
+
*
|
20
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
21
|
+
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
22
|
+
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
23
|
+
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
24
|
+
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
25
|
+
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
26
|
+
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
27
|
+
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
28
|
+
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
29
|
+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
30
|
+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
31
|
+
*
|
32
|
+
*/
|
33
|
+
|
34
|
+
#include "src/core/lib/security/transport/tsi_error.h"
|
35
|
+
|
36
|
+
grpc_error *grpc_set_tsi_error_result(grpc_error *error, tsi_result result) {
|
37
|
+
return grpc_error_set_int(grpc_error_set_str(error, GRPC_ERROR_STR_TSI_ERROR,
|
38
|
+
tsi_result_to_string(result)),
|
39
|
+
GRPC_ERROR_INT_TSI_CODE, result);
|
40
|
+
}
|
@@ -0,0 +1,42 @@
|
|
1
|
+
/*
|
2
|
+
*
|
3
|
+
* Copyright 2015, Google Inc.
|
4
|
+
* All rights reserved.
|
5
|
+
*
|
6
|
+
* Redistribution and use in source and binary forms, with or without
|
7
|
+
* modification, are permitted provided that the following conditions are
|
8
|
+
* met:
|
9
|
+
*
|
10
|
+
* * Redistributions of source code must retain the above copyright
|
11
|
+
* notice, this list of conditions and the following disclaimer.
|
12
|
+
* * Redistributions in binary form must reproduce the above
|
13
|
+
* copyright notice, this list of conditions and the following disclaimer
|
14
|
+
* in the documentation and/or other materials provided with the
|
15
|
+
* distribution.
|
16
|
+
* * Neither the name of Google Inc. nor the names of its
|
17
|
+
* contributors may be used to endorse or promote products derived from
|
18
|
+
* this software without specific prior written permission.
|
19
|
+
*
|
20
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
21
|
+
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
22
|
+
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
23
|
+
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
24
|
+
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
25
|
+
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
26
|
+
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
27
|
+
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
28
|
+
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
29
|
+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
30
|
+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
31
|
+
*
|
32
|
+
*/
|
33
|
+
|
34
|
+
#ifndef GRPC_CORE_LIB_SECURITY_TRANSPORT_TSI_ERROR_H
|
35
|
+
#define GRPC_CORE_LIB_SECURITY_TRANSPORT_TSI_ERROR_H
|
36
|
+
|
37
|
+
#include "src/core/lib/iomgr/error.h"
|
38
|
+
#include "src/core/lib/tsi/transport_security_interface.h"
|
39
|
+
|
40
|
+
grpc_error *grpc_set_tsi_error_result(grpc_error *error, tsi_result result);
|
41
|
+
|
42
|
+
#endif /* GRPC_CORE_LIB_SECURITY_TRANSPORT_TSI_ERROR_H */
|
@@ -31,8 +31,8 @@
|
|
31
31
|
*
|
32
32
|
*/
|
33
33
|
|
34
|
-
#ifndef
|
35
|
-
#define
|
34
|
+
#ifndef GRPC_CORE_LIB_SECURITY_UTIL_B64_H
|
35
|
+
#define GRPC_CORE_LIB_SECURITY_UTIL_B64_H
|
36
36
|
|
37
37
|
#include <grpc/support/slice.h>
|
38
38
|
|
@@ -49,4 +49,4 @@ gpr_slice grpc_base64_decode(const char *b64, int url_safe);
|
|
49
49
|
gpr_slice grpc_base64_decode_with_len(const char *b64, size_t b64_len,
|
50
50
|
int url_safe);
|
51
51
|
|
52
|
-
#endif /*
|
52
|
+
#endif /* GRPC_CORE_LIB_SECURITY_UTIL_B64_H */
|
@@ -0,0 +1,61 @@
|
|
1
|
+
/*
|
2
|
+
*
|
3
|
+
* Copyright 2015, Google Inc.
|
4
|
+
* All rights reserved.
|
5
|
+
*
|
6
|
+
* Redistribution and use in source and binary forms, with or without
|
7
|
+
* modification, are permitted provided that the following conditions are
|
8
|
+
* met:
|
9
|
+
*
|
10
|
+
* * Redistributions of source code must retain the above copyright
|
11
|
+
* notice, this list of conditions and the following disclaimer.
|
12
|
+
* * Redistributions in binary form must reproduce the above
|
13
|
+
* copyright notice, this list of conditions and the following disclaimer
|
14
|
+
* in the documentation and/or other materials provided with the
|
15
|
+
* distribution.
|
16
|
+
* * Neither the name of Google Inc. nor the names of its
|
17
|
+
* contributors may be used to endorse or promote products derived from
|
18
|
+
* this software without specific prior written permission.
|
19
|
+
*
|
20
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
21
|
+
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
22
|
+
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
23
|
+
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
24
|
+
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
25
|
+
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
26
|
+
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
27
|
+
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
28
|
+
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
29
|
+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
30
|
+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
31
|
+
*
|
32
|
+
*/
|
33
|
+
|
34
|
+
#include "src/core/lib/security/util/json_util.h"
|
35
|
+
|
36
|
+
#include <string.h>
|
37
|
+
|
38
|
+
#include <grpc/support/log.h>
|
39
|
+
#include <grpc/support/string_util.h>
|
40
|
+
|
41
|
+
const char *grpc_json_get_string_property(const grpc_json *json,
|
42
|
+
const char *prop_name) {
|
43
|
+
grpc_json *child;
|
44
|
+
for (child = json->child; child != NULL; child = child->next) {
|
45
|
+
if (strcmp(child->key, prop_name) == 0) break;
|
46
|
+
}
|
47
|
+
if (child == NULL || child->type != GRPC_JSON_STRING) {
|
48
|
+
gpr_log(GPR_ERROR, "Invalid or missing %s property.", prop_name);
|
49
|
+
return NULL;
|
50
|
+
}
|
51
|
+
return child->value;
|
52
|
+
}
|
53
|
+
|
54
|
+
bool grpc_copy_json_string_property(const grpc_json *json,
|
55
|
+
const char *prop_name,
|
56
|
+
char **copied_value) {
|
57
|
+
const char *prop_value = grpc_json_get_string_property(json, prop_name);
|
58
|
+
if (prop_value == NULL) return false;
|
59
|
+
*copied_value = gpr_strdup(prop_value);
|
60
|
+
return true;
|
61
|
+
}
|