Merge "Handling Forbidden Exception" into stable/kilo

This commit is contained in:
Jenkins 2015-09-17 23:35:43 +00:00 committed by Gerrit Code Review
commit 78a83cca4a
1 changed files with 10 additions and 7 deletions

View File

@ -137,13 +137,16 @@ class KeystoneContextMiddleware(ContextMiddleware):
roles = headers.get('X-Roles').split(',')
self.make_context(
request,
auth_token=headers.get('X-Auth-Token'),
user=headers.get('X-User-ID'),
tenant=tenant_id,
roles=roles,
service_catalog=catalog)
try:
self.make_context(
request,
auth_token=headers.get('X-Auth-Token'),
user=headers.get('X-User-ID'),
tenant=tenant_id,
roles=roles,
service_catalog=catalog)
except exceptions.Forbidden:
return flask.Response(status=403)
class NoAuthContextMiddleware(ContextMiddleware):