Skip to content
Snippets Groups Projects
Commit c357749b authored by Craig Tiller's avatar Craig Tiller
Browse files

Merge pull request #4625 from murgatroid99/ruby_client_stub_fix_typo

Fix a bug recently reported in the mailing list
parents 9a781b7e 69108a33
Branches
Tags
No related merge requests found
# Copyright 2015, Google Inc. # Copyright 2015-2016, Google Inc.
# All rights reserved. # All rights reserved.
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # 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'] unless ENV['GRPC_DEFAULT_SSL_ROOTS_FILE_PATH']
ENV['GRPC_DEFAULT_SSL_ROOTS_FILE_PATH'] = ssl_roots_path ENV['GRPC_DEFAULT_SSL_ROOTS_FILE_PATH'] = ssl_roots_path
end end
......
# Copyright 2015, Google Inc. # Copyright 2015-2016, Google Inc.
# All rights reserved. # All rights reserved.
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
...@@ -464,7 +464,7 @@ module GRPC ...@@ -464,7 +464,7 @@ module GRPC
method, method,
nil, # host use nil, nil, # host use nil,
deadline) deadline)
call.set_credentials credentials unless credentials.nil? call.set_credentials! credentials unless credentials.nil?
ActiveCall.new(call, @queue, marshal, unmarshal, deadline, started: false) ActiveCall.new(call, @queue, marshal, unmarshal, deadline, started: false)
end end
end end
......
#!/usr/bin/env ruby #!/usr/bin/env ruby
# Copyright 2015, Google Inc. # Copyright 2015-2016, Google Inc.
# All rights reserved. # All rights reserved.
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
...@@ -264,11 +264,15 @@ class NamedTests ...@@ -264,11 +264,15 @@ class NamedTests
def per_rpc_creds def per_rpc_creds
auth_creds = Google::Auth.get_application_default(@args.oauth_scope) auth_creds = Google::Auth.get_application_default(@args.oauth_scope)
update_metadata = proc do |md|
kw = auth_creds.updater_proc.call({}) kw = auth_creds.updater_proc.call({})
end
call_creds = GRPC::Core::CallCredentials.new(update_metadata)
resp = perform_large_unary(fill_username: true, resp = perform_large_unary(fill_username: true,
fill_oauth_scope: true, fill_oauth_scope: true,
**kw) credentials: call_creds)
json_key = File.read(ENV[AUTH_ENV]) json_key = File.read(ENV[AUTH_ENV])
wanted_email = MultiJson.load(json_key)['client_email'] wanted_email = MultiJson.load(json_key)['client_email']
assert("#{__callee__}: bad username") { wanted_email == resp.username } assert("#{__callee__}: bad username") { wanted_email == resp.username }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment