Skip to content

Commit

Permalink
chore(protocol): switch default to /api/v1/dsp
Browse files Browse the repository at this point in the history
  • Loading branch information
wolf4ood committed May 29, 2023
1 parent cb80327 commit 9eede8f
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 104 deletions.
2 changes: 1 addition & 1 deletion charts/tractusx-connector-azure-vault/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ controlplane:
# -- port for incoming api calls
port: 8084
# -- path for incoming api calls
path: /api/v1/ids
path: /api/v1/dsp
# -- metrics api, used for application metrics, must not be internet facing
metrics:
# -- port for incoming api calls
Expand Down
2 changes: 1 addition & 1 deletion charts/tractusx-connector-memory/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ runtime:
# -- port for incoming api calls
port: 8084
# -- path for incoming api calls
path: /api/v1/ids
path: /api/v1/dsp
# -- observability api with unsecured access, must not be internet facing
observability:
# -- port for incoming API calls
Expand Down
2 changes: 1 addition & 1 deletion charts/tractusx-connector/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ controlplane:
# -- port for incoming api calls
port: 8084
# -- path for incoming api calls
path: /api/v1/ids
path: /api/v1/dsp
# -- metrics api, used for application metrics, must not be internet facing
metrics:
# -- port for incoming api calls
Expand Down
110 changes: 12 additions & 98 deletions docs/development/postman/collection.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
{
"info": {
"_postman_id": "a0ba0a29-d90c-41d9-a581-4348a1ab342d",
"name": "product-edc_my_environment_new_DSP",
"_postman_id": "64e409d9-3fd0-4b85-8de9-df1094a58400",
"name": "tractusx-edc_dsp",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"_exporter_id": "6134257",
"_collection_link": "https://interstellar-comet-6468.postman.co/workspace/My-Workspace~c263a823-c6ce-4746-8d47-2b5211c34d92/collection/6134257-a0ba0a29-d90c-41d9-a581-4348a1ab342d?action=share&creator=6134257&source=collection_link"
"_exporter_id": "27652630"
},
"item": [
{
Expand Down Expand Up @@ -327,7 +326,7 @@
"header": [],
"body": {
"mode": "raw",
"raw": "{\r\n \"@context\": {},\r\n \"protocol\": \"dataspace-protocol-http\",\r\n \"providerUrl\": \"http://plato-controlplane:8084/protocol/api/v1/ids\",\r\n \"querySpec\": {\r\n \"offset\": 0,\r\n \"limit\": 100,\r\n \"filter\": \"\",\r\n \"range\": {\r\n \"from\": 0,\r\n \"to\": 100\r\n },\r\n \"sortField\": \"\",\r\n \"criterion\": \"\"\r\n }\r\n}",
"raw": "{\r\n \"@context\": {},\r\n \"protocol\": \"dataspace-protocol-http\",\r\n \"providerUrl\": \"{{PROVIDER_IDS_URL}}\",\r\n \"querySpec\": {\r\n \"offset\": 0,\r\n \"limit\": 100,\r\n \"filter\": \"\",\r\n \"range\": {\r\n \"from\": 0,\r\n \"to\": 100\r\n },\r\n \"sortField\": \"\",\r\n \"criterion\": \"\"\r\n }\r\n}",
"options": {
"raw": {
"language": "json"
Expand Down Expand Up @@ -369,7 +368,7 @@
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"@context\": {\n \"odrl\": \"http://www.w3.org/ns/odrl/2/\"\n },\n \"@type\": \"NegotiationInitiateRequestDto\",\n \"connectorId\": \"99:83:A7:17:86:FF:98:93:CE:A0:DD:A1:F1:36:FA:F6:0F:75:0A:23:keyid:99:83:A7:17:86:FF:98:93:CE:A0:DD:A1:F1:36:FA:F6:0F:75:0A:23\",\n \"connectorAddress\": \"{{PROVIDER_IDS_URL}}/api/v1/ids\",\n \"protocol\": \"dataspace-protocol-http\",\n \"providerId\": \"urn:connector:provider\",\n \"offer\": {\n \"offerId\": \"4:4:b7e07c85-ea9c-4439-b952-e7dfaf075868\",\n \"assetId\": \"{{ASSET_ID}}\",\n \"policy\": {\n \"@id\": \"4:4:b7e07c85-ea9c-4439-b952-e7dfaf075868\",\n \"@type\": \"odrl:Set\",\n \"odrl:permission\": {\n \"odrl:target\": \"{{ASSET_ID}}\",\n \"odrl:action\": {\n \"odrl:type\": \"USE\" \n },\n \"odrl:constraint\": {\n \"odrl:or\": {\n \"odrl:leftOperand\": \"BusinessPartnerNumber\",\n \"odrl:operator\": \"EQ\",\n \"odrl:rightOperand\": \"{{POLICY_BPN}}\"\n }\n }\n },\n \"odrl:prohibition\": [],\n \"odrl:obligation\": [],\n \"odrl:target\": \"{{ASSET_ID}}\"\n }\n }\n}",
"raw": "{\n\t\"@context\": {\n\t\t\"odrl\": \"http://www.w3.org/ns/odrl/2/\"\n\t},\n\t\"@type\": \"NegotiationInitiateRequestDto\",\n\t\"connectorAddress\": \"{{PROVIDER_IDS_URL}}\",\n\t\"protocol\": \"dataspace-protocol-http\",\n\t\"connectorId\": \"{{PROVIDER_ID}}\",\n\t\"providerId\": \"{{PROVIDER_ID}}\",\n\t\"offer\": {\n\t\t\"offerId\": \"1:1:54cb02d1-a12d-4e9e-bd7b-14e7ec30d72b\",\n\t\t\"assetId\": \"{{ASSET_ID}}\",\n\t\t\"policy\": {\n\t\t\t\"@type\": \"odrl:Set\",\n\t\t\t\"odrl:permission\": {\n\t\t\t\t\"odrl:target\": \"{{ASSET_ID}}\",\n\t\t\t\t\"odrl:action\": {\n\t\t\t\t\t\"odrl:type\": \"USE\"\n\t\t\t\t},\n\t\t\t\t\"odrl:constraint\": {\n\t\t\t\t\t\"odrl:or\": {\n\t\t\t\t\t\t\"odrl:leftOperand\": \"BusinessPartnerNumber\",\n\t\t\t\t\t\t\"odrl:operator\": \"EQ\",\n\t\t\t\t\t\t\"odrl:rightOperand\": \"{{POLICY_BPN}}\"\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"odrl:prohibition\": [],\n\t\t\t\"odrl:obligation\": [],\n\t\t\t\"odrl:target\": \"{{ASSET_ID}}\"\n\t\t}\n\t}\n}",
"options": {
"raw": {
"language": "json"
Expand Down Expand Up @@ -495,7 +494,7 @@
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"@context\": {\n \"odrl\": \"http://www.w3.org/ns/odrl/2/\"\n },\n \"assetId\": \"{{ASSET_ID}}\",\n \"connectorAddress\": \"{{PROVIDER_IDS_URL}}/api/v1/ids\",\n \"connectorId\": \"foo\",\n \"contractId\": \"4:4:b062d420-caa6-4a9b-9f6f-3dfd18d51e5a\",\n \"dataDestination\": {\n \"properties\": {\n \"type\": \"HttpProxy\"\n }\n },\n \"managedResources\": false,\n \"properties\": {\n \"receiver.http.endpoint\": \"{{BACKEND_SERVICE}}\"\n },\n \"protocol\": \"dataspace-protocol-http\",\n \"transferType\": {\n \"contentType\": \"application/octet-stream\",\n \"isFinite\": true\n }\n}",
"raw": "{\n \"@context\": {\n \"odrl\": \"http://www.w3.org/ns/odrl/2/\"\n },\n \"assetId\": \"{{ASSET_ID}}\",\n \"connectorAddress\": \"{{PROVIDER_IDS_URL}}\",\n \"connectorId\": \"foo\",\n \"contractId\": \"1:1:92ba144e-940f-4ac9-8ea1-03f04a44e043\",\n \"dataDestination\": {\n \"properties\": {\n \"type\": \"HttpProxy\"\n }\n },\n \"managedResources\": false,\n \"properties\": {\n \"receiver.http.endpoint\": \"{{BACKEND_SERVICE}}\"\n },\n \"protocol\": \"dataspace-protocol-http\",\n \"transferType\": {\n \"contentType\": \"application/octet-stream\",\n \"isFinite\": true\n }\n}",
"options": {
"raw": {
"language": "json"
Expand Down Expand Up @@ -598,96 +597,6 @@
}
},
"response": []
},
{
"name": "CPA-getData",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"Body matches string\", function () {\r",
" var jsonData = pm.response.json();\r",
" pm.collectionVariables.set(\"authCode\", jsonData.authCode);\r",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "{{CONSUMER_DATAMGMT_URL}}/adapter/asset/sync/{{ASSET_ID}}?providerUrl={{PROVIDER_IDS_URL}}/api/v1/ids/data&contractAgreementReuse=false",
"host": [
"{{CONSUMER_DATAMGMT_URL}}"
],
"path": [
"adapter",
"asset",
"sync",
"{{ASSET_ID}}"
],
"query": [
{
"key": "providerUrl",
"value": "{{PROVIDER_IDS_URL}}/api/v1/ids/data"
},
{
"key": "contractAgreementReuse",
"value": "false"
}
]
}
},
"response": []
},
{
"name": "Get Data from consumer-dataplane pubic api (port-forward)",
"event": [
{
"listen": "prerequest",
"script": {
"exec": [
""
],
"type": "text/javascript"
}
},
{
"listen": "test",
"script": {
"exec": [
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "{{authCode}}",
"type": "text"
}
],
"url": {
"raw": "http://localhost:8081/api/public",
"protocol": "http",
"host": [
"localhost"
],
"port": "8081",
"path": [
"api",
"public"
]
}
},
"response": []
}
],
"auth": {
Expand Down Expand Up @@ -732,7 +641,7 @@
},
{
"key": "PROVIDER_IDS_URL",
"value": "http://plato-controlplane:8084"
"value": "http://plato-controlplane:8084/api/v1/dsp\n"
},
{
"key": "PROVIDER_DATAMGMT_URL",
Expand Down Expand Up @@ -796,6 +705,11 @@
{
"key": "authCode",
"value": ""
},
{
"key": "PROVIDER_ID",
"value": "BPNPLATO",
"type": "string"
}
]
}
67 changes: 66 additions & 1 deletion docs/migration/Version_0.3.4_0.4.0.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Migration from 0.3.3 to 0.3.4
# Migration from 0.3.3 to 0.4.0

## Switching to DSP

Expand All @@ -10,9 +10,16 @@ From the Tractus-X EDC perspective this causes breaking changes in the following
The old Management API is now deprecated and is **not** tested for compliance. Please upgrade using the `/v2/` path
for every endpoint, e.g. `<PATH>/management/v2/assets`. Please also refer to
the [EDC OpenAPI spec](https://app.swaggerhub.com/apis/eclipse-edc-bot/management-api/0.0.1-SNAPSHOT#/).
An updated postman collection with the `v2` flow is available [here](../development/postman/collection.json)

- modules: all `*ids*` modules are deprecated and cannot be used anymore. Please migrate over
to `org.eclipse.edc:dsp:0.0.1-milestone-9`.

- path: the default protocol path is now `/api/v1/dsp` instead of `/api/v1/ids`

- `edc.participant.id`: new mandatory configuration for the participant id in the dataspace (BPN number).
It's configured via mandatory property in the charts with object ```yaml participant: id: "id"```.

**Please note that this is not a complete documentation of the DSP Protocol, please refer to
the [official documentation](https://docs.internationaldataspaces.org/dataspace-protocol/overview/readme)**

Expand All @@ -27,3 +34,61 @@ The Business tests were brittle, consumed a lot of resources and were quite cumb

Since the old Control-Plane-Adapter is incompatible with DSP, a new iteration was created.
**Due to time constraints with this release documentation for this feature will to be published subsequently**

## Other changes

- When using the EDR [HttpDynamicReceiverExtension](https://github.com/eclipse-edc/Connector/tree/main/extensions/control-plane/transfer/transfer-pull-http-dynamic-receiver) in the transfer process initiation
the properties for configuring the receiver on single transfer process has been changed to:

```json
"privateProperties": {
"receiverHttpEndpoint": "{{BACKEND_SERVICE}}"
}
```

instead of:

```json
"properties": {
"receiver.http.endpoint": "{{BACKEND_SERVICE}}"
}
```

## New Catalog

The DSP catalog is expressed as [DCat Catalog](https://www.w3.org/TR/vocab-dcat-3/), when querying the catalog a response like this will return:

```json
{
"@id": "5a3207ae-bd0d-4a3b-bc8a-05adfbe75d95",
"@type": "dcat:Catalog",
"dcat:dataset": {
"@id": "e6279569-17a9-4ba3-9401-a8ae4100e4eb",
"@type": "dcat:Dataset",
"odrl:hasPolicy": {
"@id": "2:1:535def6e-8321-4c0e-a595-aabdd9c18eed",
"@type": "odrl:Set",
"odrl:permission": [],
"odrl:prohibition": [],
"odrl:obligation": [],
"odrl:target": "1"
},
"dcat:distribution": [
...
],
"edc:description": "Product EDC Demo Asset",
"edc:id": "1"
},
"dcat:service": {
...
},
"edc:participantId": "participantId",
"@context": {
}
}
```

When starting a new contract negotiation for an asset:

- the `@id` of `odrl:hasPolicy` object should be passed in the `offerId` field
- the `edc:participantId` should be passed in the `providerId` and `connectorId` fields. `connectorId` it's still needed for backward compatibility and it will probably be removed in the next versions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--
-- Copyright (c) 2022 Mercedes-Benz Tech Innovation GmbH
-- Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
--
-- This program and the accompanying materials are made available under the
-- terms of the Apache License, Version 2.0 which is available at
Expand All @@ -8,7 +8,7 @@
-- SPDX-License-Identifier: Apache-2.0
--
-- Contributors:
-- Mercedes-Benz Tech Innovation GmbH - EDC Snapshot 20221201 Update
-- Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation
--

-- add columns
Expand Down

0 comments on commit 9eede8f

Please sign in to comment.