]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
heat common : context should split roles from X-Roles
authorSteven Hardy <shardy@redhat.com>
Wed, 6 Feb 2013 11:39:12 +0000 (11:39 +0000)
committerSteven Hardy <shardy@redhat.com>
Wed, 6 Feb 2013 14:52:02 +0000 (14:52 +0000)
The auth_token code joins roles with a comma delimiter and stores
the result in the X-Roles header, so we need to split X-Roles back
into a list for the context (otherwise the oslo policy code breaks)

Change-Id: I32bd1d6355b6fe0e16e729f35b1d0b5c61346a70
Signed-off-by: Steven Hardy <shardy@redhat.com>
heat/common/context.py

index 0bdca8e150ac13d95a91f4b08ec8f69455bd07a9..68d0c09c47cb823faef14ad220ad444ed9e79eb3 100644 (file)
@@ -185,7 +185,7 @@ class ContextMiddleware(wsgi.Middleware):
             tenant = headers.get('X-Tenant-Name')
             tenant_id = headers.get('X-Tenant-Id')
             auth_url = headers.get('X-Auth-Url')
-            roles = headers.get('X-Roles')
+            roles = headers.get('X-Roles').split(',')
         except Exception:
             raise exception.NotAuthenticated()