diff --git a/doc/source/usage.rst b/doc/source/usage.rst index 0e7edfc9..96b2be80 100644 --- a/doc/source/usage.rst +++ b/doc/source/usage.rst @@ -76,7 +76,6 @@ call to the constructor. client.authenticate() The default authentication strategy assumes a Keystone compliant auth system. -For Rackspace auth, use the keyword argument "auth_strategy='rax'". Versions diff --git a/releasenotes/notes/remove-rax-references-in-client-33551aa2bb25181b.yaml b/releasenotes/notes/remove-rax-references-in-client-33551aa2bb25181b.yaml new file mode 100644 index 00000000..f2b6c09a --- /dev/null +++ b/releasenotes/notes/remove-rax-references-in-client-33551aa2bb25181b.yaml @@ -0,0 +1,4 @@ +--- +fixes: + - Remove all the rax references in the client. Use the rackspace plugin for + auth if you want to use rax auth with troveclient. Bug 1401804 diff --git a/troveclient/compat/auth.py b/troveclient/compat/auth.py index 8482fea2..ed7de513 100644 --- a/troveclient/compat/auth.py +++ b/troveclient/compat/auth.py @@ -24,10 +24,6 @@ def get_authenticator_cls(cls_or_name): elif isinstance(cls_or_name, six.string_types): if cls_or_name == "keystone": return KeyStoneV2Authenticator - elif cls_or_name == "rax": - return RaxAuthenticator - elif cls_or_name == "rax2": - return RaxAuthenticator2 elif cls_or_name == "auth1.1": return Auth1_1 elif cls_or_name == "fake": @@ -133,37 +129,6 @@ class Auth1_1(Authenticator): return self._authenticate(auth_url, body, root_key='auth') -class RaxAuthenticator(Authenticator): - def authenticate(self): - if self.url is None: - raise exceptions.AuthUrlNotGiven() - return self._rax_auth(self.url) - - def _rax_auth(self, url): - """Authenticate against the Rackspace auth service.""" - body = {'auth': { - 'RAX-KSKEY:apiKeyCredentials': { - 'username': self.username, - 'apiKey': self.password, - 'tenantName': self.tenant} - } - } - - return self._authenticate(self.url, body) - - -class RaxAuthenticator2(RaxAuthenticator): - """Rax specific authenticator. - - Necessary to be able to call using the same auth url as the new client - uses for Rax auth. - """ - - def __init__(self, *args, **kwargs): - super(RaxAuthenticator2, self).__init__(*args, **kwargs) - self.url = "%s/tokens" % self.url - - class FakeAuth(Authenticator): """Useful for faking auth.""" diff --git a/troveclient/compat/common.py b/troveclient/compat/common.py index 9f8cba55..152ea775 100644 --- a/troveclient/compat/common.py +++ b/troveclient/compat/common.py @@ -161,8 +161,8 @@ class CliOptions(object): add_option("tenant_id", help="Tenant Id associated with the account.") add_option("auth_type", - help="Auth type to support different auth environments, \ - Supported values are 'keystone', 'rax'.") + help="Auth type to support different auth environments, " + "Supported value are 'keystone'.") add_option("service_type", help="Service type is a name associated for the catalog.") add_option("service_name", diff --git a/troveclient/compat/tests/test_auth.py b/troveclient/compat/tests/test_auth.py index 22b7cdf7..8f6d9217 100644 --- a/troveclient/compat/tests/test_auth.py +++ b/troveclient/compat/tests/test_auth.py @@ -51,7 +51,6 @@ class AuthenticatorTest(testtools.TestCase): def test_get_authenticator_cls(self): class_list = (auth.KeyStoneV2Authenticator, - auth.RaxAuthenticator, auth.Auth1_1, auth.FakeAuth) @@ -59,7 +58,6 @@ class AuthenticatorTest(testtools.TestCase): self.assertEqual(c, auth.get_authenticator_cls(c)) class_names = {"keystone": auth.KeyStoneV2Authenticator, - "rax": auth.RaxAuthenticator, "auth1.1": auth.Auth1_1, "fake": auth.FakeAuth} @@ -200,55 +198,6 @@ class Auth1_1Test(testtools.TestCase): self.assertEqual('auth', root_key) -class RaxAuthenticatorTest(testtools.TestCase): - - def test_authenticate(self): - # url is None - check_url_none(self, auth.RaxAuthenticator) - - # url is not None, so it must not throw exception - url = "test_url" - authObj = auth.RaxAuthenticator(url=url, - type=auth.RaxAuthenticator, - client=None, username=None, - password=None, tenant=None) - - def side_effect_func(url): - return url - - mock_obj = mock.Mock() - mock_obj.side_effect = side_effect_func - authObj._rax_auth = mock_obj - r = authObj.authenticate() - self.assertEqual(url, r) - - def test__rax_auth(self): - username = "trove_user" - password = "trove_password" - tenant = "tenant" - authObj = auth.RaxAuthenticator(url=None, - type=auth.RaxAuthenticator, - client=None, username=username, - password=password, tenant=tenant) - - def side_effect_func(url, body): - return body - - mock_obj = mock.Mock() - mock_obj.side_effect = side_effect_func - authObj._authenticate = mock_obj - body = authObj._rax_auth(mock.Mock()) - - v = body['auth']['RAX-KSKEY:apiKeyCredentials']['username'] - self.assertEqual(username, v) - - v = body['auth']['RAX-KSKEY:apiKeyCredentials']['apiKey'] - self.assertEqual(password, v) - - v = body['auth']['RAX-KSKEY:apiKeyCredentials']['tenantName'] - self.assertEqual(tenant, v) - - class FakeAuthTest(testtools.TestCase): def test_authenticate(self):