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':
|
if environ.get('HTTP_X_IDENTITY_STATUS') != 'Confirmed':
|
||||||
return
|
return
|
||||||
roles = []
|
roles = []
|
||||||
if 'HTTP_X_ROLE' in environ:
|
if 'HTTP_X_ROLES' in environ:
|
||||||
roles = environ['HTTP_X_ROLE'].split(',')
|
roles = environ['HTTP_X_ROLES'].split(',')
|
||||||
identity = {'user': environ.get('HTTP_X_USER'),
|
identity = {'user': environ.get('HTTP_X_USER_NAME'),
|
||||||
'tenant': (environ.get('HTTP_X_TENANT_ID'),
|
'tenant': (environ.get('HTTP_X_TENANT_ID'),
|
||||||
environ.get('HTTP_X_TENANT_NAME')),
|
environ.get('HTTP_X_TENANT_NAME')),
|
||||||
'roles': roles}
|
'roles': roles}
|
||||||
|
@ -71,8 +71,8 @@ class SwiftAuth(unittest.TestCase):
|
|||||||
return dict(X_IDENTITY_STATUS=status,
|
return dict(X_IDENTITY_STATUS=status,
|
||||||
X_TENANT_ID=tenant_id,
|
X_TENANT_ID=tenant_id,
|
||||||
X_TENANT_NAME=tenant_name,
|
X_TENANT_NAME=tenant_name,
|
||||||
X_ROLE=role,
|
X_ROLES=role,
|
||||||
X_USER=user)
|
X_USER_NAME=user)
|
||||||
|
|
||||||
def _get_successful_middleware(self):
|
def _get_successful_middleware(self):
|
||||||
response_iter = iter([('200 OK', {}, '')])
|
response_iter = iter([('200 OK', {}, '')])
|
||||||
|
Loading…
Reference in New Issue
Block a user