def test_override_asked_for_and_allowed(self): conf = {'allow_overrides': 'true'} self.test_auth = swift_auth.filter_factory(conf)(FakeApp()) req = self._make_request('/v1/AUTH_account', environ={'swift.authorize_override': True}) resp = req.get_response(self.test_auth) self.assertEquals(resp.status_int, 404)
def test_confirmed_identity_is_authorized(self): role = self.test_auth.reseller_admin_role headers = self._get_identity_headers(role=role) req = self._make_request('/v1/AUTH_acct/c', headers) response_iter = iter([('200 OK', {}, '')]) test_auth = swift_auth.filter_factory({})( FakeApp(response_iter)) resp = req.get_response(test_auth) self.assertEquals(resp.status_int, 200)
def setUp(self): self.test_auth = swift_auth.filter_factory({})(FakeApp())
def test_blank_reseller_prefix(self): conf = {'reseller_prefix': ''} test_auth = swift_auth.filter_factory(conf)(FakeApp()) account = tenant_id = 'foo' self.assertTrue(test_auth._reseller_check(account, tenant_id))
def _get_successful_middleware(self): response_iter = iter([('200 OK', {}, '')]) return swift_auth.filter_factory({})(FakeApp(response_iter))