Merge "Use X_USER_NAME and X_ROLES headers."
This commit is contained in:
commit
987bc69326
@ -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}
|
||||
|
@ -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', {}, '')])
|
||||
|
Loading…
Reference in New Issue
Block a user