diff options
author | murgatroid99 <mlumish@google.com> | 2015-12-04 14:36:52 -0800 |
---|---|---|
committer | murgatroid99 <mlumish@google.com> | 2015-12-04 14:36:52 -0800 |
commit | cfa26e1ce7f65f70801cada2f2573437915d5fb8 (patch) | |
tree | cdb0701294660a2fa14175c85253cb0bb4d99a52 /src/ruby/bin/apis | |
parent | 9946f2b80a9dcc01fece8b9ddae4c80a77647b9d (diff) |
Plumb CallCredentials through Ruby code, replacing metadata_updater functionality
Diffstat (limited to 'src/ruby/bin/apis')
-rwxr-xr-x | src/ruby/bin/apis/pubsub_demo.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/ruby/bin/apis/pubsub_demo.rb b/src/ruby/bin/apis/pubsub_demo.rb index 003e91a6b3..eca43215b7 100755 --- a/src/ruby/bin/apis/pubsub_demo.rb +++ b/src/ruby/bin/apis/pubsub_demo.rb @@ -80,8 +80,9 @@ def publisher_stub(opts) address = "#{opts.host}:#{opts.port}" stub_clz = Tech::Pubsub::PublisherService::Stub # shorter GRPC.logger.info("... access PublisherService at #{address}") - stub_clz.new(address, - creds: ssl_creds, update_metadata: auth_proc(opts), + call_creds = GRPC::Core::CallCredentials.new(auth_proc(opts)) + combined_creds = ssl_creds.compose(call_creds) + stub_clz.new(address, creds: combined_creds, GRPC::Core::Channel::SSL_TARGET => opts.host) end @@ -90,8 +91,9 @@ def subscriber_stub(opts) address = "#{opts.host}:#{opts.port}" stub_clz = Tech::Pubsub::SubscriberService::Stub # shorter GRPC.logger.info("... access SubscriberService at #{address}") - stub_clz.new(address, - creds: ssl_creds, update_metadata: auth_proc(opts), + call_creds = GRPC::Core::CallCredentials.new(auth_proc(opts)) + combined_creds = ssl_creds.compose(call_creds) + stub_clz.new(address, creds: combined_creds, GRPC::Core::Channel::SSL_TARGET => opts.host) end |