aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ruby/bin
diff options
context:
space:
mode:
authorGravatar Tim Emiola <temiola@google.com>2015-04-14 16:41:28 -0700
committerGravatar Tim Emiola <temiola@google.com>2015-04-14 16:41:28 -0700
commit189d9b0b1d82665c2d83a050d2b2b4382daa7360 (patch)
treeae16a520813b60566c39a98b07b6012dde757071 /src/ruby/bin
parent7db18b4cbf2585a226a822e4ab1523416e60ab09 (diff)
Adds a jwt_token_creds interop test
Diffstat (limited to 'src/ruby/bin')
-rwxr-xr-xsrc/ruby/bin/interop/interop_client.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/ruby/bin/interop/interop_client.rb b/src/ruby/bin/interop/interop_client.rb
index b2a8711c79..af7a1d5b15 100755
--- a/src/ruby/bin/interop/interop_client.rb
+++ b/src/ruby/bin/interop/interop_client.rb
@@ -110,6 +110,11 @@ def create_stub(opts)
end
end
+ if opts.test_case == 'jwt_token_creds' # don't use a scope
+ auth_creds = Google::Auth.get_application_default
+ stub_opts[:update_metadata] = auth_creds.updater_proc
+ end
+
logger.info("... connecting securely to #{address}")
Grpc::Testing::TestService::Stub.new(address, **stub_opts)
else
@@ -201,6 +206,15 @@ class NamedTests
p 'OK: service_account_creds'
end
+ def jwt_token_creds
+ json_key = File.read(ENV[AUTH_ENV])
+ wanted_email = MultiJson.load(json_key)['client_email']
+ resp = perform_large_unary(fill_username: true)
+ assert_equal(wanted_email, resp.username,
+ 'service_account_creds: incorrect username')
+ p 'OK: jwt_token_creds'
+ end
+
def compute_engine_creds
resp = perform_large_unary(fill_username: true,
fill_oauth_scope: true)