diff options
| author | Chmouel Boudjnah <chmouel@chmouel.com> | 2012-05-22 15:01:38 +0000 |
|---|---|---|
| committer | Chmouel Boudjnah <chmouel@chmouel.com> | 2012-05-22 15:03:15 +0000 |
| commit | daf395b5e85bfa1f91612dda7030b3089ca4da7a (patch) | |
| tree | 2983f386fc8607cc658028d7ca595ce57af03d0c | |
| parent | 33d107aa1d3e1aa2c188f9df7338a1e7d97a4ed2 (diff) | |
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
| -rw-r--r-- | keystone/middleware/swift_auth.py | 6 | ||||
| -rw-r--r-- | tests/test_swift_auth_middleware.py | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/keystone/middleware/swift_auth.py b/keystone/middleware/swift_auth.py index 19f8cab9..08c00909 100644 --- a/keystone/middleware/swift_auth.py +++ b/keystone/middleware/swift_auth.py @@ -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} diff --git a/tests/test_swift_auth_middleware.py b/tests/test_swift_auth_middleware.py index ea585a76..7b432e8e 100644 --- a/tests/test_swift_auth_middleware.py +++ b/tests/test_swift_auth_middleware.py @@ -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', {}, '')]) |
