Skip to content

Commit

Permalink
Revert "chore(e2e): reflect some api changes"
Browse files Browse the repository at this point in the history
This reverts commit bdf3f37.
  • Loading branch information
arnoweiss committed Aug 1, 2024
1 parent bdf3f37 commit bd810c7
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 45 deletions.
18 changes: 11 additions & 7 deletions docs/tutorials/e2e/boost/consumeData.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Alice finds the Asset with the ID 3 and the description "Product EDC Demo Asset
## Negotiate a contract

:::info
Don't forget to change the `offerId` with the one you received in the previous step in your catalog request.
Dont forget to change the `offerId`with the one you received in the previous step in your catalog request.
:::

But before she can transfer the data, she must negotiate the contract with Bob. To do this, she uses the following `curl` command:
Expand Down Expand Up @@ -78,7 +78,8 @@ The response should look like this:
"tx": "https://w3id.org/tractusx/v0.0.1/ns/",
"edc": "https://w3id.org/edc/v0.0.1/ns/",
"dcat": "https://www.w3.org/ns/dcat/",
"odrl": "http://www.w3.org/ns/odrl/2/"
"odrl": "http://www.w3.org/ns/odrl/2/",
"dspace": "https://w3id.org/dspace/v0.8/"
}
}
```
Expand All @@ -100,7 +101,7 @@ curl --location 'http://dataconsumer-1-controlplane.tx.test/management/v2/contra
--header 'X-Api-Key: TEST1' | jq
```

- If the negotiation was **successful**, Alice will see an output as shown below.
- If the negotiation was **successful**, Alice will see an ouput as shown below.
- If the negotiation was **unsuccessful**, the negotiation state (`edc:state`) will be `TERMINATED` and no contract agreement ID will be present.

