From b4deb5e53b19dd7b0c6655bb4d3a75be4dff937c Mon Sep 17 00:00:00 2001 From: Mathias Brunkow Moser Date: Tue, 2 Jan 2024 15:06:00 +0100 Subject: [PATCH 01/21] fix: updated spring boot to v3.2.1 to fix vulnerabilities --- DEPENDENCIES_BACKEND | 136 ++++++++++++------------- dpp-backend/digitalproductpass/pom.xml | 4 +- 2 files changed, 70 insertions(+), 70 deletions(-) diff --git a/DEPENDENCIES_BACKEND b/DEPENDENCIES_BACKEND index bfbedf427..4d477a4a9 100644 --- a/DEPENDENCIES_BACKEND +++ b/DEPENDENCIES_BACKEND @@ -1,5 +1,5 @@ -maven/mavencentral/ch.qos.logback/logback-classic/1.4.11, EPL-1.0 OR LGPL-2.1-only, approved, #3435 -maven/mavencentral/ch.qos.logback/logback-core/1.4.11, EPL-1.0 OR LGPL-2.1-only, approved, #3373 +maven/mavencentral/ch.qos.logback/logback-classic/1.4.14, EPL-1.0 OR LGPL-2.1-only, approved, #3435 +maven/mavencentral/ch.qos.logback/logback-core/1.4.14, EPL-1.0 OR LGPL-2.1-only, approved, #3373 maven/mavencentral/com.fasterxml.jackson.core/jackson-annotations/2.15.3, Apache-2.0, approved, #7947 maven/mavencentral/com.fasterxml.jackson.core/jackson-core/2.15.3, MIT AND Apache-2.0, approved, #7932 maven/mavencentral/com.fasterxml.jackson.core/jackson-databind/2.15.3, Apache-2.0, approved, #7934 @@ -27,28 +27,28 @@ maven/mavencentral/commons-lang/commons-lang/2.6, Apache-2.0, approved, CQ6183 maven/mavencentral/commons-logging/commons-logging/1.2, Apache-2.0, approved, CQ10162 maven/mavencentral/commons-net/commons-net/3.9.0, Apache-2.0, approved, clearlydefined maven/mavencentral/io.github.classgraph/classgraph/4.8.149, MIT, approved, CQ22530 -maven/mavencentral/io.micrometer/micrometer-commons/1.11.5, Apache-2.0 AND (Apache-2.0 AND MIT), approved, #9243 -maven/mavencentral/io.micrometer/micrometer-observation/1.11.5, Apache-2.0, approved, #9242 -maven/mavencentral/io.netty/netty-buffer/4.1.100.Final, Apache-2.0, approved, CQ21842 -maven/mavencentral/io.netty/netty-codec-dns/4.1.100.Final, Apache-2.0 AND BSD-3-Clause AND MIT, approved, CQ20926 -maven/mavencentral/io.netty/netty-codec-http/4.1.100.Final, Apache-2.0 AND BSD-3-Clause AND MIT, approved, CQ20926 -maven/mavencentral/io.netty/netty-codec-http2/4.1.100.Final, Apache-2.0 AND BSD-3-Clause AND MIT, approved, CQ20926 -maven/mavencentral/io.netty/netty-codec-socks/4.1.100.Final, Apache-2.0 AND BSD-3-Clause AND MIT, approved, CQ20926 -maven/mavencentral/io.netty/netty-codec/4.1.100.Final, Apache-2.0 AND BSD-3-Clause AND MIT, approved, CQ20926 -maven/mavencentral/io.netty/netty-common/4.1.100.Final, Apache-2.0 AND MIT AND CC0-1.0, approved, CQ21843 -maven/mavencentral/io.netty/netty-handler-proxy/4.1.100.Final, Apache-2.0 AND BSD-3-Clause AND MIT, approved, CQ20926 -maven/mavencentral/io.netty/netty-handler/4.1.100.Final, Apache-2.0 AND BSD-3-Clause AND MIT, approved, CQ20926 -maven/mavencentral/io.netty/netty-resolver-dns-classes-macos/4.1.100.Final, Apache-2.0, approved, #6367 -maven/mavencentral/io.netty/netty-resolver-dns-native-macos/4.1.100.Final, Apache-2.0, approved, #7004 -maven/mavencentral/io.netty/netty-resolver-dns/4.1.100.Final, Apache-2.0 AND BSD-3-Clause AND MIT, approved, CQ20926 -maven/mavencentral/io.netty/netty-resolver/4.1.100.Final, Apache-2.0 AND BSD-3-Clause AND MIT, approved, CQ20926 -maven/mavencentral/io.netty/netty-transport-classes-epoll/4.1.100.Final, Apache-2.0, approved, #6366 -maven/mavencentral/io.netty/netty-transport-native-epoll/4.1.100.Final, Apache-2.0 AND BSD-3-Clause AND MIT, approved, CQ20926 -maven/mavencentral/io.netty/netty-transport-native-unix-common/4.1.100.Final, Apache-2.0 AND BSD-3-Clause AND MIT, approved, CQ20926 -maven/mavencentral/io.netty/netty-transport/4.1.100.Final, Apache-2.0 AND BSD-3-Clause AND MIT, approved, CQ20926 -maven/mavencentral/io.projectreactor.netty/reactor-netty-core/1.1.12, Apache-2.0, approved, #5946 -maven/mavencentral/io.projectreactor.netty/reactor-netty-http/1.1.12, Apache-2.0, approved, #6999 -maven/mavencentral/io.projectreactor/reactor-core/3.5.11, Apache-2.0, approved, #5934 +maven/mavencentral/io.micrometer/micrometer-commons/1.12.1, Apache-2.0 AND (Apache-2.0 AND MIT), approved, #11679 +maven/mavencentral/io.micrometer/micrometer-observation/1.12.1, Apache-2.0, approved, #11680 +maven/mavencentral/io.netty/netty-buffer/4.1.104.Final, Apache-2.0, approved, CQ21842 +maven/mavencentral/io.netty/netty-codec-dns/4.1.104.Final, Apache-2.0 AND BSD-3-Clause AND MIT, approved, CQ20926 +maven/mavencentral/io.netty/netty-codec-http/4.1.104.Final, Apache-2.0 AND BSD-3-Clause AND MIT, approved, CQ20926 +maven/mavencentral/io.netty/netty-codec-http2/4.1.104.Final, Apache-2.0 AND BSD-3-Clause AND MIT, approved, CQ20926 +maven/mavencentral/io.netty/netty-codec-socks/4.1.104.Final, Apache-2.0 AND BSD-3-Clause AND MIT, approved, CQ20926 +maven/mavencentral/io.netty/netty-codec/4.1.104.Final, Apache-2.0 AND BSD-3-Clause AND MIT, approved, CQ20926 +maven/mavencentral/io.netty/netty-common/4.1.104.Final, Apache-2.0 AND MIT AND CC0-1.0, approved, CQ21843 +maven/mavencentral/io.netty/netty-handler-proxy/4.1.104.Final, Apache-2.0 AND BSD-3-Clause AND MIT, approved, CQ20926 +maven/mavencentral/io.netty/netty-handler/4.1.104.Final, Apache-2.0 AND BSD-3-Clause AND MIT, approved, CQ20926 +maven/mavencentral/io.netty/netty-resolver-dns-classes-macos/4.1.104.Final, Apache-2.0, approved, #6367 +maven/mavencentral/io.netty/netty-resolver-dns-native-macos/4.1.104.Final, Apache-2.0, approved, #7004 +maven/mavencentral/io.netty/netty-resolver-dns/4.1.104.Final, Apache-2.0 AND BSD-3-Clause AND MIT, approved, CQ20926 +maven/mavencentral/io.netty/netty-resolver/4.1.104.Final, Apache-2.0 AND BSD-3-Clause AND MIT, approved, CQ20926 +maven/mavencentral/io.netty/netty-transport-classes-epoll/4.1.104.Final, Apache-2.0, approved, #6366 +maven/mavencentral/io.netty/netty-transport-native-epoll/4.1.104.Final, Apache-2.0 AND BSD-3-Clause AND MIT, approved, CQ20926 +maven/mavencentral/io.netty/netty-transport-native-unix-common/4.1.104.Final, Apache-2.0 AND BSD-3-Clause AND MIT, approved, CQ20926 +maven/mavencentral/io.netty/netty-transport/4.1.104.Final, Apache-2.0 AND BSD-3-Clause AND MIT, approved, CQ20926 +maven/mavencentral/io.projectreactor.netty/reactor-netty-core/1.1.14, Apache-2.0, approved, #5946 +maven/mavencentral/io.projectreactor.netty/reactor-netty-http/1.1.14, Apache-2.0, approved, #6999 +maven/mavencentral/io.projectreactor/reactor-core/3.6.1, Apache-2.0, approved, clearlydefined maven/mavencentral/io.swagger.core.v3/swagger-annotations-jakarta/2.2.7, Apache-2.0, approved, #5947 maven/mavencentral/io.swagger.core.v3/swagger-core-jakarta/2.2.7, Apache-2.0, approved, #5929 maven/mavencentral/io.swagger.core.v3/swagger-models-jakarta/2.2.7, Apache-2.0, approved, #5919 @@ -57,17 +57,17 @@ maven/mavencentral/jakarta.annotation/jakarta.annotation-api/2.1.1, EPL-2.0 OR G maven/mavencentral/jakarta.servlet/jakarta.servlet-api/6.0.0, EPL-2.0 OR GPL-2.0-only with Classpath-exception-2.0, approved, ee4j.servlet maven/mavencentral/jakarta.validation/jakarta.validation-api/3.0.2, Apache-2.0, approved, ee4j.validation maven/mavencentral/jakarta.xml.bind/jakarta.xml.bind-api/4.0.1, BSD-3-Clause, approved, ee4j.jaxb -maven/mavencentral/net.minidev/accessors-smart/2.4.11, Apache-2.0, approved, #7515 -maven/mavencentral/net.minidev/json-smart/2.4.11, Apache-2.0, approved, #3288 +maven/mavencentral/net.minidev/accessors-smart/2.5.0, Apache-2.0, approved, clearlydefined +maven/mavencentral/net.minidev/json-smart/2.5.0, Apache-2.0, approved, clearlydefined maven/mavencentral/org.apache.commons/commons-collections4/4.4, Apache-2.0, approved, clearlydefined -maven/mavencentral/org.apache.commons/commons-lang3/3.12.0, Apache-2.0, approved, clearlydefined +maven/mavencentral/org.apache.commons/commons-lang3/3.13.0, Apache-2.0, approved, #9820 maven/mavencentral/org.apache.commons/commons-text/1.10.0, Apache-2.0, approved, clearlydefined -maven/mavencentral/org.apache.logging.log4j/log4j-api/2.20.0, Apache-2.0, approved, clearlydefined -maven/mavencentral/org.apache.logging.log4j/log4j-core/2.20.0, Apache-2.0 AND (Apache-2.0 AND LGPL-2.0-or-later), approved, #8809 -maven/mavencentral/org.apache.logging.log4j/log4j-to-slf4j/2.20.0, Apache-2.0, approved, #8799 -maven/mavencentral/org.apache.tomcat.embed/tomcat-embed-core/10.1.15, Apache-2.0 AND (EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0) AND (CDDL-1.0 OR GPL-2.0-only WITH Classpath-exception-2.0) AND W3C AND CC0-1.0, approved, #5949 -maven/mavencentral/org.apache.tomcat.embed/tomcat-embed-el/10.1.15, Apache-2.0, approved, #6997 -maven/mavencentral/org.apache.tomcat.embed/tomcat-embed-websocket/10.1.15, Apache-2.0, approved, #7920 +maven/mavencentral/org.apache.logging.log4j/log4j-api/2.21.1, Apache-2.0 AND (Apache-2.0 AND LGPL-2.0-or-later), approved, #11079 +maven/mavencentral/org.apache.logging.log4j/log4j-core/2.21.1, Apache-2.0, restricted, clearlydefined +maven/mavencentral/org.apache.logging.log4j/log4j-to-slf4j/2.21.1, Apache-2.0, approved, #11919 +maven/mavencentral/org.apache.tomcat.embed/tomcat-embed-core/10.1.17, Apache-2.0 AND (EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0) AND (CDDL-1.0 OR GPL-2.0-only WITH Classpath-exception-2.0) AND W3C AND CC0-1.0, approved, #5949 +maven/mavencentral/org.apache.tomcat.embed/tomcat-embed-el/10.1.17, Apache-2.0, approved, #6997 +maven/mavencentral/org.apache.tomcat.embed/tomcat-embed-websocket/10.1.17, Apache-2.0, approved, #7920 maven/mavencentral/org.atteo/evo-inflector/1.3, Apache-2.0, approved, clearlydefined maven/mavencentral/org.bouncycastle/bcpkix-jdk15on/1.69, MIT, approved, clearlydefined maven/mavencentral/org.bouncycastle/bcprov-jdk15on/1.69, MIT, approved, clearlydefined @@ -85,48 +85,48 @@ maven/mavencentral/org.sonatype.plexus/plexus-sec-dispatcher/1.4, Apache-2.0, ap maven/mavencentral/org.springdoc/springdoc-openapi-starter-common/2.0.2, Apache-2.0, approved, #5920 maven/mavencentral/org.springdoc/springdoc-openapi-starter-webmvc-api/2.0.2, Apache-2.0, approved, #5950 maven/mavencentral/org.springdoc/springdoc-openapi-starter-webmvc-ui/2.0.2, Apache-2.0, approved, #5923 -maven/mavencentral/org.springframework.boot/spring-boot-autoconfigure/3.1.5, Apache-2.0, approved, #9341 -maven/mavencentral/org.springframework.boot/spring-boot-starter-data-rest/3.1.5, Apache-2.0, approved, #9105 -maven/mavencentral/org.springframework.boot/spring-boot-starter-json/3.1.5, Apache-2.0, approved, #9336 -maven/mavencentral/org.springframework.boot/spring-boot-starter-logging/3.1.5, Apache-2.0, approved, #9343 -maven/mavencentral/org.springframework.boot/spring-boot-starter-oauth2-client/3.1.5, Apache-2.0, approved, #8806 -maven/mavencentral/org.springframework.boot/spring-boot-starter-reactor-netty/3.1.5, Apache-2.0, approved, #9738 +maven/mavencentral/org.springframework.boot/spring-boot-autoconfigure/3.2.1, Apache-2.0, approved, #11751 +maven/mavencentral/org.springframework.boot/spring-boot-starter-data-rest/3.2.1, , restricted, clearlydefined +maven/mavencentral/org.springframework.boot/spring-boot-starter-json/3.2.1, Apache-2.0, approved, #11894 +maven/mavencentral/org.springframework.boot/spring-boot-starter-logging/3.2.1, Apache-2.0, approved, #11890 +maven/mavencentral/org.springframework.boot/spring-boot-starter-oauth2-client/3.2.1, , restricted, clearlydefined +maven/mavencentral/org.springframework.boot/spring-boot-starter-reactor-netty/3.2.1, , restricted, clearlydefined maven/mavencentral/org.springframework.boot/spring-boot-starter-security/3.0.2, Apache-2.0, approved, #7329 -maven/mavencentral/org.springframework.boot/spring-boot-starter-tomcat/3.1.5, Apache-2.0, approved, #9351 +maven/mavencentral/org.springframework.boot/spring-boot-starter-tomcat/3.2.1, Apache-2.0, approved, #11923 maven/mavencentral/org.springframework.boot/spring-boot-starter-web/3.0.2, Apache-2.0, approved, #5945 -maven/mavencentral/org.springframework.boot/spring-boot-starter-webflux/3.1.5, Apache-2.0, approved, #9739 -maven/mavencentral/org.springframework.boot/spring-boot-starter/3.1.5, Apache-2.0, approved, #9349 -maven/mavencentral/org.springframework.boot/spring-boot/3.1.5, Apache-2.0, approved, #9352 +maven/mavencentral/org.springframework.boot/spring-boot-starter-webflux/3.2.1, , restricted, clearlydefined +maven/mavencentral/org.springframework.boot/spring-boot-starter/3.2.1, Apache-2.0, approved, #11935 +maven/mavencentral/org.springframework.boot/spring-boot/3.2.1, Apache-2.0, approved, #11752 maven/mavencentral/org.springframework.cloud/spring-cloud-commons/3.1.5, Apache-2.0, approved, #4726 maven/mavencentral/org.springframework.cloud/spring-cloud-context/3.1.5, Apache-2.0, approved, #4722 maven/mavencentral/org.springframework.cloud/spring-cloud-starter-bootstrap/3.1.5, Apache-2.0, approved, clearlydefined maven/mavencentral/org.springframework.cloud/spring-cloud-starter/3.1.5, Apache-2.0, approved, #4723 -maven/mavencentral/org.springframework.data/spring-data-commons/3.1.5, Apache-2.0, approved, #8805 -maven/mavencentral/org.springframework.data/spring-data-rest-core/4.1.5, Apache-2.0, approved, #9107 -maven/mavencentral/org.springframework.data/spring-data-rest-webmvc/4.1.5, Apache-2.0, approved, #9103 -maven/mavencentral/org.springframework.hateoas/spring-hateoas/2.1.2, Apache-2.0, approved, #9106 +maven/mavencentral/org.springframework.data/spring-data-commons/3.2.1, Apache-2.0, approved, #11917 +maven/mavencentral/org.springframework.data/spring-data-rest-core/4.2.1, , restricted, clearlydefined +maven/mavencentral/org.springframework.data/spring-data-rest-webmvc/4.2.1, , restricted, clearlydefined +maven/mavencentral/org.springframework.hateoas/spring-hateoas/2.2.0, Apache-2.0, approved, #11883 maven/mavencentral/org.springframework.plugin/spring-plugin-core/3.0.0, Apache-2.0, approved, #7104 -maven/mavencentral/org.springframework.security/spring-security-config/6.1.5, Apache-2.0, approved, #9736 -maven/mavencentral/org.springframework.security/spring-security-core/6.1.5, Apache-2.0, approved, #9801 -maven/mavencentral/org.springframework.security/spring-security-crypto/6.1.5, Apache-2.0 AND ISC, approved, #9735 -maven/mavencentral/org.springframework.security/spring-security-oauth2-client/6.1.5, Apache-2.0, approved, #9740 -maven/mavencentral/org.springframework.security/spring-security-oauth2-core/6.1.5, Apache-2.0, approved, #9741 -maven/mavencentral/org.springframework.security/spring-security-oauth2-jose/6.1.5, Apache-2.0, approved, #9345 +maven/mavencentral/org.springframework.security/spring-security-config/6.2.1, Apache-2.0, approved, #11896 +maven/mavencentral/org.springframework.security/spring-security-core/6.2.1, Apache-2.0, approved, #11904 +maven/mavencentral/org.springframework.security/spring-security-crypto/6.2.1, Apache-2.0 AND ISC, approved, #11908 +maven/mavencentral/org.springframework.security/spring-security-oauth2-client/6.2.1, , restricted, clearlydefined +maven/mavencentral/org.springframework.security/spring-security-oauth2-core/6.2.1, Apache-2.0, approved, #11925 +maven/mavencentral/org.springframework.security/spring-security-oauth2-jose/6.2.1, Apache-2.0, approved, #11893 maven/mavencentral/org.springframework.security/spring-security-rsa/1.0.11.RELEASE, Apache-2.0, approved, CQ20647 -maven/mavencentral/org.springframework.security/spring-security-web/6.1.5, Apache-2.0, approved, #9800 -maven/mavencentral/org.springframework.session/spring-session-core/3.1.3, Apache-2.0, approved, #11345 -maven/mavencentral/org.springframework.session/spring-session-jdbc/3.1.3, Apache-2.0, approved, #9104 -maven/mavencentral/org.springframework/spring-aop/6.0.13, Apache-2.0, approved, #5940 -maven/mavencentral/org.springframework/spring-beans/6.0.13, Apache-2.0, approved, #5937 -maven/mavencentral/org.springframework/spring-context/6.0.13, Apache-2.0, approved, #5936 -maven/mavencentral/org.springframework/spring-core/6.0.13, Apache-2.0 AND BSD-3-Clause, approved, #5948 -maven/mavencentral/org.springframework/spring-expression/6.0.13, Apache-2.0, approved, #3284 -maven/mavencentral/org.springframework/spring-jcl/6.0.13, Apache-2.0, approved, #3283 -maven/mavencentral/org.springframework/spring-jdbc/6.0.13, Apache-2.0, approved, #5924 -maven/mavencentral/org.springframework/spring-tx/6.0.13, Apache-2.0, approved, #5926 -maven/mavencentral/org.springframework/spring-web/6.0.13, Apache-2.0, approved, #5942 -maven/mavencentral/org.springframework/spring-webflux/6.0.13, Apache-2.0, approved, #6964 -maven/mavencentral/org.springframework/spring-webmvc/6.0.13, Apache-2.0, approved, #5944 +maven/mavencentral/org.springframework.security/spring-security-web/6.2.1, Apache-2.0, approved, #11911 +maven/mavencentral/org.springframework.session/spring-session-core/3.2.1, , restricted, clearlydefined +maven/mavencentral/org.springframework.session/spring-session-jdbc/3.2.1, , restricted, clearlydefined +maven/mavencentral/org.springframework/spring-aop/6.1.2, Apache-2.0, approved, #11755 +maven/mavencentral/org.springframework/spring-beans/6.1.2, Apache-2.0, approved, #11754 +maven/mavencentral/org.springframework/spring-context/6.1.2, Apache-2.0, approved, #11753 +maven/mavencentral/org.springframework/spring-core/6.1.2, Apache-2.0 AND BSD-3-Clause, approved, #11750 +maven/mavencentral/org.springframework/spring-expression/6.1.2, Apache-2.0, approved, #11747 +maven/mavencentral/org.springframework/spring-jcl/6.1.2, Apache-2.0, approved, #11749 +maven/mavencentral/org.springframework/spring-jdbc/6.1.2, Apache-2.0, approved, #11897 +maven/mavencentral/org.springframework/spring-tx/6.1.2, Apache-2.0, approved, #11901 +maven/mavencentral/org.springframework/spring-web/6.1.2, Apache-2.0, approved, #11748 +maven/mavencentral/org.springframework/spring-webflux/6.1.2, , restricted, clearlydefined +maven/mavencentral/org.springframework/spring-webmvc/6.1.2, Apache-2.0, approved, #11879 maven/mavencentral/org.webjars/swagger-ui/4.15.5, Apache-2.0 AND MIT, approved, #5921 -maven/mavencentral/org.webjars/webjars-locator-core/0.52, MIT, approved, clearlydefined +maven/mavencentral/org.webjars/webjars-locator-core/0.55, MIT, approved, clearlydefined maven/mavencentral/org.yaml/snakeyaml/2.0, Apache-2.0 AND (Apache-2.0 OR BSD-3-Clause OR EPL-1.0 OR GPL-2.0-or-later OR LGPL-2.1-or-later), approved, #7275 diff --git a/dpp-backend/digitalproductpass/pom.xml b/dpp-backend/digitalproductpass/pom.xml index 93227ccbd..1e5e0190f 100644 --- a/dpp-backend/digitalproductpass/pom.xml +++ b/dpp-backend/digitalproductpass/pom.xml @@ -28,12 +28,12 @@ org.springframework.boot spring-boot-starter-parent - 3.1.5 + 3.2.1 org.eclipse.tractusx digitalproductpass - 2.0.0 + 2.0.1 jar Catena-X Digital Product Passport Backend Digital Product Passport Consumer Backend Reference Implementation System for Product Passport Consumer Frontend Application From bc97c4fa57151add6d4d70e2f0ef07d19c6ecf15 Mon Sep 17 00:00:00 2001 From: Mathias Brunkow Moser Date: Tue, 2 Jan 2024 16:40:49 +0100 Subject: [PATCH 02/21] chore: added the backend dependencies --- DEPENDENCIES_BACKEND | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/DEPENDENCIES_BACKEND b/DEPENDENCIES_BACKEND index 4d477a4a9..e2b1bbae3 100644 --- a/DEPENDENCIES_BACKEND +++ b/DEPENDENCIES_BACKEND @@ -63,7 +63,7 @@ maven/mavencentral/org.apache.commons/commons-collections4/4.4, Apache-2.0, appr maven/mavencentral/org.apache.commons/commons-lang3/3.13.0, Apache-2.0, approved, #9820 maven/mavencentral/org.apache.commons/commons-text/1.10.0, Apache-2.0, approved, clearlydefined maven/mavencentral/org.apache.logging.log4j/log4j-api/2.21.1, Apache-2.0 AND (Apache-2.0 AND LGPL-2.0-or-later), approved, #11079 -maven/mavencentral/org.apache.logging.log4j/log4j-core/2.21.1, Apache-2.0, restricted, clearlydefined +maven/mavencentral/org.apache.logging.log4j/log4j-core/2.21.1, Apache-2.0 AND (Apache-2.0 AND LGPL-2.0-or-later), approved, #12592 maven/mavencentral/org.apache.logging.log4j/log4j-to-slf4j/2.21.1, Apache-2.0, approved, #11919 maven/mavencentral/org.apache.tomcat.embed/tomcat-embed-core/10.1.17, Apache-2.0 AND (EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0) AND (CDDL-1.0 OR GPL-2.0-only WITH Classpath-exception-2.0) AND W3C AND CC0-1.0, approved, #5949 maven/mavencentral/org.apache.tomcat.embed/tomcat-embed-el/10.1.17, Apache-2.0, approved, #6997 @@ -86,15 +86,15 @@ maven/mavencentral/org.springdoc/springdoc-openapi-starter-common/2.0.2, Apache- maven/mavencentral/org.springdoc/springdoc-openapi-starter-webmvc-api/2.0.2, Apache-2.0, approved, #5950 maven/mavencentral/org.springdoc/springdoc-openapi-starter-webmvc-ui/2.0.2, Apache-2.0, approved, #5923 maven/mavencentral/org.springframework.boot/spring-boot-autoconfigure/3.2.1, Apache-2.0, approved, #11751 -maven/mavencentral/org.springframework.boot/spring-boot-starter-data-rest/3.2.1, , restricted, clearlydefined +maven/mavencentral/org.springframework.boot/spring-boot-starter-data-rest/3.2.1, Apache-2.0, approved, #12594 maven/mavencentral/org.springframework.boot/spring-boot-starter-json/3.2.1, Apache-2.0, approved, #11894 maven/mavencentral/org.springframework.boot/spring-boot-starter-logging/3.2.1, Apache-2.0, approved, #11890 -maven/mavencentral/org.springframework.boot/spring-boot-starter-oauth2-client/3.2.1, , restricted, clearlydefined -maven/mavencentral/org.springframework.boot/spring-boot-starter-reactor-netty/3.2.1, , restricted, clearlydefined +maven/mavencentral/org.springframework.boot/spring-boot-starter-oauth2-client/3.2.1, Apache-2.0, approved, #12587 +maven/mavencentral/org.springframework.boot/spring-boot-starter-reactor-netty/3.2.1, Apache-2.0, approved, #12590 maven/mavencentral/org.springframework.boot/spring-boot-starter-security/3.0.2, Apache-2.0, approved, #7329 maven/mavencentral/org.springframework.boot/spring-boot-starter-tomcat/3.2.1, Apache-2.0, approved, #11923 maven/mavencentral/org.springframework.boot/spring-boot-starter-web/3.0.2, Apache-2.0, approved, #5945 -maven/mavencentral/org.springframework.boot/spring-boot-starter-webflux/3.2.1, , restricted, clearlydefined +maven/mavencentral/org.springframework.boot/spring-boot-starter-webflux/3.2.1, Apache-2.0, approved, #12589 maven/mavencentral/org.springframework.boot/spring-boot-starter/3.2.1, Apache-2.0, approved, #11935 maven/mavencentral/org.springframework.boot/spring-boot/3.2.1, Apache-2.0, approved, #11752 maven/mavencentral/org.springframework.cloud/spring-cloud-commons/3.1.5, Apache-2.0, approved, #4726 @@ -102,20 +102,20 @@ maven/mavencentral/org.springframework.cloud/spring-cloud-context/3.1.5, Apache- maven/mavencentral/org.springframework.cloud/spring-cloud-starter-bootstrap/3.1.5, Apache-2.0, approved, clearlydefined maven/mavencentral/org.springframework.cloud/spring-cloud-starter/3.1.5, Apache-2.0, approved, #4723 maven/mavencentral/org.springframework.data/spring-data-commons/3.2.1, Apache-2.0, approved, #11917 -maven/mavencentral/org.springframework.data/spring-data-rest-core/4.2.1, , restricted, clearlydefined -maven/mavencentral/org.springframework.data/spring-data-rest-webmvc/4.2.1, , restricted, clearlydefined +maven/mavencentral/org.springframework.data/spring-data-rest-core/4.2.1, Apache-2.0, approved, #12591 +maven/mavencentral/org.springframework.data/spring-data-rest-webmvc/4.2.1, Apache-2.0, approved, #12595 maven/mavencentral/org.springframework.hateoas/spring-hateoas/2.2.0, Apache-2.0, approved, #11883 maven/mavencentral/org.springframework.plugin/spring-plugin-core/3.0.0, Apache-2.0, approved, #7104 maven/mavencentral/org.springframework.security/spring-security-config/6.2.1, Apache-2.0, approved, #11896 maven/mavencentral/org.springframework.security/spring-security-core/6.2.1, Apache-2.0, approved, #11904 maven/mavencentral/org.springframework.security/spring-security-crypto/6.2.1, Apache-2.0 AND ISC, approved, #11908 -maven/mavencentral/org.springframework.security/spring-security-oauth2-client/6.2.1, , restricted, clearlydefined +maven/mavencentral/org.springframework.security/spring-security-oauth2-client/6.2.1, Apache-2.0, approved, #12586 maven/mavencentral/org.springframework.security/spring-security-oauth2-core/6.2.1, Apache-2.0, approved, #11925 maven/mavencentral/org.springframework.security/spring-security-oauth2-jose/6.2.1, Apache-2.0, approved, #11893 maven/mavencentral/org.springframework.security/spring-security-rsa/1.0.11.RELEASE, Apache-2.0, approved, CQ20647 maven/mavencentral/org.springframework.security/spring-security-web/6.2.1, Apache-2.0, approved, #11911 -maven/mavencentral/org.springframework.session/spring-session-core/3.2.1, , restricted, clearlydefined -maven/mavencentral/org.springframework.session/spring-session-jdbc/3.2.1, , restricted, clearlydefined +maven/mavencentral/org.springframework.session/spring-session-core/3.2.1, Apache-2.0, approved, #12588 +maven/mavencentral/org.springframework.session/spring-session-jdbc/3.2.1, Apache-2.0, approved, #12596 maven/mavencentral/org.springframework/spring-aop/6.1.2, Apache-2.0, approved, #11755 maven/mavencentral/org.springframework/spring-beans/6.1.2, Apache-2.0, approved, #11754 maven/mavencentral/org.springframework/spring-context/6.1.2, Apache-2.0, approved, #11753 @@ -125,7 +125,7 @@ maven/mavencentral/org.springframework/spring-jcl/6.1.2, Apache-2.0, approved, # maven/mavencentral/org.springframework/spring-jdbc/6.1.2, Apache-2.0, approved, #11897 maven/mavencentral/org.springframework/spring-tx/6.1.2, Apache-2.0, approved, #11901 maven/mavencentral/org.springframework/spring-web/6.1.2, Apache-2.0, approved, #11748 -maven/mavencentral/org.springframework/spring-webflux/6.1.2, , restricted, clearlydefined +maven/mavencentral/org.springframework/spring-webflux/6.1.2, Apache-2.0, approved, #12593 maven/mavencentral/org.springframework/spring-webmvc/6.1.2, Apache-2.0, approved, #11879 maven/mavencentral/org.webjars/swagger-ui/4.15.5, Apache-2.0 AND MIT, approved, #5921 maven/mavencentral/org.webjars/webjars-locator-core/0.55, MIT, approved, clearlydefined From 2364db6621c30f5524b66404dd2a408088b82be1 Mon Sep 17 00:00:00 2001 From: Mathias Brunkow Moser Date: Tue, 2 Jan 2024 16:44:04 +0100 Subject: [PATCH 03/21] fix: fixed the irs exception handling when creating the job --- .../services/IrsService.java | 36 +++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/services/IrsService.java b/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/services/IrsService.java index 8c50f8140..2e52916d8 100644 --- a/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/services/IrsService.java +++ b/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/services/IrsService.java @@ -215,8 +215,40 @@ public String getChildren(String processId, String path, String globalAssetId, S try { String searchId = TreeManager.generateSearchId(processId, globalAssetId); Long created = DateTimeUtil.getTimestamp(); - Map irsResponse = this.startJob(processId, globalAssetId, searchId, bpn); - String jobId = irsResponse.get("id"); + Map irsResponse = null; + boolean error = true; + String exception = ""; + String jobId = null; + try { + irsResponse = this.startJob(processId, globalAssetId, searchId, bpn); + }catch (Exception e) { + exception = "["+e.getMessage()+"]"; + } + if(irsResponse != null){ + jobId = irsResponse.get("id"); + } + + if(jobId!=null && !jobId.equals("")){ + error = false; + }else{ + exception = "The Job Id is null or empty! " + exception; + } + if(error){ + LogUtil.printError("[PROCESS "+ processId + "] Failed to create the IRS Job for the globalAssetId [" + globalAssetId+"]! "+exception); + this.processManager.setJobHistory( + processId, + new JobHistory( + exception, + searchId, + globalAssetId, + path, + created, + created, + -2 + ) + ); + return null; + } LogUtil.printMessage("[PROCESS "+ processId + "] Job with id [" + jobId + "] created in the IRS for the globalAssetId [" + globalAssetId+"]"); this.processManager.setJobHistory( processId, From 109b1b2dc85dde8cd05852f0c1d971ed33e9432d Mon Sep 17 00:00:00 2001 From: Mathias Brunkow Moser Date: Tue, 2 Jan 2024 17:39:18 +0100 Subject: [PATCH 04/21] fix: check for repeated assets --- .../http/controllers/api/ContractController.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/http/controllers/api/ContractController.java b/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/http/controllers/api/ContractController.java index 5294d5edc..f0c9f56b9 100644 --- a/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/http/controllers/api/ContractController.java +++ b/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/http/controllers/api/ContractController.java @@ -183,16 +183,21 @@ public Response create(@Valid @RequestBody DiscoverySearch searchBody) { return httpUtil.buildResponse(response, httpResponse); } Long currentTimestamp = DateTimeUtil.getTimestamp(); - + Dtr tmpDtr = null; // Iterate over every DTR and add it to the file for(Dtr dtr: dtrs){ - Long validUntil = dtr.getValidUntil(); + Long validUntil = dtr.getValidUntil(); if(dtr.getContractId() == null || dtr.getContractId().isEmpty() || validUntil == null || validUntil < currentTimestamp){ requestDtrs = true; // If the cache invalidation time has come request Dtrs break; } - + if(tmpDtr == null){ + tmpDtr = dtr; + }else if(tmpDtr.getBpn().equals(dtr.getBpn()) && tmpDtr.getEndpoint().equals(dtr.getEndpoint()) && tmpDtr.getAssetId().equals(dtr.getAssetId())){ + requestDtrs = true; // If there is repeated DTRs clean the Endpoints + break; + } processManager.addSearchStatusDtr(processId, dtr); } if(requestDtrs){ From ec78252aa79193d984b9e60d2926941523fbba7d Mon Sep 17 00:00:00 2001 From: Mathias Brunkow Moser Date: Tue, 2 Jan 2024 17:47:55 +0100 Subject: [PATCH 05/21] chore: updated license to match the new year lincense header --- .../http/controllers/api/ContractController.java | 3 ++- .../http/controllers/api/IrsController.java | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/http/controllers/api/ContractController.java b/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/http/controllers/api/ContractController.java index f0c9f56b9..399523bc7 100644 --- a/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/http/controllers/api/ContractController.java +++ b/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/http/controllers/api/ContractController.java @@ -2,7 +2,8 @@ * * Catena-X - Product Passport Consumer Backend * - * Copyright (c) 2022, 2023 BASF SE, BMW AG, Henkel AG & Co. KGaA + * Copyright (c) 2022, 2024 BASF SE, BMW AG, Henkel AG & Co. KGaA + * Copyright (c) 2022, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. diff --git a/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/http/controllers/api/IrsController.java b/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/http/controllers/api/IrsController.java index 08ea00343..62c3fa706 100644 --- a/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/http/controllers/api/IrsController.java +++ b/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/http/controllers/api/IrsController.java @@ -2,8 +2,8 @@ * * Catena-X - Product Passport Consumer Backend * - * Copyright (c) 2022, 2023 BASF SE, BMW AG, Henkel AG & Co. KGaA - * Copyright (c) 2022, 2023 Contributors to the CatenaX (ng) GitHub Organisation. + * Copyright (c) 2022, 2024 BASF SE, BMW AG, Henkel AG & Co. KGaA + * Copyright (c) 2022, 2024 Contributors to the Eclipse Foundation * * * See the NOTICE file(s) distributed with this work for additional From 5e7f6f814e3b15b38b780ead256d5c8e2d17de16 Mon Sep 17 00:00:00 2001 From: Mathias Brunkow Moser Date: Tue, 2 Jan 2024 17:54:44 +0100 Subject: [PATCH 06/21] fix: fixed helm config map configuration --- charts/digital-product-pass/templates/configmap-backend.yaml | 4 +++- charts/digital-product-pass/values.yaml | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/charts/digital-product-pass/templates/configmap-backend.yaml b/charts/digital-product-pass/templates/configmap-backend.yaml index f02201c93..e88373592 100644 --- a/charts/digital-product-pass/templates/configmap-backend.yaml +++ b/charts/digital-product-pass/templates/configmap-backend.yaml @@ -101,7 +101,9 @@ data: transfer: {{ .Values.backend.digitalTwinRegistry.timeouts.transfer }} digitalTwin: {{ .Values.backend.digitalTwinRegistry.timeouts.digitalTwin }} # -- temporary storage of dDTRs for optimization - temporaryStorage: {{ .Values.backend.digitalTwinRegistry.temporaryStorage.enabled }} + temporaryStorage: + enabled: {{ .Values.backend.digitalTwinRegistry.temporaryStorage.enabled }} + lifetime: {{ .Values.backend.digitalTwinRegistry.temporaryStorage.lifetime }} # -- discovery configuration discovery: # -- discovery finder configuration diff --git a/charts/digital-product-pass/values.yaml b/charts/digital-product-pass/values.yaml index d7ea17dd8..88f377506 100644 --- a/charts/digital-product-pass/values.yaml +++ b/charts/digital-product-pass/values.yaml @@ -120,6 +120,7 @@ backend: # -- temporary storage of dDTRs for optimization temporaryStorage: enabled: true + lifetime: 12 # -- lifetime of the temporaryStorage in hours # -- discovery configuration discovery: From fbed779fdecbee4d16f0681745abbde646dc04a2 Mon Sep 17 00:00:00 2001 From: Mathias Brunkow Moser Date: Tue, 2 Jan 2024 17:59:05 +0100 Subject: [PATCH 07/21] chore: updated the configuration structure with default values --- charts/digital-product-pass/templates/configmap-backend.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/digital-product-pass/templates/configmap-backend.yaml b/charts/digital-product-pass/templates/configmap-backend.yaml index e88373592..95c418acc 100644 --- a/charts/digital-product-pass/templates/configmap-backend.yaml +++ b/charts/digital-product-pass/templates/configmap-backend.yaml @@ -102,8 +102,8 @@ data: digitalTwin: {{ .Values.backend.digitalTwinRegistry.timeouts.digitalTwin }} # -- temporary storage of dDTRs for optimization temporaryStorage: - enabled: {{ .Values.backend.digitalTwinRegistry.temporaryStorage.enabled }} - lifetime: {{ .Values.backend.digitalTwinRegistry.temporaryStorage.lifetime }} + enabled: {{ tpl (.Values.backend.digitalTwinRegistry.temporaryStorage.enabled | default true) . }} + lifetime: {{ tpl (.Values.backend.digitalTwinRegistry.temporaryStorage.lifetime | default 12) . }} # -- discovery configuration discovery: # -- discovery finder configuration From 224f0d058dc19ddd4ab6213fe46b208d1f374854 Mon Sep 17 00:00:00 2001 From: Mathias Brunkow Moser Date: Tue, 2 Jan 2024 18:05:04 +0100 Subject: [PATCH 08/21] chore: fixed the config map --- charts/digital-product-pass/templates/configmap-backend.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/digital-product-pass/templates/configmap-backend.yaml b/charts/digital-product-pass/templates/configmap-backend.yaml index 95c418acc..e88373592 100644 --- a/charts/digital-product-pass/templates/configmap-backend.yaml +++ b/charts/digital-product-pass/templates/configmap-backend.yaml @@ -102,8 +102,8 @@ data: digitalTwin: {{ .Values.backend.digitalTwinRegistry.timeouts.digitalTwin }} # -- temporary storage of dDTRs for optimization temporaryStorage: - enabled: {{ tpl (.Values.backend.digitalTwinRegistry.temporaryStorage.enabled | default true) . }} - lifetime: {{ tpl (.Values.backend.digitalTwinRegistry.temporaryStorage.lifetime | default 12) . }} + enabled: {{ .Values.backend.digitalTwinRegistry.temporaryStorage.enabled }} + lifetime: {{ .Values.backend.digitalTwinRegistry.temporaryStorage.lifetime }} # -- discovery configuration discovery: # -- discovery finder configuration From 26296b29bee1ac991ab96b92b0ee0809217235f8 Mon Sep 17 00:00:00 2001 From: Mathias Brunkow Moser Date: Tue, 2 Jan 2024 18:30:39 +0100 Subject: [PATCH 09/21] feat: added function to check for duplicates --- .../managers/DtrSearchManager.java | 25 ++++++++++++++++--- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/managers/DtrSearchManager.java b/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/managers/DtrSearchManager.java index 454cff907..dab8130fe 100644 --- a/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/managers/DtrSearchManager.java +++ b/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/managers/DtrSearchManager.java @@ -2,8 +2,8 @@ * * Catena-X - Product Passport Consumer Backend * - * Copyright (c) 2022, 2023 BASF SE, BMW AG, Henkel AG & Co. KGaA - * Copyright (c) 2022, 2023 Contributors to the CatenaX (ng) GitHub Organisation. + * Copyright (c) 2022, 2024 BASF SE, BMW AG, Henkel AG & Co. KGaA + * Copyright (c) 2022, 2024 Contributors to the Eclipse Foundation * * * See the NOTICE file(s) distributed with this work for additional @@ -345,7 +345,7 @@ public void run() { public DtrSearchManager addConnectionToBpnEntry(String bpn, Dtr dtr) { if (!(bpn == null || bpn.isEmpty() || bpn.isBlank() || dtr.getEndpoint().isEmpty() || dtr.getEndpoint().isBlank())) { if (this.dtrDataModel.containsKey(bpn)) { - if (!this.dtrDataModel.get(bpn).contains(dtr)){ + if (!hasDtrDuplicates(this.dtrDataModel.get(bpn), dtr)){ this.dtrDataModel.get(bpn).add(dtr); } } else { @@ -354,6 +354,23 @@ public DtrSearchManager addConnectionToBpnEntry(String bpn, Dtr dtr) { } return this; } + /** + * Check if elements are present in array list already as duplicates + *

