Correct AccessTokenAuthMetadataPlugin name

It was never itself a "call credentials" of any sort.
pull/13587/head
Nathaniel Manista 7 years ago
parent 95bcb4924b
commit 6288753742
  1. 2
      src/python/grpcio/grpc/__init__.py
  2. 2
      src/python/grpcio/grpc/_auth.py
  3. 2
      src/python/grpcio_tests/tests/tests.json
  4. 6
      src/python/grpcio_tests/tests/unit/_auth_test.py

@ -1196,7 +1196,7 @@ def access_token_call_credentials(access_token):
""" """
from grpc import _auth # pylint: disable=cyclic-import from grpc import _auth # pylint: disable=cyclic-import
return _metadata_call_credentials( return _metadata_call_credentials(
_auth.AccessTokenCallCredentials(access_token), None) _auth.AccessTokenAuthMetadataPlugin(access_token), None)
def composite_call_credentials(*call_credentials): def composite_call_credentials(*call_credentials):

@ -63,7 +63,7 @@ class GoogleCallCredentials(grpc.AuthMetadataPlugin):
self._pool.shutdown(wait=False) self._pool.shutdown(wait=False)
class AccessTokenCallCredentials(grpc.AuthMetadataPlugin): class AccessTokenAuthMetadataPlugin(grpc.AuthMetadataPlugin):
"""Metadata wrapper for raw access token credentials.""" """Metadata wrapper for raw access token credentials."""
def __init__(self, access_token): def __init__(self, access_token):

@ -22,7 +22,7 @@
"unit._api_test.ChannelConnectivityTest", "unit._api_test.ChannelConnectivityTest",
"unit._api_test.ChannelTest", "unit._api_test.ChannelTest",
"unit._auth_context_test.AuthContextTest", "unit._auth_context_test.AuthContextTest",
"unit._auth_test.AccessTokenCallCredentialsTest", "unit._auth_test.AccessTokenAuthMetadataPluginTest",
"unit._auth_test.GoogleCallCredentialsTest", "unit._auth_test.GoogleCallCredentialsTest",
"unit._channel_args_test.ChannelArgsTest", "unit._channel_args_test.ChannelArgsTest",
"unit._channel_connectivity_test.ChannelConnectivityTest", "unit._channel_connectivity_test.ChannelConnectivityTest",

@ -61,7 +61,7 @@ class GoogleCallCredentialsTest(unittest.TestCase):
self.assertTrue(callback_event.wait(1.0)) self.assertTrue(callback_event.wait(1.0))
class AccessTokenCallCredentialsTest(unittest.TestCase): class AccessTokenAuthMetadataPluginTest(unittest.TestCase):
def test_google_call_credentials_success(self): def test_google_call_credentials_success(self):
callback_event = threading.Event() callback_event = threading.Event()
@ -71,8 +71,8 @@ class AccessTokenCallCredentialsTest(unittest.TestCase):
self.assertIsNone(error) self.assertIsNone(error)
callback_event.set() callback_event.set()
call_creds = _auth.AccessTokenCallCredentials('token') metadata_plugin = _auth.AccessTokenAuthMetadataPlugin('token')
call_creds(None, mock_callback) metadata_plugin(None, mock_callback)
self.assertTrue(callback_event.wait(1.0)) self.assertTrue(callback_event.wait(1.0))

Loading…
Cancel
Save