Remove deprecated token_api.list_tokens

The method token_api.list_tokens was deprecated in Icehouse and
slated for removal in Juno. It was determined that the driver
version of .list_tokens was an internal method and should not
be used outside of the .delete_tokens method.

blueprint: non-persistent-tokens
Change-Id: I33e81503b1469537bbd745937bf2efe17c7ae469
This commit is contained in:
Morgan Fainberg 2014-06-28 21:48:28 -07:00 committed by Dolph Mathews
parent b3f9a5ff2c
commit 8602a7d5e7
3 changed files with 1 additions and 37 deletions

View File

@ -3109,11 +3109,6 @@ class TokenTests(object):
def test_token_list(self):
self._test_token_list(self.token_api._list_tokens)
def test_token_list_deprecated_public_interface(self):
# TODO(morganfainberg): Remove once token_api.list_tokens is removed
# (post Icehouse release)
self._test_token_list(self.token_api.list_tokens)
def test_token_list_trust(self):
trust_id = uuid.uuid4().hex
token_id5, data = self.create_token_sample_data(trust_id=trust_id)
@ -3299,10 +3294,6 @@ class TokenTests(object):
token_id, data = self.create_token_sample_data(user_id=user_id)
self.token_api.get_token(token_id)
def test_list_tokens_unicode_user_id(self):
user_id = six.text_type(uuid.uuid4().hex)
self.token_api.list_tokens(user_id)
def test_token_expire_timezone(self):
@test_utils.timezone

View File

@ -114,8 +114,7 @@ class KvsToken(tests.TestCase, test_backend.TokenTests):
expire_delta = datetime.timedelta(seconds=86400)
# NOTE(morganfainberg): Directly access the data cache since we need to
# get expired tokens as well as valid tokens. token_api.list_tokens()
# will not return any expired tokens in the list.
# get expired tokens as well as valid tokens.
user_key = self.token_api.driver._prefix_user_id(user_id)
user_token_list = self.token_api.driver._store.get(user_key)
valid_token_ref = self.token_api.get_token(valid_token_id)

View File

@ -29,7 +29,6 @@ from keystone import exception
from keystone.openstack.common.gettextutils import _
from keystone.openstack.common import log
from keystone.openstack.common import timeutils
from keystone.openstack.common import versionutils
CONF = config.CONF
@ -260,31 +259,6 @@ class Manager(manager.Manager):
self._get_token.invalidate(self, token_id)
self.token_provider_api.invalidate_individual_token_cache(token_id)
@versionutils.deprecated(versionutils.deprecated.ICEHOUSE, remove_in=+1)
def list_tokens(self, user_id, tenant_id=None, trust_id=None,
consumer_id=None):
"""Returns a list of current token_id's for a user
This is effectively a private method only used by the ``delete_tokens``
method and should not be called by anything outside of the
``token_api`` manager or the token driver itself.
:param user_id: identity of the user
:type user_id: string
:param tenant_id: identity of the tenant
:type tenant_id: string
:param trust_id: identity of the trust
:type trust_id: string
:param consumer_id: identity of the consumer
:type consumer_id: string
:returns: list of token_id's
"""
return self.driver._list_tokens(user_id,
tenant_id=tenant_id,
trust_id=trust_id,
consumer_id=consumer_id)
@six.add_metaclass(abc.ABCMeta)
class Driver(object):