@@ -7,24 +7,45 @@ purge_cache "$END_USER_VARNISH_SERVICE"
77purge_cache " $ADMIN_VARNISH_SERVICE "
88purge_cache " $FRONTEND_VARNISH_SERVICE "
99
10- # test that the signed up agent accessing BASE_URL returns correct Link header with ACL modes (no Control)
10+ # add agent to the writers group
1111
12- RESPONSE_HEADERS=$( mktemp)
12+ add-agent-to-group.sh \
13+ -f " $OWNER_CERT_FILE " \
14+ -p " $OWNER_CERT_PWD " \
15+ --agent " $AGENT_URI " \
16+ " ${ADMIN_BASE_URL} acl/groups/writers/"
1317
14- curl -k -f \
18+ # create a new document to test ACL modes against
19+
20+ doc_url=$( create-item.sh \
21+ -b " $END_USER_BASE_URL " \
22+ -f " $AGENT_CERT_FILE " \
23+ -p " $AGENT_CERT_PWD " \
24+ --container " $END_USER_BASE_URL " \
25+ --title " ACL Test Document Agent" \
26+ --slug " acl-test-document-agent"
27+ )
28+
29+ # test that the signed up agent accessing the document returns correct Link header with ACL modes (no Control)
30+
31+ response_headers=$( mktemp)
32+
33+ curl -k -f -v \
1534 -E " $AGENT_CERT_FILE " :" $AGENT_CERT_PWD " \
1635 -H " Accept: application/n-triples" \
17- -D " $RESPONSE_HEADERS " \
36+ -D " $response_headers " \
1837 -o /dev/null \
19- " $END_USER_BASE_URL "
38+ " $doc_url "
39+
40+ cat " $response_headers "
2041
2142# check that each expected ACL mode is present in Link header (order independent)
2243# signed up agents should have Read, Write, Append but NOT Control
23- grep -q " Link:.*<http://www.w3.org/ns/auth/acl#Read>; rel=http://www.w3.org/ns/auth/acl#mode" " $RESPONSE_HEADERS "
24- grep -q " Link:.*<http://www.w3.org/ns/auth/acl#Write>; rel=http://www.w3.org/ns/auth/acl#mode" " $RESPONSE_HEADERS "
25- grep -q " Link:.*<http://www.w3.org/ns/auth/acl#Append>; rel=http://www.w3.org/ns/auth/acl#mode" " $RESPONSE_HEADERS "
44+ grep -q " Link:.*<http://www.w3.org/ns/auth/acl#Read>; rel=http://www.w3.org/ns/auth/acl#mode" " $response_headers "
45+ grep -q " Link:.*<http://www.w3.org/ns/auth/acl#Write>; rel=http://www.w3.org/ns/auth/acl#mode" " $response_headers "
46+ grep -q " Link:.*<http://www.w3.org/ns/auth/acl#Append>; rel=http://www.w3.org/ns/auth/acl#mode" " $response_headers "
2647
2748# verify Control mode is NOT present for signed up agent
28- ! grep -q " Link:.*<http://www.w3.org/ns/auth/acl#Control>; rel=http://www.w3.org/ns/auth/acl#mode" " $RESPONSE_HEADERS "
49+ ! grep -q " Link:.*<http://www.w3.org/ns/auth/acl#Control>; rel=http://www.w3.org/ns/auth/acl#mode" " $response_headers "
2950
30- rm " $RESPONSE_HEADERS "
51+ rm " $response_headers "
0 commit comments