auth_token _cache_get checks token expired

When auth_token stores the token in the cache, it's stored with
the expiration time; but when the token is retrieved from the
cache, if the expiration time has passed the token is treated as if
it wasn't cached. This creates extra work because now auth_token
has to check the token expiration (either by decrypting the PKI
token or online validation for UUID tokens).

With this change, getting the token from the cache will fail if the
expiration is past.

Change-Id: Id0ec6b3c2e5af4a2d910f16da4e0312733fc2198
This commit is contained in:
Brant Knudson 2014-05-30 10:02:51 -05:00
parent 30efde6dfd
commit 389f90461f

View File

@ -1518,6 +1518,7 @@ class TokenCache(object):
return data
else:
self.LOG.debug('Cached Token seems expired')
raise InvalidUserToken('Token authorization failed')
def _cache_store(self, token_id, data):
"""Store value into memcache.