150
150
self.assertEquals(resp.environ['swift.authorize'],
151
151
self.test_auth.authorize)
153
def test_override_asked_for_but_not_allowed(self):
155
auth.filter_factory({'allow_overrides': 'false'})(FakeApp())
156
req = self._make_request('/v1/AUTH_account',
157
environ={'swift.authorize_override': True})
158
resp = req.get_response(self.test_auth)
159
self.assertEquals(resp.status_int, 401)
160
self.assertEquals(resp.environ['swift.authorize'],
161
self.test_auth.authorize)
163
def test_override_asked_for_and_allowed(self):
165
auth.filter_factory({'allow_overrides': 'true'})(FakeApp())
166
req = self._make_request('/v1/AUTH_account',
167
environ={'swift.authorize_override': True})
168
resp = req.get_response(self.test_auth)
169
self.assertEquals(resp.status_int, 404)
170
self.assertTrue('swift.authorize' not in resp.environ)
172
def test_override_default_allowed(self):
173
req = self._make_request('/v1/AUTH_account',
174
environ={'swift.authorize_override': True})
175
resp = req.get_response(self.test_auth)
176
self.assertEquals(resp.status_int, 404)
177
self.assertTrue('swift.authorize' not in resp.environ)
153
179
def test_auth_deny_non_reseller_prefix(self):
154
180
resp = self._make_request('/v1/BLAH_account',
155
181
headers={'X-Auth-Token': 'BLAH_t'}).get_response(self.test_auth)