diff options
author | James E. Blair <jim@acmegating.com> | 2022-09-24 09:25:48 -0700 |
---|---|---|
committer | James E. Blair <jim@acmegating.com> | 2022-10-06 15:38:24 -0700 |
commit | 5e6dbf2001fdb4f99f616a33a0fe2f6b44613062 (patch) | |
tree | 8b74c11f0002cfc8dc1543316b38295e36f56739 /tests/unit/test_web.py | |
parent | 3a0eaa1ffea1a32d4f11864485f2883194a99354 (diff) | |
download | zuul-5e6dbf2001fdb4f99f616a33a0fe2f6b44613062.tar.gz |
Remove unused /api/user/authorizations REST endpoint
This has not beeen used for a while and can be removed. This will
simplify the authorization code in zuul-web.
Change-Id: I0fa6c4fb87672c44d3f97db0be558737b4f102bc
Diffstat (limited to 'tests/unit/test_web.py')
-rw-r--r-- | tests/unit/test_web.py | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/tests/unit/test_web.py b/tests/unit/test_web.py index d8901fabb..96bc503ff 100644 --- a/tests/unit/test_web.py +++ b/tests/unit/test_web.py @@ -2394,10 +2394,6 @@ class TestTenantScopedWebApi(BaseTestWeb): {'action': 'authorizations', 'path': 'api/tenant/my-tenant/authorizations', 'allowed_methods': ['GET', ]}, - # TODO (mhu) deprecated, remove in next version - {'action': 'authorizations', - 'path': 'api/user/authorizations', - 'allowed_methods': ['GET', ]}, ] for endpoint in endpoints: preflight = self.options_url( @@ -2853,10 +2849,6 @@ class TestTenantScopedWebApiWithAuthRules(BaseTestWeb): 'exp': time.time() + 3600} token = jwt.encode(authz, key='NoDanaOnlyZuul', algorithm='HS256') - # TODO(mhu) deprecated, remove after next release - req = self.get_url('/api/user/authorizations', - headers={'Authorization': 'Bearer %s' % token}) - self.assertEqual(401, req.status_code, req.text) req = self.get_url('/api/tenant/tenant-one/authorizations', headers={'Authorization': 'Bearer %s' % token}) self.assertEqual(401, req.status_code, req.text) @@ -2895,19 +2887,6 @@ class TestTenantScopedWebApiWithAuthRules(BaseTestWeb): authz['exp'] = time.time() + 3600 token = jwt.encode(authz, key='NoDanaOnlyZuul', algorithm='HS256') - # TODO(mhu) deprecated, remove after next release - req = self.get_url('/api/user/authorizations', - headers={'Authorization': 'Bearer %s' % token}) - self.assertEqual(200, req.status_code, req.text) - data = req.json() - self.assertTrue('zuul' in data, - "%s got %s" % (authz['sub'], data)) - self.assertTrue('admin' in data['zuul'], - "%s got %s" % (authz['sub'], data)) - self.assertEqual(test_user['zuul.admin'], - data['zuul']['admin'], - "%s got %s" % (authz['sub'], data)) - req = self.get_url('/api/tenant/tenant-one/authorizations', headers={'Authorization': 'Bearer %s' % token}) self.assertEqual(200, req.status_code, req.text) @@ -2942,9 +2921,6 @@ class TestTenantScopedWebApiWithAuthRules(BaseTestWeb): """Test that missing Authorization header results in HTTP 401""" req = self.get_url('/api/tenant/tenant-one/authorizations') self.assertEqual(401, req.status_code, req.text) - # TODO(mhu) deprecated, remove after next release - req = self.get_url('/api/user/authorizations') - self.assertEqual(401, req.status_code, req.text) class TestTenantScopedWebApiTokenWithExpiry(BaseTestWeb): |