diff options
Diffstat (limited to 'src/python/grpcio_test/grpc_interop/client.py')
-rw-r--r-- | src/python/grpcio_test/grpc_interop/client.py | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/python/grpcio_test/grpc_interop/client.py b/src/python/grpcio_test/grpc_interop/client.py index 36afe6c096..21e344ca35 100644 --- a/src/python/grpcio_test/grpc_interop/client.py +++ b/src/python/grpcio_test/grpc_interop/client.py @@ -49,11 +49,11 @@ def _args(): parser.add_argument( '--test_case', help='the test case to execute', type=str) parser.add_argument( - '--use_tls', help='require a secure connection', dest='use_tls', - action='store_true') + '--use_tls', help='require a secure connection', default=False, + type=resources.parse_bool) parser.add_argument( '--use_test_ca', help='replace platform root CAs with ca.pem', - action='store_true') + default=False, type=resources.parse_bool) parser.add_argument( '--server_host_override', help='the server host to which to claim to connect', type=str) @@ -71,12 +71,17 @@ def _oauth_access_token(args): def _stub(args): if args.oauth_scope: if args.test_case == 'oauth2_auth_token': + # TODO(jtattermusch): This testcase sets the auth metadata key-value + # manually, which also means that the user would need to do the same + # thing every time he/she would like to use and out of band oauth token. + # The transformer function that produces the metadata key-value from + # the access token should be provided by gRPC auth library. access_token = _oauth_access_token(args) metadata_transformer = lambda x: [ - ('Authorization', 'Bearer %s' % access_token)] + ('authorization', 'Bearer %s' % access_token)] else: metadata_transformer = lambda x: [ - ('Authorization', 'Bearer %s' % _oauth_access_token(args))] + ('authorization', 'Bearer %s' % _oauth_access_token(args))] else: metadata_transformer = lambda x: [] if args.use_tls: |