```json
Expand All @@ -120,7 +121,8 @@ curl --location 'http://dataconsumer-1-controlplane.tx.test/management/v2/contra
"tx": "https://w3id.org/tractusx/v0.0.1/ns/",
"edc": "https://w3id.org/edc/v0.0.1/ns/",
"dcat": "https://www.w3.org/ns/dcat/",
"odrl": "http://www.w3.org/ns/odrl/2/"
"odrl": "http://www.w3.org/ns/odrl/2/",
"dspace": "https://w3id.org/dspace/v0.8/"
}
}
```
Expand Down Expand Up @@ -178,7 +180,8 @@ The response in this case looks like this:
"tx": "https://w3id.org/tractusx/v0.0.1/ns/",
"edc": "https://w3id.org/edc/v0.0.1/ns/",
"dcat": "https://www.w3.org/ns/dcat/",
"odrl": "http://www.w3.org/ns/odrl/2/"
"odrl": "http://www.w3.org/ns/odrl/2/",
"dspace": "https://w3id.org/dspace/v0.8/"
}
}
```
Expand Down Expand Up @@ -226,7 +229,8 @@ curl --location 'http://dataconsumer-1-controlplane.tx.test/management/v2/transf
"tx": "https://w3id.org/tractusx/v0.0.1/ns/",
"edc": "https://w3id.org/edc/v0.0.1/ns/",
"dcat": "https://www.w3.org/ns/dcat/",
"odrl": "http://www.w3.org/ns/odrl/2/"
"odrl": "http://www.w3.org/ns/odrl/2/",
"dspace": "https://w3id.org/dspace/v0.8/"
}
}
```
Expand Down Expand Up @@ -274,7 +278,7 @@ curl -X GET -H 'Authorization: eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjE3MTU2NzA1MDEsImRh
```

:::info
Currently the response for this curl command is
Currently the response for this curl commoand is

```json
{
Expand Down
49 changes: 24 additions & 25 deletions docs/tutorials/e2e/boost/dtrTutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ To ensure that Bob's DTR becomes visible for Alice and to start the data exchang

Action (Bob): Create a data asset using the following command:

(note: that the "http://purl.org/dc/terms/type" property is standardized with "https://w3id.org/catenax/taxonomy#DigitalTwinRegistry" for the Digital Twin Registry.)
(note: that the "asset:prop:type" is standardized with "data.core.digitalTwinRegistry" for the Digital Twin Registry.)

```curl --location 'http://dataprovider-controlplane.tx.test/management/v3/assets' \
--header 'Content-Type: application/json' \
Expand Down Expand Up @@ -73,11 +73,11 @@ Action (Bob): Create a data asset using the following command:
}'
```

As per the current standards, there is no need to proxy the HTTP method. If there is (for instance due to a proprietary query endpoint), the data provider must ensure that the technical user that the registered credentials abstract does NOT have the power to manipulate the DTR's data (for instance via the `PUT /shell-descriptors/{{aasId}}` API.
As per the current standards, there is no need to proxy the HTTP method. If there is (for instance due to a proprietary query endpoint), the data provider must ensure thatthat the technical user that the registered credentials abstract does NOT have the power to manipulate the DTR's data (for instance via the `PUT /shell-descriptors/{{aasId}}` API.

#### Create a policy

After Bob has created a data asset, he must define a BPN-restrictive policy in order to give Alice access to the asset. This policy is not standardized and can be chosen according to its needs. Bob wants to define the policy that only Alice can see the DTR Asset.
After Bob has created an data asset, he must define a BPN-restrictive policy in order to give Alice access to the asset. This policy is not standardized and can be chosen according to its needs. Bob wants to define the policy that only Alice can see the DTR Asset.

Action (Bob): Defines the access policy using the following command:

Expand All @@ -86,25 +86,24 @@ Action (Bob): Defines the access policy using the following command:
"@context": {
"odrl": "http://www.w3.org/ns/odrl/2/"
},
"@type": "PolicyDefinition",
"@type": "PolicyDefinitionRequestDto",
"@id": "{{POLICY_ID}}",
"policy": {
"@type": "Policy",
"odrl:permission" : [{
"odrl:action" : "USE",
"odrl:constraint" : {
"@type": "LogicalConstraint",
"odrl:or" : [{
"@type" : "Constraint",
"odrl:leftOperand" : "BusinessPartnerNumber",
"odrl:operator" :
{
"@id": "odrl:eq"
},
"odrl:rightOperand" : "{{CONSUMER_BPN}}"
}]
}
}]
"@type": "Policy",
"odrl:permission" : [{
"odrl:action" : "USE",
"odrl:constraint" : {
"@type": "LogicalConstraint",
"odrl:or" : [{
"@type" : "Constraint",
"odrl:leftOperand" : "BusinessPartnerNumber",
"odrl:operator" : {
"@id": "odrl:eq"
},
"odrl:rightOperand" : "{{CONSUMER_BPN}}"
}]
}
}]
}
}
```
Expand All @@ -123,7 +122,7 @@ Action (Bob): Create the contract policy using the following command:
"accessPolicyId": "{{ACCESS_POLICY_ID}}",
"contractPolicyId": "{{CONTRACT_POLICY_ID}}",
"assetsSelector" : {
"@type" : "Criterion",
"@type" : "CriterionDto",
"operandLeft": "{{EDC_NAMESPACE}}id",
"operator": "=",
"operandRight": "{{ASSET_ID}}"
Expand Down Expand Up @@ -216,11 +215,11 @@ curl -i -X POST "${edcManagementBaseUrl}/v3/assets" -H "X-Api-Key: ${edcApiKey}"
Action (Bob): Create a Policy with the following commands:

```curl
curl -i -X POST "${edcManagementBaseUrl}/v3/policydefinitions" -H "X-Api-Key: ${edcApiKey}" -H "Content-Type: application/json" --data-raw "{
curl -i -X POST "${edcManagementBaseUrl}/v2/policydefinitions" -H "X-Api-Key: ${edcApiKey}" -H "Content-Type: application/json" --data-raw "{
\"@context\": {
\"odrl\": \"http://www.w3.org/ns/odrl/2/\"
},
\"@type\": \"PolicyDefinition\",
\"@type\": \"PolicyDefinitionRequestDto\",
\"@id\": \"${policyId}\",
\"policy\": {
\"@type\": \"Policy\",
Expand All @@ -238,14 +237,14 @@ curl -i -X POST "${edcManagementBaseUrl}/v3/policydefinitions" -H "X-Api-Key: ${
Action (Bob): Create a contract definition with the following commands:

