diff --git a/src/ruby/lib/grpc.rb b/src/ruby/lib/grpc.rb index 228fbe366c538abe2d4d6cfe3da0990da05ca989..1671ba3550b8f20563cc26f0eeeef480f21322f0 100644 --- a/src/ruby/lib/grpc.rb +++ b/src/ruby/lib/grpc.rb @@ -1,4 +1,4 @@ -# Copyright 2015, Google Inc. +# Copyright 2015-2016, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -27,7 +27,7 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -ssl_roots_path = File.expand_path('../../../etc/roots.pem', __FILE__) +ssl_roots_path = File.expand_path('../../../../etc/roots.pem', __FILE__) unless ENV['GRPC_DEFAULT_SSL_ROOTS_FILE_PATH'] ENV['GRPC_DEFAULT_SSL_ROOTS_FILE_PATH'] = ssl_roots_path end diff --git a/src/ruby/lib/grpc/generic/client_stub.rb b/src/ruby/lib/grpc/generic/client_stub.rb index 32da7a2b0f1e7e29b5e2edb5e9fda1f025f63620..4da9ff086a9550bb1e7274f0a101df7759ef8b64 100644 --- a/src/ruby/lib/grpc/generic/client_stub.rb +++ b/src/ruby/lib/grpc/generic/client_stub.rb @@ -1,4 +1,4 @@ -# Copyright 2015, Google Inc. +# Copyright 2015-2016, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -464,7 +464,7 @@ module GRPC method, nil, # host use nil, deadline) - call.set_credentials credentials unless credentials.nil? + call.set_credentials! credentials unless credentials.nil? ActiveCall.new(call, @queue, marshal, unmarshal, deadline, started: false) end end diff --git a/src/ruby/pb/test/client.rb b/src/ruby/pb/test/client.rb index 8dbfed4b2967b9d6df2725a32c57c0e93691e7b7..684ee807715a17a6280841e95ea3777d542e31eb 100755 --- a/src/ruby/pb/test/client.rb +++ b/src/ruby/pb/test/client.rb @@ -1,6 +1,6 @@ #!/usr/bin/env ruby -# Copyright 2015, Google Inc. +# Copyright 2015-2016, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -264,11 +264,15 @@ class NamedTests def per_rpc_creds auth_creds = Google::Auth.get_application_default(@args.oauth_scope) - kw = auth_creds.updater_proc.call({}) + update_metadata = proc do |md| + kw = auth_creds.updater_proc.call({}) + end + + call_creds = GRPC::Core::CallCredentials.new(update_metadata) resp = perform_large_unary(fill_username: true, fill_oauth_scope: true, - **kw) + credentials: call_creds) json_key = File.read(ENV[AUTH_ENV]) wanted_email = MultiJson.load(json_key)['client_email'] assert("#{__callee__}: bad username") { wanted_email == resp.username }