diff --git a/.github/workflows/chart-release.yml b/.github/workflows/chart-release.yml index 4df7b7f38..ea14f45a3 100644 --- a/.github/workflows/chart-release.yml +++ b/.github/workflows/chart-release.yml @@ -48,7 +48,7 @@ jobs: git config user.email "$GITHUB_ACTOR@users.noreply.github.com" - name: Install Helm - uses: azure/setup-helm@v3 + uses: azure/setup-helm@v4 with: token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/code-ql.yaml b/.github/workflows/code-ql.yaml index da6675060..d6df0d3b2 100644 --- a/.github/workflows/code-ql.yaml +++ b/.github/workflows/code-ql.yaml @@ -68,7 +68,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v2 + uses: github/codeql-action/init@v3 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file @@ -83,7 +83,7 @@ jobs: # Automates dependency installation for Python, Ruby, and JavaScript, optimizing the CodeQL analysis setup # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@v2 + uses: github/codeql-action/autobuild@v3 # ℹī¸ Command-line programs to run using the OS shell. # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun diff --git a/.github/workflows/dockerbuild.yaml b/.github/workflows/dockerbuild.yaml index 1f367f278..2f0e74b93 100644 --- a/.github/workflows/dockerbuild.yaml +++ b/.github/workflows/dockerbuild.yaml @@ -56,7 +56,7 @@ jobs: # Create SemVer or ref tags dependent of trigger event - name: Docker meta id: meta - uses: docker/metadata-action@v4 + uses: docker/metadata-action@v5 with: images: | ${{ env.IMAGE_NAMESPACE }}/${{ env.IMAGE_NAME }} @@ -73,7 +73,7 @@ jobs: - name: DockerHub login if: github.event_name != 'pull_request' - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: # Use existing DockerHub credentials present as secrets username: ${{ secrets.DOCKER_HUB_USER }} diff --git a/.github/workflows/kics.yml b/.github/workflows/kics.yml index 0f7e98932..8d403bf48 100644 --- a/.github/workflows/kics.yml +++ b/.github/workflows/kics.yml @@ -69,7 +69,7 @@ jobs: # Upload findings to GitHub Advanced Security Dashboard - name: Upload SARIF file for GitHub Advanced Security Dashboard if: always() - uses: github/codeql-action/upload-sarif@v2 + uses: github/codeql-action/upload-sarif@v3 with: sarif_file: kicsResults/results.sarif diff --git a/.github/workflows/trivy.yml b/.github/workflows/trivy.yml index 404120d97..403549944 100644 --- a/.github/workflows/trivy.yml +++ b/.github/workflows/trivy.yml @@ -38,7 +38,7 @@ jobs: steps: - name: Run Trivy vulnerability scanner - uses: aquasecurity/trivy-action@0.18.0 + uses: aquasecurity/trivy-action@0.20.0 with: image-ref: "tractusx/managed-simple-data-exchanger-backend:latest" # Pull image from Docker Hub and run Trivy vulnerability scanner format: "sarif" diff --git a/CHANGELOG.md b/CHANGELOG.md index 3371df6a6..216e7852c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,12 +32,19 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - Refactor code for pcf, dt access API, EDC 7. - Dt access api use in digital twin processing. - Added test cases for PCF and policy controller. +- Refactor code to make stable release +- Documentation updated ### Fixed - Remove garbage character from 'edc_request_template' path. Fixed [#147](https://github.com/eclipse-tractusx/managed-simple-data-exchanger-backend/issues/147). - Dependabot bump version fix in pom.xml and DEPENDENCIES file update. - Dockerfile image update. [#117](https://github.com/eclipse-tractusx/managed-simple-data-exchanger-backend/pull/117) +- Dependabot bump version fixes for 24/05 +## [2.3.7] - 2024-05-09 +### Fixed +- Rename edc_request_template directory. +- This is fixed for issue #147. ## [2.3.6] - 2024-03-06 ### Fixed diff --git a/DEPENDENCIES b/DEPENDENCIES index b4216370e..20166bc00 100644 --- a/DEPENDENCIES +++ b/DEPENDENCIES @@ -1,15 +1,15 @@ -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.ethlo.time/itu/1.7.0, Apache-2.0, approved, clearlydefined -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 -maven/mavencentral/com.fasterxml.jackson.dataformat/jackson-dataformat-toml/2.15.3, Apache-2.0, approved, #9160 -maven/mavencentral/com.fasterxml.jackson.dataformat/jackson-dataformat-yaml/2.15.3, Apache-2.0, approved, #8802 -maven/mavencentral/com.fasterxml.jackson.datatype/jackson-datatype-jdk8/2.15.3, Apache-2.0, approved, #8808 -maven/mavencentral/com.fasterxml.jackson.datatype/jackson-datatype-jsr310/2.15.3, Apache-2.0, approved, #7930 -maven/mavencentral/com.fasterxml.jackson.module/jackson-module-parameter-names/2.15.3, Apache-2.0, approved, #8803 -maven/mavencentral/com.fasterxml/classmate/1.5.1, Apache-2.0, approved, clearlydefined +maven/mavencentral/ch.qos.logback/logback-classic/1.5.6, EPL-1.0 AND LGPL-2.1-only, approved, #13282 +maven/mavencentral/ch.qos.logback/logback-core/1.5.6, EPL-1.0 AND LGPL-2.1-only, approved, #13283 +maven/mavencentral/com.ethlo.time/itu/1.8.0, Apache-2.0, approved, #12927 +maven/mavencentral/com.fasterxml.jackson.core/jackson-annotations/2.15.4, Apache-2.0, approved, #7947 +maven/mavencentral/com.fasterxml.jackson.core/jackson-core/2.15.4, MIT AND Apache-2.0, approved, #7932 +maven/mavencentral/com.fasterxml.jackson.core/jackson-databind/2.15.4, Apache-2.0, approved, #7934 +maven/mavencentral/com.fasterxml.jackson.dataformat/jackson-dataformat-toml/2.15.4, Apache-2.0, approved, #9160 +maven/mavencentral/com.fasterxml.jackson.dataformat/jackson-dataformat-yaml/2.15.4, Apache-2.0, approved, #8802 +maven/mavencentral/com.fasterxml.jackson.datatype/jackson-datatype-jdk8/2.15.4, Apache-2.0, approved, #8808 +maven/mavencentral/com.fasterxml.jackson.datatype/jackson-datatype-jsr310/2.15.4, Apache-2.0, approved, #7930 +maven/mavencentral/com.fasterxml.jackson.module/jackson-module-parameter-names/2.15.4, Apache-2.0, approved, #8803 +maven/mavencentral/com.fasterxml/classmate/1.6.0, Apache-2.0, approved, clearlydefined maven/mavencentral/com.github.ben-manes.caffeine/caffeine/3.1.8, Apache-2.0, approved, clearlydefined maven/mavencentral/com.github.docker-java/docker-java-api/3.3.3, Apache-2.0, approved, #10346 maven/mavencentral/com.github.docker-java/docker-java-transport-zerodep/3.3.3, Apache-2.0 AND (Apache-2.0 AND BSD-3-Clause), approved, #7946 @@ -17,58 +17,59 @@ maven/mavencentral/com.github.docker-java/docker-java-transport/3.3.3, Apache-2. maven/mavencentral/com.github.stephenc.jcip/jcip-annotations/1.0-1, Apache-2.0, approved, CQ21949 maven/mavencentral/com.google.code.gson/gson/2.10.1, Apache-2.0, approved, #6159 maven/mavencentral/com.google.errorprone/error_prone_annotations/2.21.1, Apache-2.0, approved, #9834 -maven/mavencentral/com.jayway.jsonpath/json-path/2.8.0, Apache-2.0, approved, clearlydefined -maven/mavencentral/com.networknt/json-schema-validator/1.0.72, Apache-2.0, approved, CQ22638 +maven/mavencentral/com.jayway.jsonpath/json-path/2.9.0, Apache-2.0, approved, clearlydefined +maven/mavencentral/com.networknt/json-schema-validator/1.4.0, Apache-2.0 AND Unicode-TOU, approved, #13812 maven/mavencentral/com.nimbusds/nimbus-jose-jwt/9.24.4, Apache-2.0, approved, clearlydefined maven/mavencentral/com.opencsv/opencsv/5.9, Apache-2.0, approved, clearlydefined maven/mavencentral/com.sun.istack/istack-commons-runtime/4.1.2, BSD-3-Clause, approved, #2590 maven/mavencentral/com.vaadin.external.google/android-json/0.0.20131108.vaadin1, Apache-2.0, approved, CQ21310 maven/mavencentral/com.zaxxer/HikariCP/5.0.1, Apache-2.0, approved, clearlydefined maven/mavencentral/commons-beanutils/commons-beanutils/1.9.4, Apache-2.0, approved, CQ12654 -maven/mavencentral/commons-codec/commons-codec/1.15, Apache-2.0 AND BSD-3-Clause AND LicenseRef-Public-Domain, approved, CQ22641 +maven/mavencentral/commons-codec/commons-codec/1.16.1, Apache-2.0 AND (Apache-2.0 AND BSD-3-Clause), approved, #9157 maven/mavencentral/commons-collections/commons-collections/3.2.2, Apache-2.0, approved, CQ10385 -maven/mavencentral/commons-io/commons-io/2.7, Apache-2.0, approved, clearlydefined +maven/mavencentral/commons-io/commons-io/2.16.1, Apache-2.0, approved, #14190 maven/mavencentral/commons-logging/commons-logging/1.2, Apache-2.0, approved, CQ10162 maven/mavencentral/io.github.openfeign.form/feign-form-spring/3.8.0, Apache-2.0, approved, clearlydefined maven/mavencentral/io.github.openfeign.form/feign-form/3.8.0, Apache-2.0, approved, clearlydefined -maven/mavencentral/io.github.openfeign/feign-core/12.3, Apache-2.0, approved, clearlydefined -maven/mavencentral/io.github.openfeign/feign-slf4j/12.3, Apache-2.0, approved, clearlydefined -maven/mavencentral/io.micrometer/micrometer-commons/1.11.6, Apache-2.0 AND (Apache-2.0 AND MIT), approved, #9243 -maven/mavencentral/io.micrometer/micrometer-observation/1.11.6, Apache-2.0, approved, #9242 -maven/mavencentral/io.smallrye/jandex/3.0.5, Apache-2.0, approved, clearlydefined +maven/mavencentral/io.github.openfeign/feign-core/13.2.1, Apache-2.0, approved, clearlydefined +maven/mavencentral/io.github.openfeign/feign-slf4j/13.2.1, Apache-2.0, approved, clearlydefined +maven/mavencentral/io.micrometer/micrometer-commons/1.12.5, Apache-2.0 AND (Apache-2.0 AND MIT), approved, #11679 +maven/mavencentral/io.micrometer/micrometer-observation/1.12.5, Apache-2.0, approved, #11680 +maven/mavencentral/io.smallrye/jandex/3.1.2, Apache-2.0, approved, clearlydefined maven/mavencentral/io.swagger.core.v3/swagger-annotations-jakarta/2.2.21, Apache-2.0, approved, #5947 maven/mavencentral/io.swagger.core.v3/swagger-core-jakarta/2.2.21, Apache-2.0, approved, #5929 maven/mavencentral/io.swagger.core.v3/swagger-models-jakarta/2.2.21, Apache-2.0, approved, #5919 -maven/mavencentral/jakarta.activation/jakarta.activation-api/2.1.2, EPL-2.0 OR BSD-3-Clause OR GPL-2.0-only with Classpath-exception-2.0, approved, ee4j.jaf +maven/mavencentral/jakarta.activation/jakarta.activation-api/2.1.3, EPL-2.0 OR BSD-3-Clause OR GPL-2.0-only with Classpath-exception-2.0, approved, ee4j.jaf maven/mavencentral/jakarta.annotation/jakarta.annotation-api/2.1.1, EPL-2.0 OR GPL-2.0-only with Classpath-exception-2.0, approved, ee4j.ca maven/mavencentral/jakarta.inject/jakarta.inject-api/2.0.1, Apache-2.0, approved, ee4j.cdi maven/mavencentral/jakarta.persistence/jakarta.persistence-api/3.1.0, EPL-2.0 OR BSD-3-Clause, approved, ee4j.jpa maven/mavencentral/jakarta.transaction/jakarta.transaction-api/2.0.1, EPL-2.0 OR GPL-2.0-only with Classpath-exception-2.0, approved, ee4j.jta 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/jakarta.xml.bind/jakarta.xml.bind-api/4.0.2, BSD-3-Clause, approved, ee4j.jaxb maven/mavencentral/junit/junit/4.13.2, EPL-2.0, approved, CQ23636 -maven/mavencentral/net.bytebuddy/byte-buddy-agent/1.14.10, Apache-2.0, approved, #7164 -maven/mavencentral/net.bytebuddy/byte-buddy/1.14.10, Apache-2.0 AND BSD-3-Clause, approved, #7163 +maven/mavencentral/net.bytebuddy/byte-buddy-agent/1.14.13, Apache-2.0, approved, #7164 +maven/mavencentral/net.bytebuddy/byte-buddy/1.14.13, Apache-2.0 AND BSD-3-Clause, approved, #7163 maven/mavencentral/net.java.dev.jna/jna/5.12.1, Apache-2.0 OR LGPL-2.1-or-later, approved, #3217 -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/org.antlr/antlr4-runtime/4.10.1, BSD-3-Clause AND LicenseRef-Public-domain AND MIT AND LicenseRef-Unicode-TOU, approved, #7065 +maven/mavencentral/net.minidev/accessors-smart/2.5.1, Apache-2.0, approved, clearlydefined +maven/mavencentral/net.minidev/json-smart/2.5.1, Apache-2.0, approved, clearlydefined +maven/mavencentral/org.antlr/antlr4-runtime/4.13.0, BSD-3-Clause, approved, #10767 maven/mavencentral/org.apache.commons/commons-collections4/4.4, Apache-2.0, approved, clearlydefined maven/mavencentral/org.apache.commons/commons-compress/1.24.0, Apache-2.0 AND BSD-3-Clause AND bzip2-1.0.6 AND LicenseRef-Public-Domain, approved, #10368 -maven/mavencentral/org.apache.commons/commons-csv/1.8, 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-csv/1.11.0, Apache-2.0, approved, #14690 +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.17.1, Apache-2.0, approved, clearlydefined -maven/mavencentral/org.apache.logging.log4j/log4j-to-slf4j/2.17.1, Apache-2.0, approved, #2163 -maven/mavencentral/org.apache.tomcat.embed/tomcat-embed-core/10.1.16, 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.16, Apache-2.0, approved, #6997 -maven/mavencentral/org.apache.tomcat.embed/tomcat-embed-websocket/10.1.16, 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-to-slf4j/2.21.1, Apache-2.0, approved, #11919 +maven/mavencentral/org.apache.tomcat.embed/tomcat-embed-core/10.1.20, 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.20, Apache-2.0, approved, #6997 +maven/mavencentral/org.apache.tomcat.embed/tomcat-embed-websocket/10.1.20, Apache-2.0, approved, #7920 maven/mavencentral/org.apiguardian/apiguardian-api/1.1.2, Apache-2.0, approved, clearlydefined -maven/mavencentral/org.aspectj/aspectjweaver/1.9.20.1, Apache-2.0 AND BSD-3-Clause AND EPL-1.0 AND BSD-3-Clause AND Apache-1.1, approved, #7695 +maven/mavencentral/org.aspectj/aspectjweaver/1.9.22, Apache-2.0 AND BSD-3-Clause AND EPL-1.0 AND BSD-3-Clause AND Apache-1.1, approved, #7695 maven/mavencentral/org.assertj/assertj-core/3.24.2, Apache-2.0, approved, #6161 +maven/mavencentral/org.awaitility/awaitility/4.2.1, Apache-2.0, approved, #14178 maven/mavencentral/org.bouncycastle/bcprov-jdk18on/1.77, MIT AND CC0-1.0, approved, #11595 maven/mavencentral/org.checkerframework/checker-qual/3.37.0, MIT, approved, clearlydefined -maven/mavencentral/org.eclipse.angus/angus-activation/2.0.1, EPL-2.0 OR GPL-2.0-only with Classpath-exception-2.0, approved, ee4j.angus +maven/mavencentral/org.eclipse.angus/angus-activation/2.0.2, EPL-2.0 OR GPL-2.0-only with Classpath-exception-2.0, approved, ee4j.angus maven/mavencentral/org.eclipse.persistence/eclipselink/3.0.3, EPL-2.0 OR BSD-3-Clause, approved, ee4j.eclipselink maven/mavencentral/org.eclipse.tractusx/batch/0.0.1, Apache-2.0, approved, automotive.tractusx maven/mavencentral/org.eclipse.tractusx/bpn-discovery/0.0.1, Apache-2.0, approved, automotive.tractusx @@ -86,86 +87,86 @@ maven/mavencentral/org.eclipse.tractusx/serial-part/0.0.1, Apache-2.0, approved, maven/mavencentral/org.eclipse.tractusx/single-level-bom-as-built/0.0.1, Apache-2.0, approved, automotive.tractusx maven/mavencentral/org.eclipse.tractusx/single-level-bom-as-planned/0.0.1, Apache-2.0, approved, automotive.tractusx maven/mavencentral/org.eclipse.tractusx/single-level-usage-as-built/0.0.1, Apache-2.0, approved, automotive.tractusx -maven/mavencentral/org.flywaydb/flyway-core/9.16.3, Apache-2.0, approved, #7935 -maven/mavencentral/org.glassfish.jaxb/jaxb-core/4.0.4, BSD-3-Clause, approved, ee4j.jaxb-impl -maven/mavencentral/org.glassfish.jaxb/jaxb-runtime/4.0.4, BSD-3-Clause, approved, ee4j.jaxb-impl -maven/mavencentral/org.glassfish.jaxb/txw2/4.0.4, BSD-3-Clause, approved, ee4j.jaxb-impl +maven/mavencentral/org.flywaydb/flyway-core/9.22.3, Apache-2.0, approved, #10349 +maven/mavencentral/org.glassfish.jaxb/jaxb-core/4.0.5, BSD-3-Clause, approved, ee4j.jaxb-impl +maven/mavencentral/org.glassfish.jaxb/jaxb-runtime/4.0.5, BSD-3-Clause, approved, ee4j.jaxb-impl +maven/mavencentral/org.glassfish.jaxb/txw2/4.0.5, BSD-3-Clause, approved, ee4j.jaxb-impl maven/mavencentral/org.hamcrest/hamcrest-core/2.2, BSD-3-Clause, approved, clearlydefined maven/mavencentral/org.hamcrest/hamcrest/2.2, BSD-3-Clause, approved, clearlydefined maven/mavencentral/org.hibernate.common/hibernate-commons-annotations/6.0.6.Final, LGPL-2.1-only, approved, #6962 -maven/mavencentral/org.hibernate.orm/hibernate-core/6.2.13.Final, LGPL-2.1-only AND Apache-2.0 AND MIT AND CC-PDDC AND (EPL-2.0 OR BSD-3-Clause), approved, #9121 +maven/mavencentral/org.hibernate.orm/hibernate-core/6.4.4.Final, LGPL-2.1-or-later AND (EPL-2.0 OR BSD-3-Clause) AND MIT, approved, #12490 maven/mavencentral/org.hibernate.validator/hibernate-validator/8.0.1.Final, Apache-2.0, approved, clearlydefined maven/mavencentral/org.jboss.logging/jboss-logging/3.5.3.Final, Apache-2.0, approved, #9471 maven/mavencentral/org.jetbrains/annotations/17.0.0, Apache-2.0, approved, clearlydefined -maven/mavencentral/org.junit.jupiter/junit-jupiter-api/5.9.3, EPL-2.0, approved, #3133 -maven/mavencentral/org.junit.jupiter/junit-jupiter-engine/5.9.3, EPL-2.0, approved, #3125 -maven/mavencentral/org.junit.jupiter/junit-jupiter-params/5.9.3, EPL-2.0, approved, #3134 -maven/mavencentral/org.junit.jupiter/junit-jupiter/5.9.3, EPL-2.0, approved, #6972 -maven/mavencentral/org.junit.platform/junit-platform-commons/1.9.3, EPL-2.0, approved, #3130 -maven/mavencentral/org.junit.platform/junit-platform-engine/1.9.3, EPL-2.0, approved, #3128 -maven/mavencentral/org.mapstruct/mapstruct/1.4.2.Final, Apache-2.0, approved, #2483 -maven/mavencentral/org.mockito/mockito-core/4.8.1, MIT, approved, clearlydefined -maven/mavencentral/org.mockito/mockito-junit-jupiter/4.8.1, MIT, approved, clearlydefined -maven/mavencentral/org.objenesis/objenesis/3.2, Apache-2.0, approved, clearlydefined -maven/mavencentral/org.opentest4j/opentest4j/1.2.0, Apache-2.0, approved, clearlydefined -maven/mavencentral/org.ow2.asm/asm/9.3, BSD-3-Clause, approved, clearlydefined +maven/mavencentral/org.junit.jupiter/junit-jupiter-api/5.10.2, EPL-2.0, approved, #9714 +maven/mavencentral/org.junit.jupiter/junit-jupiter-engine/5.10.2, EPL-2.0, approved, #9711 +maven/mavencentral/org.junit.jupiter/junit-jupiter-params/5.10.2, EPL-2.0, approved, #9708 +maven/mavencentral/org.junit.jupiter/junit-jupiter/5.10.2, EPL-2.0, approved, #13393 +maven/mavencentral/org.junit.platform/junit-platform-commons/1.10.2, EPL-2.0, approved, #9715 +maven/mavencentral/org.junit.platform/junit-platform-engine/1.10.2, EPL-2.0, approved, #9709 +maven/mavencentral/org.mapstruct/mapstruct/1.5.5.Final, Apache-2.0, approved, #6277 +maven/mavencentral/org.mockito/mockito-core/5.7.0, MIT AND (Apache-2.0 AND MIT) AND Apache-2.0, approved, #11424 +maven/mavencentral/org.mockito/mockito-junit-jupiter/5.7.0, MIT, approved, #11423 +maven/mavencentral/org.objenesis/objenesis/3.3, Apache-2.0, approved, clearlydefined +maven/mavencentral/org.opentest4j/opentest4j/1.3.0, Apache-2.0, approved, #9713 +maven/mavencentral/org.ow2.asm/asm/9.6, BSD-3-Clause, approved, #10776 maven/mavencentral/org.postgresql/postgresql/42.7.3, BSD-2-Clause AND Apache-2.0, approved, #11681 -maven/mavencentral/org.projectlombok/lombok/1.18.30, MIT AND LicenseRef-Public-Domain, approved, CQ23907 +maven/mavencentral/org.projectlombok/lombok/1.18.32, MIT AND LicenseRef-Public-Domain, approved, CQ23907 maven/mavencentral/org.rnorth.duct-tape/duct-tape/1.0.8, MIT, approved, clearlydefined maven/mavencentral/org.skyscreamer/jsonassert/1.5.1, Apache-2.0, approved, clearlydefined -maven/mavencentral/org.slf4j/jul-to-slf4j/2.0.9, MIT, approved, #7698 -maven/mavencentral/org.slf4j/slf4j-api/2.0.9, MIT, approved, #5915 +maven/mavencentral/org.slf4j/jul-to-slf4j/2.0.13, MIT, approved, #7698 +maven/mavencentral/org.slf4j/slf4j-api/2.0.13, MIT, approved, #5915 maven/mavencentral/org.springdoc/springdoc-openapi-starter-common/2.5.0, Apache-2.0, approved, clearlydefined maven/mavencentral/org.springdoc/springdoc-openapi-starter-webmvc-api/2.5.0, Apache-2.0, approved, clearlydefined maven/mavencentral/org.springdoc/springdoc-openapi-starter-webmvc-ui/2.5.0, Apache-2.0, approved, clearlydefined -maven/mavencentral/org.springframework.boot/spring-boot-autoconfigure/3.1.6, Apache-2.0, approved, #9341 -maven/mavencentral/org.springframework.boot/spring-boot-devtools/3.1.6, Apache-2.0, approved, clearlydefined -maven/mavencentral/org.springframework.boot/spring-boot-starter-aop/3.1.6, Apache-2.0, approved, #9338 -maven/mavencentral/org.springframework.boot/spring-boot-starter-cache/3.1.6, Apache-2.0, approved, #9653 -maven/mavencentral/org.springframework.boot/spring-boot-starter-data-jpa/3.1.6, Apache-2.0, approved, #9733 -maven/mavencentral/org.springframework.boot/spring-boot-starter-jdbc/3.1.6, Apache-2.0, approved, #9737 -maven/mavencentral/org.springframework.boot/spring-boot-starter-json/3.1.6, Apache-2.0, approved, #9336 -maven/mavencentral/org.springframework.boot/spring-boot-starter-logging/3.1.6, Apache-2.0, approved, #9343 -maven/mavencentral/org.springframework.boot/spring-boot-starter-oauth2-resource-server/3.1.6, Apache-2.0, approved, #8804 -maven/mavencentral/org.springframework.boot/spring-boot-starter-security/3.1.6, Apache-2.0, approved, #9337 -maven/mavencentral/org.springframework.boot/spring-boot-starter-test/3.1.6, Apache-2.0, approved, #9353 -maven/mavencentral/org.springframework.boot/spring-boot-starter-tomcat/3.1.6, Apache-2.0, approved, #9351 -maven/mavencentral/org.springframework.boot/spring-boot-starter-validation/3.1.6, Apache-2.0, approved, #9335 -maven/mavencentral/org.springframework.boot/spring-boot-starter-web/3.1.6, Apache-2.0, approved, #9347 -maven/mavencentral/org.springframework.boot/spring-boot-starter/3.1.6, Apache-2.0, approved, #9349 -maven/mavencentral/org.springframework.boot/spring-boot-test-autoconfigure/3.1.6, Apache-2.0, approved, #9339 -maven/mavencentral/org.springframework.boot/spring-boot-test/3.1.6, Apache-2.0, approved, #9346 -maven/mavencentral/org.springframework.boot/spring-boot/3.1.6, Apache-2.0, approved, #9352 -maven/mavencentral/org.springframework.cloud/spring-cloud-commons/4.0.3, Apache-2.0, approved, #7292 -maven/mavencentral/org.springframework.cloud/spring-cloud-context/4.0.3, Apache-2.0, approved, #7306 -maven/mavencentral/org.springframework.cloud/spring-cloud-openfeign-core/4.0.3, Apache-2.0, approved, #7305 -maven/mavencentral/org.springframework.cloud/spring-cloud-starter-openfeign/4.0.3, Apache-2.0, approved, #7302 -maven/mavencentral/org.springframework.cloud/spring-cloud-starter/4.0.3, Apache-2.0, approved, #7299 -maven/mavencentral/org.springframework.data/spring-data-commons/3.1.6, Apache-2.0, approved, #8805 -maven/mavencentral/org.springframework.data/spring-data-jpa/3.1.6, Apache-2.0, approved, #9120 +maven/mavencentral/org.springframework.boot/spring-boot-autoconfigure/3.2.5, Apache-2.0, approved, #11751 +maven/mavencentral/org.springframework.boot/spring-boot-devtools/3.2.5, Apache-2.0, approved, clearlydefined +maven/mavencentral/org.springframework.boot/spring-boot-starter-aop/3.2.5, Apache-2.0, approved, #11928 +maven/mavencentral/org.springframework.boot/spring-boot-starter-cache/3.2.5, Apache-2.0, approved, #13493 +maven/mavencentral/org.springframework.boot/spring-boot-starter-data-jpa/3.2.5, Apache-2.0, approved, #11926 +maven/mavencentral/org.springframework.boot/spring-boot-starter-jdbc/3.2.5, Apache-2.0, approved, #11878 +maven/mavencentral/org.springframework.boot/spring-boot-starter-json/3.2.5, Apache-2.0, approved, #11894 +maven/mavencentral/org.springframework.boot/spring-boot-starter-logging/3.2.5, Apache-2.0, approved, #11890 +maven/mavencentral/org.springframework.boot/spring-boot-starter-oauth2-resource-server/3.2.5, Apache-2.0, approved, #11931 +maven/mavencentral/org.springframework.boot/spring-boot-starter-security/3.2.5, Apache-2.0, approved, #12069 +maven/mavencentral/org.springframework.boot/spring-boot-starter-test/3.2.5, Apache-2.0, approved, #12917 +maven/mavencentral/org.springframework.boot/spring-boot-starter-tomcat/3.2.5, Apache-2.0, approved, #11923 +maven/mavencentral/org.springframework.boot/spring-boot-starter-validation/3.2.5, Apache-2.0, approved, #12921 +maven/mavencentral/org.springframework.boot/spring-boot-starter-web/3.2.5, Apache-2.0, approved, #11916 +maven/mavencentral/org.springframework.boot/spring-boot-starter/3.2.5, Apache-2.0, approved, #11935 +maven/mavencentral/org.springframework.boot/spring-boot-test-autoconfigure/3.2.5, Apache-2.0, approved, #12920 +maven/mavencentral/org.springframework.boot/spring-boot-test/3.2.5, Apache-2.0, approved, #12916 +maven/mavencentral/org.springframework.boot/spring-boot/3.2.5, Apache-2.0, approved, #11752 +maven/mavencentral/org.springframework.cloud/spring-cloud-commons/4.1.2, Apache-2.0, approved, #13495 +maven/mavencentral/org.springframework.cloud/spring-cloud-context/4.1.2, Apache-2.0, approved, #13494 +maven/mavencentral/org.springframework.cloud/spring-cloud-openfeign-core/4.1.1, Apache-2.0, approved, clearlydefined +maven/mavencentral/org.springframework.cloud/spring-cloud-starter-openfeign/4.1.1, Apache-2.0, approved, clearlydefined +maven/mavencentral/org.springframework.cloud/spring-cloud-starter/4.1.2, Apache-2.0, approved, clearlydefined +maven/mavencentral/org.springframework.data/spring-data-commons/3.2.5, Apache-2.0, approved, #11917 +maven/mavencentral/org.springframework.data/spring-data-jpa/3.2.5, Apache-2.0, approved, #11882 maven/mavencentral/org.springframework.security/spring-security-config/6.1.2, Apache-2.0, approved, #9736 -maven/mavencentral/org.springframework.security/spring-security-core/6.2.2, Apache-2.0, approved, #11904 -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-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-oauth2-resource-server/6.1.5, Apache-2.0, approved, #8798 -maven/mavencentral/org.springframework.security/spring-security-rsa/1.0.11.RELEASE, Apache-2.0, approved, CQ20647 -maven/mavencentral/org.springframework.security/spring-security-test/6.1.5, Apache-2.0, approved, #10674 -maven/mavencentral/org.springframework.security/spring-security-web/6.1.5, Apache-2.0, approved, #9800 -maven/mavencentral/org.springframework/spring-aop/6.0.14, Apache-2.0, approved, #5940 -maven/mavencentral/org.springframework/spring-aspects/6.0.14, Apache-2.0, approved, #5930 -maven/mavencentral/org.springframework/spring-beans/6.0.14, Apache-2.0, approved, #5937 -maven/mavencentral/org.springframework/spring-context-support/6.0.14, Apache-2.0, approved, #6960 -maven/mavencentral/org.springframework/spring-context/6.0.14, Apache-2.0, approved, #5936 -maven/mavencentral/org.springframework/spring-core/6.0.14, Apache-2.0 AND BSD-3-Clause, approved, #5948 -maven/mavencentral/org.springframework/spring-expression/6.0.14, Apache-2.0, approved, #3284 -maven/mavencentral/org.springframework/spring-jcl/6.0.14, Apache-2.0, approved, #3283 -maven/mavencentral/org.springframework/spring-jdbc/6.0.14, Apache-2.0, approved, #5924 -maven/mavencentral/org.springframework/spring-orm/6.0.14, Apache-2.0, approved, #5925 -maven/mavencentral/org.springframework/spring-test/6.0.14, Apache-2.0, approved, #7003 -maven/mavencentral/org.springframework/spring-tx/6.0.14, Apache-2.0, approved, #5926 -maven/mavencentral/org.springframework/spring-web/6.0.14, Apache-2.0, approved, #5942 -maven/mavencentral/org.springframework/spring-webmvc/6.0.14, Apache-2.0, approved, #5944 +maven/mavencentral/org.springframework.security/spring-security-core/6.2.4, Apache-2.0, approved, #11904 +maven/mavencentral/org.springframework.security/spring-security-crypto/6.2.4, Apache-2.0 AND ISC, approved, #11908 +maven/mavencentral/org.springframework.security/spring-security-oauth2-core/6.2.4, Apache-2.0, approved, #11925 +maven/mavencentral/org.springframework.security/spring-security-oauth2-jose/6.2.4, Apache-2.0, approved, #11893 +maven/mavencentral/org.springframework.security/spring-security-oauth2-resource-server/6.2.4, Apache-2.0, approved, #11920 +maven/mavencentral/org.springframework.security/spring-security-rsa/1.1.2, Apache-2.0, approved, clearlydefined +maven/mavencentral/org.springframework.security/spring-security-test/6.2.4, Apache-2.0, approved, #12922 +maven/mavencentral/org.springframework.security/spring-security-web/6.2.4, Apache-2.0, approved, #11911 +maven/mavencentral/org.springframework/spring-aop/6.1.6, Apache-2.0, approved, #11755 +maven/mavencentral/org.springframework/spring-aspects/6.1.6, Apache-2.0, approved, #11905 +maven/mavencentral/org.springframework/spring-beans/6.1.6, Apache-2.0, approved, #11754 +maven/mavencentral/org.springframework/spring-context-support/6.1.6, Apache-2.0, approved, #13496 +maven/mavencentral/org.springframework/spring-context/6.1.6, Apache-2.0, approved, #11753 +maven/mavencentral/org.springframework/spring-core/6.1.6, Apache-2.0 AND BSD-3-Clause, approved, #11750 +maven/mavencentral/org.springframework/spring-expression/6.1.6, Apache-2.0, approved, #11747 +maven/mavencentral/org.springframework/spring-jcl/6.1.6, Apache-2.0, approved, #11749 +maven/mavencentral/org.springframework/spring-jdbc/6.1.6, Apache-2.0, approved, #11897 +maven/mavencentral/org.springframework/spring-orm/6.1.6, Apache-2.0, approved, #11924 +maven/mavencentral/org.springframework/spring-test/6.1.6, Apache-2.0, approved, #12919 +maven/mavencentral/org.springframework/spring-tx/6.1.6, Apache-2.0, approved, #11901 +maven/mavencentral/org.springframework/spring-web/6.1.6, Apache-2.0, approved, #11748 +maven/mavencentral/org.springframework/spring-webmvc/6.1.6, Apache-2.0, approved, #11879 maven/mavencentral/org.testcontainers/database-commons/1.19.0, Apache-2.0, approved, #10345 maven/mavencentral/org.testcontainers/jdbc/1.19.0, Apache-2.0, approved, #10348 maven/mavencentral/org.testcontainers/junit-jupiter/1.19.1, MIT, approved, #10344 @@ -173,4 +174,4 @@ maven/mavencentral/org.testcontainers/postgresql/1.19.1, MIT, approved, #10350 maven/mavencentral/org.testcontainers/testcontainers/1.19.1, Apache-2.0 AND MIT, approved, #10347 maven/mavencentral/org.webjars/swagger-ui/5.13.0, Apache-2.0, approved, #14547 maven/mavencentral/org.xmlunit/xmlunit-core/2.9.1, Apache-2.0, approved, #6272 -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 +maven/mavencentral/org.yaml/snakeyaml/2.2, 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, #10232 diff --git a/INSTALL.md b/INSTALL.md index e1085be02..91c47782e 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -96,6 +96,14 @@ Apart from both upload Batch upload is additional feature were added into DFT. 4. Create Asset in EDC Connector. 5. Stores the line in the database. +For PartTypeInformation Upload: + +1. Maps the content of the line with an PartTypeInformation. +2. Generates the UUID if it does not contain a UUID. +3. Registers in DigitalTwins. +4. Create Asset in EDC Connector. +5. Stores the line in the database. + For SingleLevelBoMAsPlanned Upload: 1. Maps the content of the line with an SingleLevelBoMAsPlanned. @@ -112,6 +120,14 @@ Apart from both upload Batch upload is additional feature were added into DFT. 4. Create Asset in EDC Connector. 5. Stores the line in the database. +For Pcf Upload: + +1. Maps the content of the line with an Pcf. +2. checks if an PartAsPlanned Aspect exists so it can be related to that Aspect. +3. Registers in DigitalTwins. +4. Create Asset in EDC Connector. +5. Stores the line in the database. + The file .csv is loaded in memory, the content is saved and then, the file is removed from memory. diff --git a/README.md b/README.md index 609a91fac..099100eee 100644 --- a/README.md +++ b/README.md @@ -87,7 +87,7 @@ Listed below are configuration keys needed to get the `sde-backend` up and runni | discovery.clientSecret | X | default | discovery clientSecret | | discovery.grantType | X | default | discovery grantType | | partner.pool.hostname | X | default | partner pool hostname | -| partner.pool.authentication.url | X | default | partner pool authentication url | +| partner.pool.authentication.url | X | default | partner pool authentication url | | partner.pool.clientId | X | default | partner pool clientId | | partner.pool.clientSecret | X | default | partner pool clientSecret | | partner.pool.grantType | X | default | partner pool grantType | @@ -96,6 +96,12 @@ Listed below are configuration keys needed to get the `sde-backend` up and runni | portal.backend.clientId | X | default | portal clientId | | portal.backend.clientSecret | X | default | portal clientSecret | | portal.backend.grantType | X | default | portal grantType | +| policy.hub.hostname | X | default | policy hub hostname | +| policy.hub.authentication.url | X | default | policy hub authentication url | +| policy.hub.clientId | X | default | policy hub clientId | +| policy.hub.clientSecret | X | default | policy hub clientSecret | +| policy.hub.grantType | X | default | policy hub grantType | + #### Example Configuration/application.properties @@ -206,6 +212,11 @@ portal.backend.authentication.url=default portal.backend.clientId=default portal.backend.clientSecret=default portal.backend.grantType=default +policy.hub.hostname=default +policy.hub.authentication.url=default +policy.hub.clientId=default +policy.hub.clientSecret=default +policy.hub.grantType=default ``` The above configuration we can use as for different deployment as specified here [InstallationGuide.md](InstallationGuide.md) @@ -222,6 +233,7 @@ To find information about supported submodules and there version in SDE please v * SingleLevelBoMAsBuilt * Batch * PartAsPlanned + * PartTypeInformation * SingleLevelBoMAsPlanned * PartSiteInformationAsPlanned * SingleLevelUsageAsBuilt @@ -231,6 +243,7 @@ To find information about supported submodules and there version in SDE please v * SingleLevelBoMAsBuilt * Batch * PartAsPlanned + * PartTypeInformation * SingleLevelBoMAsPlanned * PartSiteInformationAsPlanned * SingleLevelUsageAsBuilt @@ -240,6 +253,7 @@ To find information about supported submodules and there version in SDE please v * SingleLevelBoMAsBuilt * Batch * PartAsPlanned + * PartTypeInformation * SingleLevelBoMAsPlanned * PartSiteInformationAsPlanned * SingleLevelUsageAsBuilt @@ -288,6 +302,16 @@ To find information about supported submodules and there version in SDE please v | **GET:- localhost:8080/api/contract-offers** |This API is used to get all contract offers | Refer Api Doc |Refer Api Doc| | **GET:- localhost:8080/api/legal-entities** |This API is used to fetch legal entities (list of company's) for Process| Refer Api Doc |Refer Api Doc| | **POST:- localhost:8080/api/connectors-discovery** |This API is used to fetch connectors information | Refer Api Doc |Refer Api Doc| +| **GET:- localhost:8080/api/policy-attributes** |This API is used to fetch policy attributes | Refer Api Doc |Refer Api Doc| +| **GET:- localhost:8080/api/policy-types** |This API is used to fetch type of policy attributes | Refer Api Doc |Refer Api Doc| +| **GET:- localhost:8080/api/policy-content** |This API is used to fetch policy content | Refer Api Doc |Refer Api Doc| +| **POST:- localhost:8080/api/policy-content** |This API is used to create policy content | Refer Api Doc |Refer Api Doc| +| **POST:- localhost:8080/api/policy** |This API is used to save policy | Refer Api Doc |Refer Api Doc| +| **PUT:- localhost:8080/api/policy/{uuid}** |This API is used to update policy | Refer Api Doc |Refer Api Doc| +| **GET:- localhost:8080/api/policy/{uuid}** |This API is used to get policy | Refer Api Doc |Refer Api Doc| +| **GET:- localhost:8080/api/policy/is-policy-name-valid** |This API is used to check policy name valid or not | Refer Api Doc |Refer Api Doc| +| **GET:- localhost:8080/api/policy** |This API is used to all policy | Refer Api Doc |Refer Api Doc| +| **DELETE:- localhost:8080/api/policy/{uuid}** |This API is used to delete policy | Refer Api Doc |Refer Api Doc| ## Detailed API specs available under: @@ -326,10 +350,16 @@ https:///backend/api/swagger-ui/index.html | Tables | Description | Unique Id | | ------ | ------ | ------ | | **aspect** | Table used to Store Date About Serialized Part | **Primary Key**:UUID | +| **serialpart_v_300** | Table used to Store Date About Serialized Part | **Primary Key**:UUID | | **aspect_relationship** |Data about the relationship of parts to its child-components. | **Primary Key**:parent_catenax_id, child_catenax_id | +| **single_level_bom_asbuilt_v_300** |Data about the relationship of parts to its child-components. | **Primary Key**:parent_catenax_id, child_catenax_id | | **batch** |Table used to Store Date about Serialized Part. | **Primary Key**:UUID | +| **batch_v_300** |Table used to Store Date about Serialized Part. | **Primary Key**:UUID | | **part_as_planned** |Table used to Store Date about Part As Planned. | **Primary Key**:UUID | +| **part_type_information** |Table used to Store Date about Part As Planned. | **Primary Key**:UUID | +| **pcf_aspect** |Table used to Store Date about Part As Planned. | **Primary Key**:UUID | | **single_level_bom_as_planned** |Data about the relationship of part As Planned to its child-components. | **Primary Key**:parent_catenax_id, child_catenax_id | +| **single_level_bom_as_planned_v_300** |Data about the relationship of part As Planned to its child-components. | **Primary Key**:parent_catenax_id, child_catenax_id | | **part_site_information_as_planned** |Table used to Store Date about Part Site Information As Planned. | **Primary Key**:UUID | | **contract_negotiation_info** |Tables Contains Contract Negotiation Info and offerid | **Primary Key**: connector_id, offer_id | | **failure_log** |Table Contains Data About Failure Entries | **Primary Key**:UUID | @@ -339,6 +369,7 @@ https:///backend/api/swagger-ui/index.html | **sde_permission** |Table Contains list of permissions | **Primary Key**:sde_permission | | **sde_role_permission_mapping** |Table Contains mapping of role with permissions | **Primary Key**:sde_role, sde_permission | | **single_level_usage_as_built** |Data about the relationship of parts to its child-components. | **Primary Key**:parent_catenax_id, child_catenax_id | +| **single_level_usage_as_built_v_300** |Data about the relationship of parts to its child-components. | **Primary Key**:parent_catenax_id, child_catenax_id | --- ## flyway diff --git a/build/Dockerfile b/build/Dockerfile index 7b1a1f40c..5d0722382 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -18,7 +18,7 @@ # SPDX-License-Identifier: Apache-2.0 ################################################################################ # our base build image -FROM maven:3.9-eclipse-temurin-17-focal AS build +FROM maven:3-eclipse-temurin-19-focal AS build # copy the project files COPY ../pom.xml ./pom.xml @@ -27,7 +27,9 @@ COPY ../pom.xml ./pom.xml COPY ../modules ./modules # build for release -RUN mvn clean install +#Commeting this because workflow job already building jar file +#As SDE its require some docker enviroment to run test cases so avoid it +#RUN mvn clean install # our final base image diff --git a/modules/README.md b/modules/README.md index 130261c9e..a3f5621e9 100644 --- a/modules/README.md +++ b/modules/README.md @@ -13,15 +13,18 @@ SDE backend splited into multiple services loosely-coupled Maven modules. - modules/sde-external-services/digital-twins - modules/sde-external-services/portal - modules/sde-external-services/bpn-discovery +- modules/sde-external-services/policy-hub + - modules/sde-common - modules/sde-core -- modules/sde-submodules/serial-part-typization + +- modules/sde-submodules/serial-part +- modules/sde-submodules/single-level-bom-as-built - modules/sde-submodules/batch -- modules/sde-submodules/assembly-part-relationship - modules/sde-submodules/part-as-planned +- modules/sde-submodules/part-type-information - modules/sde-submodules/part-site-information-as-planned - modules/sde-submodules/single-level-usage-as-built - modules/sde-submodules/single-level-bom-as-planned - modules/sde-submodules/pcf -- modules/sde-usecases/traceability - modules/pcf-exchange \ No newline at end of file diff --git a/modules/pcf-exchange/README.md b/modules/pcf-exchange/README.md index 5c3a65a8b..67f5ed989 100644 --- a/modules/pcf-exchange/README.md +++ b/modules/pcf-exchange/README.md @@ -12,4 +12,5 @@ https://eclipse-tractusx.github.io/docs-kits/category/pcf-exchange-kit ##### External service dependency : - dDTR service. - EDC Service. -- BPN Discovery. \ No newline at end of file +- BPN Discovery. +- Portal Service. \ No newline at end of file diff --git a/modules/sde-common/pom.xml b/modules/sde-common/pom.xml index 175fc8bc0..d21e57e2f 100644 --- a/modules/sde-common/pom.xml +++ b/modules/sde-common/pom.xml @@ -49,7 +49,7 @@ com.networknt json-schema-validator - 1.0.72 + 1.4.0 diff --git a/modules/sde-core/pom.xml b/modules/sde-core/pom.xml index ff41b86ef..8b95ce182 100644 --- a/modules/sde-core/pom.xml +++ b/modules/sde-core/pom.xml @@ -63,7 +63,7 @@ commons-io commons-io - 2.7 + 2.16.1 com.github.ben-manes.caffeine @@ -105,7 +105,7 @@ org.apache.commons commons-csv - 1.8 + 1.11.0 org.springframework.boot @@ -222,7 +222,6 @@ spring-security-test test - diff --git a/modules/sde-core/src/main/java/org/eclipse/tractusx/sde/core/csv/service/CsvHandlerService.java b/modules/sde-core/src/main/java/org/eclipse/tractusx/sde/core/csv/service/CsvHandlerService.java index fb916b0c7..0f0258788 100644 --- a/modules/sde-core/src/main/java/org/eclipse/tractusx/sde/core/csv/service/CsvHandlerService.java +++ b/modules/sde-core/src/main/java/org/eclipse/tractusx/sde/core/csv/service/CsvHandlerService.java @@ -81,13 +81,21 @@ public String storeFile(MultipartFile multipartFile) { } UUID uuid = UUID.randomUUID(); + + if (fileName.contains("..") || fileName.contains("/") || fileName.contains("\\")) { + throw new IllegalArgumentException("Invalid csv filename"); + } + fileName = fileName.replace( fileName.substring(0, fileName.lastIndexOf(".")), uuid.toString() ); Path targetLocation = this.fileStorageLocation.resolve(fileName); - + if (!targetLocation.startsWith(this.fileStorageLocation + File.separator)) { + throw new IllegalArgumentException("Invalid csv filename"); + } + Files.copy(stream, targetLocation, StandardCopyOption.REPLACE_EXISTING); stream.close(); diff --git a/modules/sde-core/src/main/java/org/eclipse/tractusx/sde/core/submodel/executor/step/EDCUsecaseHandler.java b/modules/sde-core/src/main/java/org/eclipse/tractusx/sde/core/submodel/executor/step/EDCUsecaseHandler.java index f3e275c9c..87a7515f4 100644 --- a/modules/sde-core/src/main/java/org/eclipse/tractusx/sde/core/submodel/executor/step/EDCUsecaseHandler.java +++ b/modules/sde-core/src/main/java/org/eclipse/tractusx/sde/core/submodel/executor/step/EDCUsecaseHandler.java @@ -58,7 +58,8 @@ public ObjectNode run(Integer rowNumber, ObjectNode objectNode, String processId SubmoduleCommonColumnsConstant.SHELL_ID); String subModelId = JsonObjectUtility.getValueFromJsonObjectAsString(objectNode, SubmoduleCommonColumnsConstant.SUBMODULE_ID); - String uuid = JsonObjectUtility.getValueFromJsonObjectAsString(objectNode, getIdentifierOfModel()); + + String uuid = getDatabaseIdentifierValues(objectNode, getDatabaseIdentifierSpecsOfModel()); AssetEntryRequest assetEntryRequest = assetFactory.getAssetRequest(submodule, getSubmodelShortDescriptionOfModel(), shellId, subModelId, getSubmoduleUriPathOfSubmodule(), uuid, diff --git a/modules/sde-core/src/main/java/org/eclipse/tractusx/sde/core/utils/SubmoduleUtility.java b/modules/sde-core/src/main/java/org/eclipse/tractusx/sde/core/utils/SubmoduleUtility.java index 2c8c27d3d..5ccc08680 100644 --- a/modules/sde-core/src/main/java/org/eclipse/tractusx/sde/core/utils/SubmoduleUtility.java +++ b/modules/sde-core/src/main/java/org/eclipse/tractusx/sde/core/utils/SubmoduleUtility.java @@ -47,6 +47,7 @@ public List getTableColomnHeader(Submodel schemaObj) { tableColomnHeader.add(SubmoduleCommonColumnsConstant.PROCESS_ID); tableColomnHeader.add(SubmoduleCommonColumnsConstant.DELETED); tableColomnHeader.add(SubmoduleCommonColumnsConstant.UPDATED); + tableColomnHeader.add(SubmoduleCommonColumnsConstant.SHELL_ACCESS_RULE_IDS); return tableColomnHeader; } diff --git a/modules/sde-core/src/main/resources/application.properties b/modules/sde-core/src/main/resources/application.properties index 835090129..a2f03f7cc 100644 --- a/modules/sde-core/src/main/resources/application.properties +++ b/modules/sde-core/src/main/resources/application.properties @@ -64,10 +64,12 @@ logging.level.root=info ## Digital Twins digital-twins.hostname= digital-twins.authentication.url= -digital-twins.api=/api/v3.0 +digital-twins.registry.uri= +digital-twins.registry.lookup.uri= digital-twins.authentication.clientId= digital-twins.authentication.clientSecret= digital-twins.authentication.grantType=client_credentials +digital-twins.authentication.scope= ## EDC Provider edc.hostname= @@ -76,6 +78,8 @@ edc.apiKeyHeader= edc.apiKey= edc.dsp.endpointpath=/api/v1/dsp edc.dataplane.endpointpath=/api/public +edc.managementpath.apiversion=/v2 +edc.managementpath.apiversion.asset=/v3 ## EDC Consumer edc.consumer.hostname= diff --git a/modules/sde-core/src/main/resources/edc_request_template/edc_asset_lookup.json b/modules/sde-core/src/main/resources/edc_request_template/edc_asset_lookup.json index 2f1479b54..653b4df29 100644 --- a/modules/sde-core/src/main/resources/edc_request_template/edc_asset_lookup.json +++ b/modules/sde-core/src/main/resources/edc_request_template/edc_asset_lookup.json @@ -11,12 +11,12 @@ { "edc:operandLeft": "https://w3id.org/edc/v0.0.1/ns/type", "edc:operator": "=", - "edc:operandRight": "data.core.digitalTwinRegistry" + "edc:operandRight": "${assetType}" }, { - "edc:operandLeft": "https://w3id.org/edc/v0.0.1/ns/registry", + "edc:operandLeft": "https://w3id.org/edc/v0.0.1/ns/${registryType}", "edc:operator": "=", - "edc:operandRight": "${digitalTwinRegistry}" + "edc:operandRight": "${baseUrl}" } ] } \ No newline at end of file diff --git a/modules/sde-core/src/main/resources/edc_request_template/edc_asset_lookup_for_exchange.json b/modules/sde-core/src/main/resources/edc_request_template/edc_asset_lookup_for_exchange.json index ac1334f44..f4b571575 100644 --- a/modules/sde-core/src/main/resources/edc_request_template/edc_asset_lookup_for_exchange.json +++ b/modules/sde-core/src/main/resources/edc_request_template/edc_asset_lookup_for_exchange.json @@ -3,7 +3,7 @@ { "operandLeft": "https://w3id.org/edc/v0.0.1/ns/type", "operator": "=", - "operandRight": "data.core.digitalTwinRegistry" + "operandRight": "${type}" } ] } \ No newline at end of file diff --git a/modules/sde-core/src/test/java/org/eclipse/tractusx/sde/controllers/ConsumerControllerTest.java b/modules/sde-core/src/test/java/org/eclipse/tractusx/sde/controllers/ConsumerControllerTest.java index e2ca2e924..c4cd2c56e 100644 --- a/modules/sde-core/src/test/java/org/eclipse/tractusx/sde/controllers/ConsumerControllerTest.java +++ b/modules/sde-core/src/test/java/org/eclipse/tractusx/sde/controllers/ConsumerControllerTest.java @@ -1,6 +1,6 @@ /******************************************************************************** - * Copyright (c) 2022, 2024 T-Systems International GmbH - * Copyright (c) 2022, 2024 Contributors to the Eclipse Foundation + * Copyright (c) 2022,2024 T-Systems International GmbH + * Copyright (c) 2022,2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -27,7 +27,9 @@ import static org.mockito.Mockito.when; import java.util.ArrayList; +import java.util.HashSet; import java.util.List; +import java.util.Set; import org.eclipse.tractusx.sde.common.entities.Policies; import org.eclipse.tractusx.sde.core.controller.ConsumerController; @@ -66,7 +68,7 @@ class ConsumerControllerTest { @Test void testQueryOnDataOfferWithoutOfferModel() throws Exception { when(consumerControlPanelService.queryOnDataOffers((String) any(), (String) any(), (String) any(), anyInt(), - anyInt())).thenReturn(new ArrayList<>()); + anyInt())).thenReturn(new HashSet<>()); MockHttpServletRequestBuilder requestBuilder = MockMvcRequestBuilders.get("/query-data-offers") .param("bpnNumber", "foo"); @@ -78,7 +80,7 @@ void testQueryOnDataOfferWithoutOfferModel() throws Exception { @Test void testQueryOnDataOffersWithOfferModel() throws Exception { - ArrayList queryDataOfferModelList = new ArrayList<>(); + Set queryDataOfferModelList = new HashSet<>(); queryDataOfferModelList.add(QueryDataOfferModel.builder() .assetId("foo") .connectorId("test") diff --git a/modules/sde-core/src/test/java/org/eclipse/tractusx/sde/controllers/PolicyControllerTest.java b/modules/sde-core/src/test/java/org/eclipse/tractusx/sde/controllers/PolicyControllerTest.java index bc022bbcd..f56faeb96 100644 --- a/modules/sde-core/src/test/java/org/eclipse/tractusx/sde/controllers/PolicyControllerTest.java +++ b/modules/sde-core/src/test/java/org/eclipse/tractusx/sde/controllers/PolicyControllerTest.java @@ -54,73 +54,98 @@ @EnablePostgreSQL class PolicyControllerTest { - @Autowired - private MockMvc mvc; - @Autowired - private PolicyRepository policyRepository; - - @Autowired - private PolicyService policyService; - - private final ObjectMapper objectMapper = new ObjectMapper(); - - @BeforeEach - public void init() { - policyRepository.deleteAll(); - } - - //@Test - void testSaveAndRetrievePolicy() throws Exception { - mvc.perform(MockMvcRequestBuilders.post("/policy").contentType(MediaType.APPLICATION_JSON) - .content(objectMapper.writeValueAsString(getPolicy("new_policy")))).andExpect(status().isOk()); - - Assertions.assertEquals(1, policyRepository.findAll().size()); - List entities = policyRepository.findAll(); - String uuid = entities.get(0).getUuid(); - - mvc.perform(MockMvcRequestBuilders.get("/policy/{uuid}", uuid).contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isOk()); - - } - - //@Test - void testUniquePolicies() throws Exception { - mvc.perform(MockMvcRequestBuilders.post("/policy").contentType(MediaType.APPLICATION_JSON) - .content(objectMapper.writeValueAsString(getPolicy("new_policy")))).andExpect(status().isOk()); - - Assertions.assertEquals(1, policyRepository.findAll().size()); - - mvc.perform(MockMvcRequestBuilders.post("/policy").contentType(MediaType.APPLICATION_JSON) - .content(objectMapper.writeValueAsString(getPolicy("new_policy")))).andExpect(status().isBadRequest()); - - Assertions.assertEquals(1, policyRepository.findAll().size()); - - } - - //@Test - void findMatchingPolicyBasedOnFileName() throws Exception { - - String fileName = "Mysubmodel_new_policy.csv"; - mvc.perform(MockMvcRequestBuilders.post("/policy").contentType(MediaType.APPLICATION_JSON) - .content(objectMapper.writeValueAsString(getPolicy("new_policy")))).andExpect(status().isOk()); - - List findMatchingPolicyBasedOnFileName = policyService.findMatchingPolicyBasedOnFileName(fileName); - Assertions.assertEquals(1, findMatchingPolicyBasedOnFileName.size()); - Assertions.assertEquals("new_policy", findMatchingPolicyBasedOnFileName.get(0).getPolicyName()); - - } - - private PolicyModel getPolicy(String policyName) { - - List accessPolicies = List.of( - Policies.builder().technicalKey("BusinessPartnerNumber") - .value(List.of("BPNL00000005PROV", "BPNL00000005PROW", "BPNL00000005PROB")).build(), - Policies.builder().technicalKey("Membership").value(List.of("active")).build()); - - Policies usagePolicies = Policies.builder().technicalKey("Membership").value(List.of("active")).build(); - - return PolicyModel.builder().policyName(policyName).accessPolicies(accessPolicies) - .usagePolicies(List.of(usagePolicies)).build(); - } + @Autowired + private MockMvc mvc; + + @Autowired + private PolicyRepository policyRepository; + + @Autowired + private PolicyService policyService; + + private final ObjectMapper objectMapper = new ObjectMapper(); + + @BeforeEach + public void init() { + policyRepository.deleteAll(); + } + + @Test + void testSaveAndRetrievePolicy() throws Exception { + mvc.perform(MockMvcRequestBuilders + .post("/policy") + .contentType(MediaType.APPLICATION_JSON) + .content(objectMapper.writeValueAsString(getPolicy("new_policy")))) + .andExpect(status().isOk()); + + Assertions.assertEquals(1, policyRepository.findAll().size()); + List entities = policyRepository.findAll(); + String uuid = entities.get(0).getUuid(); + + mvc.perform(MockMvcRequestBuilders + .get("/policy/{uuid}", uuid) + .contentType(MediaType.APPLICATION_JSON)) + .andExpect(status().isOk()); + + } + + @Test + void testUniquePolicies() throws Exception { + mvc.perform(MockMvcRequestBuilders + .post("/policy") + .contentType(MediaType.APPLICATION_JSON) + .content(objectMapper.writeValueAsString(getPolicy("new_policy")))) + .andExpect(status().isOk()); + + Assertions.assertEquals(1, policyRepository.findAll().size()); + + mvc.perform(MockMvcRequestBuilders + .post("/policy") + .contentType(MediaType.APPLICATION_JSON) + .content(objectMapper.writeValueAsString(getPolicy("new_policy")))) + .andExpect(status().isBadRequest()); + + Assertions.assertEquals(1, policyRepository.findAll().size()); + + } + + @Test + void findMatchingPolicyBasedOnFileName() throws Exception { + + String fileName = "Mysubmodel_new_policy.csv"; + mvc.perform(MockMvcRequestBuilders + .post("/policy") + .contentType(MediaType.APPLICATION_JSON) + .content(objectMapper.writeValueAsString(getPolicy("new_policy")))) + .andExpect(status().isOk()); + + List findMatchingPolicyBasedOnFileName = policyService.findMatchingPolicyBasedOnFileName(fileName); + Assertions.assertEquals(1, findMatchingPolicyBasedOnFileName.size()); + Assertions.assertEquals("new_policy", findMatchingPolicyBasedOnFileName.get(0).getPolicyName()); + + } + + + private PolicyModel getPolicy(String policyName) { + + List accessPolicies = List.of(Policies.builder() + .technicalKey("BusinessPartnerNumber") + .value(List.of("BPNL00000005PROV", "BPNL00000005PROW", "BPNL00000005PROB")) + .build(),Policies.builder() + .technicalKey("Membership") + .value(List.of("active")) + .build()); + + Policies usagePolicies = Policies.builder() + .technicalKey("Membership") + .value(List.of("active")) + .build(); + + return PolicyModel.builder() + .policyName(policyName) + .accessPolicies(accessPolicies) + .usagePolicies(List.of(usagePolicies)) + .build(); + } } \ No newline at end of file diff --git a/modules/sde-core/src/test/java/org/eclipse/tractusx/sde/service/ConsumerControlPanelServiceTest.java b/modules/sde-core/src/test/java/org/eclipse/tractusx/sde/service/ConsumerControlPanelServiceTest.java index ed19685ce..d7175281e 100644 --- a/modules/sde-core/src/test/java/org/eclipse/tractusx/sde/service/ConsumerControlPanelServiceTest.java +++ b/modules/sde-core/src/test/java/org/eclipse/tractusx/sde/service/ConsumerControlPanelServiceTest.java @@ -28,6 +28,7 @@ import java.util.ArrayList; import java.util.List; +import java.util.Set; import java.util.UUID; import org.eclipse.tractusx.sde.bpndiscovery.handler.BpnDiscoveryProxyService; @@ -143,7 +144,7 @@ public void setup() { void testQueryOnDataOfferEmpty() throws Exception { - List queryOnDataOffers = consumerControlPanelService.queryOnDataOffers("example", "", "", + Set queryOnDataOffers = consumerControlPanelService.queryOnDataOffers("example", "", "", 0, 0); assertTrue(queryOnDataOffers.isEmpty()); } diff --git a/modules/sde-core/src/test/resource/application-test.properties b/modules/sde-core/src/test/resources/application-test.properties similarity index 92% rename from modules/sde-core/src/test/resource/application-test.properties rename to modules/sde-core/src/test/resources/application-test.properties index 5f2f80790..5651f211b 100644 --- a/modules/sde-core/src/test/resource/application-test.properties +++ b/modules/sde-core/src/test/resources/application-test.properties @@ -106,7 +106,7 @@ portal.backend.clientSecret=test portal.backend.grantType=client_credentials ## bpn & discovery finder -bpndiscovery.hostname=http://test +bpndiscovery.hostname=test discovery.authentication.url=test discovery.clientId=test discovery.clientSecret=test @@ -115,6 +115,18 @@ discovery.grantType=client_credentials springdoc.api-docs.path=/api-docs springdoc.swagger-ui.oauth.client-id=test +## Notification Email server info +mail.smtp.username=test +mail.smtp.password=test +mail.smtp.host=test +mail.smtp.port=587 +mail.from.address=test +mail.to.address=test +mail.cc.address=test +mail.replyto.address=test +mail.smtp.starttls.enable=true +mail.smtp.auth=true + # policy-hub config policy.hub.hostname=test policy.hub.authentication.url=test diff --git a/modules/sde-external-services/README.md b/modules/sde-external-services/README.md index 5df0c77af..7377beab4 100644 --- a/modules/sde-external-services/README.md +++ b/modules/sde-external-services/README.md @@ -12,4 +12,4 @@ Currenlty SDE consume below Downstearm services API's to perform the Asset creat - digital-twins - portal - bpn-discovery -- policy-nub \ No newline at end of file +- policy-hub diff --git a/modules/sde-external-services/bpn-discovery/src/main/java/org/eclipse/tractusx/sde/bpndiscovery/handler/BPNDiscoveryUseCaseHandler.java b/modules/sde-external-services/bpn-discovery/src/main/java/org/eclipse/tractusx/sde/bpndiscovery/handler/BPNDiscoveryUseCaseHandler.java index 49a7c5fb2..8540aefc8 100644 --- a/modules/sde-external-services/bpn-discovery/src/main/java/org/eclipse/tractusx/sde/bpndiscovery/handler/BPNDiscoveryUseCaseHandler.java +++ b/modules/sde-external-services/bpn-discovery/src/main/java/org/eclipse/tractusx/sde/bpndiscovery/handler/BPNDiscoveryUseCaseHandler.java @@ -96,7 +96,7 @@ public void delete(Integer rowIndex, JsonObject jsonObject, String delProcessId, private Map generateBPNDiscoveryIdentifiersIds(JsonNode jsonObject) { return getBPNDiscoverySpecsOfModel().entrySet().stream().map(entry -> { - String value = JsonObjectUtility.getValueFromJsonObjectAsString(jsonObject, entry.getValue().getAsString()); + String value = JsonObjectUtility.getValueFromJsonObjectAsString(jsonObject, extractExactFieldName(entry.getValue().getAsString())); if (StringUtils.isBlank(value)) { value = entry.getValue().getAsString(); } diff --git a/modules/sde-external-services/digital-twins/README.md b/modules/sde-external-services/digital-twins/README.md index 2f19708cf..806162944 100644 --- a/modules/sde-external-services/digital-twins/README.md +++ b/modules/sde-external-services/digital-twins/README.md @@ -5,6 +5,6 @@ This is maven package build to call DT API's to create simantic twins/aspects in This module contain all implementation related to DigitalTwins registry api's call. - Swagger Link: https://semantics.int.demo.catena-x.net/registry/swagger-ui/index.html + Swagger Link: https:///registry/swagger-ui/index.html diff --git a/modules/sde-external-services/edc/src/main/java/org/eclipse/tractusx/sde/edc/entities/request/policies/PolicyConstraintBuilderService.java b/modules/sde-external-services/edc/src/main/java/org/eclipse/tractusx/sde/edc/entities/request/policies/PolicyConstraintBuilderService.java index 684be2878..e60223e04 100644 --- a/modules/sde-external-services/edc/src/main/java/org/eclipse/tractusx/sde/edc/entities/request/policies/PolicyConstraintBuilderService.java +++ b/modules/sde-external-services/edc/src/main/java/org/eclipse/tractusx/sde/edc/entities/request/policies/PolicyConstraintBuilderService.java @@ -1,6 +1,6 @@ /******************************************************************************** - * Copyright (c) 2022, 2024 T-Systems International GmbH - * Copyright (c) 2022, 2024 Contributors to the Eclipse Foundation + * Copyright (c) 2022,2024 T-Systems International GmbH + * Copyright (c) 2022,2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -29,6 +29,7 @@ import org.eclipse.tractusx.sde.common.entities.Policies; import org.eclipse.tractusx.sde.common.entities.PolicyModel; import org.eclipse.tractusx.sde.common.mapper.JsonObjectMapper; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import com.fasterxml.jackson.databind.JsonNode; @@ -39,29 +40,83 @@ @RequiredArgsConstructor public class PolicyConstraintBuilderService { + private static final String BUSINESS_PARTNER_NUMBER = "BusinessPartnerNumber"; + private final PolicyRequestFactory policyRequestFactory; private final JsonObjectMapper jsonobjectMapper; + @Value("${manufacturerId}") + private String manufacturerId; + +// private final IPolicyHubProxyService policyHubProxyService; +// +// public JsonNode getAccessPolicy(String assetId, PolicyModel policy) { +// +// return policyRequestFactory.setPolicyIdAndGetObject(assetId, +// policyHubProxyService.getPolicyContent( +// mapPolicy(PolicyTypeIdEnum.ACCESS, ConstraintOperandIdEnum.OR, policy.getAccessPolicies())), +// "a"); +// } +// +// public JsonNode getUsagePolicy(String assetId, PolicyModel policy) { +// +// return policyRequestFactory.setPolicyIdAndGetObject(assetId, +// policyHubProxyService.getPolicyContent( +// mapPolicy(PolicyTypeIdEnum.USAGE, ConstraintOperandIdEnum.AND, policy.getUsagePolicies())), +// "u"); +// } + +// private PolicyContentRequest mapPolicy(PolicyTypeIdEnum policyType, ConstraintOperandIdEnum constraintOperandId, +// List policies) { +// +// List constraintsList = new ArrayList<>(); +// policies.forEach(policy -> { +// +// List valueList = getAndOwnerBPNIfNotExist(policy); +// +// OperatorIdEnum operator = OperatorIdEnum.EQUALS; +// +// if (valueList.size() > 1) { +// operator = OperatorIdEnum.IN; +// } +// +// for (String value : valueList) { +// constraintsList.add( +// Constraint.builder() +// .key(policy.getTechnicalKey()) +// .operator(operator) +// .value(value) +// .build()); +// } +// }); +// +// return PolicyContentRequest.builder() +// .policyType(policyType) +// .constraintOperand(constraintOperandId) +// .constraints(constraintsList) +// .build(); +// } + public JsonNode getAccessPolicy(String assetId, PolicyModel policy) { return jsonobjectMapper.objectToJsonNode(policyRequestFactory.getPolicy(assetId, - getPoliciesConstraints(policy.getAccessPolicies(), "odrl:or"), Collections.emptyMap(), "a")); + getPoliciesConstraints(policy.getAccessPolicies(), "odrl:or", "a"), Collections.emptyMap(), "a")); } public JsonNode getUsagePolicy(String assetId, PolicyModel policy) { return jsonobjectMapper.objectToJsonNode(policyRequestFactory.getPolicy(assetId, - getPoliciesConstraints(policy.getUsagePolicies(), "odrl:and"), Collections.emptyMap(), "u")); + getPoliciesConstraints(policy.getUsagePolicies(), "odrl:and", "u"), Collections.emptyMap(), "u")); } public ActionRequest getUsagePoliciesConstraints(List policies) { - return getPoliciesConstraints(policies, "odrl:and"); + return getPoliciesConstraints(policies, "odrl:and", "u"); } - public ActionRequest getPoliciesConstraints(List usagePolicies, String operator) { + public ActionRequest getPoliciesConstraints(List usagePolicies, String operator, String type) { List constraintList = new ArrayList<>(); if (usagePolicies != null && !usagePolicies.isEmpty()) { - usagePolicies.forEach(policy -> preparePolicyConstraint(constraintList, policy)); + usagePolicies.forEach(policy -> preparePolicyConstraint(constraintList, policy, type)); } constraintList.sort(Comparator.comparing(ConstraintRequest::getLeftOperand)); @@ -76,24 +131,40 @@ public ActionRequest getPoliciesConstraints(List usagePolicies, String } - private void preparePolicyConstraint(List policies, Policies policy) { + private void preparePolicyConstraint(List policies, Policies policy, String type) { String operator = "odrl:eq"; - for (String value : policy.getValue()) { + + List values = policy.getValue(); + + if (type.equals("a")) + values = getAndOwnerBPNIfNotExist(policy, values); + + for (String value : values) { if (StringUtils.isNotBlank(value)) { - - if(policy.getTechnicalKey().contains("FrameworkAgreement")) { - value="active"; - } - ConstraintRequest request = ConstraintRequest.builder() .leftOperand(policy.getTechnicalKey()) .operator(Operator.builder().id(operator).build()) - .rightOperand(value) - .build(); + .rightOperand(value).build(); policies.add(request); } } } + private List getAndOwnerBPNIfNotExist(Policies policy, List values) { + + if (policy.getTechnicalKey().equals(BUSINESS_PARTNER_NUMBER) && !values.isEmpty() + && (values.size() == 1 && StringUtils.isNotBlank(values.get(0))) && !values.contains(manufacturerId)) { + + List temp = new ArrayList<>(); + values.stream().forEach(temp::add); + temp.add(manufacturerId); + values = temp; + + } + + return values; + + } + } diff --git a/modules/sde-external-services/edc/src/main/java/org/eclipse/tractusx/sde/edc/entities/request/policies/PolicyRequest.java b/modules/sde-external-services/edc/src/main/java/org/eclipse/tractusx/sde/edc/entities/request/policies/PolicyRequest.java index ea4733750..a14ac8148 100644 --- a/modules/sde-external-services/edc/src/main/java/org/eclipse/tractusx/sde/edc/entities/request/policies/PolicyRequest.java +++ b/modules/sde-external-services/edc/src/main/java/org/eclipse/tractusx/sde/edc/entities/request/policies/PolicyRequest.java @@ -56,6 +56,9 @@ public class PolicyRequest { @JsonProperty("@id") private String id; + @JsonProperty("profile") + private String profile; + @JsonProperty("odrl:permission") private Object permissions; diff --git a/modules/sde-external-services/edc/src/main/java/org/eclipse/tractusx/sde/edc/entities/request/policies/PolicyRequestFactory.java b/modules/sde-external-services/edc/src/main/java/org/eclipse/tractusx/sde/edc/entities/request/policies/PolicyRequestFactory.java index 148ad60d2..6c44ad835 100644 --- a/modules/sde-external-services/edc/src/main/java/org/eclipse/tractusx/sde/edc/entities/request/policies/PolicyRequestFactory.java +++ b/modules/sde-external-services/edc/src/main/java/org/eclipse/tractusx/sde/edc/entities/request/policies/PolicyRequestFactory.java @@ -1,7 +1,7 @@ /******************************************************************************** * Copyright (c) 2022 BMW GmbH - * Copyright (c) 2022, 2024 T-Systems International GmbH - * Copyright (c) 2022, 2024 Contributors to the Eclipse Foundation + * Copyright (c) 2022,2024 T-Systems International GmbH + * Copyright (c) 2022,2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -25,34 +25,57 @@ import java.util.List; import java.util.Map; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.ObjectNode; + @Service public class PolicyRequestFactory { + @Value("${edc.policy.profile:noprofile}") + private String cxPolicyProfile; + public PolicyDefinitionRequest getPolicy(String assetId, ActionRequest action, Map extensibleProperties, String type) { List permissions = getPermissions(assetId, action); + + if (cxPolicyProfile != null && cxPolicyProfile.equals("noprofile")) { + cxPolicyProfile = "cx-policy:profile2405"; + } PolicyRequest policyRequest = PolicyRequest.builder() .permissions(permissions) + .profile(cxPolicyProfile) .obligations(new ArrayList<>()) .extensibleProperties(extensibleProperties) .prohibitions(new ArrayList<>()).build(); //Use submodel id to generate unique policy id for asset use policy type as prefix asset/usage - String submodelId = assetId; - if (assetId.indexOf("urn:uuid") != -1) { - submodelId = assetId.substring(assetId.indexOf("urn:uuid", 9)); - submodelId =submodelId.replace("urn:uuid:", ""); - } + String policyId = getGeneratedPolicyId(assetId, type); return PolicyDefinitionRequest.builder() - .id(type +"-"+ submodelId) + .id(policyId) .policyRequest(policyRequest).build(); } + public JsonNode setPolicyIdAndGetObject(String assetId, JsonNode jsonNode, String type) { + String policyId = getGeneratedPolicyId(assetId, type); + return ((ObjectNode) jsonNode).put("@id", policyId); + } + + private String getGeneratedPolicyId(String assetId, String type) { + String submodelId = assetId; + if (assetId.length() > 45) { + submodelId = assetId.substring(46); + submodelId = submodelId.replace("urn:uuid:", ""); + } + return type + "-" + submodelId; + } + + public List getPermissions(String assetId, ActionRequest action) { ArrayList permissions = new ArrayList<>(); diff --git a/modules/sde-external-services/edc/src/main/java/org/eclipse/tractusx/sde/edc/model/response/QueryDataOfferModel.java b/modules/sde-external-services/edc/src/main/java/org/eclipse/tractusx/sde/edc/model/response/QueryDataOfferModel.java index a7beae993..3451661d3 100644 --- a/modules/sde-external-services/edc/src/main/java/org/eclipse/tractusx/sde/edc/model/response/QueryDataOfferModel.java +++ b/modules/sde-external-services/edc/src/main/java/org/eclipse/tractusx/sde/edc/model/response/QueryDataOfferModel.java @@ -1,6 +1,6 @@ /******************************************************************************** - * Copyright (c) 2022, 2024 T-Systems International GmbH - * Copyright (c) 2022, 2024 Contributors to the Eclipse Foundation + * Copyright (c) 2022,2024 T-Systems International GmbH + * 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,6 +20,8 @@ package org.eclipse.tractusx.sde.edc.model.response; +import java.util.Objects; + import org.eclipse.tractusx.sde.common.entities.PolicyModel; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; @@ -73,4 +75,24 @@ public class QueryDataOfferModel { private PolicyModel policy; -} \ No newline at end of file + @Override + public boolean equals(Object obj) { + + if (this == obj) + return true; + + if (obj == null || obj.getClass() != this.getClass()) + return false; + + // type casting of the argument. + QueryDataOfferModel offer = (QueryDataOfferModel) obj; + + return (offer.assetId.equals(this.assetId) && offer.connectorOfferUrl.equals(this.connectorOfferUrl)); + } + + @Override + public int hashCode() { + return Objects.hash(this.assetId.hashCode()); + } + +} diff --git a/modules/sde-external-services/edc/src/main/java/org/eclipse/tractusx/sde/edc/services/ConsumerControlPanelService.java b/modules/sde-external-services/edc/src/main/java/org/eclipse/tractusx/sde/edc/services/ConsumerControlPanelService.java index 440aa4dce..90f23f775 100644 --- a/modules/sde-external-services/edc/src/main/java/org/eclipse/tractusx/sde/edc/services/ConsumerControlPanelService.java +++ b/modules/sde-external-services/edc/src/main/java/org/eclipse/tractusx/sde/edc/services/ConsumerControlPanelService.java @@ -21,12 +21,14 @@ package org.eclipse.tractusx.sde.edc.services; import java.time.LocalDateTime; -import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; +import java.util.HashSet; +import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Optional; +import java.util.Set; import java.util.UUID; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.atomic.AtomicReference; @@ -81,10 +83,10 @@ public class ConsumerControlPanelService { private final ContractNegotiationService contractNegotiationService; private final LookUpDTTwin lookUpDTTwin; - public List queryOnDataOffers(String manufacturerPartId, String searchBpnNumber, + public Set queryOnDataOffers(String manufacturerPartId, String searchBpnNumber, String submodel, Integer offset, Integer limit) { - List queryOnDataOffers = new ArrayList<>(); + List queryOnDataOffers = new LinkedList<>(); List bpnList = null; // 1 find bpn if empty using BPN discovery @@ -122,7 +124,7 @@ public List queryOnDataOffers(String manufacturerPartId, St } } } - return queryOnDataOffers; + return new HashSet<>(queryOnDataOffers); } diff --git a/modules/sde-external-services/edc/src/main/java/org/eclipse/tractusx/sde/edc/services/LookUpDTTwin.java b/modules/sde-external-services/edc/src/main/java/org/eclipse/tractusx/sde/edc/services/LookUpDTTwin.java index b2e99360d..1be1d37a0 100644 --- a/modules/sde-external-services/edc/src/main/java/org/eclipse/tractusx/sde/edc/services/LookUpDTTwin.java +++ b/modules/sde-external-services/edc/src/main/java/org/eclipse/tractusx/sde/edc/services/LookUpDTTwin.java @@ -30,6 +30,7 @@ import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.tuple.Pair; +import org.eclipse.tractusx.sde.common.configuration.properties.SDEConfigurationProperties; import org.eclipse.tractusx.sde.common.constants.CommonConstants; import org.eclipse.tractusx.sde.digitaltwins.entities.common.KeyValuePair; import org.eclipse.tractusx.sde.digitaltwins.entities.common.MultiLanguage; @@ -43,7 +44,6 @@ import org.eclipse.tractusx.sde.edc.model.edr.EDRCachedByIdResponse; import org.eclipse.tractusx.sde.edc.model.request.QueryDataOfferRequest; import org.eclipse.tractusx.sde.edc.model.response.QueryDataOfferModel; -import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; import feign.FeignException; @@ -62,11 +62,7 @@ public class LookUpDTTwin { private final CatalogResponseBuilder catalogResponseBuilder; - @Value(value = "${digital-twins.managed.thirdparty:false}") - private boolean managedThirdParty; - - @Value(value = "${manufacturerId}") - private String manufacturerId; + private final SDEConfigurationProperties sdeConfigurationProperties; String filterExpressionTemplate = """ "filterExpression": [ @@ -88,8 +84,8 @@ public List lookUpTwin(EDRCachedByIdResponse edrToken, Quer header.put("authorization", edrToken.getAuthorization()); submodel = StringUtils.isBlank(submodel) ? "" : submodel; - if (StringUtils.isNotBlank(bpnNumber)) - header.put("Edc-Bpn", bpnNumber); + if (StringUtils.isNotBlank(sdeConfigurationProperties.getManufacturerId())) + header.put("Edc-Bpn", sdeConfigurationProperties.getManufacturerId()); if (StringUtils.isBlank(manufacturerPartId)) { return lookUpAllShellForBPN(submodel, endpoint, dtOfferUrl, header, offset, limit); diff --git a/modules/sde-external-services/edc/src/main/java/org/eclipse/tractusx/sde/edc/util/EDCAssetLookUp.java b/modules/sde-external-services/edc/src/main/java/org/eclipse/tractusx/sde/edc/util/EDCAssetLookUp.java index 87ded8bc4..67e805d33 100644 --- a/modules/sde-external-services/edc/src/main/java/org/eclipse/tractusx/sde/edc/util/EDCAssetLookUp.java +++ b/modules/sde-external-services/edc/src/main/java/org/eclipse/tractusx/sde/edc/util/EDCAssetLookUp.java @@ -45,9 +45,9 @@ public class EDCAssetLookUp { private String filterExpressionTemplate = """ "filterExpression": [{ - "operandLeft": "https://w3id.org/edc/v0.0.1/ns/type", - "operator": "=", - "operandRight": "%s" + "operandLeft": "'http://purl.org/dc/terms/type'.'@id'", + "operator": "=", + "operandRight": "https://w3id.org/catenax/taxonomy#%s" }]"""; public List getEDCAssetsByType(String bpnNumber, String assetType) { diff --git a/modules/sde-external-services/edc/src/main/java/org/eclipse/tractusx/sde/edc/util/PCFExchangeAssetUtils.java b/modules/sde-external-services/edc/src/main/java/org/eclipse/tractusx/sde/edc/util/PCFExchangeAssetUtils.java index ee242a0f3..349ac4ba9 100644 --- a/modules/sde-external-services/edc/src/main/java/org/eclipse/tractusx/sde/edc/util/PCFExchangeAssetUtils.java +++ b/modules/sde-external-services/edc/src/main/java/org/eclipse/tractusx/sde/edc/util/PCFExchangeAssetUtils.java @@ -22,6 +22,7 @@ import java.util.List; import org.eclipse.tractusx.sde.common.utils.LogUtil; +import org.eclipse.tractusx.sde.edc.constants.EDCAssetConstant; import org.eclipse.tractusx.sde.edc.model.response.QueryDataOfferModel; import org.springframework.cache.annotation.CacheEvict; import org.springframework.cache.annotation.Cacheable; @@ -39,7 +40,7 @@ public class PCFExchangeAssetUtils { @Cacheable(value = "bpn-pcfexchange", key = "#bpnNumber") public List getPCFExchangeUrl(String bpnNumber) { - return edcAssetLookUp.getEDCAssetsByType(bpnNumber, "data.pcf.exchangeEndpoint"); + return edcAssetLookUp.getEDCAssetsByType(bpnNumber, EDCAssetConstant.DATA_CORE_PCF_EXCHANGE_ENPOINT_TYPE); } @CacheEvict(value = "bpn-pcfexchange", key = "#bpnNumber") diff --git a/modules/sde-submodules/pcf/src/main/resources/pcf-v6.0.0.json b/modules/sde-submodules/pcf/src/main/resources/pcf-v6.0.0.json index 96ec30481..b031f5d39 100644 --- a/modules/sde-submodules/pcf/src/main/resources/pcf-v6.0.0.json +++ b/modules/sde-submodules/pcf/src/main/resources/pcf-v6.0.0.json @@ -959,6 +959,7 @@ ], "addOn": { "identifier": "${id}", + "appendURNUUIDWithIdentifier": false, "lookupShellSpecificAssetIdsSpecs": { "assetLifecyclePhase": "${assetLifeCyclePhase}", "manufacturerPartId": "${productId}", @@ -971,6 +972,7 @@ "bpnDiscoverySpecs": { "manufacturerPartId": "${productId}" }, + "databaseIdentifierSpecs": ["${productId}"], "responseTemplate": { "specVersion": "${specVersion}", "companyIds": [ diff --git a/modules/sde-submodules/single-level-usage-as-built/src/main/resources/single-level-usage-as-built-v1.0.1.json b/modules/sde-submodules/single-level-usage-as-built/src/main/resources/single-level-usage-as-built-v1.0.1.json index e0ea87bfd..69f53b13e 100644 --- a/modules/sde-submodules/single-level-usage-as-built/src/main/resources/single-level-usage-as-built-v1.0.1.json +++ b/modules/sde-submodules/single-level-usage-as-built/src/main/resources/single-level-usage-as-built-v1.0.1.json @@ -239,7 +239,7 @@ } ] }, - "createShellIfNotExist": false, + "createShellIfNotExist": true, "createShellSpecificAssetIdsSpecs": { "partInstanceId": "${part_instance_id}", "manufacturerPartId": "${manufacturer_part_id}", diff --git a/modules/sde-submodules/single-level-usage-as-built/src/main/resources/single-level-usage-as-built-v3.0.0.json b/modules/sde-submodules/single-level-usage-as-built/src/main/resources/single-level-usage-as-built-v3.0.0.json index e6f3691c1..03e890f2a 100644 --- a/modules/sde-submodules/single-level-usage-as-built/src/main/resources/single-level-usage-as-built-v3.0.0.json +++ b/modules/sde-submodules/single-level-usage-as-built/src/main/resources/single-level-usage-as-built-v3.0.0.json @@ -278,7 +278,7 @@ } ] }, - "createShellIfNotExist": false, + "createShellIfNotExist": true, "createShellSpecificAssetIdsSpecs": { "partInstanceId": "${part_instance_id}", "manufacturerPartId": "${manufacturer_part_id}", diff --git a/modules/sde-submodules/submodules.md b/modules/sde-submodules/submodules.md index 3bb98ef05..59684ee5d 100644 --- a/modules/sde-submodules/submodules.md +++ b/modules/sde-submodules/submodules.md @@ -1,4 +1,4 @@ -# SDE Submodules + # SDE Submodules --- ## Description This is maven package mainly build for supporting different semantic submodels like SerialPartTypization, Batch, AssemblyPartRelationship etc. @@ -8,13 +8,19 @@ Currently SDE supports below submodels. ### Supported Models -#### [serial-part-typization in Version 1.1.1] +#### [serial-part in Version 1.0.0] +#### [serial-part in Version 3.0.0] #### [batch in Version 2.0.0] -#### [assembly-part-relationship in Version 1.1.1] -#### [partAsPlanned in Version 1.0.0] -#### [singleLevelBoMAsPlanned in Version 1.0.1] -#### [partSiteInformationAsPlanned in Version 1.0.0] -#### [SingleLevelUsageAsBuilt in Version 1.0.1] +#### [batch in Version 3.0.0] +#### [single-level-bom-as-built in Version 1.0.0] +#### [single-level-bom-as-built in Version 3.0.0] +#### [part-as-planned in Version 1.0.0] +#### [part-type-information in Version 1.0.0] +#### [part-site-information-as-planned in Version 1.0.0] +#### [single-level-bom-as-planned in Version 1.0.1] +#### [single-level-bom-as-planned in Version 3.0.0] +#### [Single-level-usage-as-built in Version 1.0.1] +#### [Single-level-usage-as-built in Version 3.0.0] #### [Product Carbon Footprint(PCF) in Version 6.0.0] ### How we can add Submodels? @@ -36,11 +42,18 @@ Once your maven module ready just do the clean build and install so submodel wil -[serial-part-typization in Version 1.1.1]: serial-part-typization/serial-part-typization.md +[serial-part in Version 1.0.0]: serial-part/serial-part.md +[serial-part in Version 3.0.0]: serial-part/serial-part.md [batch in Version 2.0.0]: batch/batch.md -[assembly-part-relationship in Version 1.1.1]: assembly-part-relationship/assembly-part-relationship.md -[partAsPlanned in Version 1.0.0]: part-as-planned/part-as-planned.md -[singleLevelBoMAsPlanned in Version 1.0.1]: single-level-bom-as-planned/single-level-bom-as-planned.md -[partSiteInformationAsPlanned in Version 1.0.0]: part-site-information-as-planned/part-site-information-as-planned.md -[SingleLevelUsageAsBuilt in Version 1.0.1]: single-level-usage-as-built/single-level-usage-as-built.md -[Product Carbon Footprint(PCF) in Version 6.0.0]: pcf/pcf.md +[batch in Version 3.0.0]: batch/batch.md +[single-level-bom-as-built in Version 1.0.0]: single-level-bom-as-built/single-level-bom-as-built.md +[single-level-bom-as-built in Version 3.0.0]: single-level-bom-as-built/single-level-bom-as-built.md +[part-as-planned in Version 1.0.0]: part-as-planned/part-as-planned.md +[part-type-information in Version 1.0.0]: part-type-information/part-type-information.md +[part-site-information-as-planned in Version 1.0.0]: part-site-information-as-planned/part-site-information-as-planned.md +[single-level-bom-as-planned in Version 1.0.1]: single-level-bom-as-planned/single-level-bom-as-planned.md +[single-level-bom-as-planned in Version 3.0.0]: single-level-bom-as-planned/single-level-bom-as-planned.md +[Single-level-usage-as-built in Version 1.0.1]: Single-level-usage-as-built/Single-level-usage-as-built.md +[Single-level-usage-as-built in Version 3.0.0]: Single-level-usage-as-built/Single-level-usage-as-built.md +[Product Carbon Footprint(PCF) in Version 6.0.0] pcf/pcf.md + diff --git a/pom.xml b/pom.xml index 330135856..0da1109e1 100644 --- a/pom.xml +++ b/pom.xml @@ -28,7 +28,7 @@ org.springframework.boot spring-boot-starter-parent - 3.1.6 + 3.2.5 @@ -41,11 +41,9 @@ 17 - 2.17.1 - 2022.0.3 - 1.4.2.Final - 1.4.2.Final - 2.0 + 2023.0.1 + 1.5.5.Final + 1.5.5.Final @@ -102,21 +100,15 @@ - ch.qos.logback - logback-classic - 1.4.14 - - - ch.qos.logback - logback-core - - - - - ch.qos.logback - logback-core - 1.4.14 - + ch.qos.logback + logback-classic + 1.5.6 + + + ch.qos.logback + logback-core + 1.5.6 + org.springframework.cloud spring-cloud-starter-openfeign @@ -148,17 +140,8 @@ org.springframework.security spring-security-config - - org.springframework.security - spring-security-core - - - org.springframework.security - spring-security-core - 6.2.2 - org.springframework.boot spring-boot-devtools @@ -173,7 +156,7 @@ org.mapstruct mapstruct - 1.4.2.Final + ${org.mapstruct.version} org.springframework.boot @@ -191,7 +174,6 @@ org.yaml snakeyaml - ${snakey-version} @@ -219,7 +201,7 @@ org.eclipse.dash license-tool-plugin - 1.0.3-SNAPSHOT + 1.1.0 automotive.tractusx @@ -307,4 +289,4 @@ - \ No newline at end of file +