Skip to content

Commit

Permalink
Merge pull request #705 from FraunhoferISST/chore/tx-edc-080
Browse files Browse the repository at this point in the history
Chore/ Update to tx-edc version 0.8.0
  • Loading branch information
tom-rm-meyer-ISST authored Dec 11, 2024
2 parents fe53a12 + c40e0cd commit c55e29c
Show file tree
Hide file tree
Showing 15 changed files with 127 additions and 178 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/trufflehog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
with:
path: ./ # Scan the entire repository
base: "${{ github.event.repository.default_branch }}" # Set base branch for comparison (pull requests)
extra_args: --filter-entropy=4 --results=verified,unknown --debug
extra_args: --filter-entropy=4 --results=verified,unknown --debug --exclude-paths=.thignore

- name: Scan Results Status
if: steps.trufflehog.outcome == 'failure'
Expand Down
1 change: 1 addition & 0 deletions .thignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
local/.*
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Beside the dependencies provided in the Helm Chart, the following dependencies h

| Application | App Version | Chart Version |
|-------------------------------------------------------------------------------------------------------------------|-------------|---------------|
| [Tractus-X Connector](https://github.com/eclipse-tractusx/tractusx-edc/tree/main/charts/tractusx-connector) | 0.7.3 | 0.7.3 |
| [Tractus-X Connector](https://github.com/eclipse-tractusx/tractusx-edc/tree/main/charts/tractusx-connector) | 0.8.0 | 0.8.0 |
| [Digital Twin Registry](https://github.com/eclipse-tractusx/sldt-digital-twin-registry/tree/main/charts/registry) | 0.5.0 | 0.5.0 |

## Overview of Implemented Standards
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -423,12 +423,11 @@ public Response getAllNegotiations() throws IOException {
*
* @param partner The partner
* @param contractId The contract id
* @param assetId The asset id
* @return The response object
* @throws IOException If the connection to your control plane fails
*/
public JsonNode initiateProxyPullTransfer(Partner partner, String contractId, String assetId, String partnerEdcUrl) throws IOException {
var body = edcRequestBodyBuilder.buildProxyPullRequestBody(partner, contractId, assetId, partnerEdcUrl);
public JsonNode initiateProxyPullTransfer(Partner partner, String contractId, String partnerEdcUrl) throws IOException {
var body = edcRequestBodyBuilder.buildProxyPullRequestBody(partner, contractId, partnerEdcUrl);
try (var response = sendPostRequest(body, List.of("v3", "transferprocesses"))) {
String data = response.body().string();
JsonNode result = objectMapper.readTree(data);
Expand All @@ -437,8 +436,8 @@ public JsonNode initiateProxyPullTransfer(Partner partner, String contractId, St
}
}

public JsonNode initiateProxyPullTransfer(Partner partner, String contractId, String assetId) throws IOException {
return initiateProxyPullTransfer(partner, contractId, assetId, partner.getEdcUrl());
public JsonNode initiateProxyPullTransfer(Partner partner, String contractId) throws IOException {
return initiateProxyPullTransfer(partner, contractId, partner.getEdcUrl());
}

/**
Expand Down Expand Up @@ -551,7 +550,7 @@ private JsonNode postNotificationToPartner(Partner partner, AssetType type, Json
}
}
// Request EdrToken
var transferResp = initiateProxyPullTransfer(partner, contractId, assetId, partnerDspUrl);
var transferResp = initiateProxyPullTransfer(partner, contractId, partnerDspUrl);
log.debug("Transfer Request {}", transferResp.toPrettyString());
String transferId = transferResp.get("@id").asText();
// try proxy pull and terminate request
Expand Down Expand Up @@ -620,7 +619,7 @@ private JsonNode getSubmodelFromPartner(MaterialPartnerRelation mpr, AssetType t
log.warn("URL from AAS: " + partnerDspUrl);
}
// Request EdrToken
var transferResp = initiateProxyPullTransfer(partner, submodelContractId, assetId, partnerDspUrl);
var transferResp = initiateProxyPullTransfer(partner, submodelContractId, partnerDspUrl);
log.debug("Transfer Request {}", transferResp.toPrettyString());
String transferId = transferResp.get("@id").asText();
// try proxy pull and terminate request
Expand Down Expand Up @@ -853,7 +852,7 @@ private JsonNode getAasSubmodelDescriptors(String manufacturerPartId, String man
assetId = dtrContractData[0];
contractId = dtrContractData[1];
}
var transferResp = initiateProxyPullTransfer(partner, contractId, assetId);
var transferResp = initiateProxyPullTransfer(partner, contractId);
String transferId = transferResp.get("@id").asText();
try {
EdrDto edrDto = getAndAwaitEdrDto(transferId);
Expand Down Expand Up @@ -954,7 +953,7 @@ private EdrDto getEdrForTransferProcessId(String transferProcessId, int retries)
if (retries < 0) return null;
boolean failed = true;
try (Response response = sendGetRequest(
List.of("v2", "edrs", transferProcessId, "dataaddress"),
List.of("v3", "edrs", transferProcessId, "dataaddress"),
Map.of("auto_refresh", "true"))
) {
if (response.isSuccessful() && response.body() != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -328,12 +328,11 @@ public JsonNode buildAssetNegotiationBody(Partner partner, JsonNode dcatCatalogI
* @param assetId The assetId
* @return The request body
*/
public JsonNode buildProxyPullRequestBody(Partner partner, String contractID, String assetId, String partnerEdcUrl) {
public JsonNode buildProxyPullRequestBody(Partner partner, String contractID, String partnerEdcUrl) {
var body = getEdcContextObject();
body.put("connectorId", partner.getBpnl());
body.put("counterPartyAddress", partnerEdcUrl);
body.put("contractId", contractID);
body.put("assetId", assetId);
body.put("protocol", "dataspace-protocol-http");
body.put("managedResources", false);
body.put("transferType", "HttpData-PULL");
Expand Down
5 changes: 4 additions & 1 deletion local/bdrs/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,8 @@ web.http.directory.port=8582
web.http.directory.path=/api/directory
# looking up DIDs should not use https
edc.iam.did.web.use.https=false
edc.iam.trusted-issuer.issuer.id=did:web:mock-util-service/trusted-issuer
_level=DEBUG

# The following property was moved to the docker-compose.yaml file's "environment" due to some technical docker compose issues:
# https://github.com/docker/compose/issues/12123#issuecomment-2529442716
#edc.iam.trusted-issuer.portal.id: did:web:mock-util-service/trusted-issuer
2 changes: 1 addition & 1 deletion local/docker-compose-infrastructure.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#
# SPDX-License-Identifier: Apache-2.0
#
version: "3"

services:
# Outcommented as not updated for R24.05 but scheduled for R24.08
Expand Down Expand Up @@ -104,6 +103,7 @@ services:
environment:
WEB_HTTP_PORT: 8580
WEB_HTTP_PATH: /api
edc.iam.trusted-issuer.issuer.id: did:web:mock-util-service/trusted-issuer
ports:
- "127.0.0.1:8580:8580"
- "127.0.0.1:8581:8581"
Expand Down
34 changes: 33 additions & 1 deletion local/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#
# SPDX-License-Identifier: Apache-2.0
#
version: "3"

services:

puris-frontend-customer:

Check warning on line 24 in local/docker-compose.yaml

View workflow job for this annotation

GitHub Actions / Analyze KICS

[MEDIUM] Container Capabilities Unrestricted

Some capabilities are not needed in certain (or any) containers. Make sure that you only add capabilities that your container needs. Drop unnecessary capabilities as well.

Check warning on line 24 in local/docker-compose.yaml

View workflow job for this annotation

GitHub Actions / Analyze KICS

[MEDIUM] Container Capabilities Unrestricted

Some capabilities are not needed in certain (or any) containers. Make sure that you only add capabilities that your container needs. Drop unnecessary capabilities as well.

Check warning on line 24 in local/docker-compose.yaml

View workflow job for this annotation

GitHub Actions / Analyze KICS

[MEDIUM] Container Capabilities Unrestricted

Some capabilities are not needed in certain (or any) containers. Make sure that you only add capabilities that your container needs. Drop unnecessary capabilities as well.

Check warning on line 24 in local/docker-compose.yaml

View workflow job for this annotation

GitHub Actions / Analyze KICS

[MEDIUM] Container Capabilities Unrestricted

Some capabilities are not needed in certain (or any) containers. Make sure that you only add capabilities that your container needs. Drop unnecessary capabilities as well.
Expand Down Expand Up @@ -73,6 +73,11 @@ services:
SPRING_DATASOURCE_URL: jdbc:postgresql://postgres-all:5432/puris_customer
SPRING_DATASOURCE_USERNAME: ${PG_USER}
SPRING_DATASOURCE_PASSWORD: ${PG_PW}
puris.dtr.idp.edc-client.id: ${KC_MANAGE_CLIENT_ID}
puris.dtr.idp.edc-client.secret.alias: ${CUSTOMER_KC_DTR_PURIS_CLIENT_ALIAS}
puris.dtr.idp.puris-client.id: ${KC_MANAGE_CLIENT_ID}
puris.dtr.idp.puris-client.secret: ${CUSTOMER_KC_DTR_PURIS_CLIENT_SECRET}

networks:
- miw-net
extra_hosts:
Expand Down Expand Up @@ -146,12 +151,20 @@ services:
container_name: customer-control-plane
env_file:
- ./tractus-x-edc/config/customer/control-plane.properties
environment:
edc.iam.trusted-issuer.portal.id: did:web:mock-util-service/trusted-issuer

ports:
- "127.0.0.1:8180:8180"
- "127.0.0.1:8181:8181"
- "127.0.0.1:8182:8182"
- "127.0.0.1:8183:8183"
- "127.0.0.1:8184:8184"
healthcheck:
test: [ "CMD-SHELL", "wget -q --spider http://customer-control-plane:8180/api/check/health" ]
interval: 4s
timeout: 3s
retries: 20
networks:
- miw-net
extra_hosts:
Expand All @@ -161,6 +174,8 @@ services:
depends_on:
postgres-all:
condition: service_healthy
edc-customer-control-plane:
condition: service_healthy
restart: on-failure
extends:
file: ./tractus-x-edc/docker-compose.yaml
Expand All @@ -174,6 +189,8 @@ services:
- "127.0.0.1:8299:8299"
env_file:
- ./tractus-x-edc/config/customer/data-plane.properties
environment:
edc.iam.trusted-issuer.portal.id: did:web:mock-util-service/trusted-issuer
networks:
- miw-net
extra_hosts:
Expand Down Expand Up @@ -231,6 +248,10 @@ services:
SPRING_DATASOURCE_URL: jdbc:postgresql://postgres-all:5432/puris_supplier
SPRING_DATASOURCE_USERNAME: ${PG_USER}
SPRING_DATASOURCE_PASSWORD: ${PG_PW}
puris.dtr.idp.edc-client.id: ${KC_MANAGE_CLIENT_ID}
puris.dtr.idp.edc-client.secret.alias: ${SUPPLIER_KC_DTR_PURIS_CLIENT_ALIAS}
puris.dtr.idp.puris-client.id: ${KC_MANAGE_CLIENT_ID}
puris.dtr.idp.puris-client.secret: ${SUPPLIER_KC_DTR_PURIS_CLIENT_SECRET}
networks:
- miw-net
extra_hosts:
Expand Down Expand Up @@ -283,8 +304,15 @@ services:
- "127.0.0.1:9183:9183"
- "127.0.0.1:9184:9184"
- "127.0.0.1:1044:1044"
healthcheck:
test: [ "CMD-SHELL", "wget -q --spider http://supplier-control-plane:9180/api/check/health" ]
interval: 4s
timeout: 3s
retries: 20
env_file:
- ./tractus-x-edc/config/supplier/control-plane.properties
environment:
edc.iam.trusted-issuer.portal.id: did:web:mock-util-service/trusted-issuer
networks:
- miw-net
extra_hosts:
Expand All @@ -294,6 +322,8 @@ services:
depends_on:
postgres-all:
condition: service_healthy
edc-supplier-control-plane:
condition: service_healthy
restart: on-failure
extends:
file: ./tractus-x-edc/docker-compose.yaml
Expand All @@ -307,6 +337,8 @@ services:
- "127.0.0.1:9299:9299"
env_file:
- ./tractus-x-edc/config/supplier/data-plane.properties
environment:
edc.iam.trusted-issuer.portal.id: did:web:mock-util-service/trusted-issuer
networks:
- miw-net
extra_hosts:
Expand Down
74 changes: 18 additions & 56 deletions local/tractus-x-edc/config/customer/control-plane.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,14 @@ web.http.control.path=/api/controlplane/control
# PROTOCOL (replaced IDS in 0.3.0)
web.http.protocol.port=8184
web.http.protocol.path=/api/v1/dsp

web.http.catalog.port=8196
web.http.catalog.path=/catalog
web.http.catalog.auth.type=tokenbased
web.http.catalog.auth.key=${EDC_API_PW}

edc.participant.id=BPNL4444444444XX
edc.component.id=customer-controlplane-component-id
edc.api.auth.key=${EDC_API_PW}
edc.dsp.callback.address=http://customer-control-plane:8184/api/v1/dsp
edc.hostname=customer-control-plane
Expand All @@ -24,7 +31,6 @@ edc.iam.sts.oauth.token.url=http://keycloak:8080/realms/miw_test/protocol/openid
edc.iam.sts.oauth.client.id=${CUSTOMER_OAUTH_CLIENT_ID}
edc.iam.sts.oauth.client.secret.alias=${CUSTOMER_OAUTH_SECRET_ALIAS}
tx.edc.iam.sts.dim.url=http://mock-util-service:80/sts
edc.iam.trusted-issuer.portal.id=did:web:mock-util-service/trusted-issuer
# configure one Credential service for all (else pulled from did, nevertheless done)
tx.iam.iatp.credentialservice.url=http://mock-util-service:80
# don't use https during did resolving
Expand All @@ -44,62 +50,18 @@ edc.vault.hashicorp.token=${VAULT_DEV_ROOT_TOKEN_ID}
edc.transfer.proxy.endpoint=http://customer-data-plane:8285/api/public/
edc.transfer.proxy.token.signer.privatekey.alias=${CUSTOMER_PRIVATE_KEY_ALIAS}
edc.transfer.proxy.token.verifier.publickey.alias=${CUSTOMER_PUBLIC_KEY_ALIAS}
# Data-Plane selector configuration
edc.dataplane.selector.edchttp.url=http://customer-data-plane:8283/api/signaling/v1/dataflows
# HttpData-PULL,HttpData-PUSH,AmazonS3-PUSH,AzureStorage-PUSH
edc.dataplane.selector.edchttp.transfertypes=HttpData-PULL,HttpData-PUSH
edc.dataplane.selector.edchttp.sourcetypes=HttpData
edc.dataplane.selector.edchttp.destinationtypes=HttpData,HttpProxy
edc.dataplane.selector.edchttp.properties={"publicApiUrl" : "http://customer-data-plane:8285/api/public"}
# backend receiver for static Endpoint Data References
edc.receiver.http.dynamic.endpoint=http://customer-backend:8081/catena/edrendpoint
edc.receiver.http.dynamic.auth-key=X-API-KEY
edc.receiver.http.dynamic.auth-code=${CUSTOMER_BACKEND_API_KEY}

edc.dataplane.api.public.baseurl=http://customer-data-plane:8285/api/public/

# Postgresql related configuration
edc.datasource.asset.name=asset
edc.datasource.asset.url=jdbc:postgresql://postgres-all:5432/edc_customer
# edc.datasource.asset.user and edc.datasource.asset.password are set via .env
edc.datasource.asset.user=${PG_USER}
edc.datasource.asset.password=${PG_PW}
edc.datasource.contractdefinition.name=contractdefinition
edc.datasource.contractdefinition.url=jdbc:postgresql://postgres-all:5432/edc_customer
# edc.datasource.contractdefinition.user and edc.datasource.contractdefinition.password are set via .env
edc.datasource.contractdefinition.user=${PG_USER}
edc.datasource.contractdefinition.password=${PG_PW}
edc.datasource.contractnegotiation.name=contractnegotiation
edc.datasource.contractnegotiation.url=jdbc:postgresql://postgres-all:5432/edc_customer
# edc.datasource.contractnegotiation.user and edc.datasource.contractnegotiation.password are set via .env
edc.datasource.contractnegotiation.user=${PG_USER}
edc.datasource.contractnegotiation.password=${PG_PW}
edc.datasource.policy.name=policy
edc.datasource.policy.url=jdbc:postgresql://postgres-all:5432/edc_customer
# edc.datasource.policy.user and edc.datasource.policy.password are set via .env
edc.datasource.policy.user=${PG_USER}
edc.datasource.policy.password=${PG_PW}
edc.datasource.transferprocess.name=transferprocess
edc.datasource.transferprocess.url=jdbc:postgresql://postgres-all:5432/edc_customer
# edc.datasource.transferprocess.user and edc.datasource.transferprocess.password are set via .env
edc.datasource.transferprocess.user=${PG_USER}
edc.datasource.transferprocess.password=${PG_PW}
edc.datasource.policy-monitor.name=policy-monitor
edc.datasource.policy-monitor.url=jdbc:postgresql://postgres-all:5432/edc_customer
# edc.datasource.policy-monitor.user and edc.datasource.policy-monitor.password are set via .env
edc.datasource.policy-monitor.user=${PG_USER}
edc.datasource.policy-monitor.password=${PG_PW}
# see extension https://github.com/eclipse-tractusx/tractusx-edc/tree/main/edc-extensions/bpn-validation/business-partner-store-sql
edc.datasource.bpn.name=policy-monitor
edc.datasource.bpn.url=jdbc:postgresql://postgres-all:5432/edc_customer
# edc.datasource.policy-monitor.user and edc.datasource.policy-monitor.password are set via .env
edc.datasource.bpn.user=${PG_USER}
edc.datasource.bpn.password=${PG_PW}
# new in 0.4.x
# see extension https://github.com/eclipse-edc/Connector/tree/main/extensions/common/store/sql/edr-index-sql
edc.datasource.edr.name=edr
edc.datasource.edr.url=jdbc:postgresql://postgres-all:5432/edc_customer
#edc.datasource.edr.user and edc.datasource.edr.password are set via .env
#org.eclipse.tractusx.edc.postgresql.migration.edr.enabled=false
edc.datasource.edr.user=${PG_USER}
edc.datasource.edr.password=${PG_PW}
edc.datasource.default.url=jdbc:postgresql://postgres-all:5432/edc_customer
edc.datasource.default.user=${PG_USER}
edc.datasource.default.password=${PG_PW}

# Data Encryption edc-extensions/data-encryption
edc.data.encryption.keys.alias=${CUSTOMER_ENCRYPTION_KEYS_ALIAS}

# The following property was moved to the docker-compose.yaml file's "environment" due to some technical docker compose issues:
# https://github.com/docker/compose/issues/12123#issuecomment-2529442716
#edc.iam.trusted-issuer.portal.id=did:web:mock-util-service/trusted-issuer

30 changes: 12 additions & 18 deletions local/tractus-x-edc/config/customer/data-plane.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,16 @@ web.http.management.path=/api/v1/data
edc.dataplane.token.validation.endpoint=http://customer-control-plane:8183/api/controlplane/control/token
# EDC hostname
edc.hostname=customer-data-plane
edc.component.id=customer-dataplane-component-id
# HashiCorp vault related configuration
edc.vault.hashicorp.url=http://vault:8200
edc.vault.hashicorp.health.check.enabled=false
edc.vault.hashicorp.token=${VAULT_DEV_ROOT_TOKEN_ID}
# EDR exentions
edc.datasource.edr.name=edr
edc.datasource.edr.url=jdbc:postgresql://postgres-all:5432/edc_customer
#edc.datasource.edr.user and edc.datasource.edr.password are set via .env
#org.eclipse.tractusx.edc.postgresql.migration.edr.enabled=false
edc.datasource.edr.user=${PG_USER}
edc.datasource.edr.password=${PG_PW}
# see extension https://github.com/eclipse-edc/Connector/tree/main/extensions/data-plane/store/sql/data-plane-store-sql
edc.datasource.dataplane.name=edr
edc.datasource.dataplane.url=jdbc:postgresql://postgres-all:5432/edc_customer
edc.datasource.dataplane.user=${PG_USER}
edc.datasource.dataplane.password=${PG_PW}
# extension https://github.com/eclipse-edc/Connector/tree/main/extensions/data-plane/store/sql/accesstokendata-store-sql
edc.datasource.accesstokendata.name=edr
edc.datasource.accesstokendata.url=jdbc:postgresql://postgres-all:5432/edc_customer
edc.datasource.accesstokendata.user=${PG_USER}
edc.datasource.accesstokendata.password=${PG_PW}

edc.datasource.default.url=jdbc:postgresql://postgres-all:5432/edc_customer
edc.datasource.default.user=${PG_USER}
edc.datasource.default.password=${PG_PW}

# token refresh
edc.dataplane.token.expiry=300
edc.dataplane.token.expiry.tolerance=10
Expand All @@ -52,10 +41,15 @@ edc.iam.sts.oauth.token.url=http://keycloak:8080/realms/miw_test/protocol/openid
edc.iam.sts.oauth.client.id=${CUSTOMER_OAUTH_CLIENT_ID}
edc.iam.sts.oauth.client.secret.alias=${CUSTOMER_OAUTH_SECRET_ALIAS}
edc.iam.sts.dim.url=http://mock-util-service:80/sts
edc.iam.trusted-issuer.portal.id=did:web:mock-util-service/trusted-issuer
# configure one Credential service for all (else pulled from did): https://github.com/eclipse-tractusx/tractusx-edc/blob/d7d3586ffc4ef03c858e38fde6bfa8687efa50c9/edc-extensions/bdrs-client/src/main/java/org/eclipse/tractusx/edc/identity/mapper/BdrsClientExtension.java#L50
tx.iam.credentialservice.url=http://mock-util-service:80
# don't use https during did resolving in catalog request
edc.iam.did.web.use.https=false

edc.dpf.selector.url=http://customer-control-plane:8183/api/controlplane/control/v1/dataplanes
tx.edc.dpf.consumer.proxy.auth.apikey=${EDC_API_PW}
edc.data.encryption.keys.alias=${CUSTOMER_ENCRYPTION_KEYS_ALIAS}

# The following property was moved to the docker-compose.yaml file's "environment" due to some technical docker compose issues:
# https://github.com/docker/compose/issues/12123#issuecomment-2529442716
#edc.iam.trusted-issuer.portal.id=did:web:mock-util-service/trusted-issuer
Loading

0 comments on commit c55e29c

Please sign in to comment.