mirror of
https://github.com/webrecorder/pywb.git
synced 2025-03-15 00:03:28 +01:00
Add test
This commit is contained in:
parent
c27ff67c44
commit
7c5fa48667
1
sample_archive/access/allow_all.aclj
Normal file
1
sample_archive/access/allow_all.aclj
Normal file
@ -0,0 +1 @@
|
|||||||
|
*, - {"access": "allow", "user": "staff"}
|
@ -62,6 +62,13 @@ collections:
|
|||||||
acl_paths:
|
acl_paths:
|
||||||
- ./sample_archive/access/pywb.aclj
|
- ./sample_archive/access/pywb.aclj
|
||||||
|
|
||||||
|
pywb-wildcard-surt:
|
||||||
|
index_paths: ./sample_archive/cdx/
|
||||||
|
archive_paths: ./sample_archive/warcs/
|
||||||
|
default_access: block
|
||||||
|
acl_paths:
|
||||||
|
- ./sample_archive/access/allow_all.aclj
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -96,5 +96,9 @@ class TestACLApp(BaseConfigTest):
|
|||||||
|
|
||||||
assert '"http://httpbin.org/anything/resource.json"' in resp.text
|
assert '"http://httpbin.org/anything/resource.json"' in resp.text
|
||||||
|
|
||||||
|
def test_allow_all_acl_user_specific(self):
|
||||||
|
resp = self.testapp.get('/pywb-wildcard-surt/mp_/http://example.com/', status=451)
|
||||||
|
|
||||||
|
assert 'Access Blocked' in resp.text
|
||||||
|
|
||||||
|
resp = self.testapp.get('/pywb-wildcard-surt/mp_/http://example.com/', headers={"X-Pywb-Acl-User": "staff"}, status=200)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user