File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ set -euo pipefail
3+
4+ initialize_dataset " $END_USER_BASE_URL " " $TMP_END_USER_DATASET " " $END_USER_ENDPOINT_URL "
5+ initialize_dataset " $ADMIN_BASE_URL " " $TMP_ADMIN_DATASET " " $ADMIN_ENDPOINT_URL "
6+ purge_cache " $END_USER_VARNISH_SERVICE "
7+ purge_cache " $ADMIN_VARNISH_SERVICE "
8+ purge_cache " $FRONTEND_VARNISH_SERVICE "
9+
10+ # test that the signed up agent accessing BASE_URL returns correct Link header with ACL modes (no Control)
11+
12+ RESPONSE_HEADERS=$( mktemp)
13+
14+ curl -k -f -s \
15+ -E " $AGENT_CERT_FILE " :" $AGENT_CERT_PWD " \
16+ -H " Accept: application/n-triples" \
17+ -D " $RESPONSE_HEADERS " \
18+ -o /dev/null \
19+ " $END_USER_BASE_URL "
20+
21+ cat " $RESPONSE_HEADERS "
22+
23+ # check that each expected ACL mode is present in Link header (order independent)
24+ # signed up agents should have Read, Write, Append but NOT Control
25+ grep -q " Link:.*<http://www.w3.org/ns/auth/acl#Read>; rel=http://www.w3.org/ns/auth/acl#mode" " $RESPONSE_HEADERS "
26+ grep -q " Link:.*<http://www.w3.org/ns/auth/acl#Write>; rel=http://www.w3.org/ns/auth/acl#mode" " $RESPONSE_HEADERS "
27+ grep -q " Link:.*<http://www.w3.org/ns/auth/acl#Append>; rel=http://www.w3.org/ns/auth/acl#mode" " $RESPONSE_HEADERS "
28+
29+ # verify Control mode is NOT present for signed up agent
30+ ! grep -q " Link:.*<http://www.w3.org/ns/auth/acl#Control>; rel=http://www.w3.org/ns/auth/acl#mode" " $RESPONSE_HEADERS "
31+
32+ rm " $RESPONSE_HEADERS "
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ set -euo pipefail
3+
4+ initialize_dataset " $END_USER_BASE_URL " " $TMP_END_USER_DATASET " " $END_USER_ENDPOINT_URL "
5+ initialize_dataset " $ADMIN_BASE_URL " " $TMP_ADMIN_DATASET " " $ADMIN_ENDPOINT_URL "
6+ purge_cache " $END_USER_VARNISH_SERVICE "
7+ purge_cache " $ADMIN_VARNISH_SERVICE "
8+ purge_cache " $FRONTEND_VARNISH_SERVICE "
9+
10+ # test that the owner agent accessing BASE_URL returns correct Link header with all ACL modes
11+
12+ RESPONSE_HEADERS=$( mktemp)
13+
14+ curl -k -f -s \
15+ -E " $OWNER_CERT_FILE " :" $OWNER_CERT_PWD " \
16+ -H " Accept: application/n-triples" \
17+ -D " $RESPONSE_HEADERS " \
18+ -o /dev/null \
19+ " $END_USER_BASE_URL "
20+
21+ # check that each ACL mode is present in Link header (order independent)
22+ grep -q " Link:.*<http://www.w3.org/ns/auth/acl#Read>; rel=http://www.w3.org/ns/auth/acl#mode" " $RESPONSE_HEADERS "
23+ grep -q " Link:.*<http://www.w3.org/ns/auth/acl#Write>; rel=http://www.w3.org/ns/auth/acl#mode" " $RESPONSE_HEADERS "
24+ grep -q " Link:.*<http://www.w3.org/ns/auth/acl#Append>; rel=http://www.w3.org/ns/auth/acl#mode" " $RESPONSE_HEADERS "
25+ grep -q " Link:.*<http://www.w3.org/ns/auth/acl#Control>; rel=http://www.w3.org/ns/auth/acl#mode" " $RESPONSE_HEADERS "
26+
27+ rm " $RESPONSE_HEADERS "
You can’t perform that action at this time.
0 commit comments