From 65ab65faac57b156c4d238afa8de422f52a5a68a Mon Sep 17 00:00:00 2001 From: asteroide Date: Fri, 4 Mar 2016 15:50:10 +0100 Subject: Update KeystoneMiddleware to the stable/liberty version. Change-Id: I225ed685dad129dc7c1d5d6a00e54c0facde0c07 --- .../keystonemiddleware/auth_token/_identity.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'keystonemiddleware-moon/keystonemiddleware/auth_token/_identity.py') diff --git a/keystonemiddleware-moon/keystonemiddleware/auth_token/_identity.py b/keystonemiddleware-moon/keystonemiddleware/auth_token/_identity.py index 98be3b2e..6fbeac27 100644 --- a/keystonemiddleware-moon/keystonemiddleware/auth_token/_identity.py +++ b/keystonemiddleware-moon/keystonemiddleware/auth_token/_identity.py @@ -212,25 +212,28 @@ class IdentityServer(object): try: auth_ref = self._request_strategy.verify_token(user_token) except exceptions.NotFound as e: - self._LOG.warn(_LW('Authorization failed for token')) - self._LOG.warn(_LW('Identity response: %s'), e.response.text) + self._LOG.warning(_LW('Authorization failed for token')) + self._LOG.warning(_LW('Identity response: %s'), e.response.text) + raise exc.InvalidToken(_('Token authorization failed')) except exceptions.Unauthorized as e: self._LOG.info(_LI('Identity server rejected authorization')) - self._LOG.warn(_LW('Identity response: %s'), e.response.text) + self._LOG.warning(_LW('Identity response: %s'), e.response.text) if retry: self._LOG.info(_LI('Retrying validation')) return self.verify_token(user_token, False) + msg = _('Identity server rejected authorization necessary to ' + 'fetch token data') + raise exc.ServiceError(msg) except exceptions.HttpError as e: self._LOG.error( _LE('Bad response code while validating token: %s'), e.http_status) - self._LOG.warn(_LW('Identity response: %s'), e.response.text) + self._LOG.warning(_LW('Identity response: %s'), e.response.text) + msg = _('Failed to fetch token data from identity server') + raise exc.ServiceError(msg) else: return auth_ref - msg = _('Failed to fetch token data from identity server') - raise exc.InvalidToken(msg) - def fetch_revocation_list(self): try: data = self._request_strategy.fetch_revocation_list() -- cgit 1.2.3-korg