-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix ordering of DID document context (#3375)
* fix ordering of DID document context * add e2e-test to check all generated DID documents have the correct 0-th context --------- Co-authored-by: Gerard Snaauw <gerard.snaauw@nedap.com>
- Loading branch information
1 parent
b66f65d
commit 3a20c44
Showing
5 changed files
with
60 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
services: | ||
nodeA: | ||
image: "${IMAGE_NODE_A:-nutsfoundation/nuts-node:master}" | ||
ports: | ||
- "18081:8081" | ||
environment: | ||
NUTS_CONFIGFILE: /opt/nuts/nuts.yaml | ||
volumes: | ||
- "./nuts.yaml:/opt/nuts/nuts.yaml:ro" | ||
healthcheck: | ||
interval: 1s # Make test run quicker by checking health status more often |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/usr/bin/env bash | ||
source ../../util.sh | ||
|
||
echo "------------------------------------" | ||
echo "Cleaning up running Docker containers and volumes, and key material..." | ||
echo "------------------------------------" | ||
docker compose down | ||
docker compose rm -f -v | ||
|
||
echo "------------------------------------" | ||
echo "Starting Docker containers..." | ||
echo "------------------------------------" | ||
docker compose up -d --remove-orphans | ||
docker compose up --wait nodeA | ||
|
||
echo "------------------------------------" | ||
echo "Registering vendors..." | ||
echo "------------------------------------" | ||
|
||
# Create Subject | ||
DID_DOCS=$(curl -s -X POST http://localhost:18081/internal/vdr/v2/subject) | ||
# Get @context at index 0 from all DID Documents | ||
FIRST_CONTEXT=$(echo ${DID_DOCS} | jq -r '.documents[]["@context"][0]') | ||
COUNTER=0 | ||
for row in ${FIRST_CONTEXT}; do | ||
if [ "$row" != "https://www.w3.org/ns/did/v1" ]; then | ||
FAILING_DID=$(echo ${DID_DOCS} | jq -r ".documents[${COUNTER}].id") | ||
echo "First Context in DID Document '${FAILING_DID}' ($row) is not equal to https://www.w3.org/ns/did/v1" | ||
echo ${DID_DOCS} | jq -r .documents[${COUNTER}] | ||
docker compose stop | ||
exit 1 | ||
fi | ||
COUNTER=$((COUNTER + 1)) | ||
done | ||
|
||
echo "------------------------------------" | ||
echo "Stopping Docker containers..." | ||
echo "------------------------------------" | ||
docker compose stop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters