From 2d818c06b805b051996d605ef8ef5b5415bd6293 Mon Sep 17 00:00:00 2001 From: Thiago da Silva Date: Tue, 3 Dec 2013 18:06:21 -0500 Subject: fix issue with swauth-clean-token returning 403 errors The issue was due to missing a necessary change that was made when changing the auth account name from .auth to metadata volume. the auth account has a group of the same name, so the .auth account also had a .auth group, so we needed to change that too to the metadata volume (e.g., gsmetadata) Change-Id: Iaa3b7a1b2628f5b863807932e863593be0011a82 Signed-off-by: Thiago da Silva Reviewed-on: http://review.gluster.org/6416 Reviewed-by: Luis Pabon Tested-by: Luis Pabon --- test/unit/common/middleware/gswauth/swauth/test_middleware.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'test/unit/common/middleware/gswauth') diff --git a/test/unit/common/middleware/gswauth/swauth/test_middleware.py b/test/unit/common/middleware/gswauth/swauth/test_middleware.py index 46d634f..7bf44fe 100644 --- a/test/unit/common/middleware/gswauth/swauth/test_middleware.py +++ b/test/unit/common/middleware/gswauth/swauth/test_middleware.py @@ -805,6 +805,7 @@ class TestAuth(unittest.TestCase): self.assertEquals(self.test_auth.app.calls, 2) def test_get_token_for_auth_acct_success(self): + fmc = FakeMemcache() local_auth = \ auth.filter_factory({ 'super_admin_key': 'supertest', @@ -814,7 +815,7 @@ class TestAuth(unittest.TestCase): resp = Request.blank( '/auth/v1.0', environ={'REQUEST_METHOD': 'GET', - 'swift.cache': FakeMemcache()}, + 'swift.cache': fmc}, headers={'X-Auth-User': 'act:.super_admin', 'X-Auth-Key': 'supertest'}).get_response(local_auth) self.assertEquals(resp.status_int, 200) @@ -822,6 +823,9 @@ class TestAuth(unittest.TestCase): self.assertTrue(itk.startswith('AUTH_itk'), itk) self.assertEquals(resp.headers.get('x-storage-url'), 'http://127.0.0.1:8080/v1/AUTH_gsmd') + expires, groups = fmc.get('AUTH_/auth/%s' % itk) + self.assertEquals(groups, + 'gsmd,.reseller_admin,AUTH_gsmd') def test_get_token_for_auth_acct_fail_passwd(self): local_auth = \ @@ -3870,7 +3874,7 @@ class TestAuth(unittest.TestCase): self.assert_(expires > time(), expires) self.assertEquals( groups, - '.auth,.reseller_admin,AUTH_.auth') + 'gsmetadata,.reseller_admin,AUTH_gsmetadata') def test_get_admin_detail_fail_no_colon(self): self.test_auth.app = FakeApp(iter([])) -- cgit