Class: SslTestService
- Inherits:
-
Object
- Object
- SslTestService
- Includes:
- GRPC::GenericService
- Defined in:
- src/ruby/spec/client_auth_spec.rb
Overview
a test service that checks the cert of its peer
Instance Method Summary collapse
- #a_bidi_rpc(requests, call) ⇒ Object
- #a_client_streaming_rpc(call) ⇒ Object
- #a_server_streaming_rpc(_, call) ⇒ Object
- #an_rpc(req, call) ⇒ Object
- #check_peer_cert(call) ⇒ Object
Methods included from GRPC::GenericService
Instance Method Details
#a_bidi_rpc(requests, call) ⇒ Object
82 83 84 85 86 |
# File 'src/ruby/spec/client_auth_spec.rb', line 82 def a_bidi_rpc(requests, call) check_peer_cert(call) requests.each { |r| p r } [EchoMsg.new, EchoMsg.new] end |
#a_client_streaming_rpc(call) ⇒ Object
71 72 73 74 75 |
# File 'src/ruby/spec/client_auth_spec.rb', line 71 def a_client_streaming_rpc(call) check_peer_cert(call) call.each_remote_read.each { |r| p r } EchoMsg.new end |
#a_server_streaming_rpc(_, call) ⇒ Object
77 78 79 80 |
# File 'src/ruby/spec/client_auth_spec.rb', line 77 def a_server_streaming_rpc(_, call) check_peer_cert(call) [EchoMsg.new, EchoMsg.new] end |
#an_rpc(req, call) ⇒ Object
66 67 68 69 |
# File 'src/ruby/spec/client_auth_spec.rb', line 66 def an_rpc(req, call) check_peer_cert(call) req end |
#check_peer_cert(call) ⇒ Object
61 62 63 64 |
# File 'src/ruby/spec/client_auth_spec.rb', line 61 def check_peer_cert(call) error_msg = "want:\n#{client_cert}\n\ngot:\n#{call.peer_cert}" fail(error_msg) unless call.peer_cert == client_cert end |