grpc 1.31.0.pre2 → 1.31.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of grpc might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/Makefile +2 -2
- data/src/core/tsi/ssl_transport_security.cc +9 -3
- data/src/ruby/bin/math_services_pb.rb +4 -4
- data/src/ruby/lib/grpc/generic/client_stub.rb +1 -1
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/src/ruby/pb/grpc/health/v1/health_services_pb.rb +2 -2
- data/src/ruby/pb/src/proto/grpc/testing/messages_pb.rb +5 -0
- data/src/ruby/pb/src/proto/grpc/testing/test_services_pb.rb +28 -12
- data/src/ruby/spec/pb/codegen/grpc/testing/same_package_service_name.proto +27 -0
- data/src/ruby/spec/pb/codegen/grpc/testing/same_ruby_package_service_name.proto +29 -0
- data/src/ruby/spec/pb/codegen/package_option_spec.rb +20 -0
- data/src/ruby/spec/user_agent_spec.rb +74 -0
- metadata +37 -31
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 75ee4567615708f4d6389a7b38894392c9bb268f01e7b164afeff7b43e648258
         | 
| 4 | 
            +
              data.tar.gz: 28353f6c57fc97a27c2c42ca3d179da939e5ce7a2b640df8be70f5a5b6634150
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 8b58a476ad6942037983bda31ddd0eabb1c816d3e7b95e7764f3869c6aef3a051fcbc991855f58ddd5e318bdccccaad3e219b886bfd291edabab20550e1dc479
         | 
| 7 | 
            +
              data.tar.gz: bdb737514759fe270684a3430f379a530e89870b413e9623d059cb056561f596f734dcd1270c869b84d1b05c62820d1cc19b90a942f3a7d9554f5590806097a6
         | 
    
        data/Makefile
    CHANGED
    
    | @@ -450,8 +450,8 @@ Q = @ | |
| 450 450 | 
             
            endif
         | 
| 451 451 |  | 
| 452 452 | 
             
            CORE_VERSION = 11.0.0
         | 
| 453 | 
            -
            CPP_VERSION = 1.31. | 
| 454 | 
            -
            CSHARP_VERSION = 2.31. | 
| 453 | 
            +
            CPP_VERSION = 1.31.1
         | 
| 454 | 
            +
            CSHARP_VERSION = 2.31.1
         | 
| 455 455 |  | 
| 456 456 | 
             
            CPPFLAGS_NO_ARCH += $(addprefix -I, $(INCLUDES)) $(addprefix -D, $(DEFINES))
         | 
| 457 457 | 
             
            CPPFLAGS += $(CPPFLAGS_NO_ARCH) $(ARCH_FLAGS)
         | 
