Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,18 @@ COPY platform/import-letsencrypt-stg-roots.sh import-letsencrypt-stg-roots.sh

COPY platform/select-root-services.rq select-root-services.rq

COPY platform/select-agent-metadata.rq select-agent-metadata.rq

# copy the metadata of built-in agents

COPY platform/root-secretary.trig.template root-secretary.trig.template

COPY platform/root-owner.trig.template root-owner.trig.template

COPY platform/root-secretary-authorization.trig.template root-secretary-authorization.trig.template

COPY platform/root-owner-authorization.trig.template root-owner-authorization.trig.template

# copy the metadata of the namespace ontology

COPY platform/namespace-ontology.trig.template namespace-ontology.trig.template
Expand Down
1 change: 1 addition & 0 deletions bin/add-generic-service.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env bash
set -eo pipefail

print_usage()
{
Expand Down
1 change: 1 addition & 0 deletions bin/add-result-set-chart.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env bash
set -eo pipefail

print_usage()
{
Expand Down
1 change: 1 addition & 0 deletions bin/add-select.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env bash
set -eo pipefail

print_usage()
{
Expand Down
1 change: 1 addition & 0 deletions bin/add-view.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env bash
set -eo pipefail

print_usage()
{
Expand Down
3 changes: 2 additions & 1 deletion bin/admin/acl/add-agent-to-group.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env bash
set -eo pipefail

print_usage()
{
Expand Down Expand Up @@ -79,4 +80,4 @@ sparql+="}\n"

# PATCH SPARQL to the named graph

echo -e "$sparql" | curl -X PATCH --data-binary @- -s -k -E "$cert_pem_file":"$cert_password" "$target" -H "Content-Type: application/sparql-update"
echo -e "$sparql" | curl -f -X PATCH --data-binary @- -s -k -E "$cert_pem_file":"$cert_password" "$target" -H "Content-Type: application/sparql-update"
1 change: 1 addition & 0 deletions bin/admin/acl/create-authorization.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env bash
set -eo pipefail

print_usage()
{
Expand Down
1 change: 1 addition & 0 deletions bin/admin/acl/create-group.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env bash
set -eo pipefail

print_usage()
{
Expand Down
3 changes: 2 additions & 1 deletion bin/admin/add-ontology-import.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env bash
set -eo pipefail

print_usage()
{
Expand Down Expand Up @@ -80,4 +81,4 @@ sparql+="}\n"

# PATCH SPARQL to the named graph

echo -e "$sparql" | curl -X PATCH --data-binary @- -v -k -E "$cert_pem_file":"$cert_password" "$target" -H "Content-Type: application/sparql-update"
echo -e "$sparql" | curl -f -X PATCH --data-binary @- -v -k -E "$cert_pem_file":"$cert_password" "$target" -H "Content-Type: application/sparql-update"
1 change: 1 addition & 0 deletions bin/admin/model/add-class.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env bash
set -eo pipefail

print_usage()
{
Expand Down
1 change: 1 addition & 0 deletions bin/admin/model/add-construct.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env bash
set -eo pipefail

print_usage()
{
Expand Down
1 change: 1 addition & 0 deletions bin/admin/model/add-property-constraint.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env bash
set -eo pipefail

print_usage()
{
Expand Down
1 change: 1 addition & 0 deletions bin/admin/model/add-restriction.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env bash
set -eo pipefail

print_usage()
{
Expand Down
1 change: 1 addition & 0 deletions bin/admin/model/add-select.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env bash
set -eo pipefail

print_usage()
{
Expand Down
1 change: 1 addition & 0 deletions bin/admin/model/create-ontology.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env bash
set -eo pipefail

print_usage()
{
Expand Down
1 change: 1 addition & 0 deletions bin/content/add-object-block.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env bash
set -eo pipefail

print_usage()
{
Expand Down
1 change: 1 addition & 0 deletions bin/content/add-xhtml-block.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env bash
set -eo pipefail

print_usage()
{
Expand Down
1 change: 1 addition & 0 deletions bin/create-container.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env bash
set -eo pipefail

print_usage()
{
Expand Down
1 change: 1 addition & 0 deletions bin/create-item.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env bash
set -eo pipefail

print_usage()
{
Expand Down
4 changes: 2 additions & 2 deletions bin/get.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ fi
# GET RDF document

if [ -n "$head" ] ; then
curl -v -k -E "$cert_pem_file":"$cert_password" -H "Accept: ${accept}" "$target" --head
curl -f -v -k -E "$cert_pem_file":"$cert_password" -H "Accept: ${accept}" "$target" --head
else
curl -v -k -E "$cert_pem_file":"$cert_password" -H "Accept: ${accept}" "$target"
curl -f -v -k -E "$cert_pem_file":"$cert_password" -H "Accept: ${accept}" "$target"
fi
1 change: 1 addition & 0 deletions bin/imports/create-csv-import.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env bash
set -eo pipefail

print_usage()
{
Expand Down
3 changes: 2 additions & 1 deletion bin/imports/create-file.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env bash
set -eo pipefail

print_usage()
{
Expand Down Expand Up @@ -176,7 +177,7 @@ if [ -n "$proxy" ]; then
fi

# POST RDF/POST multipart form and capture the effective URL
effective_url=$(echo -e "$rdf_post" | curl -w '%{url_effective}' -v -s -k -X PUT -H "Accept: text/turtle" -E "$cert_pem_file":"$cert_password" -o /dev/null --config - "$target")
effective_url=$(echo -e "$rdf_post" | curl -w '%{url_effective}' -f -v -s -k -X PUT -H "Accept: text/turtle" -E "$cert_pem_file":"$cert_password" -o /dev/null --config - "$target")

# If using proxy, rewrite the effective URL back to original hostname
if [ -n "$proxy" ]; then
Expand Down
1 change: 1 addition & 0 deletions bin/imports/create-query.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env bash
set -eo pipefail

print_usage()
{
Expand Down
1 change: 1 addition & 0 deletions bin/imports/create-rdf-import.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env bash
set -eo pipefail

print_usage()
{
Expand Down
2 changes: 1 addition & 1 deletion bin/patch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@ fi

# resolve SPARQL update from stdin against base URL and PATCH it to the server
# uparse currently does not support --base: https://github.com/apache/jena/issues/3296
cat - | curl -v -k -E "$cert_pem_file":"$cert_password" --data-binary @- -H "Content-Type: application/sparql-update" -X PATCH -o /dev/null "$final_url"
cat - | curl -f -v -k -E "$cert_pem_file":"$cert_password" --data-binary @- -H "Content-Type: application/sparql-update" -X PATCH -o /dev/null "$final_url"
2 changes: 1 addition & 1 deletion bin/post.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ else
fi

# resolve RDF document from stdin against base URL and POST to the server and print request URL
effective_url=$(cat - | turtle --base="$url" | curl -w '%{url_effective}' -v -k -E "$cert_pem_file":"$cert_password" -d @- -H "Content-Type: ${content_type}" -H "Accept: text/turtle" -o /dev/null "$final_url")
effective_url=$(cat - | turtle --base="$url" | curl -w '%{url_effective}' -f -v -k -E "$cert_pem_file":"$cert_password" -d @- -H "Content-Type: ${content_type}" -H "Accept: text/turtle" -o /dev/null "$final_url") || exit $?

# If using proxy, rewrite the effective URL back to original hostname
if [ -n "$proxy" ]; then
Expand Down
2 changes: 1 addition & 1 deletion bin/put.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ else
fi

# resolve RDF document from stdin against base URL and PUT to the server and print request URL
effective_url=$(cat - | turtle --base="$url" | curl -w '%{url_effective}' -v -k -E "$cert_pem_file":"$cert_password" -d @- -X PUT -H "Content-Type: ${content_type}" -H "Accept: text/turtle" -o /dev/null "$final_url")
effective_url=$(cat - | turtle --base="$url" | curl -w '%{url_effective}' -f -v -k -E "$cert_pem_file":"$cert_password" -d @- -X PUT -H "Content-Type: ${content_type}" -H "Accept: text/turtle" -o /dev/null "$final_url") || exit $?

# If using proxy, rewrite the effective URL back to original hostname
if [ -n "$proxy" ]; then
Expand Down
24 changes: 22 additions & 2 deletions http-tests/admin/acl/add-delete-authorization.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,27 @@ container=$(create-container.sh \
--slug "$slug" \
--parent "$END_USER_BASE_URL")

# create authorization
# create fake test.localhost authorization (should be filtered out)

create-authorization.sh \
-f "$OWNER_CERT_FILE" \
-p "$OWNER_CERT_PWD" \
-b "https://admin.test.localhost:4443/" \
--label "Fake DELETE authorization from test.localhost" \
--agent "$AGENT_URI" \
--to "$container" \
--write

# access is still denied (fake authorization filtered out)

curl -k -w "%{http_code}\n" -o /dev/null -s \
-E "$AGENT_CERT_FILE":"$AGENT_CERT_PWD" \
-H "Accept: application/n-triples" \
-X DELETE \
"$container" \
| grep -q "$STATUS_FORBIDDEN"

# create real localhost authorization

create-authorization.sh \
-f "$OWNER_CERT_FILE" \
Expand All @@ -39,7 +59,7 @@ create-authorization.sh \
--to "$container" \
--write

# access is allowed after authorization is created
# access is allowed after real authorization is created

curl -k -w "%{http_code}\n" -o /dev/null -f -s \
-E "$AGENT_CERT_FILE":"$AGENT_CERT_PWD" \
Expand Down
24 changes: 22 additions & 2 deletions http-tests/admin/acl/add-delete-class-authorization.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,27 @@ container=$(create-container.sh \
--slug "$slug" \
--parent "$END_USER_BASE_URL")

# create authorization
# create fake test.localhost authorization (should be filtered out)

create-authorization.sh \
-f "$OWNER_CERT_FILE" \
-p "$OWNER_CERT_PWD" \
-b "https://admin.test.localhost:4443/" \
--label "Fake DELETE class authorization from test.localhost" \
--agent "$AGENT_URI" \
--to-all-in "https://www.w3.org/ns/ldt/document-hierarchy#Container" \
--write

# access is still denied (fake authorization filtered out)

curl -k -w "%{http_code}\n" -o /dev/null -s \
-E "$AGENT_CERT_FILE":"$AGENT_CERT_PWD" \
-H "Accept: application/n-triples" \
-X DELETE \
"$container" \
| grep -q "$STATUS_FORBIDDEN"

# create real localhost authorization

create-authorization.sh \
-f "$OWNER_CERT_FILE" \
Expand All @@ -39,7 +59,7 @@ create-authorization.sh \
--to-all-in "https://www.w3.org/ns/ldt/document-hierarchy#Container" \
--write

# access is allowed after authorization is created
# access is allowed after real authorization is created

curl -k -w "%{http_code}\n" -o /dev/null -f -s \
-E "$AGENT_CERT_FILE":"$AGENT_CERT_PWD" \
Expand Down
24 changes: 22 additions & 2 deletions http-tests/admin/acl/add-delete-group-authorization.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,27 @@ container=$(create-container.sh \
--slug "$slug" \
--parent "$END_USER_BASE_URL")

# create authorization
# create fake test.localhost authorization (should be filtered out)

create-authorization.sh \
-f "$OWNER_CERT_FILE" \
-p "$OWNER_CERT_PWD" \
-b "https://admin.test.localhost:4443/" \
--label "Fake DELETE group authorization from test.localhost" \
--agent-group "$group" \
--to "$container" \
--write

# access is still denied (fake authorization filtered out)

curl -k -w "%{http_code}\n" -o /dev/null -s \
-E "$AGENT_CERT_FILE":"$AGENT_CERT_PWD" \
-H "Accept: application/n-triples" \
-X DELETE \
"$container" \
| grep -q "$STATUS_FORBIDDEN"

# create real localhost authorization

create-authorization.sh \
-f "$OWNER_CERT_FILE" \
Expand All @@ -55,7 +75,7 @@ create-authorization.sh \
--to "$container" \
--write

# access is allowed after authorization is created
# access is allowed after real authorization is created

curl -k -w "%{http_code}\n" -o /dev/null -f -s \
-E "$AGENT_CERT_FILE":"$AGENT_CERT_PWD" \
Expand Down
23 changes: 21 additions & 2 deletions http-tests/admin/acl/add-get-authorization.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,26 @@ curl -k -w "%{http_code}\n" -o /dev/null -s \
"$END_USER_BASE_URL" \
| grep -q "$STATUS_FORBIDDEN"

# create authorization
# create fake test.localhost authorization (should be filtered out)

create-authorization.sh \
-f "$OWNER_CERT_FILE" \
-p "$OWNER_CERT_PWD" \
-b "https://admin.test.localhost:4443/" \
--label "Fake GET authorization from test.localhost" \
--agent "$AGENT_URI" \
--to "$END_USER_BASE_URL" \
--read

# access is still denied (fake authorization filtered out)

curl -k -w "%{http_code}\n" -o /dev/null -s \
-E "$AGENT_CERT_FILE":"$AGENT_CERT_PWD" \
-H "Accept: application/n-triples" \
"$END_USER_BASE_URL" \
| grep -q "$STATUS_FORBIDDEN"

# create real localhost authorization

create-authorization.sh \
-f "$OWNER_CERT_FILE" \
Expand All @@ -26,7 +45,7 @@ create-authorization.sh \
--to "$END_USER_BASE_URL" \
--read

# access is allowed after authorization is created
# access is allowed after real authorization is created

curl -k -w "%{http_code}\n" -o /dev/null -f -s \
-E "$AGENT_CERT_FILE":"$AGENT_CERT_PWD" \
Expand Down
23 changes: 21 additions & 2 deletions http-tests/admin/acl/add-get-class-authorization.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,26 @@ curl -k -w "%{http_code}\n" -o /dev/null -s \
"$END_USER_BASE_URL" \
| grep -q "$STATUS_FORBIDDEN"

# create authorization
# create fake test.localhost authorization (should be filtered out)

create-authorization.sh \
-f "$OWNER_CERT_FILE" \
-p "$OWNER_CERT_PWD" \
-b "https://admin.test.localhost:4443/" \
--label "Fake GET Container authorization from test.localhost" \
--agent "$AGENT_URI" \
--to-all-in "https://w3id.org/atomgraph/linkeddatahub/default#Root" \
--read

# access is still denied (fake authorization filtered out)

curl -k -w "%{http_code}\n" -o /dev/null -s \
-E "$AGENT_CERT_FILE":"$AGENT_CERT_PWD" \
-H "Accept: application/n-triples" \
"$END_USER_BASE_URL" \
| grep -q "$STATUS_FORBIDDEN"

# create real localhost authorization

create-authorization.sh \
-f "$OWNER_CERT_FILE" \
Expand All @@ -26,7 +45,7 @@ create-authorization.sh \
--to-all-in "https://w3id.org/atomgraph/linkeddatahub/default#Root" \
--read

# access is allowed after authorization is created
# access is allowed after real authorization is created

curl -k -w "%{http_code}\n" -o /dev/null -f -s \
-E "$AGENT_CERT_FILE":"$AGENT_CERT_PWD" \
Expand Down
Loading