Use X_USER_NAME and X_ROLES headers.

- Don't use deprecated headers X_USER and X_ROLE but the newest one
  X_USER_NAME and X_ROLES.
- Fixes bug 999447.

Change-Id: I12752c7668863cbb47ee4b6e484cc494133443e8
This commit is contained in:
Chmouel Boudjnah 2012-05-22 15:01:38 +00:00
parent 33d107aa1d
commit daf395b5e8
2 changed files with 5 additions and 5 deletions

View File

@ -125,9 +125,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

@ -70,8 +70,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', {}, '')])