From 628875374223df0174bd28535bbe151475822f3b Mon Sep 17 00:00:00 2001 From: Nathaniel Manista Date: Fri, 1 Dec 2017 16:00:17 +0000 Subject: [PATCH] Correct AccessTokenAuthMetadataPlugin name It was never itself a "call credentials" of any sort. --- src/python/grpcio/grpc/__init__.py | 2 +- src/python/grpcio/grpc/_auth.py | 2 +- src/python/grpcio_tests/tests/tests.json | 2 +- src/python/grpcio_tests/tests/unit/_auth_test.py | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/python/grpcio/grpc/__init__.py b/src/python/grpcio/grpc/__init__.py index 17d52a7a3e2..45ee2c2acd1 100644 --- a/src/python/grpcio/grpc/__init__.py +++ b/src/python/grpcio/grpc/__init__.py @@ -1196,7 +1196,7 @@ def access_token_call_credentials(access_token): """ from grpc import _auth # pylint: disable=cyclic-import return _metadata_call_credentials( - _auth.AccessTokenCallCredentials(access_token), None) + _auth.AccessTokenAuthMetadataPlugin(access_token), None) def composite_call_credentials(*call_credentials): diff --git a/src/python/grpcio/grpc/_auth.py b/src/python/grpcio/grpc/_auth.py index c6542d01354..9a339b59004 100644 --- a/src/python/grpcio/grpc/_auth.py +++ b/src/python/grpcio/grpc/_auth.py @@ -63,7 +63,7 @@ class GoogleCallCredentials(grpc.AuthMetadataPlugin): self._pool.shutdown(wait=False) -class AccessTokenCallCredentials(grpc.AuthMetadataPlugin): +class AccessTokenAuthMetadataPlugin(grpc.AuthMetadataPlugin): """Metadata wrapper for raw access token credentials.""" def __init__(self, access_token): diff --git a/src/python/grpcio_tests/tests/tests.json b/src/python/grpcio_tests/tests/tests.json index e277a3ea1d1..34cbade92c3 100644 --- a/src/python/grpcio_tests/tests/tests.json +++ b/src/python/grpcio_tests/tests/tests.json @@ -22,7 +22,7 @@ "unit._api_test.ChannelConnectivityTest", "unit._api_test.ChannelTest", "unit._auth_context_test.AuthContextTest", - "unit._auth_test.AccessTokenCallCredentialsTest", + "unit._auth_test.AccessTokenAuthMetadataPluginTest", "unit._auth_test.GoogleCallCredentialsTest", "unit._channel_args_test.ChannelArgsTest", "unit._channel_connectivity_test.ChannelConnectivityTest", diff --git a/src/python/grpcio_tests/tests/unit/_auth_test.py b/src/python/grpcio_tests/tests/unit/_auth_test.py index f61951b80a0..e2cb9389368 100644 --- a/src/python/grpcio_tests/tests/unit/_auth_test.py +++ b/src/python/grpcio_tests/tests/unit/_auth_test.py @@ -61,7 +61,7 @@ class GoogleCallCredentialsTest(unittest.TestCase): self.assertTrue(callback_event.wait(1.0)) -class AccessTokenCallCredentialsTest(unittest.TestCase): +class AccessTokenAuthMetadataPluginTest(unittest.TestCase): def test_google_call_credentials_success(self): callback_event = threading.Event() @@ -71,8 +71,8 @@ class AccessTokenCallCredentialsTest(unittest.TestCase): self.assertIsNone(error) callback_event.set() - call_creds = _auth.AccessTokenCallCredentials('token') - call_creds(None, mock_callback) + metadata_plugin = _auth.AccessTokenAuthMetadataPlugin('token') + metadata_plugin(None, mock_callback) self.assertTrue(callback_event.wait(1.0))