Cached tokens aren't expired

The auth_token test said that the cached tokens are expired. The
tokens weren't expired, so remove the code.

Change-Id: I8ce30cc09ee9bbc19cc4ebdb5d935a80d2d5d473
This commit is contained in:
Brant Knudson
2014-05-05 17:09:23 -05:00
parent 04c525560f
commit 01231bbc6e
2 changed files with 3 additions and 4 deletions

View File

@@ -972,7 +972,7 @@ class AuthProtocol(object):
env_key = self._header_to_env_var(key)
return env.get(env_key, default)
def _cache_get(self, token_id, ignore_expires=False):
def _cache_get(self, token_id):
"""Return token information from cache.
If token is invalid raise InvalidUserToken
@@ -1035,7 +1035,7 @@ class AuthProtocol(object):
expires = timeutils.normalize_time(expires)
utcnow = timeutils.utcnow()
if ignore_expires or utcnow < expires:
if utcnow < expires:
self.LOG.debug('Returning cached token')
return data
else:

View File

@@ -730,8 +730,7 @@ class CommonAuthTokenMiddlewareTest(object):
def _get_cached_token(self, token):
token_id = cms.cms_hash_token(token)
# NOTE(vish): example tokens are expired so skip the expiration check.
return self.middleware._cache_get(token_id, ignore_expires=True)
return self.middleware._cache_get(token_id)
def test_memcache(self):
# NOTE(jamielennox): it appears that httpretty can mess with the