+ * @param dtrList + * the {@code List} list of dtrs + * @param dtr + * the {@code DTR} object to check if exists + * + * @return this {@code DtrSearchManager} object. + * + */ + public Boolean hasDtrDuplicates(List dtrList, Dtr dtr){ + if(dtrList.contains(dtr)){ + return true; + } + return dtrList.stream().anyMatch(e -> e.getAssetId().equals(dtr.getAssetId()) && e.getEndpoint().equals(dtr.getEndpoint()) && e.getBpn().equals(dtr.getBpn())); + } /** * Loads the thread safe DTR Data Model from the storage file. @@ -469,7 +486,7 @@ public boolean saveDtrDataModel() { this.createDataModelFile(); } String filePath = jsonUtil.toJsonFile(this.dtrDataModelFilePath, this.dtrDataModel, true); - LogUtil.printMessage("[DTR DataModel] Saved [" + this.dtrDataModel.size() + "] assets in DTR data model."); + LogUtil.printMessage("[DTR DataModel] [" + this.dtrDataModel.size() + "] Digital Twin Registries available at the dtrDataModel."); return filePath != null; } From 6078ce4918b1fb9345db850363f37041527a15ac Mon Sep 17 00:00:00 2001 From: Mathias Brunkow Moser Date: Wed, 3 Jan 2024 09:44:48 +0100 Subject: [PATCH 10/21] feat: initial structure prepared for check of multiple bpns --- .../controllers/api/ContractController.java | 6 ++++- .../managers/DtrSearchManager.java | 26 +++++++++++++++++-- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/http/controllers/api/ContractController.java b/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/http/controllers/api/ContractController.java index 399523bc7..755cd73f1 100644 --- a/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/http/controllers/api/ContractController.java +++ b/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/http/controllers/api/ContractController.java @@ -165,7 +165,11 @@ public Response create(@Valid @RequestBody DiscoverySearch searchBody) { LogUtil.printWarning("Failed to load data model from disk!"); } } - // This checks if the cache is deactivated or if the bns are not in thedataModel, if one of them is not in the data model then we need to check for them + System.out.println("Temporary Storage is: "+dtrConfig.getTemporaryStorage().getEnabled()); + System.out.println(dataModel); + System.out.println(bpnList); + System.out.println("Has all keys: "+jsonUtil.checkJsonKeys(dataModel, bpnList, ".", false)); + // This checks if the cache is deactivated or if the bns are not in the dataModel, if one of them is not in the data model then we need to check for them if(!dtrConfig.getTemporaryStorage().getEnabled() || ((dataModel==null) || !jsonUtil.checkJsonKeys(dataModel, bpnList, ".", false))){ catenaXService.searchDTRs(bpnList, processId); }else{ diff --git a/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/managers/DtrSearchManager.java b/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/managers/DtrSearchManager.java index dab8130fe..1e56374cf 100644 --- a/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/managers/DtrSearchManager.java +++ b/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/managers/DtrSearchManager.java @@ -208,6 +208,11 @@ public void searchEndpoint(String processId, String bpn, String endpoint){ try { if (!asyncThread.join(Duration.ofSeconds(searchTimeoutSeconds))) { asyncThread.interrupt(); + if (dtrConfig.getTemporaryStorage().getEnabled()) { + addConnectionToBpnEntry(bpn, null); + saveDtrDataModel(); + } + LogUtil.printWarning("Failed to retrieve the Catalog due a timeout for the URL: " + endpoint); return; } @@ -343,7 +348,10 @@ public void run() { * */ public DtrSearchManager addConnectionToBpnEntry(String bpn, Dtr dtr) { - if (!(bpn == null || bpn.isEmpty() || bpn.isBlank() || dtr.getEndpoint().isEmpty() || dtr.getEndpoint().isBlank())) { + if(bpn == null || bpn.isEmpty() || bpn.isBlank()){ + return this; + } + if (!(dtr == null || dtr.getEndpoint().isEmpty() || dtr.getEndpoint().isBlank())) { if (this.dtrDataModel.containsKey(bpn)) { if (!hasDtrDuplicates(this.dtrDataModel.get(bpn), dtr)){ this.dtrDataModel.get(bpn).add(dtr); @@ -351,6 +359,8 @@ public DtrSearchManager addConnectionToBpnEntry(String bpn, Dtr dtr) { } else { this.dtrDataModel.put(bpn, new ArrayList<>(){{add(dtr);}}); } + }else{ + this.dtrDataModel.put(bpn, new ArrayList<>(){}); } return this; } @@ -369,7 +379,17 @@ public Boolean hasDtrDuplicates(List dtrList, Dtr dtr){ if(dtrList.contains(dtr)){ return true; } - return dtrList.stream().anyMatch(e -> e.getAssetId().equals(dtr.getAssetId()) && e.getEndpoint().equals(dtr.getEndpoint()) && e.getBpn().equals(dtr.getBpn())); + List dtrListParsed = null; + try { + dtrListParsed = (List) jsonUtil.bindReferenceType(dtrList, new TypeReference>() { + }); + } catch (Exception e) { + throw new ManagerException(this.getClass().getName(), e, "Could not bind the reference type for the DTR list!"); + } + if(dtrListParsed == null){ + throw new ManagerException(this.getClass().getName(), "Could not bind the reference type for the DTR list because it is null!"); + } + return dtrListParsed.stream().anyMatch(e -> e.getAssetId().equals(dtr.getAssetId()) && e.getEndpoint().equals(dtr.getEndpoint()) && e.getBpn().equals(dtr.getBpn())); } /** @@ -515,6 +535,8 @@ public void deleteBpns(ConcurrentHashMap> dataModel, List Date: Wed, 3 Jan 2024 10:33:38 +0100 Subject: [PATCH 11/21] chore: updated axios library to v1.6.0 and added i18n 9.2.2 --- DEPENDENCIES_FRONTEND | 19 ++- package-lock.json | 276 +++++++++++++++++++++++++++++++++++++++--- package.json | 5 +- 3 files changed, 281 insertions(+), 19 deletions(-) diff --git a/DEPENDENCIES_FRONTEND b/DEPENDENCIES_FRONTEND index edd0ee959..97d328fd1 100644 --- a/DEPENDENCIES_FRONTEND +++ b/DEPENDENCIES_FRONTEND @@ -11,7 +11,8 @@ npm/npmjs/-/ansi-styles/4.3.0, MIT, approved, clearlydefined npm/npmjs/-/anymatch/3.1.3, ISC, approved, #5050 npm/npmjs/-/argparse/1.0.10, MIT, approved, #2174 npm/npmjs/-/astral-regex/2.0.0, MIT, approved, clearlydefined -npm/npmjs/-/axios/0.26.0, MIT, approved, clearlydefined +npm/npmjs/-/asynckit/0.4.0, MIT, approved, clearlydefined +npm/npmjs/-/axios/1.6.3, MIT, approved, #11338 npm/npmjs/-/balanced-match/1.0.2, MIT, approved, clearlydefined npm/npmjs/-/base64-js/1.5.1, MIT, approved, clearlydefined npm/npmjs/-/binary-extensions/2.2.0, MIT, approved, clearlydefined @@ -29,6 +30,7 @@ npm/npmjs/-/color-convert/1.9.3, MIT, approved, clearlydefined npm/npmjs/-/color-convert/2.0.1, MIT, approved, clearlydefined npm/npmjs/-/color-name/1.1.3, MIT, approved, clearlydefined npm/npmjs/-/color-name/1.1.4, MIT, approved, clearlydefined +npm/npmjs/-/combined-stream/1.0.8, MIT, approved, clearlydefined npm/npmjs/-/commander/8.3.0, MIT, approved, clearlydefined npm/npmjs/-/commondir/1.0.1, MIT, approved, clearlydefined npm/npmjs/-/concat-map/0.0.1, MIT, approved, clearlydefined @@ -42,6 +44,7 @@ npm/npmjs/-/debug/4.3.4, MIT, approved, clearlydefined npm/npmjs/-/deep-is/0.1.4, MIT, approved, #2130 npm/npmjs/-/deepmerge/4.2.2, MIT, approved, clearlydefined npm/npmjs/-/define-lazy-prop/2.0.0, MIT, approved, clearlydefined +npm/npmjs/-/delayed-stream/1.0.0, MIT, approved, clearlydefined npm/npmjs/-/doctrine/3.0.0, Apache-2.0 AND BSD-2-Clause, approved, CQ22628 npm/npmjs/-/emoji-regex/8.0.0, MIT, approved, clearlydefined npm/npmjs/-/enquirer/2.3.6, MIT AND (ISC AND MIT), approved, #2727 @@ -79,7 +82,8 @@ npm/npmjs/-/find-cache-dir/3.3.2, MIT, approved, clearlydefined npm/npmjs/-/find-up/4.1.0, MIT, approved, clearlydefined npm/npmjs/-/flat-cache/3.0.4, MIT, approved, clearlydefined npm/npmjs/-/flatted/3.2.7, ISC AND (ISC AND MIT), approved, #2430 -npm/npmjs/-/follow-redirects/1.14.9, MIT, approved, clearlydefined +npm/npmjs/-/follow-redirects/1.15.4, MIT, approved, #10782 +npm/npmjs/-/form-data/4.0.0, MIT, approved, clearlydefined npm/npmjs/-/fs-extra/11.1.0, MIT, approved, #5742 npm/npmjs/-/fs.realpath/1.0.0, ISC, approved, clearlydefined npm/npmjs/-/fsevents/2.3.2, MIT, approved, #2967 @@ -127,6 +131,8 @@ npm/npmjs/-/magic-string/0.25.9, MIT, approved, clearlydefined npm/npmjs/-/make-dir/3.1.0, MIT, approved, clearlydefined npm/npmjs/-/merge2/1.4.1, MIT, approved, clearlydefined npm/npmjs/-/micromatch/4.0.5, MIT, approved, clearlydefined +npm/npmjs/-/mime-db/1.52.0, MIT, approved, clearlydefined +npm/npmjs/-/mime-types/2.1.35, MIT, approved, clearlydefined npm/npmjs/-/minimatch/3.1.2, ISC, approved, clearlydefined npm/npmjs/-/minimatch/5.1.6, ISC, approved, #5952 npm/npmjs/-/ms/2.1.2, MIT, approved, #5895 @@ -156,6 +162,7 @@ npm/npmjs/-/postcss/8.4.31, MIT, approved, #3545 npm/npmjs/-/prelude-ls/1.2.1, MIT, approved, clearlydefined npm/npmjs/-/process/0.11.10, MIT, approved, CQ23452 npm/npmjs/-/progress/2.0.3, MIT, approved, clearlydefined +npm/npmjs/-/proxy-from-env/1.1.0, MIT, approved, clearlydefined npm/npmjs/-/punycode/2.3.0, MIT, approved, #6373 npm/npmjs/-/queue-microtask/1.2.3, MIT, approved, clearlydefined npm/npmjs/-/readdirp/3.6.0, MIT, approved, #2977 @@ -211,6 +218,7 @@ npm/npmjs/-/vscode-languageserver-types/3.16.0, MIT, approved, clearlydefined npm/npmjs/-/vscode-languageserver/7.0.0, MIT, approved, clearlydefined npm/npmjs/-/vscode-uri/3.0.7, MIT, approved, #5741 npm/npmjs/-/vue-eslint-parser/9.1.0, MIT, approved, #7091 +npm/npmjs/-/vue-i18n/9.2.2, MIT, approved, clearlydefined npm/npmjs/-/vue-router/4.0.13, MIT, approved, clearlydefined npm/npmjs/-/vue-template-compiler/2.7.14, 0BSD AND MIT AND MIT, approved, #3476 npm/npmjs/-/vue-tsc/1.0.24, MIT, approved, clearlydefined @@ -260,6 +268,11 @@ npm/npmjs/@esbuild/win32-x64/0.17.19, Apache-2.0 AND MIT AND BSD-3-Clause AND (B npm/npmjs/@eslint/eslintrc/0.4.3, MIT, approved, clearlydefined npm/npmjs/@humanwhocodes/config-array/0.5.0, Apache-2.0, approved, clearlydefined npm/npmjs/@humanwhocodes/object-schema/1.2.1, BSD-3-Clause, approved, clearlydefined +npm/npmjs/@intlify/core-base/9.2.2, MIT, approved, clearlydefined +npm/npmjs/@intlify/devtools-if/9.2.2, MIT, approved, clearlydefined +npm/npmjs/@intlify/message-compiler/9.2.2, MIT, approved, clearlydefined +npm/npmjs/@intlify/shared/9.2.2, MIT, approved, clearlydefined +npm/npmjs/@intlify/vue-devtools/9.2.2, MIT, approved, clearlydefined npm/npmjs/@mdi/font/5.9.55, Apache-2.0, approved, clearlydefined npm/npmjs/@nodelib/fs.scandir/2.1.5, MIT, approved, clearlydefined npm/npmjs/@nodelib/fs.stat/2.0.5, MIT, approved, clearlydefined @@ -275,7 +288,7 @@ npm/npmjs/@vue/compiler-core/3.2.47, MIT, approved, #7097 npm/npmjs/@vue/compiler-dom/3.2.47, MIT, approved, #7093 npm/npmjs/@vue/compiler-sfc/3.2.47, MIT, approved, #3104 npm/npmjs/@vue/compiler-ssr/3.2.47, MIT, approved, #7098 -npm/npmjs/@vue/devtools-api/6.0.12, MIT, approved, clearlydefined +npm/npmjs/@vue/devtools-api/6.5.1, MIT, approved, clearlydefined npm/npmjs/@vue/reactivity-transform/3.2.47, MIT, approved, #3096 npm/npmjs/@vue/reactivity/3.2.47, MIT, approved, #7088 npm/npmjs/@vue/runtime-core/3.2.47, MIT, approved, #7086 diff --git a/package-lock.json b/package-lock.json index e1772e6c3..31c296721 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,17 +1,17 @@ { "name": "digital-product-pass-frontend", - "version": "2.0.0", + "version": "2.0.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "digital-product-pass-frontend", - "version": "2.0.0", + "version": "2.0.1", "dependencies": { "@mdi/font": "5.9.55", "@popperjs/core": "^2.11.2", "@vitejs/plugin-vue": "^4.0.0", - "axios": "^0.26.0", + "axios": ">=1.6.0", "core-js": "^3.8.3", "crypto-js": "^4.2.0", "eslint-config-prettier": "^8.5.0", @@ -22,6 +22,7 @@ "vite": ">=4.1.5", "vite-plugin-vuetify": "^1.0.2", "vue": "^3.2.47", + "vue-i18n": "9.2.2", "vue-router": "^4.0.13", "vue3-qrcode-reader": "^0.0.1", "vuetify": "^3.1.4", @@ -482,6 +483,63 @@ "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", "dev": true }, + "node_modules/@intlify/core-base": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/@intlify/core-base/-/core-base-9.2.2.tgz", + "integrity": "sha512-JjUpQtNfn+joMbrXvpR4hTF8iJQ2sEFzzK3KIESOx+f+uwIjgw20igOyaIdhfsVVBCds8ZM64MoeNSx+PHQMkA==", + "dependencies": { + "@intlify/devtools-if": "9.2.2", + "@intlify/message-compiler": "9.2.2", + "@intlify/shared": "9.2.2", + "@intlify/vue-devtools": "9.2.2" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/@intlify/devtools-if": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/@intlify/devtools-if/-/devtools-if-9.2.2.tgz", + "integrity": "sha512-4ttr/FNO29w+kBbU7HZ/U0Lzuh2cRDhP8UlWOtV9ERcjHzuyXVZmjyleESK6eVP60tGC9QtQW9yZE+JeRhDHkg==", + "dependencies": { + "@intlify/shared": "9.2.2" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/@intlify/message-compiler": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/@intlify/message-compiler/-/message-compiler-9.2.2.tgz", + "integrity": "sha512-IUrQW7byAKN2fMBe8z6sK6riG1pue95e5jfokn8hA5Q3Bqy4MBJ5lJAofUsawQJYHeoPJ7svMDyBaVJ4d0GTtA==", + "dependencies": { + "@intlify/shared": "9.2.2", + "source-map": "0.6.1" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/@intlify/shared": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/@intlify/shared/-/shared-9.2.2.tgz", + "integrity": "sha512-wRwTpsslgZS5HNyM7uDQYZtxnbI12aGiBZURX3BTR9RFIKKRWpllTsgzHWvj3HKm3Y2Sh5LPC1r0PDCKEhVn9Q==", + "engines": { + "node": ">= 14" + } + }, + "node_modules/@intlify/vue-devtools": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/@intlify/vue-devtools/-/vue-devtools-9.2.2.tgz", + "integrity": "sha512-+dUyqyCHWHb/UcvY1MlIpO87munedm3Gn6E9WWYdWrMuYLcoIoOEVDWSS8xSwtlPU+kA+MEQTP6Q1iI/ocusJg==", + "dependencies": { + "@intlify/core-base": "9.2.2", + "@intlify/shared": "9.2.2" + }, + "engines": { + "node": ">= 14" + } + }, "node_modules/@mdi/font": { "version": "5.9.55", "license": "Apache-2.0" @@ -663,8 +721,9 @@ } }, "node_modules/@vue/devtools-api": { - "version": "6.0.12", - "license": "MIT" + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/@vue/devtools-api/-/devtools-api-6.5.1.tgz", + "integrity": "sha512-+KpckaAQyfbvshdDW5xQylLni1asvNSGme1JFs8I1+/H5pHEhqUKMEQD/qn3Nx5+/nycBq11qAEi8lk+LXI2dA==" }, "node_modules/@vue/reactivity": { "version": "3.2.47", @@ -848,11 +907,19 @@ "node": ">=8" } }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" + }, "node_modules/axios": { - "version": "0.26.0", - "license": "MIT", + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.3.tgz", + "integrity": "sha512-fWyNdeawGam70jXSVlKl+SUNVcL6j6W79CuSIPfi6HnDUmSCH6gyUys/HrqHeA/wU0Az41rRgean494d0Jb+ww==", "dependencies": { - "follow-redirects": "^1.14.8" + "follow-redirects": "^1.15.0", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" } }, "node_modules/balanced-match": { @@ -1011,6 +1078,17 @@ "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", "dev": true }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/commondir": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", @@ -1104,6 +1182,14 @@ "node": ">=8" } }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/doctrine": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", @@ -1724,14 +1810,15 @@ "dev": true }, "node_modules/follow-redirects": { - "version": "1.14.9", + "version": "1.15.4", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.4.tgz", + "integrity": "sha512-Cr4D/5wlrb0z9dgERpUL3LrmPKVDsETIJhaCMeDfuFYcqa5bldGV6wBsAN6X/vxlXQtFBMrXdXxdL8CbDTGniw==", "funding": [ { "type": "individual", "url": "https://github.com/sponsors/RubenVerborgh" } ], - "license": "MIT", "engines": { "node": ">=4.0" }, @@ -1741,6 +1828,19 @@ } } }, + "node_modules/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -2123,6 +2223,25 @@ "node": ">=8.6" } }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, "node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", @@ -2424,6 +2543,11 @@ "node": ">=0.4.0" } }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" + }, "node_modules/punycode": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", @@ -3301,6 +3425,23 @@ "node": ">=4.0" } }, + "node_modules/vue-i18n": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/vue-i18n/-/vue-i18n-9.2.2.tgz", + "integrity": "sha512-yswpwtj89rTBhegUAv9Mu37LNznyu3NpyLQmozF3i1hYOhwpG8RjcjIFIIfnu+2MDZJGSZPXaKWvnQA71Yv9TQ==", + "dependencies": { + "@intlify/core-base": "9.2.2", + "@intlify/shared": "9.2.2", + "@intlify/vue-devtools": "9.2.2", + "@vue/devtools-api": "^6.2.1" + }, + "engines": { + "node": ">= 14" + }, + "peerDependencies": { + "vue": "^3.0.0" + } + }, "node_modules/vue-router": { "version": "4.0.13", "license": "MIT", @@ -3770,6 +3911,48 @@ "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", "dev": true }, + "@intlify/core-base": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/@intlify/core-base/-/core-base-9.2.2.tgz", + "integrity": "sha512-JjUpQtNfn+joMbrXvpR4hTF8iJQ2sEFzzK3KIESOx+f+uwIjgw20igOyaIdhfsVVBCds8ZM64MoeNSx+PHQMkA==", + "requires": { + "@intlify/devtools-if": "9.2.2", + "@intlify/message-compiler": "9.2.2", + "@intlify/shared": "9.2.2", + "@intlify/vue-devtools": "9.2.2" + } + }, + "@intlify/devtools-if": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/@intlify/devtools-if/-/devtools-if-9.2.2.tgz", + "integrity": "sha512-4ttr/FNO29w+kBbU7HZ/U0Lzuh2cRDhP8UlWOtV9ERcjHzuyXVZmjyleESK6eVP60tGC9QtQW9yZE+JeRhDHkg==", + "requires": { + "@intlify/shared": "9.2.2" + } + }, + "@intlify/message-compiler": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/@intlify/message-compiler/-/message-compiler-9.2.2.tgz", + "integrity": "sha512-IUrQW7byAKN2fMBe8z6sK6riG1pue95e5jfokn8hA5Q3Bqy4MBJ5lJAofUsawQJYHeoPJ7svMDyBaVJ4d0GTtA==", + "requires": { + "@intlify/shared": "9.2.2", + "source-map": "0.6.1" + } + }, + "@intlify/shared": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/@intlify/shared/-/shared-9.2.2.tgz", + "integrity": "sha512-wRwTpsslgZS5HNyM7uDQYZtxnbI12aGiBZURX3BTR9RFIKKRWpllTsgzHWvj3HKm3Y2Sh5LPC1r0PDCKEhVn9Q==" + }, + "@intlify/vue-devtools": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/@intlify/vue-devtools/-/vue-devtools-9.2.2.tgz", + "integrity": "sha512-+dUyqyCHWHb/UcvY1MlIpO87munedm3Gn6E9WWYdWrMuYLcoIoOEVDWSS8xSwtlPU+kA+MEQTP6Q1iI/ocusJg==", + "requires": { + "@intlify/core-base": "9.2.2", + "@intlify/shared": "9.2.2" + } + }, "@mdi/font": { "version": "5.9.55" }, @@ -3928,7 +4111,9 @@ } }, "@vue/devtools-api": { - "version": "6.0.12" + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/@vue/devtools-api/-/devtools-api-6.5.1.tgz", + "integrity": "sha512-+KpckaAQyfbvshdDW5xQylLni1asvNSGme1JFs8I1+/H5pHEhqUKMEQD/qn3Nx5+/nycBq11qAEi8lk+LXI2dA==" }, "@vue/reactivity": { "version": "3.2.47", @@ -4071,10 +4256,19 @@ "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", "dev": true }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" + }, "axios": { - "version": "0.26.0", + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.3.tgz", + "integrity": "sha512-fWyNdeawGam70jXSVlKl+SUNVcL6j6W79CuSIPfi6HnDUmSCH6gyUys/HrqHeA/wU0Az41rRgean494d0Jb+ww==", "requires": { - "follow-redirects": "^1.14.8" + "follow-redirects": "^1.15.0", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" } }, "balanced-match": { @@ -4190,6 +4384,14 @@ "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", "dev": true }, + "combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "requires": { + "delayed-stream": "~1.0.0" + } + }, "commondir": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", @@ -4257,6 +4459,11 @@ "integrity": "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==", "dev": true }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==" + }, "doctrine": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", @@ -4718,7 +4925,19 @@ "dev": true }, "follow-redirects": { - "version": "1.14.9" + "version": "1.15.4", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.4.tgz", + "integrity": "sha512-Cr4D/5wlrb0z9dgERpUL3LrmPKVDsETIJhaCMeDfuFYcqa5bldGV6wBsAN6X/vxlXQtFBMrXdXxdL8CbDTGniw==" + }, + "form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + } }, "fs.realpath": { "version": "1.0.0", @@ -5013,6 +5232,19 @@ "picomatch": "^2.3.1" } }, + "mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==" + }, + "mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "requires": { + "mime-db": "1.52.0" + } + }, "minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", @@ -5211,6 +5443,11 @@ "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", "dev": true }, + "proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" + }, "punycode": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", @@ -5778,6 +6015,17 @@ } } }, + "vue-i18n": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/vue-i18n/-/vue-i18n-9.2.2.tgz", + "integrity": "sha512-yswpwtj89rTBhegUAv9Mu37LNznyu3NpyLQmozF3i1hYOhwpG8RjcjIFIIfnu+2MDZJGSZPXaKWvnQA71Yv9TQ==", + "requires": { + "@intlify/core-base": "9.2.2", + "@intlify/shared": "9.2.2", + "@intlify/vue-devtools": "9.2.2", + "@vue/devtools-api": "^6.2.1" + } + }, "vue-router": { "version": "4.0.13", "requires": { diff --git a/package.json b/package.json index abb41b450..2bde68311 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "digital-product-pass-frontend", - "version": "2.0.0", + "version": "2.0.1", "private": true, "scripts": { "serve": "vite --host localhost", @@ -15,7 +15,7 @@ "@mdi/font": "5.9.55", "@popperjs/core": "^2.11.2", "@vitejs/plugin-vue": "^4.0.0", - "axios": "^0.26.0", + "axios": ">=1.6.0", "core-js": "^3.8.3", "crypto-js": "^4.2.0", "eslint-config-prettier": "^8.5.0", @@ -26,6 +26,7 @@ "vite": ">=4.1.5", "vite-plugin-vuetify": "^1.0.2", "vue": "^3.2.47", + "vue-i18n": "9.2.2", "vue-router": "^4.0.13", "vue3-qrcode-reader": "^0.0.1", "vuetify": "^3.1.4", From 7c543da1441d251877d14bd17edb824aa8541364 Mon Sep 17 00:00:00 2001 From: Mathias Brunkow Moser Date: Wed, 3 Jan 2024 10:42:36 +0100 Subject: [PATCH 12/21] chore: added new header licenses --- .../templates/configmap-backend.yaml | 5 +++-- charts/digital-product-pass/values.yaml | 6 +++--- dpp-backend/digitalproductpass/pom.xml | 11 ++++------- .../http/controllers/api/ContractController.java | 3 ++- .../http/controllers/api/IrsController.java | 2 +- .../digitalproductpass/managers/DtrSearchManager.java | 2 +- .../digitalproductpass/services/IrsService.java | 6 ++++-- .../src/main/resources/application.yml | 5 +++-- 8 files changed, 21 insertions(+), 19 deletions(-) diff --git a/charts/digital-product-pass/templates/configmap-backend.yaml b/charts/digital-product-pass/templates/configmap-backend.yaml index e88373592..ba8c9285c 100644 --- a/charts/digital-product-pass/templates/configmap-backend.yaml +++ b/charts/digital-product-pass/templates/configmap-backend.yaml @@ -1,7 +1,8 @@ ################################################################################# -# Catena-X - Product Passport Consumer Application +# Catena-X - Digital Product Pass Application # -# Copyright (c) 2022, 2023 BASF SE, BMW AG, Henkel AG & Co. KGaA +# Copyright (c) 2022, 2024 BASF SE, BMW AG, Henkel AG & Co. KGaA +# Copyright (c) 2022, 2024 Contributors to the Eclipse Foundation # # See the NOTICE file(s) distributed with this work for additional # information regarding copyright ownership. diff --git a/charts/digital-product-pass/values.yaml b/charts/digital-product-pass/values.yaml index 88f377506..4f30d65da 100644 --- a/charts/digital-product-pass/values.yaml +++ b/charts/digital-product-pass/values.yaml @@ -1,7 +1,8 @@ ################################################################################# -# Catena-X - Product Passport Consumer Application +# Catena-X - Digital Product Pass Application # -# Copyright (c) 2022, 2023 BASF SE, BMW AG, Henkel AG & Co. KGaA +# Copyright (c) 2022, 2024 BASF SE, BMW AG, Henkel AG & Co. KGaA +# Copyright (c) 2022, 2024 Contributors to the Eclipse Foundation # # See the NOTICE file(s) distributed with this work for additional # information regarding copyright ownership. @@ -20,7 +21,6 @@ # SPDX-License-Identifier: Apache-2.0 ################################################################################# -# Default values for dpp-frontend. # This is a YAML-formatted file. # Declare variables to be passed into your templates. diff --git a/dpp-backend/digitalproductpass/pom.xml b/dpp-backend/digitalproductpass/pom.xml index 1e5e0190f..302f017f5 100644 --- a/dpp-backend/digitalproductpass/pom.xml +++ b/dpp-backend/digitalproductpass/pom.xml @@ -1,10 +1,11 @@ org.yaml snakeyaml diff --git a/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/http/controllers/api/ContractController.java b/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/http/controllers/api/ContractController.java index 755cd73f1..7d5973386 100644 --- a/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/http/controllers/api/ContractController.java +++ b/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/http/controllers/api/ContractController.java @@ -1,10 +1,11 @@ /********************************************************************************* * - * Catena-X - Product Passport Consumer Backend + * Catena-X - Digital Product Pass Backend * * Copyright (c) 2022, 2024 BASF SE, BMW AG, Henkel AG & Co. KGaA * Copyright (c) 2022, 2024 Contributors to the Eclipse Foundation * + * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. * diff --git a/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/http/controllers/api/IrsController.java b/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/http/controllers/api/IrsController.java index 62c3fa706..ab4950ef1 100644 --- a/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/http/controllers/api/IrsController.java +++ b/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/http/controllers/api/IrsController.java @@ -1,6 +1,6 @@ /********************************************************************************* * - * Catena-X - Product Passport Consumer Backend + * Catena-X - Digital Product Pass Backend * * Copyright (c) 2022, 2024 BASF SE, BMW AG, Henkel AG & Co. KGaA * Copyright (c) 2022, 2024 Contributors to the Eclipse Foundation diff --git a/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/managers/DtrSearchManager.java b/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/managers/DtrSearchManager.java index 1e56374cf..0d34152e2 100644 --- a/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/managers/DtrSearchManager.java +++ b/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/managers/DtrSearchManager.java @@ -1,6 +1,6 @@ /********************************************************************************* * - * Catena-X - Product Passport Consumer Backend + * Catena-X - Digital Product Pass Backend * * Copyright (c) 2022, 2024 BASF SE, BMW AG, Henkel AG & Co. KGaA * Copyright (c) 2022, 2024 Contributors to the Eclipse Foundation diff --git a/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/services/IrsService.java b/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/services/IrsService.java index 2e52916d8..44af019fc 100644 --- a/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/services/IrsService.java +++ b/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/services/IrsService.java @@ -1,8 +1,10 @@ /********************************************************************************* * - * Catena-X - Product Passport Consumer Backend + * Catena-X - Digital Product Pass Backend + * + * Copyright (c) 2022, 2024 BASF SE, BMW AG, Henkel AG & Co. KGaA + * Copyright (c) 2022, 2024 Contributors to the Eclipse Foundation * - * Copyright (c) 2022, 2023 BASF SE, BMW AG, Henkel AG & Co. KGaA * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. diff --git a/dpp-backend/digitalproductpass/src/main/resources/application.yml b/dpp-backend/digitalproductpass/src/main/resources/application.yml index eda024e0b..200fe7627 100644 --- a/dpp-backend/digitalproductpass/src/main/resources/application.yml +++ b/dpp-backend/digitalproductpass/src/main/resources/application.yml @@ -1,7 +1,8 @@ ################################################################################# -# Catena-X - Product Passport Consumer Backend +# Catena-X - Digital Product Pass Backend # -# Copyright (c) 2022, 2023 BASF SE, BMW AG, Henkel AG & Co. KGaA +# Copyright (c) 2022, 2024 BASF SE, BMW AG, Henkel AG & Co. KGaA +# Copyright (c) 2022, 2024 Contributors to the Eclipse Foundation # # See the NOTICE file(s) distributed with this work for additional # information regarding copyright ownership. From 3964ed0d6d23cd9819426cedb0fe73c8239b13f2 Mon Sep 17 00:00:00 2001 From: Mathias Brunkow Moser Date: Wed, 3 Jan 2024 11:17:36 +0100 Subject: [PATCH 13/21] chore: fixed authors names --- AUTHORS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AUTHORS.md b/AUTHORS.md index 7b74bfb23..7ef767dfb 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -24,7 +24,7 @@ The following people have contributed to this repository: -* Braun Jochen, CGI, https://github.com/jocbra +* Jochen Braun, CGI, https://github.com/jocbra * Muhammad Saud Khan, CGI, https://github.com/saudkhan116 * Mathias Brunkow Moser, CGI, https://github.com/matbmoser * David Zynda, BASF, https://github.com/davidzynda From ff52f02ee0b88cd24df79ef41d814f3fa425d4bc Mon Sep 17 00:00:00 2001 From: Mathias Brunkow Moser Date: Wed, 3 Jan 2024 17:23:45 +0100 Subject: [PATCH 14/21] feat: updated the log structure and the temporary storage to store invalid endpoints too --- .../controllers/api/ContractController.java | 41 ++++-------- .../listeners/AppListener.java | 4 +- .../managers/DtrSearchManager.java | 64 ++++++++++++------- .../models/catenax/Dtr.java | 23 ++++++- .../src/main/java/utils/JsonUtil.java | 2 +- 5 files changed, 80 insertions(+), 54 deletions(-) diff --git a/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/http/controllers/api/ContractController.java b/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/http/controllers/api/ContractController.java index 7d5973386..8adf6b3bd 100644 --- a/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/http/controllers/api/ContractController.java +++ b/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/http/controllers/api/ContractController.java @@ -166,10 +166,6 @@ public Response create(@Valid @RequestBody DiscoverySearch searchBody) { LogUtil.printWarning("Failed to load data model from disk!"); } } - System.out.println("Temporary Storage is: "+dtrConfig.getTemporaryStorage().getEnabled()); - System.out.println(dataModel); - System.out.println(bpnList); - System.out.println("Has all keys: "+jsonUtil.checkJsonKeys(dataModel, bpnList, ".", false)); // This checks if the cache is deactivated or if the bns are not in the dataModel, if one of them is not in the data model then we need to check for them if(!dtrConfig.getTemporaryStorage().getEnabled() || ((dataModel==null) || !jsonUtil.checkJsonKeys(dataModel, bpnList, ".", false))){ catenaXService.searchDTRs(bpnList, processId); @@ -184,28 +180,28 @@ public Response create(@Valid @RequestBody DiscoverySearch searchBody) { throw new ControllerException(this.getClass().getName(), e, "Could not bind the reference type!"); } - if(dtrs.isEmpty()){ - response.message = "Failed to get the bpns from the datamodel"; - return httpUtil.buildResponse(response, httpResponse); + if(dtrs == null || dtrs.size() == 0){ + continue; } Long currentTimestamp = DateTimeUtil.getTimestamp(); - Dtr tmpDtr = null; // Iterate over every DTR and add it to the file for(Dtr dtr: dtrs){ Long validUntil = dtr.getValidUntil(); + //Check if invalid time has come + if(dtr.getInvalid() && validUntil > currentTimestamp){ + continue; + } + if(dtr.getContractId() == null || dtr.getContractId().isEmpty() || validUntil == null || validUntil < currentTimestamp){ requestDtrs = true; // If the cache invalidation time has come request Dtrs break; } - if(tmpDtr == null){ - tmpDtr = dtr; - }else if(tmpDtr.getBpn().equals(dtr.getBpn()) && tmpDtr.getEndpoint().equals(dtr.getEndpoint()) && tmpDtr.getAssetId().equals(dtr.getAssetId())){ - requestDtrs = true; // If there is repeated DTRs clean the Endpoints - break; - } - processManager.addSearchStatusDtr(processId, dtr); + + processManager.addSearchStatusDtr(processId, dtr); //Add valid DTR to status } + + // If the refresh from the cache is necessary if(requestDtrs){ dtrSearchManager.deleteBpns(dataModel, bpnList); // Delete BPN numbers catenaXService.searchDTRs(bpnList, processId); // Start again the search @@ -264,16 +260,6 @@ public Response search(@Valid @RequestBody Search searchBody) { return httpUtil.buildResponse(response, httpResponse); } - /*List versions; - if (searchBody.getIdShort().equalsIgnoreCase("digitalProductPass")) { - versions = passportConfig.getDigitalProductPass().getVersions(); - searchBody.setSemanticId(passportConfig.getDigitalProductPass().getFullSemanticId(versions.get(0))); - LogUtil.printWarning("SEMANTID ID: " + passportConfig.getDigitalProductPass().getFullSemanticId(versions.get(0))); - } else { - versions = passportConfig.getBatteryPass().getVersions(); - searchBody.setSemanticId(passportConfig.getBatteryPass().getFullSemanticId(versions.get(0))); - }*/ - Process process = null; AssetSearch assetSearch = null; @@ -298,7 +284,7 @@ public Response search(@Valid @RequestBody Search searchBody) { return httpUtil.buildResponse(response, httpResponse); } Boolean childrenCondition = searchBody.getChildren(); - String logPrint = "[" + processId + "] Creating search for "+searchBody.getIdType() + ": "+ searchBody.getId(); + String logPrint = "[PROCESS " + processId + "] Creating search for "+searchBody.getIdType() + ": "+ searchBody.getId(); if(childrenCondition != null){ LogUtil.printMessage(logPrint + " with drilldown enabled"); process = processManager.createProcess(processId, childrenCondition, httpRequest); // Store the children condition @@ -315,6 +301,7 @@ public Response search(@Valid @RequestBody Search searchBody) { if(assetSearch == null){ + LogUtil.printWarning("[PROCESS " + processId + "] The decentralized digital twin registry asset search return a null response!"); status = processManager.getStatus(processId); // Here start the algorithm to refresh the dtrs in the cache if the transfer was incompleted List dtrList = new ArrayList(); @@ -371,7 +358,7 @@ public Response search(@Valid @RequestBody Search searchBody) { try { dataset = dataService.getContractOfferByAssetId(assetId, connectorAddress); } catch (ServiceException e) { - response.message = "The EDC is not reachable, it was not possible to retrieve catalog!"; + response.message = "The EDC is not reachable, it was not possible to retrieve catalog! Please try again!"; response.status = 502; response.statusText = "Bad Gateway"; return httpUtil.buildResponse(response, httpResponse); diff --git a/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/listeners/AppListener.java b/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/listeners/AppListener.java index 6090f61c2..dba658ee2 100644 --- a/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/listeners/AppListener.java +++ b/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/listeners/AppListener.java @@ -206,8 +206,8 @@ public void onStartUp() { String serverStartUpMessage = "\n\n" + "**********************************************************************\n\n" + " " + buildProperties.getName() + "\n" + - " Copyright (c) 2022, 2023: BASF SE, BMW AG, Henkel AG & Co. KGaA\n" + - " Copyright (c) 2022, 2023: Contributors to the Eclipse Foundation.\n\n" + + " Copyright (c) 2022, 2024: BASF SE, BMW AG, Henkel AG & Co. KGaA\n" + + " Copyright (c) 2022, 2024: Contributors to the Eclipse Foundation.\n\n" + "**********************************************************************\n\n"; System.out.print(serverStartUpMessage); System.out.print("\n========= [ APPLICATION STARTED ] ====================================\n" + diff --git a/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/managers/DtrSearchManager.java b/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/managers/DtrSearchManager.java index 0d34152e2..1ecc5839a 100644 --- a/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/managers/DtrSearchManager.java +++ b/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/managers/DtrSearchManager.java @@ -204,29 +204,45 @@ public void run() { } public void searchEndpoint(String processId, String bpn, String endpoint){ //Search Digital Twin Catalog for each connectionURL with a timeout time - Thread asyncThread = ThreadUtil.runThread(searchDigitalTwinCatalogExecutor(endpoint), "SearchEndpoint"+processId+"-"+bpn+"-"+endpoint); + SearchDtrCatalog searchDtrCatalog = new SearchDtrCatalog(endpoint); + Thread asyncThread = ThreadUtil.runThread(searchDtrCatalog, "SearchEndpoint"+processId+"-"+bpn+"-"+endpoint); + Dtr dtr = new Dtr("", endpoint, "", bpn, DateTimeUtil.addHoursToCurrentTimestamp(dtrConfig.getTemporaryStorage().getLifetime()), true); try { if (!asyncThread.join(Duration.ofSeconds(searchTimeoutSeconds))) { asyncThread.interrupt(); if (dtrConfig.getTemporaryStorage().getEnabled()) { - addConnectionToBpnEntry(bpn, null); + addConnectionToBpnEntry(bpn, dtr); saveDtrDataModel(); } - LogUtil.printWarning("Failed to retrieve the Catalog due a timeout for the URL: " + endpoint); + LogUtil.printWarning("Failed to retrieve the Catalog due that the timeout was reached for the edc endpoint: " + endpoint); return; } } catch (InterruptedException e) { - throw new RuntimeException(e); + if (dtrConfig.getTemporaryStorage().getEnabled()) { + addConnectionToBpnEntry(bpn, dtr); + saveDtrDataModel(); + } + throw new ManagerException("DtrSearchManager.searchEndpoint", "It was not possible to retrieve the Catalog for BPN "+ bpn + " and ENDPOINT" + endpoint); + } + if(searchDtrCatalog.isError()){ + if (dtrConfig.getTemporaryStorage().getEnabled()) { + addConnectionToBpnEntry(bpn, dtr); + saveDtrDataModel(); + } + LogUtil.printError("The endpoint [" + endpoint + "] of the BPN ["+bpn+"] is invalid!"); + return; } //Get catalog for a specific connectionURL (if exists) in the catalogCache data structure Catalog catalog = catalogsCache.get(endpoint); if (catalog == null) { + LogUtil.printWarning("Failed to retrieve the catalog from cache: " + endpoint); return; } Object contractOffers = catalog.getContractOffers(); //Check if contractOffer is an Array or just an Object and if is not null or empty, adds it to the dtrDataModel data structure if (contractOffers == null) { + LogUtil.printWarning("Failed to retrieve get contract offers from endpoint: " + endpoint); return; } if (contractOffers instanceof LinkedHashMap) { @@ -313,27 +329,29 @@ public String getDataModelDir() { /** * It's a Thread level method that implements the Runnable interface and searches for the Digital Twin Catalog for * a given URL connection. It doesn't return the Catalogs found, it fills the catalogs cache of this class object. - *

- * @param connectionUrl - * the {@code String} URL connection of the Digital Twin. - * */ - private Runnable searchDigitalTwinCatalogExecutor(String connectionUrl) { - return new Runnable() { - @Override - public void run() { - try { - Catalog catalog = dataTransferService.searchDigitalTwinCatalog(connectionUrl); - if (catalog == null) { - LogUtil.printWarning("No catalog was found for the URL: " + connectionUrl); - return; - } - catalogsCache.put(connectionUrl, catalog); - } catch (Exception e) { - LogUtil.printWarning("Could not find the catalog for the URL: " + connectionUrl); + public class SearchDtrCatalog implements Runnable { + Boolean error = true; + String connectionUrl; + SearchDtrCatalog(String connectionUrl) { + this.connectionUrl = connectionUrl; + } + public Boolean isError() { + return this.error; + } + @Override + public void run() { + try { + Catalog catalog = dataTransferService.searchDigitalTwinCatalog(connectionUrl); + if (catalog == null) { + return; } + catalogsCache.put(connectionUrl, catalog); + this.error = false; + } catch (Exception e) { + // Suppress exception } - }; + } } /** @@ -354,6 +372,7 @@ public DtrSearchManager addConnectionToBpnEntry(String bpn, Dtr dtr) { if (!(dtr == null || dtr.getEndpoint().isEmpty() || dtr.getEndpoint().isBlank())) { if (this.dtrDataModel.containsKey(bpn)) { if (!hasDtrDuplicates(this.dtrDataModel.get(bpn), dtr)){ + LogUtil.printMessage("[DTR DataModel] 1 "+ (!dtr.getInvalid()?"valid":"invalid") +" DTR ["+dtr.getEndpoint()+"] was found and stored! [" + this.dtrDataModel.get(bpn).size() + "] endpoints found for BPN ["+bpn+"]"); this.dtrDataModel.get(bpn).add(dtr); } } else { @@ -506,7 +525,6 @@ public boolean saveDtrDataModel() { this.createDataModelFile(); } String filePath = jsonUtil.toJsonFile(this.dtrDataModelFilePath, this.dtrDataModel, true); - LogUtil.printMessage("[DTR DataModel] [" + this.dtrDataModel.size() + "] Digital Twin Registries available at the dtrDataModel."); return filePath != null; } diff --git a/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/models/catenax/Dtr.java b/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/models/catenax/Dtr.java index d602b261e..6b7aab441 100644 --- a/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/models/catenax/Dtr.java +++ b/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/models/catenax/Dtr.java @@ -26,6 +26,7 @@ package org.eclipse.tractusx.digitalproductpass.models.catenax; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -34,6 +35,7 @@ /** * This class consists exclusively to define attributes and methods related to the Digital Twin Registry (DTR). **/ +@JsonIgnoreProperties(ignoreUnknown = true) @JsonInclude(JsonInclude.Include.NON_NULL) public class Dtr { @@ -48,7 +50,8 @@ public class Dtr { private String bpn; @JsonProperty("validUntil") private Long validUntil; - + @JsonProperty("invalid") + private Boolean invalid; /** CONSTRUCTOR(S) **/ public Dtr() { @@ -60,6 +63,16 @@ public Dtr(String contractId, String endpoint, String assetId, String bpn, Long this.assetId = assetId; this.bpn = bpn; this.validUntil = validUntil; + this.invalid = false; + } + + public Dtr(String contractId, String endpoint, String assetId, String bpn, Long validUntil, Boolean invalid) { + this.contractId = contractId; + this.endpoint = endpoint; + this.assetId = assetId; + this.bpn = bpn; + this.validUntil = validUntil; + this.invalid = invalid; } /** GETTERS AND SETTERS **/ @@ -81,4 +94,12 @@ public Long getValidUntil() { public void setValidUntil(Long validUntil) { this.validUntil = validUntil; } + + public Boolean getInvalid() { + return invalid; + } + + public void setInvalid(Boolean invalid) { + this.invalid = invalid; + } } diff --git a/dpp-backend/digitalproductpass/src/main/java/utils/JsonUtil.java b/dpp-backend/digitalproductpass/src/main/java/utils/JsonUtil.java index f4c442660..48f5e7493 100644 --- a/dpp-backend/digitalproductpass/src/main/java/utils/JsonUtil.java +++ b/dpp-backend/digitalproductpass/src/main/java/utils/JsonUtil.java @@ -280,7 +280,7 @@ synchronized public Object fromJsonFileToObject(String path, Class bindClass) String fileContent = fileUtil.readFile(path); return this.parseJson(fileContent, bindClass); } catch (Exception e) { - throw new UtilException(JsonUtil.class, "I was not possible to create JSON file ["+path+"]! -> [" + e.getMessage() + "]"); + throw new UtilException(JsonUtil.class, "It was not possible to create JSON file ["+path+"]! -> [" + e.getMessage() + "]"); } } From 92bfa0cf4fbce25a1ba6d527987660a83c8c8e6e Mon Sep 17 00:00:00 2001 From: Mathias Brunkow Moser Date: Wed, 3 Jan 2024 17:28:42 +0100 Subject: [PATCH 15/21] chore: updated header licenses --- README.md | 4 ++-- charts/digital-product-pass/Chart.yaml | 4 ++-- .../tractusx/digitalproductpass/config/DtrConfig.java | 6 +++--- .../tractusx/digitalproductpass/listeners/AppListener.java | 6 ++++-- .../tractusx/digitalproductpass/models/catenax/Dtr.java | 6 +++--- .../digitalproductpass/services/CatenaXService.java | 6 +++--- .../digitalproductpass/services/DataTransferService.java | 6 ++++-- 7 files changed, 21 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 7b89bd918..52d8b171b 100644 --- a/README.md +++ b/README.md @@ -35,9 +35,9 @@ In particular, the appliction is used to access the battery passport data provid ### Software Version #### Helm Chart Version -

2.0.0
+
2.0.1
#### Application Version -
v2.0.0
+
v2.0.1
## Application Preview diff --git a/charts/digital-product-pass/Chart.yaml b/charts/digital-product-pass/Chart.yaml index f01d8601f..09e5a1307 100644 --- a/charts/digital-product-pass/Chart.yaml +++ b/charts/digital-product-pass/Chart.yaml @@ -40,10 +40,10 @@ type: application # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 2.0.0 +version: 2.0.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/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/config/DtrConfig.java b/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/config/DtrConfig.java index d6d6bf6b0..cc27490b8 100644 --- a/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/config/DtrConfig.java +++ b/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/config/DtrConfig.java @@ -1,9 +1,9 @@ /********************************************************************************* * - * Catena-X - Product Passport Consumer Backend + * Catena-X - Digital Product Pass Backend * - * Copyright (c) 2022, 2023 BASF SE, BMW AG, Henkel AG & Co. KGaA - * Copyright (c) 2022, 2023 Contributors to the CatenaX (ng) GitHub Organisation. + * Copyright (c) 2022, 2024 BASF SE, BMW AG, Henkel AG & Co. KGaA + * Copyright (c) 2022, 2024 Contributors to the Eclipse Foundation * * * See the NOTICE file(s) distributed with this work for additional diff --git a/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/listeners/AppListener.java b/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/listeners/AppListener.java index dba658ee2..5c2ea11f7 100644 --- a/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/listeners/AppListener.java +++ b/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/listeners/AppListener.java @@ -1,8 +1,10 @@ /********************************************************************************* * - * Catena-X - Product Passport Consumer Backend + * Catena-X - Digital Product Pass Backend + * + * Copyright (c) 2022, 2024 BASF SE, BMW AG, Henkel AG & Co. KGaA + * Copyright (c) 2022, 2024 Contributors to the Eclipse Foundation * - * Copyright (c) 2022, 2023 BASF SE, BMW AG, Henkel AG & Co. KGaA * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. diff --git a/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/models/catenax/Dtr.java b/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/models/catenax/Dtr.java index 6b7aab441..dc680a631 100644 --- a/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/models/catenax/Dtr.java +++ b/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/models/catenax/Dtr.java @@ -1,9 +1,9 @@ /********************************************************************************* * - * Catena-X - Product Passport Consumer Backend + * Catena-X - Digital Product Pass Backend * - * Copyright (c) 2022, 2023 BASF SE, BMW AG, Henkel AG & Co. KGaA - * Copyright (c) 2022, 2023 Contributors to the CatenaX (ng) GitHub Organisation. + * Copyright (c) 2022, 2024 BASF SE, BMW AG, Henkel AG & Co. KGaA + * Copyright (c) 2022, 2024 Contributors to the Eclipse Foundation * * * See the NOTICE file(s) distributed with this work for additional diff --git a/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/services/CatenaXService.java b/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/services/CatenaXService.java index 0f0dfbb1d..815d63d6a 100644 --- a/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/services/CatenaXService.java +++ b/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/services/CatenaXService.java @@ -1,9 +1,9 @@ /********************************************************************************* * - * Catena-X - Product Passport Consumer Backend + * Catena-X - Digital Product Pass Backend * - * Copyright (c) 2022, 2023 BASF SE, BMW AG, Henkel AG & Co. KGaA - * Copyright (c) 2022, 2023 Contributors to the CatenaX (ng) GitHub Organisation. + * Copyright (c) 2022, 2024 BASF SE, BMW AG, Henkel AG & Co. KGaA + * Copyright (c) 2022, 2024 Contributors to the Eclipse Foundation * * * See the NOTICE file(s) distributed with this work for additional diff --git a/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/services/DataTransferService.java b/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/services/DataTransferService.java index c7a438631..76b59b0d3 100644 --- a/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/services/DataTransferService.java +++ b/dpp-backend/digitalproductpass/src/main/java/org/eclipse/tractusx/digitalproductpass/services/DataTransferService.java @@ -1,8 +1,10 @@ /********************************************************************************* * - * Catena-X - Product Passport Consumer Backend + * Catena-X - Digital Product Pass Backend + * + * Copyright (c) 2022, 2024 BASF SE, BMW AG, Henkel AG & Co. KGaA + * Copyright (c) 2022, 2024 Contributors to the Eclipse Foundation * - * Copyright (c) 2022, 2023 BASF SE, BMW AG, Henkel AG & Co. KGaA * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. From 8a058dd85ddfd5a818b9ceba7c7c6cf91b09d85d Mon Sep 17 00:00:00 2001 From: Mathias Brunkow Moser Date: Wed, 3 Jan 2024 17:45:32 +0100 Subject: [PATCH 16/21] chore: added changelogs, increased versions and checked header licenses --- CHANGELOG.md | 26 +++++++++++++++++-- README.md | 5 ++-- docs/RELEASE_USER.md | 26 ++++++++++++++++--- .../digital-product-pass-backend/Chart.yaml | 15 ++++++----- .../templates/configmap.yaml | 7 +++-- .../digital-product-pass-backend/values.yaml | 4 ++- dpp-backend/digitalproductpass/readme.md | 2 +- 7 files changed, 67 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 39d176d86..46c7a004f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,9 @@