```curl
curl -i -X POST "${edcManagementBaseUrl}/v3/contractdefinitions" -H "X-Api-Key: ${edcApiKey}" -H "Content-Type: application/json" --data-raw "{
curl -i -X POST "${edcManagementBaseUrl}/v2/contractdefinitions" -H "X-Api-Key: ${edcApiKey}" -H "Content-Type: application/json" --data-raw "{
\"@context\": {},
\"@id\": \"${contractDefinitionId}\",
\"@type\": \"ContractDefinition\",
\"accessPolicyId\": \"${policyId}\",
\"contractPolicyId\": \"${policyId}\",
\"assetsSelector\" : {
\"@type\" : \"Criterion\",
\"@type\" : \"CriterionDto\",
\"operandLeft\": \"https://w3id.org/edc/v0.0.1/ns/id\",
\"operator\": \"=\",
\"operandRight\": \"${assetId}\"
Expand Down
12 changes: 6 additions & 6 deletions docs/tutorials/e2e/boost/provideData.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ curl --location 'http://dataprovider-controlplane.tx.test/management/v3/assets'
Just to be sure, that the asset was created succesfully, Bob can check the asset using the following `curl` command:

```shell
curl -X POST http://dataprovider-controlplane.tx.test/management/v3/assets/request -H "x-api-key: TEST2" -H "content-type: application/json" | jq
curl -X POST http://dataprovider-controlplane.tx.test/management/v2/assets/request -H "x-api-key: TEST2" -H "content-type: application/json" | jq
```

The result shows the already existing assets and the newly created asset.
Expand Down Expand Up @@ -132,7 +132,7 @@ Bob tells Alice, that he created an asset, and she should now be able to request
Action (Alice): Execute a request using the following `curl` commands:

```shell
curl --location 'http://dataconsumer-1-controlplane.tx.test/management/v3/catalog/request' \
curl --location 'http://dataconsumer-1-controlplane.tx.test/management/v2/catalog/request' \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: TEST1' \
--data-raw '{
Expand Down Expand Up @@ -274,7 +274,7 @@ Alice calls Bob and says she can´t see the asset. Bob remembers that he did not
Action (Bob): Create the access policy using the following `curl` command:

```shell
curl --location 'http://dataprovider-controlplane.tx.test/management/v3/policydefinitions' \
curl --location 'http://dataprovider-controlplane.tx.test/management/v2/policydefinitions' \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: TEST2' \
--data-raw '{
Expand Down Expand Up @@ -314,7 +314,7 @@ Now that Bob created an access policy, Alice can once again try to access Bob's
Action (Alice): Execute the request again using the following `curl` command:

```shell
curl --location 'http://dataconsumer-1-controlplane.tx.test/management/v3/catalog/request' \
curl --location 'http://dataconsumer-1-controlplane.tx.test/management/v2/catalog/request' \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: TEST1' \
--data-raw '{
Expand Down Expand Up @@ -352,7 +352,7 @@ Since an access policy has already been created, a contract policy must be creat
Action (BoB): Create the contract policy using the following `curl` command:

```shell
curl --location 'http://dataprovider-controlplane.tx.test/management/v3/policydefinitions' \
curl --location 'http://dataprovider-controlplane.tx.test/management/v2/policydefinitions' \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: TEST2' \
--data-raw '{
Expand Down Expand Up @@ -430,7 +430,7 @@ Let´s see if Alice can finally see the Asset.
Action (Alice): Execute the request again using the following `curl` command:

```shell
curl --location 'http://dataconsumer-1-controlplane.tx.test/management/v3/catalog/request' \
curl --location 'http://dataconsumer-1-controlplane.tx.test/management/v2/catalog/request' \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: TEST1' \
--data-raw '{
Expand Down
14 changes: 7 additions & 7 deletions docs/tutorials/e2e/boost/restrictData.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ Now that the asset has been created, Bob creates an access policy that defines w
Action (Bob): Create the access policy using the following `curl` command:

```shell
curl --location 'http://dataprovider-controlplane.tx.test/management/v3/policydefinitions' \
curl --location 'http://dataprovider-controlplane.tx.test/management/v2/policydefinitions' \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: TEST2' \
--data-raw '{
"@context": {
"odrl": "http://www.w3.org/ns/odrl/2/"
},
"@type": "PolicyDefinition",
"@type": "PolicyDefinitionRequestDto",
"@id": "41",
"policy": {
"@type": "Policy",
Expand Down Expand Up @@ -96,14 +96,14 @@ Since an access policy has already been created, a contract policy must be creat
Action (Bob): Create the contract policy using the following `curl` command:

```shell
curl --location 'http://dataprovider-controlplane.tx.test/management/v3/policydefinitions' \
curl --location 'http://dataprovider-controlplane.tx.test/management/v2/policydefinitions' \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: TEST2' \
--data-raw '{
"@context": {
"odrl": "http://www.w3.org/ns/odrl/2/"
},
"@type": "PolicyDefinition",
"@type": "PolicyDefinitionRequestDto",
"@id": "42",
"policy": {
"@type": "Policy",
Expand Down Expand Up @@ -153,7 +153,7 @@ Lastly, the asset and the access policy must be linked in a contract definition.
Action (Bob): Create a contract definition including the asset and the policies you have created. For this, use the following `curl` command:

```shell
curl --location 'http://dataprovider-controlplane.tx.test/management/v3/contractdefinitions' \
curl --location 'http://dataprovider-controlplane.tx.test/management/v2/contractdefinitions' \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: TEST2' \
--data-raw '{
Expand All @@ -163,7 +163,7 @@ curl --location 'http://dataprovider-controlplane.tx.test/management/v3/contract
"accessPolicyId": "41",
"contractPolicyId": "42",
"assetsSelector" : {
"@type" : "Criterion",
"@type" : "CriterionDto",
"operandLeft": "https://w3id.org/edc/v0.0.1/ns/id",
"operator": "=",
"operandRight": "4"
Expand Down Expand Up @@ -196,7 +196,7 @@ Let´s see if Alice can see the Asset.
Action (Alice): Execute a request using the following `curl` command:

```shell
curl --location 'http://dataconsumer-1-controlplane.tx.test/management/v3/catalog/request' \
curl --location 'http://dataconsumer-1-controlplane.tx.test/management/v2/catalog/request' \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: TEST1' \
--data-raw '{
Expand Down

0 comments on commit bd810c7

Please sign in to comment.