| @@ -1894,8 +1894,11 @@ tsi_result tsi_create_ssl_client_handshaker_factory_with_options( | |
| 1894 1894 | 
             
            #else
         | 
| 1895 1895 | 
             
              ssl_context = SSL_CTX_new(TLSv1_2_method());
         | 
| 1896 1896 | 
             
            #endif
         | 
| 1897 | 
            +
              // TODO(mattstev): Re-enable TLS 1.3 by using |options.min_tls_version| and
         | 
| 1898 | 
            +
              // |options.max_tls_version|, rather than hardcoding in TLS 1.2 as the min and
         | 
| 1899 | 
            +
              // max.
         | 
| 1897 1900 | 
             
              result = tsi_set_min_and_max_tls_versions(
         | 
| 1898 | 
            -
                  ssl_context,  | 
| 1901 | 
            +
                  ssl_context, tsi_tls_version::TSI_TLS1_2, tsi_tls_version::TSI_TLS1_2);
         | 
| 1899 1902 | 
             
              if (result != TSI_OK) return result;
         | 
| 1900 1903 | 
             
              if (ssl_context == nullptr) {
         | 
| 1901 1904 | 
             
                gpr_log(GPR_ERROR, "Could not create ssl context.");
         | 
| @@ -2061,9 +2064,12 @@ tsi_result tsi_create_ssl_server_handshaker_factory_with_options( | |
| 2061 2064 | 
             
            #else
         | 
| 2062 2065 | 
             
                  impl->ssl_contexts[i] = SSL_CTX_new(TLSv1_2_method());
         | 
| 2063 2066 | 
             
            #endif
         | 
| 2067 | 
            +
                  // TODO(mattstev): Re-enable TLS 1.3 by using |options.min_tls_version|
         | 
| 2068 | 
            +
                  // and |options.max_tls_version|, rather than hardcoding in TLS 1.2 as the
         | 
| 2069 | 
            +
                  // min and max.
         | 
| 2064 2070 | 
             
                  result = tsi_set_min_and_max_tls_versions(impl->ssl_contexts[i],
         | 
| 2065 | 
            -
                                                             | 
| 2066 | 
            -
                                                             | 
| 2071 | 
            +
                                                            tsi_tls_version::TSI_TLS1_2,
         | 
| 2072 | 
            +
                                                            tsi_tls_version::TSI_TLS1_2);
         | 
| 2067 2073 | 
             
                  if (result != TSI_OK) return result;
         | 
| 2068 2074 | 
             
                  if (impl->ssl_contexts[i] == nullptr) {
         | 
| 2069 2075 | 
             
                    gpr_log(GPR_ERROR, "Could not create ssl context.");
         | 
| @@ -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
         | 
| @@ -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
         | 
| @@ -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
         | 
| @@ -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. | 
| 4 | 
            +
              version: 1.31.1
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - gRPC Authors
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: src/ruby/bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2020- | 
| 11 | 
            +
            date: 2020-08-17 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: google-protobuf
         | 
| @@ -1211,6 +1211,8 @@ files: | |
| 1211 1211 | 
             
            - src/ruby/spec/pb/codegen/grpc/testing/package_options_import.proto
         | 
| 1212 1212 | 
             
            - src/ruby/spec/pb/codegen/grpc/testing/package_options_import2.proto
         | 
| 1213 1213 | 
             
            - src/ruby/spec/pb/codegen/grpc/testing/package_options_ruby_style.proto
         | 
| 1214 | 
            +
            - src/ruby/spec/pb/codegen/grpc/testing/same_package_service_name.proto
         | 
| 1215 | 
            +
            - src/ruby/spec/pb/codegen/grpc/testing/same_ruby_package_service_name.proto
         | 
| 1214 1216 | 
             
            - src/ruby/spec/pb/codegen/package_option_spec.rb
         | 
| 1215 1217 | 
             
            - src/ruby/spec/pb/duplicate/codegen_spec.rb
         | 
| 1216 1218 | 
             
            - src/ruby/spec/pb/health/checker_spec.rb
         | 
| @@ -1226,6 +1228,7 @@ files: | |
| 1226 1228 | 
             
            - src/ruby/spec/testdata/server1.key
         | 
| 1227 1229 | 
             
            - src/ruby/spec/testdata/server1.pem
         | 
| 1228 1230 | 
             
            - src/ruby/spec/time_consts_spec.rb
         | 
| 1231 | 
            +
            - src/ruby/spec/user_agent_spec.rb
         | 
| 1229 1232 | 
             
            - third_party/abseil-cpp/absl/algorithm/algorithm.h
         | 
| 1230 1233 | 
             
            - third_party/abseil-cpp/absl/base/attributes.h
         | 
| 1231 1234 | 
             
            - third_party/abseil-cpp/absl/base/call_once.h
         | 
| @@ -2030,52 +2033,55 @@ required_ruby_version: !ruby/object:Gem::Requirement | |
| 2030 2033 | 
             
                  version: 2.3.0
         | 
| 2031 2034 | 
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         | 
| 2032 2035 | 
             
              requirements:
         | 
| 2033 | 
            -
              - - " | 
| 2036 | 
            +
              - - ">="
         | 
| 2034 2037 | 
             
                - !ruby/object:Gem::Version
         | 
| 2035 | 
            -
                  version:  | 
| 2038 | 
            +
                  version: '0'
         | 
| 2036 2039 | 
             
            requirements: []
         | 
| 2037 2040 | 
             
            rubygems_version: 3.1.4
         | 
| 2038 2041 | 
             
            signing_key: 
         | 
| 2039 2042 | 
             
            specification_version: 4
         | 
| 2040 2043 | 
             
            summary: GRPC system in Ruby
         | 
| 2041 2044 | 
             
            test_files:
         | 
| 2042 | 
            -
            - src/ruby/spec/ | 
| 2043 | 
            -
            - src/ruby/spec/ | 
| 2044 | 
            -
            - src/ruby/spec/compression_options_spec.rb
         | 
| 2045 | 
            -
            - src/ruby/spec/pb/duplicate/codegen_spec.rb
         | 
| 2046 | 
            -
            - src/ruby/spec/pb/codegen/package_option_spec.rb
         | 
| 2045 | 
            +
            - src/ruby/spec/time_consts_spec.rb
         | 
| 2046 | 
            +
            - src/ruby/spec/pb/health/checker_spec.rb
         | 
| 2047 2047 | 
             
            - src/ruby/spec/pb/codegen/grpc/testing/package_options_ruby_style.proto
         | 
| 2048 2048 | 
             
            - src/ruby/spec/pb/codegen/grpc/testing/package_options_import.proto
         | 
| 2049 | 
            -
            - src/ruby/spec/pb/codegen/grpc/testing/ | 
| 2049 | 
            +
            - src/ruby/spec/pb/codegen/grpc/testing/same_ruby_package_service_name.proto
         | 
| 2050 2050 | 
             
            - src/ruby/spec/pb/codegen/grpc/testing/package_options.proto
         | 
| 2051 | 
            -
            - src/ruby/spec/pb/ | 
| 2052 | 
            -
            - src/ruby/spec/ | 
| 2053 | 
            -
            - src/ruby/spec/ | 
| 2054 | 
            -
            - src/ruby/spec/ | 
| 2051 | 
            +
            - src/ruby/spec/pb/codegen/grpc/testing/same_package_service_name.proto
         | 
| 2052 | 
            +
            - src/ruby/spec/pb/codegen/grpc/testing/package_options_import2.proto
         | 
| 2053 | 
            +
            - src/ruby/spec/pb/codegen/package_option_spec.rb
         | 
| 2054 | 
            +
            - src/ruby/spec/pb/duplicate/codegen_spec.rb
         | 
| 2055 2055 | 
             
            - src/ruby/spec/debug_message_spec.rb
         | 
| 2056 | 
            -
            - src/ruby/spec/ | 
| 2057 | 
            -
            - src/ruby/spec/client_auth_spec.rb
         | 
| 2056 | 
            +
            - src/ruby/spec/call_credentials_spec.rb
         | 
| 2058 2057 | 
             
            - src/ruby/spec/client_server_spec.rb
         | 
| 2059 | 
            -
            - src/ruby/spec/ | 
| 2058 | 
            +
            - src/ruby/spec/client_auth_spec.rb
         | 
| 2059 | 
            +
            - src/ruby/spec/server_spec.rb
         | 
| 2060 | 
            +
            - src/ruby/spec/server_credentials_spec.rb
         | 
| 2061 | 
            +
            - src/ruby/spec/user_agent_spec.rb
         | 
| 2062 | 
            +
            - src/ruby/spec/testdata/ca.pem
         | 
| 2063 | 
            +
            - src/ruby/spec/testdata/client.key
         | 
| 2064 | 
            +
            - src/ruby/spec/testdata/client.pem
         | 
| 2065 | 
            +
            - src/ruby/spec/testdata/README
         | 
| 2066 | 
            +
            - src/ruby/spec/testdata/server1.key
         | 
| 2067 | 
            +
            - src/ruby/spec/testdata/server1.pem
         | 
| 2068 | 
            +
            - src/ruby/spec/spec_helper.rb
         | 
| 2069 | 
            +
            - src/ruby/spec/generic/rpc_server_pool_spec.rb
         | 
| 2070 | 
            +
            - src/ruby/spec/generic/rpc_desc_spec.rb
         | 
| 2060 2071 | 
             
            - src/ruby/spec/generic/server_interceptors_spec.rb
         | 
| 2072 | 
            +
            - src/ruby/spec/generic/interceptor_registry_spec.rb
         | 
| 2073 | 
            +
            - src/ruby/spec/generic/client_interceptors_spec.rb
         | 
| 2061 2074 | 
             
            - src/ruby/spec/generic/client_stub_spec.rb
         | 
| 2075 | 
            +
            - src/ruby/spec/generic/rpc_server_spec.rb
         | 
| 2062 2076 | 
             
            - src/ruby/spec/generic/active_call_spec.rb
         | 
| 2063 | 
            -
            - src/ruby/spec/generic/interceptor_registry_spec.rb
         | 
| 2064 2077 | 
             
            - src/ruby/spec/generic/service_spec.rb
         | 
| 2065 | 
            -
            - src/ruby/spec/ | 
| 2066 | 
            -
            - src/ruby/spec/generic/rpc_server_pool_spec.rb
         | 
| 2067 | 
            -
            - src/ruby/spec/generic/rpc_desc_spec.rb
         | 
| 2068 | 
            -
            - src/ruby/spec/google_rpc_status_utils_spec.rb
         | 
| 2069 | 
            -
            - src/ruby/spec/call_credentials_spec.rb
         | 
| 2070 | 
            -
            - src/ruby/spec/channel_credentials_spec.rb
         | 
| 2078 | 
            +
            - src/ruby/spec/compression_options_spec.rb
         | 
| 2071 2079 | 
             
            - src/ruby/spec/error_sanity_spec.rb
         | 
| 2080 | 
            +
            - src/ruby/spec/errors_spec.rb
         | 
| 2072 2081 | 
             
            - src/ruby/spec/channel_connection_spec.rb
         | 
| 2073 | 
            -
            - src/ruby/spec/ | 
| 2074 | 
            -
            - src/ruby/spec/ | 
| 2075 | 
            -
            - src/ruby/spec/ | 
| 2076 | 
            -
            - src/ruby/spec/ | 
| 2077 | 
            -
            - src/ruby/spec/testdata/client.key
         | 
| 2078 | 
            -
            - src/ruby/spec/testdata/server1.pem
         | 
| 2082 | 
            +
            - src/ruby/spec/call_spec.rb
         | 
| 2083 | 
            +
            - src/ruby/spec/channel_spec.rb
         | 
| 2084 | 
            +
            - src/ruby/spec/google_rpc_status_utils_spec.rb
         | 
| 2085 | 
            +
            - src/ruby/spec/channel_credentials_spec.rb
         | 
| 2079 2086 | 
             
            - src/ruby/spec/support/services.rb
         | 
| 2080 2087 | 
             
            - src/ruby/spec/support/helpers.rb
         | 
| 2081 | 
            -
            - src/ruby/spec/server_credentials_spec.rb
         |