Merge "Use X_USER_NAME and X_ROLES headers."

This commit is contained in:
Jenkins 2012-06-06 15:56:38 +00:00 committed by Gerrit Code Review
commit 987bc69326
2 changed files with 5 additions and 5 deletions

View File

@ -135,9 +135,9 @@ class SwiftAuth(object):
if environ.get('HTTP_X_IDENTITY_STATUS') != 'Confirmed':
return
roles = []
if 'HTTP_X_ROLE' in environ:
roles = environ['HTTP_X_ROLE'].split(',')
identity = {'user': environ.get('HTTP_X_USER'),
if 'HTTP_X_ROLES' in environ:
roles = environ['HTTP_X_ROLES'].split(',')
identity = {'user': environ.get('HTTP_X_USER_NAME'),
'tenant': (environ.get('HTTP_X_TENANT_ID'),
environ.get('HTTP_X_TENANT_NAME')),
'roles': roles}

View File

@ -71,8 +71,8 @@ class SwiftAuth(unittest.TestCase):
return dict(X_IDENTITY_STATUS=status,
X_TENANT_ID=tenant_id,
X_TENANT_NAME=tenant_name,
X_ROLE=role,
X_USER=user)
X_ROLES=role,
X_USER_NAME=user)
def _get_successful_middleware(self):
response_iter = iter([('200 OK', {}, '')])