From 086ba2df7b33cdbd94cacfc6f4945c0f86a9fbd5 Mon Sep 17 00:00:00 2001 From: Ernst-Christoph Schrewe Date: Fri, 24 May 2024 08:09:10 +0200 Subject: [PATCH 1/7] chore: initial commit --- .../EndpointDataReferenceReceiver.java | 98 ------------------- .../backend/common/edc/logic/dto/EdrDto.java | 39 -------- .../edc/logic/service/EdcAdapterService.java | 9 +- .../service/EndpointDataReferenceService.java | 84 ---------------- .../backend/common/util/VariablesService.java | 7 -- .../src/main/resources/application.properties | 2 - .../src/test/resources/application.properties | 2 - charts/puris/Chart.yaml | 4 +- charts/puris/README.md | 6 +- .../puris/templates/backend-deployment.yaml | 2 - charts/puris/values.yaml | 3 - .../config/customer/puris-backend.properties | 1 - .../config/supplier/puris-backend.properties | 1 - 13 files changed, 7 insertions(+), 251 deletions(-) delete mode 100644 backend/src/main/java/org/eclipse/tractusx/puris/backend/common/edc/controller/EndpointDataReferenceReceiver.java delete mode 100644 backend/src/main/java/org/eclipse/tractusx/puris/backend/common/edc/logic/dto/EdrDto.java delete mode 100644 backend/src/main/java/org/eclipse/tractusx/puris/backend/common/edc/logic/service/EndpointDataReferenceService.java diff --git a/backend/src/main/java/org/eclipse/tractusx/puris/backend/common/edc/controller/EndpointDataReferenceReceiver.java b/backend/src/main/java/org/eclipse/tractusx/puris/backend/common/edc/controller/EndpointDataReferenceReceiver.java deleted file mode 100644 index 20bd59e6..00000000 --- a/backend/src/main/java/org/eclipse/tractusx/puris/backend/common/edc/controller/EndpointDataReferenceReceiver.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) 2023, 2024 Volkswagen AG - * Copyright (c) 2023, 2024 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V. (represented by Fraunhofer ISST) - * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - */ -package org.eclipse.tractusx.puris.backend.common.edc.controller; - -import com.fasterxml.jackson.databind.JsonNode; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.ExampleObject; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.responses.ApiResponses; -import lombok.extern.slf4j.Slf4j; -import org.eclipse.tractusx.puris.backend.common.edc.logic.dto.EdrDto; -import org.eclipse.tractusx.puris.backend.common.edc.logic.service.EndpointDataReferenceService; -import org.eclipse.tractusx.puris.backend.common.util.PatternStore; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.CrossOrigin; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RestController; - -import java.util.regex.Pattern; - -/** - * This class contains the endpoint for receiving the authCodes from - * the counterparty's dataplane. - */ -@RestController -@Slf4j -public class EndpointDataReferenceReceiver { - - @Autowired - private EndpointDataReferenceService edrService; - - private final Pattern basicPattern = PatternStore.NON_EMPTY_NON_VERTICAL_WHITESPACE_PATTERN; - private final Pattern edcUrlPattern = PatternStore.URL_PATTERN; - - /** - * This endpoint awaits incoming EDR Tokens from external - * partners during a consumer pull transfer. - * - * @param body received from edc containing access information - * @return Status code 200 if request body was found, otherwise 400 - */ - @PostMapping("/edrendpoint") - @Operation(summary = "Endpoint for receiving the authCodes from the counterparty's connector", - requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody( - content = @Content(examples = {@ExampleObject(name = "EDR Token", value = sample)}))) - @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "Ok"), - @ApiResponse(responseCode = "400", description = "Invalid message body") - }) - @CrossOrigin - private ResponseEntity authCodeReceivingEndpoint(@RequestBody JsonNode body) { - log.debug("Received edr data:\n" + body.toPrettyString()); - String transferId = body.get("id").asText(); - boolean valid = (transferId != null) && basicPattern.matcher(transferId).matches(); - - String authKey = body.get("authKey").asText(); - valid = valid && (authKey != null) && basicPattern.matcher(authKey).matches(); - - String authCode = body.get("authCode").asText(); - valid = valid && (authCode != null) && basicPattern.matcher(authCode).matches(); - - String endpoint = body.get("endpoint").asText(); - valid = valid && (endpoint != null) && edcUrlPattern.matcher(endpoint).matches(); - - if (!valid) { - log.warn("EDR endpoint received invalid message:\n" + body.toPrettyString()); - return ResponseEntity.status(400).build(); - } - - edrService.save(transferId, new EdrDto(authKey, authCode, endpoint)); - log.debug("EDR endpoint stored authCode for " + transferId); - return ResponseEntity.status(200).build(); - } - - private final static String sample = "{\"id\":\"3b603c3e-0f1a-4989-90b7-a4b024496d04\",\"at\":1699446240954,\"payload\":{\"transferProcessId\":\"e5c59912-b88a-4c42-9766-9fa593b72603\",\"callbackAddresses\":[{\"uri\":\"http://host.docker.internal:4000\",\"events\":[\"contract.negotiation\",\"transfer.process\"],\"transactional\":false,\"authKey\":null,\"authCodeId\":null}],\"dataAddress\":{\"properties\":{\"https://w3id.org/edc/v0.0.1/ns/type\":\"EDR\",\"https://w3id.org/edc/v0.0.1/ns/endpoint\":\"http://supplier-data-plane:9285/api/public/\",\"https://w3id.org/edc/v0.0.1/ns/authCode\":\"eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjE2OTk0NDY4NDAsImRhZCI6ImMvMnFYVThaemVRTnJ5WDloUjhFZytONXpaWjhaUnc5dHpDOWRPcDlQNnpQQUhxZE9XN0pyN3JIWk94R0k0dFBXMmUxZVZ6elRJNlA5dUZXREpVVWtvRjJpWm93aXp6UEhmbGF4YTdsY0JIcWNISThhZWlEcm5MYiswM1ZXemRtMEZqLzNYYVdUa3VGYzM4VGtWS1lMaEViOVRNRUV4UGhqbEM5WFplamc0ZWJHNUZ6QldDQXZ2bmlMaWpFMjA4ZDhOcE80M0w5cG4xWXBpUThkZ2IrYjhkcEsyMDZObDNzTFhyS1hsU09ZaERHR2tLM2dSYkxBRHpiRjl3RWlCd3Z6SjFvSzFXbllzMVJwTVNOY1ZPc1ZseDJ6YS9mT1J6M29NYnh4TGdsSzMxU1c3NjVNWlVyWWlLK3JDOFhFaHNNa2JMSlNIcXhKYlFWYnZtL3dic1FyQWoxbUVsajhjbk9FY1p2NUhJOHJoUElyaTQyeU1hbXpWSXhXWW9hWU5PV0x4WHk1SUhZc3ZKcUJMc1cwaWs4eDlOZDhTcDduUGhqempLYjlQeFVVbCthS3BZQWVJaE9XZnNGT2pSMFFHM3lYcmJDalM0S1ZlaHhZbW1MZ0ZIczhyeWNsd1h2VUJzRkk4bzVLZUVwSll2U2RPSjlTQ0dNODB5a1lNczFxK0dTRVZmN2VrTUZRU2pjeGRSMElncUtFRk92OE5Ra3ZXZHAxbVpXc25IbnZNY2E0MFYxTm5nQWFVRndtRDhEeGVyc3k4R0IiLCJjaWQiOiJNUT09OlptVjBZMmhCYzNObGRBPT06T0dWbE4yWmhZelV0WlRjek15MDBPR0prTFRneFl6a3RaV1kzTkRsbFlXSTVNMll6In0.z9Nm_csmyHGBPGdEGgiyUV7pLWes0KE2IK82BHtCOS8XBerJrGb_wqNCgcgph6Zx7j84FwaVSH190FQ98FhJORgVCQ8u187hz1iPjXne9GEclR5Xr9_fSb9ZNK8VNTJvCdevJO5uT7Jkkc_-2U8DKUDDOj_Wqby8uStoSSs0P0idQ4pAazFYTy_Dbl0ltJsz6xc3YxwXk3yk0P1Ys5zYN0ueBznUMEJ6-YXpafAS5kn_iN8zU3It3Q2AgS0ER_M9AzeBHXZmST2MkaXXo3s_kuVxCZEtGRWkv8gmI3XZ5dprJ6x6keQSZ2ApSrxtmhswq2hPcqSQXF1gIFTTSSzg8A\",\"https://w3id.org/edc/v0.0.1/ns/id\":\"e5c59912-b88a-4c42-9766-9fa593b72603\",\"https://w3id.org/edc/v0.0.1/ns/authKey\":\"Authorization\"}}},\"type\":\"TransferProcessStarted\"}"; - -} diff --git a/backend/src/main/java/org/eclipse/tractusx/puris/backend/common/edc/logic/dto/EdrDto.java b/backend/src/main/java/org/eclipse/tractusx/puris/backend/common/edc/logic/dto/EdrDto.java deleted file mode 100644 index 0efc4908..00000000 --- a/backend/src/main/java/org/eclipse/tractusx/puris/backend/common/edc/logic/dto/EdrDto.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2023, 2024 Volkswagen AG - * Copyright (c) 2023, 2024 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V. (represented by Fraunhofer ISST) - * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - */ - -package org.eclipse.tractusx.puris.backend.common.edc.logic.dto; - -import org.eclipse.tractusx.puris.backend.common.edc.logic.service.EndpointDataReferenceService; - -/** - * An internal, immutable Dto class used by the {@link EndpointDataReferenceService} - * It contains an authKey, authCode and endpoint. - * - * @param authKey This defines the key, under which the - * authCode is to be sent to the data plane. - * For example: "Authorization" - * @param authCode This is the secret key to be sent - * to the data plane. - * @param endpoint The address of the data plane that has - * to handle the consumer pull. - */ -public record EdrDto(String authKey, String authCode, String endpoint) { -} diff --git a/backend/src/main/java/org/eclipse/tractusx/puris/backend/common/edc/logic/service/EdcAdapterService.java b/backend/src/main/java/org/eclipse/tractusx/puris/backend/common/edc/logic/service/EdcAdapterService.java index d80ff8d5..f5205a26 100644 --- a/backend/src/main/java/org/eclipse/tractusx/puris/backend/common/edc/logic/service/EdcAdapterService.java +++ b/backend/src/main/java/org/eclipse/tractusx/puris/backend/common/edc/logic/service/EdcAdapterService.java @@ -26,7 +26,6 @@ import lombok.extern.slf4j.Slf4j; import okhttp3.*; import org.eclipse.tractusx.puris.backend.common.edc.domain.model.SubmodelType; -import org.eclipse.tractusx.puris.backend.common.edc.logic.dto.EdrDto; import org.eclipse.tractusx.puris.backend.common.edc.logic.util.EdcRequestBodyBuilder; import org.eclipse.tractusx.puris.backend.common.util.PatternStore; import org.eclipse.tractusx.puris.backend.common.util.VariablesService; @@ -716,6 +715,9 @@ private SubmodelData fetchPartTypeSubmodelData(MaterialPartnerRelation mpr) { private record SubmodelData(String assetId, String dspUrl, String href) { } + private record EdrDto(String authKey, String authCode, String endpoint){ + } + private SubmodelData fetchSubmodelData(MaterialPartnerRelation mpr, String semanticId, String manufacturerPartId, String manufacturerId) { JsonNode submodelDescriptors = getAasSubmodelDescriptors(manufacturerPartId, manufacturerId, mpr, 1); for (var submodelDescriptor : submodelDescriptors) { @@ -903,10 +905,7 @@ private EdrDto getEdrForTransferProcessId(String transferProcessId) { } /** - * terminate the transfer with reason "Transfer done." - *

- * Edr in {@link EndpointDataReferenceService} is not removed because it is removed automatically by a job after - * time period x. + * Terminate the transfer with reason "Transfer done. * * @param transferProcessId to terminate */ diff --git a/backend/src/main/java/org/eclipse/tractusx/puris/backend/common/edc/logic/service/EndpointDataReferenceService.java b/backend/src/main/java/org/eclipse/tractusx/puris/backend/common/edc/logic/service/EndpointDataReferenceService.java deleted file mode 100644 index f3ac2a99..00000000 --- a/backend/src/main/java/org/eclipse/tractusx/puris/backend/common/edc/logic/service/EndpointDataReferenceService.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) 2023, 2024 Volkswagen AG - * Copyright (c) 2023, 2024 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V. (represented by Fraunhofer ISST) - * Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - */ -package org.eclipse.tractusx.puris.backend.common.edc.logic.service; - -import lombok.extern.slf4j.Slf4j; -import org.eclipse.tractusx.puris.backend.common.edc.logic.dto.EdrDto; -import org.eclipse.tractusx.puris.backend.common.util.VariablesService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.HashMap; -import java.util.concurrent.ExecutorService; - -/** - * This class stores authCodes which are generated in the course of - * the contracting for the request or response api. Since authCodes - * expire after a very short period, all stored items will be deleted - * after a number of minutes specified in the parameter own.authcodes.deletiontimer. - */ -@Service -@Slf4j -public class EndpointDataReferenceService { - - /** - * AuthCodes expire after a very short period and the data is quite voluminous, - * therefore it's not really useful to persist them in the database. - * The key is the transferId, the value is the authCode - */ - final private HashMap nonpersistantRepository = new HashMap<>(); - @Autowired - private VariablesService variablesService; - @Autowired - private ExecutorService executorService; - - /** - * Stores transferId and authCode as a key/value-pair. - * Please note that any data will only be stored for a period of 5 - * minutes. - * - * @param transferId to store the edr associated to - * @param edr_Dto to store providing the access - */ - public void save(String transferId, EdrDto edr_Dto) { - nonpersistantRepository.put(transferId, edr_Dto); - final long timer = variablesService.getEdrTokenDeletionTimer() * 60 * 1000; - // Start timer for deletion - executorService.submit(() -> { - try { - Thread.sleep(timer); - } catch (InterruptedException e) { - log.error("EndpointDataReferenceService Deletion Thread: Sleep interrupted", e); - } - nonpersistantRepository.remove(transferId); - log.info("Deleted authcode for transferId " + transferId); - }); - } - - /** - * @param transferId The key under which the Dto is supposed to be stored - * @return the Dto or null, if there is no authCode recorded under the given parameter - */ - public EdrDto findByTransferId(String transferId) { - return nonpersistantRepository.get(transferId); - } - -} diff --git a/backend/src/main/java/org/eclipse/tractusx/puris/backend/common/util/VariablesService.java b/backend/src/main/java/org/eclipse/tractusx/puris/backend/common/util/VariablesService.java index 9c19600c..1067186c 100644 --- a/backend/src/main/java/org/eclipse/tractusx/puris/backend/common/util/VariablesService.java +++ b/backend/src/main/java/org/eclipse/tractusx/puris/backend/common/util/VariablesService.java @@ -56,13 +56,6 @@ public class VariablesService { */ private String edrEndpoint; - @Value("${puris.edr.deletiontimer}") - /** - * The number of minutes before received authentication data - * in the context of a consumer pull is removed from memory - */ - private long edrTokenDeletionTimer; - @Value("${puris.baseurl}" + "catena/item-stock/request") /** * The url under which this application's request endpoint can diff --git a/backend/src/main/resources/application.properties b/backend/src/main/resources/application.properties index 4776ba31..4df72211 100755 --- a/backend/src/main/resources/application.properties +++ b/backend/src/main/resources/application.properties @@ -5,12 +5,10 @@ server.port=${SERVER_PORT:8081} puris.baseurl=${PURIS_BASEURL:http://customer-backend:8081/} puris.demonstrator.role=${PURIS_DEMONSTRATOR_ROLE:customer} -puris.edr.deletiontimer=${PURIS_EDR_DELETIONTIMER:2} puris.itemstocksubmodel.apiassetid=${PURIS_ITEMSTOCKSUBMODEL_APIASSETID:itemstocksubmodel-api-asset} puris.productionsubmodel.apiassetid=${PURIS_PRODUCTIONSUBMODEL_APIASSETID:productionsubmodel-api-asset} puris.demandsubmodel.apiassetid=${PURIS_DEMANDSUBMODEL_APIASSETID:demandsubmodel-api-asset} puris.deliverysubmodel.apiassetid=${PURIS_DELIVERYSUBMODEL_APIASSETID:deliverysubmodel-api-asset} -puris.frameworkagreement.use=${PURIS_FRAMEWORKAGREEMENT_USE:false} puris.frameworkagreement.credential=${PURIS_FRAMEWORKAGREEMENT_CREDENTIAL:Puris} puris.frameworkagreement.version=${PURIS_FRAMEWORKAGREEMENT_VERSION:1.0} puris.purpose.name=${PURIS_PURPOSE_NAME:cx.puris.base} diff --git a/backend/src/test/resources/application.properties b/backend/src/test/resources/application.properties index e8fa4d5f..ef0263e9 100755 --- a/backend/src/test/resources/application.properties +++ b/backend/src/test/resources/application.properties @@ -3,12 +3,10 @@ logging.level.org.eclipse.tractusx.puris=DEBUG server.port=${SERVER_PORT:8081} puris.demonstrator.role=${PURIS_DEMONSTRATOR_ROLE:customer} puris.baseurl=${PURIS_BASEURL:http://customer-backend:8081/} -puris.edr.deletiontimer=${PURIS_EDR_DELETIONTIMER:2} puris.itemstocksubmodel.apiassetid=${PURIS_ITEMSTOCKSUBMODEL_APIASSETID:itemstocksubmodel-api-asset} puris.productionsubmodel.apiassetid=${PURIS_PRODUCTIONSUBMODEL_APIASSETID:productionsubmodel-api-asset} puris.demandsubmodel.apiassetid=${PURIS_DEMANDSUBMODEL_APIASSETID:demandsubmodel-api-asset} puris.deliverysubmodel.apiassetid=${PURIS_DELIVERYSUBMODEL_APIASSETID:deliverysubmodel-api-asset} -puris.frameworkagreement.use=${PURIS_FRAMEWORKAGREEMENT_USE:false} puris.frameworkagreement.credential=${PURIS_FRAMEWORKAGREEMENT_CREDENTIAL:Puris} puris.frameworkagreement.version=${PURIS_FRAMEWORKAGREEMENT_CREDENTIAL:1.0} puris.purpose.name=${PURIS_PURPOSE_NAME:cx.puris.base} diff --git a/charts/puris/Chart.yaml b/charts/puris/Chart.yaml index b6880ece..1292ec74 100644 --- a/charts/puris/Chart.yaml +++ b/charts/puris/Chart.yaml @@ -35,10 +35,10 @@ dependencies: # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 2.6.0 +version: 2.6.1 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "2.0.0" +appVersion: "2.0.1" diff --git a/charts/puris/README.md b/charts/puris/README.md index ef810be3..7a953b50 100644 --- a/charts/puris/README.md +++ b/charts/puris/README.md @@ -1,6 +1,6 @@ # puris -![Version: 2.6.0](https://img.shields.io/badge/Version-2.6.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.0.0](https://img.shields.io/badge/AppVersion-2.0.0-informational?style=flat-square) +![Version: 2.6.1](https://img.shields.io/badge/Version-2.6.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.0.1](https://img.shields.io/badge/AppVersion-2.0.1-informational?style=flat-square) A helm chart for Kubernetes deployment of PURIS @@ -96,7 +96,6 @@ dependencies: | backend.puris.edc.controlplane.management.url | string | `"https:/your-edc-address:8181/management"` | Url to the EDC controlplane management of the edc | | backend.puris.edc.controlplane.protocol.url | string | `"https://your-edc-address:8184/api/v1/dsp"` | Url to the EDC controlplane protocol API of the edc | | backend.puris.edc.dataplane.public.url | string | `"https://your-data-plane:8285/api/public/"` | Url of one of your data plane's public api | -| backend.puris.edr.deletiontimer | int | `2` | Number of minutes before received authentication data of a consumer pull is removed from memory | | backend.puris.existingSecret | string | `"secret-puris-backend"` | Secret for backend passwords. For more information look into 'backend-secrets.yaml' file. | | backend.puris.frameworkagreement.credential | string | `"Puris"` | The name of the framework agreement. Starting with Uppercase and using CamelCase. | | backend.puris.frameworkagreement.version | string | `"1.0"` | The version of the framework agreement, NEEDS TO BE PUT AS "STRING"! | @@ -217,9 +216,6 @@ dependencies: | postgresql.service | object | `{"ports":{"postgresql":5432}}` | Possibility to override the name nameOverride: "" | | postgresql.service.ports.postgresql | int | `5432` | Port of postgres database. | ----------------------------------------------- -Autogenerated from chart metadata using [helm-docs v1.11.3](https://github.com/norwoodj/helm-docs/releases/v1.11.3) - ## NOTICE This work is licensed under the [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0). diff --git a/charts/puris/templates/backend-deployment.yaml b/charts/puris/templates/backend-deployment.yaml index 2e1156ec..21071f28 100644 --- a/charts/puris/templates/backend-deployment.yaml +++ b/charts/puris/templates/backend-deployment.yaml @@ -133,8 +133,6 @@ spec: {{- else }} value: "http://{{ $baseUrl }}/" {{- end}} - - name: PURIS_EDR_DELETIONTIMER - value: "{{ .Values.backend.puris.edr.deletiontimer }}" - name: PURIS_ITEMSTOCKSUBMODEL_APIASSETID value: "{{ .Values.backend.puris.itemstocksubmodel.apiassetid }}" - name: PURIS_PRODUCTIONSUBMODEL_APIASSETID diff --git a/charts/puris/values.yaml b/charts/puris/values.yaml index cc490573..63651bf4 100644 --- a/charts/puris/values.yaml +++ b/charts/puris/values.yaml @@ -437,9 +437,6 @@ backend: name: "cx.puris.base" # -- The version of the purpose to use for submodel contracts. NEEDS TO BE PUT AS "STRING"! version: "1" - edr: - # -- Number of minutes before received authentication data of a consumer pull is removed from memory - deletiontimer: 2 dtr: # --Endpoint for DTR url: http://localhost:4243 diff --git a/local/tractus-x-edc/config/customer/puris-backend.properties b/local/tractus-x-edc/config/customer/puris-backend.properties index 5779e8d0..20cd322c 100644 --- a/local/tractus-x-edc/config/customer/puris-backend.properties +++ b/local/tractus-x-edc/config/customer/puris-backend.properties @@ -2,7 +2,6 @@ server.port=8081 server.error.include-message=always puris.demonstrator.role=customer puris.baseurl=http://customer-backend:8081/ -puris.edr.deletiontimer=2 puris.itemstocksubmodel.apiassetid=itemstocksubmodel-api-asset puris.productionsubmodel.apiassetid=productionsubmodel-api-asset puris.demandsubmodel.apiassetid=demandsubmodel-api-asset diff --git a/local/tractus-x-edc/config/supplier/puris-backend.properties b/local/tractus-x-edc/config/supplier/puris-backend.properties index 40fc30f1..65aaa222 100644 --- a/local/tractus-x-edc/config/supplier/puris-backend.properties +++ b/local/tractus-x-edc/config/supplier/puris-backend.properties @@ -2,7 +2,6 @@ server.port=8082 server.error.include-message=always puris.demonstrator.role=supplier puris.baseurl=http://supplier-backend:8082/ -puris.edr.deletiontimer=2 puris.itemstocksubmodel.apiassetid=itemstocksubmodel-api-asset puris.productionsubmodel.apiassetid=productionsubmodel-api-asset puris.demandsubmodel.apiassetid=demandsubmodel-api-asset From 7f5f8888753611db41789093fa6b835734262c5b Mon Sep 17 00:00:00 2001 From: Ernst-Christoph Schrewe Date: Fri, 24 May 2024 08:39:31 +0200 Subject: [PATCH 2/7] chore: chart readme --- charts/puris/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/charts/puris/README.md b/charts/puris/README.md index c5bbc5b3..7a953b50 100644 --- a/charts/puris/README.md +++ b/charts/puris/README.md @@ -7,7 +7,6 @@ A helm chart for Kubernetes deployment of PURIS **Homepage:** ## Prerequisites - - Kubernetes 1.19+ - Helm 3.2.0+ From 19bd71bbca5634938a9270be6a1f629df66c2fa7 Mon Sep 17 00:00:00 2001 From: Ernst-Christoph Schrewe Date: Fri, 24 May 2024 08:48:17 +0200 Subject: [PATCH 3/7] chore: chart version bump --- charts/puris/Chart.yaml | 2 +- charts/puris/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/puris/Chart.yaml b/charts/puris/Chart.yaml index 1292ec74..5b563bc2 100644 --- a/charts/puris/Chart.yaml +++ b/charts/puris/Chart.yaml @@ -35,7 +35,7 @@ dependencies: # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 2.6.1 +version: 2.6.2 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/puris/README.md b/charts/puris/README.md index 7a953b50..3432a6e4 100644 --- a/charts/puris/README.md +++ b/charts/puris/README.md @@ -1,6 +1,6 @@ # puris -![Version: 2.6.1](https://img.shields.io/badge/Version-2.6.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.0.1](https://img.shields.io/badge/AppVersion-2.0.1-informational?style=flat-square) +![Version: 2.6.2](https://img.shields.io/badge/Version-2.6.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.0.1](https://img.shields.io/badge/AppVersion-2.0.1-informational?style=flat-square) A helm chart for Kubernetes deployment of PURIS From bb4e74bf43098f8a3b0b704619911771512cc61c Mon Sep 17 00:00:00 2001 From: --show-origin Date: Fri, 24 May 2024 11:07:04 -0700 Subject: [PATCH 4/7] chore(SecurityConfig): remove EDR endpoint path --- .../tractusx/puris/backend/common/security/SecurityConfig.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/main/java/org/eclipse/tractusx/puris/backend/common/security/SecurityConfig.java b/backend/src/main/java/org/eclipse/tractusx/puris/backend/common/security/SecurityConfig.java index 05cde367..6bdc8372 100644 --- a/backend/src/main/java/org/eclipse/tractusx/puris/backend/common/security/SecurityConfig.java +++ b/backend/src/main/java/org/eclipse/tractusx/puris/backend/common/security/SecurityConfig.java @@ -83,7 +83,7 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { .authorizeHttpRequests( // any request in spring context (authorizeHttpRequests) -> authorizeHttpRequests - .requestMatchers("/stockView/**", "/partners/**", "/materials/**", "/materialpartnerrelations/**", "/item-stock/**", "/production/**", "/delivery/**", "/demand/**", "/planned-production/**", "/material-demand/**", "/delivery-information/**", "/edrendpoint/**", "/edc/**", "/parttypeinformation/**") + .requestMatchers("/stockView/**", "/partners/**", "/materials/**", "/materialpartnerrelations/**", "/item-stock/**", "/production/**", "/delivery/**", "/demand/**", "/planned-production/**", "/material-demand/**", "/delivery-information/**", "/edc/**", "/parttypeinformation/**") .authenticated() .requestMatchers("/swagger-ui/**", "/v3/api-docs/**", "/health/**").permitAll() .dispatcherTypeMatchers(DispatcherType.ERROR).permitAll() From dc8d97de4e792f4a4ebb4096b833aae00e01da95 Mon Sep 17 00:00:00 2001 From: --show-origin Date: Fri, 24 May 2024 11:18:28 -0700 Subject: [PATCH 5/7] docs(openApi): remove EDR endpoint --- docs/api/openAPI.yaml | 56 +------------------------------------------ 1 file changed, 1 insertion(+), 55 deletions(-) diff --git a/docs/api/openAPI.yaml b/docs/api/openAPI.yaml index 2951db47..40d171f9 100644 --- a/docs/api/openAPI.yaml +++ b/docs/api/openAPI.yaml @@ -1516,61 +1516,7 @@ paths: additionalProperties: false description: OK tags: - - edc-controller - /edrendpoint: - post: - operationId: authCodeReceivingEndpoint - requestBody: - content: - application/json: - examples: - EDR Token: - description: EDR Token - value: - at: 1699446240954 - id: 3b603c3e-0f1a-4989-90b7-a4b024496d04 - payload: - callbackAddresses: - - authCodeId: null - authKey: null - events: - - contract.negotiation - - transfer.process - transactional: false - uri: http://host.docker.internal:4000 - dataAddress: - properties: - https://w3id.org/edc/v0.0.1/ns/authCode: eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjE2OTk0NDY4NDAsImRhZCI6ImMvMnFYVThaemVRTnJ5WDloUjhFZytONXpaWjhaUnc5dHpDOWRPcDlQNnpQQUhxZE9XN0pyN3JIWk94R0k0dFBXMmUxZVZ6elRJNlA5dUZXREpVVWtvRjJpWm93aXp6UEhmbGF4YTdsY0JIcWNISThhZWlEcm5MYiswM1ZXemRtMEZqLzNYYVdUa3VGYzM4VGtWS1lMaEViOVRNRUV4UGhqbEM5WFplamc0ZWJHNUZ6QldDQXZ2bmlMaWpFMjA4ZDhOcE80M0w5cG4xWXBpUThkZ2IrYjhkcEsyMDZObDNzTFhyS1hsU09ZaERHR2tLM2dSYkxBRHpiRjl3RWlCd3Z6SjFvSzFXbllzMVJwTVNOY1ZPc1ZseDJ6YS9mT1J6M29NYnh4TGdsSzMxU1c3NjVNWlVyWWlLK3JDOFhFaHNNa2JMSlNIcXhKYlFWYnZtL3dic1FyQWoxbUVsajhjbk9FY1p2NUhJOHJoUElyaTQyeU1hbXpWSXhXWW9hWU5PV0x4WHk1SUhZc3ZKcUJMc1cwaWs4eDlOZDhTcDduUGhqempLYjlQeFVVbCthS3BZQWVJaE9XZnNGT2pSMFFHM3lYcmJDalM0S1ZlaHhZbW1MZ0ZIczhyeWNsd1h2VUJzRkk4bzVLZUVwSll2U2RPSjlTQ0dNODB5a1lNczFxK0dTRVZmN2VrTUZRU2pjeGRSMElncUtFRk92OE5Ra3ZXZHAxbVpXc25IbnZNY2E0MFYxTm5nQWFVRndtRDhEeGVyc3k4R0IiLCJjaWQiOiJNUT09OlptVjBZMmhCYzNObGRBPT06T0dWbE4yWmhZelV0WlRjek15MDBPR0prTFRneFl6a3RaV1kzTkRsbFlXSTVNMll6In0.z9Nm_csmyHGBPGdEGgiyUV7pLWes0KE2IK82BHtCOS8XBerJrGb_wqNCgcgph6Zx7j84FwaVSH190FQ98FhJORgVCQ8u187hz1iPjXne9GEclR5Xr9_fSb9ZNK8VNTJvCdevJO5uT7Jkkc_-2U8DKUDDOj_Wqby8uStoSSs0P0idQ4pAazFYTy_Dbl0ltJsz6xc3YxwXk3yk0P1Ys5zYN0ueBznUMEJ6-YXpafAS5kn_iN8zU3It3Q2AgS0ER_M9AzeBHXZmST2MkaXXo3s_kuVxCZEtGRWkv8gmI3XZ5dprJ6x6keQSZ2ApSrxtmhswq2hPcqSQXF1gIFTTSSzg8A - https://w3id.org/edc/v0.0.1/ns/authKey: Authorization - https://w3id.org/edc/v0.0.1/ns/endpoint: http://supplier-data-plane:9285/api/public/ - https://w3id.org/edc/v0.0.1/ns/id: e5c59912-b88a-4c42-9766-9fa593b72603 - https://w3id.org/edc/v0.0.1/ns/type: EDR - transferProcessId: e5c59912-b88a-4c42-9766-9fa593b72603 - type: TransferProcessStarted - schema: - $ref: '#/components/schemas/JsonNode' - additionalProperties: false - required: true - responses: - '200': - content: - '*/*': - schema: - additionalProperties: false - maxItems: 50 - type: string - description: Ok - '400': - content: - '*/*': - schema: - additionalProperties: false - maxItems: 50 - type: string - description: Invalid message body - summary: Endpoint for receiving the authCodes from the counterparty's connector - tags: - - endpoint-data-reference-receiver + - edc-controller /health/: get: operationId: getHealth From 00b1a70cbef251830d2424c8838214b0f4415ca6 Mon Sep 17 00:00:00 2001 From: --show-origin Date: Fri, 24 May 2024 12:45:07 -0700 Subject: [PATCH 6/7] chore(EdcAdapterService): updated log message for better understanding --- .../backend/common/edc/logic/service/EdcAdapterService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/main/java/org/eclipse/tractusx/puris/backend/common/edc/logic/service/EdcAdapterService.java b/backend/src/main/java/org/eclipse/tractusx/puris/backend/common/edc/logic/service/EdcAdapterService.java index 3535344a..ba897de1 100644 --- a/backend/src/main/java/org/eclipse/tractusx/puris/backend/common/edc/logic/service/EdcAdapterService.java +++ b/backend/src/main/java/org/eclipse/tractusx/puris/backend/common/edc/logic/service/EdcAdapterService.java @@ -981,7 +981,7 @@ private boolean negotiateForSubmodel(MaterialPartnerRelation mpr, SubmodelType t JsonNode targetCatalogEntry = null; if (!catalogArray.isEmpty()) { if (catalogArray.size() > 1) { - log.debug("Ambiguous catalog entries found! Will take the first with supported policy \n" + catalogArray.toPrettyString()); + log.debug("Muliple contract offers found! Will take the first with supported policy \n" + catalogArray.toPrettyString()); } for (JsonNode entry : catalogArray) { From 4a563974ae14bc413e340a29278f0b030ae9a89f Mon Sep 17 00:00:00 2001 From: --show-origin Date: Fri, 24 May 2024 12:50:29 -0700 Subject: [PATCH 7/7] chore(CHANGELOG.md): updated changelog --- CHANGELOG.md | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ddbc5b2c..d8499387 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,14 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [v2.0.1](https://github.com/eclipse-tractusx/puris/releases/tag/2.0.1) -The following Changelog lists the changes. Please refer to the [documentation](docs/README.md) for configuration needs and understanding the concept changes. +The following Changelog lists the changes. Please refer to the [documentation](docs/README.md) for configuration needs +and understanding the concept changes. The **need for configuration updates** is **marked bold**. ### Added -Frontend updates - * Added Footer ### Changed @@ -26,23 +25,28 @@ Frontend updates * Font update for Role switching elements in stocks and dashboard view * Handled modal dialog behavior to always let failed validations prevent closing * Modal Dialog Demand - * Day is marked as mandatory - * Reset data when reopening + * Day is marked as mandatory + * Reset data when reopening * Catalog View - * Updated header itle + usage policy naming (previously Asset Action) - * Added table view - * increased responsiveness by loading animation + * Updated header itle + usage policy naming (previously Asset Action) + * Added table view + * increased responsiveness by loading animation * Negotiation view - * Added table view + Subheader + * Added table view + Subheader * Logout button now logs out again +Fixed constraints to exactly match on leftOperands during consumer side offer evaluation + ### Removed +- EDR Endpoint as removed for edr api usage in appVersion 2.0.0 + ### Known Knowns #### Security -The Backend is currently secured via API Key while the Frontend already uses an API-KEY. See [Admin Guide](./docs/admin/Admin_Guide.md) for further information. +The Backend is currently secured via API Key while the Frontend already uses an API-KEY. +See [Admin Guide](./docs/admin/Admin_Guide.md) for further information. #### Upgradeability @@ -211,14 +215,14 @@ Dashboard - DropDown Headers / Field Headers not correctly placed. Other views / data entry / filter screens to be checked. - Dashboard currently has larger fond than all other Page Headers -> please unify - Create Demand - Day is mandatory and should require an asterix -- Create Demand - Upon entering data and closing, SOME (not all) entries are preserved (and so are warnings for +- Create Demand - Upon entering data and closing, SOME (not all) entries are preserved (and so are warnings for mandatory fields) --> upon closing and re-opening information should be reset to default. (**block**) - Similar for Create Delivery (here SOME entries are reset but warnings stay) (**block**) Stocks - Switch between Material Stocks and Product Stocks -> same layout adaption as for Dashboard suggested (see above) -- Like the functionality that by clicking on a stock, data gets entered for add/update -> user needs better guidance to +- Like the functionality that by clicking on a stock, data gets entered for add/update -> user needs better guidance to do this (else error prone to enter one slightly different attribute and Add instead of update) - Refresh -- update request has been sent successfully. -> more information regarding data transfer needed for user @@ -232,6 +236,7 @@ Catalog - Delay in loading results and first "No Catalog available..." shown and then load items Negotiations + - Similar as Catalog - Add filters for transparency (bpnl, state)