Remove unnecessary _reject_request function

After refactoring _reject_request is now only consumed from one place so
it doesn't save any code and the function documentation is wrong. Move
it inline which is easier to read anyway.

Change-Id: I9acf3fb213f1b585f4c800ffa3e3ccb0d9f8f774
This commit is contained in:
Jamie Lennox 2016-01-16 14:32:30 +11:00
parent ecb569dc54
commit 4315ea4316

View File

@ -739,7 +739,9 @@ class AuthProtocol(BaseAuthProtocol):
self.log.info(_LI('Deferring reject downstream'))
else:
self.log.info(_LI('Rejecting request'))
self._reject_request()
raise webob.exc.HTTPUnauthorized(
body='Authentication required',
headers=self._reject_auth_headers)
if request.user_token_valid:
user_auth_ref = request.token_auth._user_auth_ref
@ -772,17 +774,6 @@ class AuthProtocol(BaseAuthProtocol):
header_val = 'Keystone uri=\'%s\'' % self._auth_uri
return [('WWW-Authenticate', header_val)]
def _reject_request(self):
"""Redirect client to auth server.
:param env: wsgi request environment
:param start_response: wsgi response callback
:returns: HTTPUnauthorized http response
"""
raise webob.exc.HTTPUnauthorized(body='Authentication required',
headers=self._reject_auth_headers)
def _token_hashes(self, token):
"""Generate a list of hashes that the current token may be cached as.