I looked a little at the cause and I found the difference.
All other services just run keystonemiddleware normally, but Keystone uses a middleware known as "auth_context". It has a class AuthContextMiddleware that inherits from BaseAuthProtocol, provided by the auth_token module in keystonemiddleware. That class has its own process_request, which literally stubs all the exceptions and invokes the parent's process_request. But unfortunately, the process_request in keystonemiddleware expects to report errors by raising!
Look at
keystone/server/flask/request_processing/middleware/auth_context.py:
class AuthContextMiddleware(...., auth_token.BaseAuthProtocol):
@middleware_exceptions
def process_request(self, request):
and
keystonemiddleware/auth_token/__init__.py:
class BaseAuthProtocol(object):
def process_request(self, request):
def validate_allowed_request(self, request, token):
I looked a little at the cause and I found the difference.
All other services just run keystonemiddleware normally, but Keystone uses a middleware known as "auth_context". It has a class AuthContextMidd leware that inherits from BaseAuthProtocol, provided by the auth_token module in keystonemiddleware. That class has its own process_request, which literally stubs all the exceptions and invokes the parent's process_request. But unfortunately, the process_request in keystonemiddleware expects to report errors by raising!
Look at
keystone/ server/ flask/request_ processing/ middleware/ auth_context. py: leware( ...., auth_token. BaseAuthProtoco l): exceptions request( self, request):
class AuthContextMidd
@middleware_
def process_
and
keystonemiddlew are/auth_ token/_ _init__ .py: l(object) : request( self, request): allowed_ request( self, request, token):
class BaseAuthProtoco
def process_
def validate_