Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
0a3d829
New endpoint that show's agents ACL authorizations
namedgraph Feb 27, 2025
12f6801
Modal access request form
namedgraph Mar 1, 2025
30e8737
Reloading access matrix when agent select changes
namedgraph Mar 2, 2025
61dcadb
RDF/POST inputs in form-request-access
namedgraph Mar 3, 2025
23ee2b5
Access request endpoint
namedgraph Mar 4, 2025
189de44
Moved access endpoints to the admin app
namedgraph Mar 5, 2025
af5f966
Fixed authorization request form
namedgraph Mar 7, 2025
9273cbf
CSS fixes
namedgraph Mar 7, 2025
f6e2499
Request access form fixes
namedgraph Mar 8, 2025
c1e4f5e
Check acl:mode in AuthorizationFilter instead of authQuery
namedgraph Mar 9, 2025
3eceb49
Access endpoint uses SPARQL query to load document types and injects …
namedgraph Mar 9, 2025
a353b0a
`AuthorizationFilter` uses new `SERVICE`-less queries and gets `VALUE…
namedgraph Mar 9, 2025
a9e4c31
If accessTo document does not exist (has no types), retry PUT authori…
namedgraph Mar 10, 2025
a9fd02a
ACL query fixes
namedgraph Mar 10, 2025
33fb93e
AuthorizationFilter fixes
namedgraph Mar 10, 2025
95de18e
Restored $base binding
namedgraph Mar 10, 2025
eb85a42
Included nfo:FileDataObject case in the document type query
namedgraph Mar 10, 2025
26bdf6c
Include `ontologies/namespace/` as a special case in ownerAclQuery
namedgraph Mar 10, 2025
f11f1d3
Fixrd ACL for the `admin/clear` endpoint
namedgraph Mar 11, 2025
b0c5438
Only containers allow child documents
namedgraph Mar 11, 2025
5be3d91
Only root *and* containers allow child documents
namedgraph Mar 11, 2025
e0e3827
Fixed parent type value
namedgraph Mar 11, 2025
663da2b
Aligned HTTP tests with the new `AuthorizationFilter` behavior
namedgraph Mar 11, 2025
6a663fa
HTTP test fixes
namedgraph Mar 11, 2025
5977b2c
Cleanup
namedgraph Mar 11, 2025
076844c
Improved Java syntax
namedgraph Mar 11, 2025
4d59582
Removed `$Container` bindings
namedgraph Mar 11, 2025
fe87173
XSLT cleanup
namedgraph Mar 11, 2025
5277708
Create document owner authorization on the fly
namedgraph Mar 12, 2025
a87ebae
Check owner of parent document after checking its type
namedgraph Mar 12, 2025
6acc630
Extracted common utility functions from `AuthorizationFilter` and the…
namedgraph Mar 12, 2025
9cdfc06
Moved document type/owner query into the web.xml config
namedgraph Mar 12, 2025
6649b98
Access endpoint returns `lacl:OwnerAuthorization` as well
namedgraph Mar 12, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 7 additions & 14 deletions http-tests/admin/POST-request-access.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,20 @@ curl -w "%{http_code}\n" -o /dev/null -k -s \
--data-urlencode "rdf=" \
--data-urlencode "sb=request" \
--data-urlencode "pu=http://www.w3.org/1999/02/22-rdf-syntax-ns#type" \
--data-urlencode "ou=https://w3id.org/atomgraph/linkeddatahub/admin/acl#AuthorizationRequest" \
--data-urlencode "pu=https://w3id.org/atomgraph/linkeddatahub/admin/acl#requestAccessTo" \
--data-urlencode "ou=http://www.w3.org/ns/auth/acl#Authorization" \
--data-urlencode "pu=http://www.w3.org/ns/auth/acl#accessTo" \
--data-urlencode "ou=${END_USER_BASE_URL}sparql" \
--data-urlencode "pu=https://w3id.org/atomgraph/linkeddatahub/admin/acl#requestAccessToClass" \
--data-urlencode "pu=http://www.w3.org/ns/auth/acl#accessToClass" \
--data-urlencode "ou=https://w3id.org/atomgraph/linkeddatahub/default#Root" \
--data-urlencode "ou=https://www.w3.org/ns/ldt/document-hierarchy#Container" \
--data-urlencode "ou=https://www.w3.org/ns/ldt/document-hierarchy#Item" \
--data-urlencode "ou=http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#FileDataObject" \
--data-urlencode "pu=https://w3id.org/atomgraph/linkeddatahub/admin/acl#requestMode" \
--data-urlencode "pu=http://www.w3.org/ns/auth/acl#mode" \
--data-urlencode "ou=http://www.w3.org/ns/auth/acl#Read" \
--data-urlencode "ou=http://www.w3.org/ns/auth/acl#Write" \
--data-urlencode "pu=http://www.w3.org/2000/01/rdf-schema#label" \
--data-urlencode "ol=Access request by Test Agent" \
--data-urlencode "pu=https://w3id.org/atomgraph/linkeddatahub/admin/acl#requestAgent" \
--data-urlencode "pu=http://www.w3.org/ns/auth/acl#agent" \
--data-urlencode "ou=${AGENT_URI}" \
--data-urlencode "sb=request-item" \
--data-urlencode "pu=http://www.w3.org/1999/02/22-rdf-syntax-ns#type" \
--data-urlencode "ou=https://www.w3.org/ns/ldt/document-hierarchy#Item" \
--data-urlencode "pu=http://rdfs.org/sioc/ns#has_container" \
--data-urlencode "ou=${ADMIN_BASE_URL}acl/authorization-requests/" \
--data-urlencode "pu=http://xmlns.com/foaf/0.1/primaryTopic" \
--data-urlencode "ob=request" \
"${ADMIN_BASE_URL}request%20access" \
| grep -q "$STATUS_CREATED"
"${ADMIN_BASE_URL}access/request" \
| grep -q "$STATUS_OK"
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ initialize_dataset "$END_USER_BASE_URL" "$TMP_END_USER_DATASET" "$END_USER_ENDPO
initialize_dataset "$ADMIN_BASE_URL" "$TMP_ADMIN_DATASET" "$ADMIN_ENDPOINT_URL"
purge_cache "$END_USER_VARNISH_SERVICE"
purge_cache "$ADMIN_VARNISH_SERVICE"
purge_cache "$FRONTEND_VARNISH_SERVICE"

# test the "Request access" HTML form
# check that write access without authorization is forbidden

curl -k -w "%{http_code}\n" -o /dev/null -f -s \
-G \
curl -k -w "%{http_code}\n" -o /dev/null -s \
-X DELETE \
-E "$AGENT_CERT_FILE":"$AGENT_CERT_PWD" \
-H 'Accept: text/html' \
--data-urlencode "access-to=${END_USER_BASE_URL}" \
"${ADMIN_BASE_URL}request%20access" \
| grep -q "$STATUS_OK"
-H "Accept: application/n-triples" \
"$END_USER_BASE_URL" \
| grep -q "$STATUS_FORBIDDEN"
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ add-agent-to-group.sh \
--agent "$AGENT_URI" \
"${ADMIN_BASE_URL}acl/groups/writers/"

# check that access to graph with parent is allowed, but the graph is not found
# check that access to non-existing graph is forbidden

curl -k -w "%{http_code}\n" -o /dev/null -s -G \
-E "$AGENT_CERT_FILE":"$AGENT_CERT_PWD" \
-X DELETE \
-H "Accept: application/n-triples" \
"${END_USER_BASE_URL}non-existing/" \
| grep -q "$STATUS_NOT_FOUND"
| grep -q "$STATUS_FORBIDDEN"
2 changes: 1 addition & 1 deletion http-tests/document-hierarchy/DELETE.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ curl -k -w "%{http_code}\n" -o /dev/null -s -G \
-E "$AGENT_CERT_FILE":"$AGENT_CERT_PWD" \
-H "Accept: application/n-triples" \
"$container" \
| grep -q "$STATUS_NOT_FOUND"
| grep -q "$STATUS_FORBIDDEN"
4 changes: 2 additions & 2 deletions http-tests/document-hierarchy/GET-403.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ purge_cache "$END_USER_VARNISH_SERVICE"
purge_cache "$ADMIN_VARNISH_SERVICE"
purge_cache "$FRONTEND_VARNISH_SERVICE"

# check that non-existing graph is forbidden
# check that read access without authorization is forbidden

curl -k -w "%{http_code}\n" -o /dev/null -s -G \
-E "$AGENT_CERT_FILE":"$AGENT_CERT_PWD" \
"${END_USER_BASE_URL}non-existing/" \
"$END_USER_BASE_URL" \
| grep -q "$STATUS_FORBIDDEN"
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ curl -k -w "%{http_code}\n" -o /dev/null -s -G \
-E "$AGENT_CERT_FILE":"$AGENT_CERT_PWD" \
-H "Accept: application/n-triples" \
"${END_USER_BASE_URL}non-existing/" \
| grep -q "$STATUS_NOT_FOUND"
| grep -q "$STATUS_FORBIDDEN"
2 changes: 1 addition & 1 deletion http-tests/document-hierarchy/GET.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ add-agent-to-group.sh \
--agent "$AGENT_URI" \
"${ADMIN_BASE_URL}acl/groups/readers/"

# GET the graph (use Chrome's default Accept value)
# GET the graph

curl -k -w "%{http_code}\n" -o /dev/null -f -s -G \
-E "$AGENT_CERT_FILE":"$AGENT_CERT_PWD" \
Expand Down
30 changes: 30 additions & 0 deletions http-tests/document-hierarchy/PATCH-403.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env bash
set -euo pipefail

initialize_dataset "$END_USER_BASE_URL" "$TMP_END_USER_DATASET" "$END_USER_ENDPOINT_URL"
initialize_dataset "$ADMIN_BASE_URL" "$TMP_ADMIN_DATASET" "$ADMIN_ENDPOINT_URL"
purge_cache "$END_USER_VARNISH_SERVICE"
purge_cache "$ADMIN_VARNISH_SERVICE"
purge_cache "$FRONTEND_VARNISH_SERVICE"

# check that write access without authorization is forbidden

update=$(cat <<EOF
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>

INSERT
{
<${END_USER_BASE_URL}> rdf:_2 <${END_USER_BASE_URL}#whateverest>
}
WHERE
{}
EOF
)

curl -k -w "%{http_code}\n" -o /dev/null -s \
-E "$AGENT_CERT_FILE":"$AGENT_CERT_PWD" \
-X PATCH \
-H "Content-Type: application/sparql-update" \
"$END_USER_BASE_URL" \
--data-binary "$update" \
| grep -q "$STATUS_FORBIDDEN"
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ add-agent-to-group.sh \
--agent "$AGENT_URI" \
"${ADMIN_BASE_URL}acl/groups/writers/"

# check that access to graph with parent is allowed, but the graph is not found
# check that write access to non-existing graph is forbidden

update=$(cat <<EOF
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
Expand All @@ -37,4 +37,4 @@ curl -k -w "%{http_code}\n" -o /dev/null -s \
"${END_USER_BASE_URL}non-existing/" \
--data-binary "$update"
) \
| grep -q "$STATUS_NOT_FOUND"
| grep -q "$STATUS_FORBIDDEN"
2 changes: 1 addition & 1 deletion http-tests/document-hierarchy/POST-403.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ purge_cache "$END_USER_VARNISH_SERVICE"
purge_cache "$ADMIN_VARNISH_SERVICE"
purge_cache "$FRONTEND_VARNISH_SERVICE"

# check that non-existing graph is forbidden
# check that append access without authorization is forbidden

(
curl -k -w "%{http_code}\n" -o /dev/null -s \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ add-agent-to-group.sh \
--agent "$AGENT_URI" \
"${ADMIN_BASE_URL}acl/groups/writers/"

# check that access to graph with parent is allowed, but the graph is not found
# check that access to non-existing graph is forbidden

(
curl -k -w "%{http_code}\n" -o /dev/null -s \
Expand All @@ -27,4 +27,4 @@ curl -k -w "%{http_code}\n" -o /dev/null -s \
<http://s> <http://p> <http://o> .
EOF
) \
| grep -q "$STATUS_NOT_FOUND"
| grep -q "$STATUS_FORBIDDEN"
57 changes: 0 additions & 57 deletions http-tests/document-hierarchy/uploads/POST-rdf-source.sh

This file was deleted.

73 changes: 0 additions & 73 deletions http-tests/document-hierarchy/uploads/POST-rdf-upload.sh

This file was deleted.

1 change: 0 additions & 1 deletion http-tests/document-hierarchy/uploads/timbl.ttl

This file was deleted.

Loading