Skip to content

Commit

Permalink
fix: set explicit context for ODRL (#70)
Browse files Browse the repository at this point in the history
fix: set explicit context for ODRL, remove DataAddress properties
  • Loading branch information
ndr-brt authored Jun 16, 2023
1 parent f78328a commit b348a62
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 59 deletions.
12 changes: 6 additions & 6 deletions transfer/transfer-01-file-transfer/contractoffer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"@context": {
"edc": "https://w3id.org/edc/v0.0.1/ns/"
"edc": "https://w3id.org/edc/v0.0.1/ns/",
"odrl": "http://www.w3.org/ns/odrl/2/"
},
"@type": "NegotiationInitiateRequestDto",
"connectorId": "provider",
Expand All @@ -12,13 +13,12 @@
"offerId": "1:test-document:3a75736e-001d-4364-8bd4-9888490edb58",
"assetId": "test-document",
"policy": {
"@context": "http://www.w3.org/ns/odrl.jsonld",
"@id": "1:test-document:13dce0f1-52ed-4554-a194-e83e92733ee5",
"@type": "set",
"permission": [],
"prohibition": [],
"obligation": [],
"target": "test-document"
"odrl:permission": [],
"odrl:prohibition": [],
"odrl:obligation": [],
"odrl:target": "test-document"
}
}
}
7 changes: 2 additions & 5 deletions transfer/transfer-01-file-transfer/filetransfer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,9 @@
},
"@type": "TransferRequestDto",
"dataDestination": {
"@type": "DataAddress",
"type": "File",
"properties": {
"path": "{path to destination file}",
"keyName": "keyName"
}
"path": "{path to destination file}",
"keyName": "keyName"
},
"protocol": "dataspace-protocol-http",
"assetId": "test-document",
Expand Down
8 changes: 3 additions & 5 deletions transfer/transfer-04-open-telemetry/filetransfer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
"assetId": "test-document",
"contractId": "{agreement ID}",
"dataDestination": {
"properties": {
"path": "/samples/output-file.txt",
"keyName": "keyName",
"type": "File"
}
"path": "/samples/output-file.txt",
"keyName": "keyName",
"type": "File"
},
"transferType": {
"contentType": "application/octet-stream",
Expand Down
9 changes: 3 additions & 6 deletions transfer/transfer-05-file-transfer-cloud/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,9 @@ curl --location --request POST 'http://localhost:9192/management/transferprocess
"assetId": "1",
"contractId": "<ContractAgreementId>",
"dataDestination": {
"properties": {
"type": "AmazonS3",
"region": "us-east-1",
"bucketName": "<Unique bucket name>"
},
"type": "AmazonS3"
"type": "AmazonS3",
"region": "us-east-1",
"bucketName": "<Unique bucket name>"
},
"managedResources": true,
"transferType": {
Expand Down
31 changes: 14 additions & 17 deletions transfer/transfer-06-consumer-pull-http/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,9 @@ curl -d '{
}
},
"dataAddress": {
"properties": {
"name": "Test asset",
"baseUrl": "https://jsonplaceholder.typicode.com/users",
"type": "HttpData"
}
"type": "HttpData",
"name": "Test asset",
"baseUrl": "https://jsonplaceholder.typicode.com/users"
}
}' -H 'content-type: application/json' http://localhost:19193/management/v2/assets \
-s | jq
Expand All @@ -205,15 +203,15 @@ This means that the consumer connector can request any asset from the provider c
```bash
curl -d '{
"@context": {
"edc": "https://w3id.org/edc/v0.0.1/ns/"
"edc": "https://w3id.org/edc/v0.0.1/ns/",
"odrl": "http://www.w3.org/ns/odrl/2/"
},
"@id": "aPolicy",
"policy": {
"@context": "http://www.w3.org/ns/odrl.jsonld",
"@type": "set",
"permission": [],
"prohibition": [],
"obligation": []
"odrl:permission": [],
"odrl:prohibition": [],
"odrl:obligation": []
}
}' -H 'content-type: application/json' http://localhost:19193/management/v2/policydefinitions \
-s | jq
Expand Down Expand Up @@ -344,7 +342,8 @@ send counter offers in addition to just confirming or declining an offer.
```bash
curl -d '{
"@context": {
"edc": "https://w3id.org/edc/v0.0.1/ns/"
"edc": "https://w3id.org/edc/v0.0.1/ns/",
"odrl": "http://www.w3.org/ns/odrl/2/"
},
"@type": "NegotiationInitiateRequestDto",
"connectorId": "provider",
Expand All @@ -356,13 +355,12 @@ curl -d '{
"offerId": "1:assetId:902a192a-dcc6-49d0-8c9f-17daa9303730",
"assetId": "assetId",
"policy": {
"@context": "http://www.w3.org/ns/odrl.jsonld",
"@id": "1:assetId:902a192a-dcc6-49d0-8c9f-17daa9303730",
"@type": "Set",
"permission": [],
"prohibition": [],
"obligation": [],
"target": "assetId"
"odrl:permission": [],
"odrl:prohibition": [],
"odrl:obligation": [],
"odrl:target": "assetId"
}
}
}' -X POST -H 'content-type: application/json' http://localhost:29193/management/v2/contractnegotiations \
Expand Down Expand Up @@ -450,7 +448,6 @@ curl -X POST "http://localhost:29193/management/v2/transferprocesses" \
"managedResources": false,
"protocol": "dataspace-protocol-http",
"dataDestination": {
"@type": "DataAddress",
"type": "HttpProxy"
}
}' \
Expand Down
35 changes: 15 additions & 20 deletions transfer/transfer-07-provider-push-http/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,9 @@ curl -d '{
}
},
"dataAddress": {
"properties": {
"name": "Test asset",
"baseUrl": "https://jsonplaceholder.typicode.com/users",
"type": "HttpData"
}
"name": "Test asset",
"baseUrl": "https://jsonplaceholder.typicode.com/users",
"type": "HttpData"
}
}' -H 'content-type: application/json' http://localhost:19193/management/v2/assets \
-s | jq
Expand All @@ -167,15 +165,15 @@ This means that the consumer connector can request any asset from the provider c
```bash
curl -d '{
"@context": {
"edc": "https://w3id.org/edc/v0.0.1/ns/"
"edc": "https://w3id.org/edc/v0.0.1/ns/",
"odrl": "http://www.w3.org/ns/odrl/2/"
},
"@id": "aPolicy",
"policy": {
"@context": "http://www.w3.org/ns/odrl.jsonld",
"@type": "set",
"permission": [],
"prohibition": [],
"obligation": []
"odrl:permission": [],
"odrl:prohibition": [],
"odrl:obligation": []
}
}' -H 'content-type: application/json' http://localhost:19193/management/v2/policydefinitions \
-s | jq
Expand Down Expand Up @@ -304,7 +302,8 @@ send counter offers in addition to just confirming or declining an offer.
```bash
curl -d '{
"@context": {
"edc": "https://w3id.org/edc/v0.0.1/ns/"
"edc": "https://w3id.org/edc/v0.0.1/ns/",
"odrl": "http://www.w3.org/ns/odrl/2/"
},
"@type": "NegotiationInitiateRequestDto",
"connectorId": "provider",
Expand All @@ -316,13 +315,12 @@ curl -d '{
"offerId": "1:assetId:902a192a-dcc6-49d0-8c9f-17daa9303730",
"assetId": "assetId",
"policy": {
"@context": "http://www.w3.org/ns/odrl.jsonld",
"@id": "1:assetId:902a192a-dcc6-49d0-8c9f-17daa9303730",
"@type": "Set",
"permission": [],
"prohibition": [],
"obligation": [],
"target": "assetId"
"odrl:permission": [],
"odrl:prohibition": [],
"odrl:obligation": [],
"odrl:target": "assetId"
}
}
}' -X POST -H 'content-type: application/json' http://localhost:29193/management/v2/contractnegotiations \
Expand Down Expand Up @@ -409,11 +407,8 @@ curl -X POST "http://localhost:29193/management/v2/transferprocesses" \
"managedResources": false,
"protocol": "dataspace-protocol-http",
"dataDestination": {
"@type": "DataAddress",
"type": "HttpData",
"properties": {
"baseUrl": "http://localhost:4000/api/consumer/store"
}
"baseUrl": "http://localhost:4000/api/consumer/store"
}
}' \
-s | jq
Expand Down

0 comments on commit b348a62

Please sign in to comment.