From f0701aa815470efec5a353ab646ec65e29cc80f9 Mon Sep 17 00:00:00 2001 From: Mathias Brunkow Moser Date: Tue, 30 May 2023 13:35:20 +0200 Subject: [PATCH 01/35] feat: added token parse endpoint --- .../http/controllers/AppController.java | 21 ++++++++ .../tractusx/productpass/models/edc/Jwt.java | 54 +++++++++++++++++++ .../src/main/java/utils/HttpUtil.java | 20 +++++++ 3 files changed, 95 insertions(+) create mode 100644 consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/edc/Jwt.java diff --git a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/http/controllers/AppController.java b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/http/controllers/AppController.java index 2128b78dd..68e6b2ad6 100644 --- a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/http/controllers/AppController.java +++ b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/http/controllers/AppController.java @@ -29,9 +29,11 @@ import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.tags.Tag; +import org.eclipse.tractusx.productpass.models.edc.Jwt; import org.eclipse.tractusx.productpass.models.http.Response; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import utils.CatenaXUtil; @@ -40,6 +42,7 @@ import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; +import utils.LogUtil; @RestController @Tag(name = "Public Controller") @@ -58,6 +61,24 @@ public Response index(){ return httpUtil.getResponse("Redirect to UI"); } + @PostMapping("/endpoint") + @Operation(summary = "Receives the calls from the EDC", responses = { + @ApiResponse(description = "Get call from EDC", responseCode = "200", content = @Content(mediaType = "application/json", + schema = @Schema(implementation = Response.class))) + }) + public Response endpoint(){ + String token = httpUtil.getAuthorizationToken(httpRequest); + if(token == null){ + return httpUtil.buildResponse(httpUtil.getNotAuthorizedResponse(), httpResponse); + } + LogUtil.printMessage("Request Received in Endpoint"); + Jwt data = httpUtil.parseToken(token); + return httpUtil.getResponse( + "RUNNING", + data + ); + } + @GetMapping("/health") @Operation(summary = "Returns the backend health status", responses = { diff --git a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/edc/Jwt.java b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/edc/Jwt.java new file mode 100644 index 000000000..8dbfa132d --- /dev/null +++ b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/edc/Jwt.java @@ -0,0 +1,54 @@ +/********************************************************************************* + * + * 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. + * + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the + * License for the specific language govern in permissions and limitations + * under the License. + * + * SPDX-License-Identifier: Apache-2.0 + ********************************************************************************/ + +package org.eclipse.tractusx.productpass.models.edc; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; + +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_NULL) +public class Jwt { + @JsonProperty("header") + Map header; + @JsonProperty("payload") Map payload; + + public Map getHeader() { + return header; + } + + public void setHeader(Map header) { + this.header = header; + } + + public Map getPayload() { + return payload; + } + + public void setPayload(Map payload) { + this.payload = payload; + } +} diff --git a/consumer-backend/productpass/src/main/java/utils/HttpUtil.java b/consumer-backend/productpass/src/main/java/utils/HttpUtil.java index aed0260fe..4a490a4ac 100644 --- a/consumer-backend/productpass/src/main/java/utils/HttpUtil.java +++ b/consumer-backend/productpass/src/main/java/utils/HttpUtil.java @@ -24,6 +24,7 @@ package utils; import org.checkerframework.checker.units.qual.C; +import org.eclipse.tractusx.productpass.models.edc.Jwt; import org.eclipse.tractusx.productpass.models.http.Response; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.env.Environment; @@ -45,6 +46,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.ArrayList; +import java.util.Base64; import java.util.HashMap; import java.util.Map; @@ -56,6 +58,8 @@ public class HttpUtil { private Environment env; + @Autowired + JsonUtil jsonUtil; public Integer maxRetries; @Autowired @@ -165,6 +169,22 @@ public String getCurrentHost(HttpServletRequest httpRequest){ } } + public Jwt parseToken(String token){ + try { + String[] chunks = token.split("\\."); + Jwt jwt = new Jwt(); + + String header = CrypUtil.fromBase64Url(chunks[0]); + String payload = CrypUtil.fromBase64Url(chunks[1]); + LogUtil.printMessage("token header: " + header + " payload: " + payload); + jwt.setHeader((Map) jsonUtil.parseJson(header)); + jwt.setPayload((Map) jsonUtil.parseJson(payload)); + return jwt; + }catch(Exception e){ + throw new UtilException(HttpUtil.class, e, "It was not possible to parse JWT Token"); + } + + } public String getCurrentUrl(HttpServletRequest httpRequest){ try { return httpRequest.getRequestURL().toString(); From 4424b6211f90c1a28ff972d58d656741fc05152d Mon Sep 17 00:00:00 2001 From: Mathias Brunkow Moser Date: Tue, 30 May 2023 13:45:22 +0200 Subject: [PATCH 02/35] fix: removed non existant instance --- .../eclipse/tractusx/productpass/services/DataPlainService.java | 1 - 1 file changed, 1 deletion(-) diff --git a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/services/DataPlainService.java b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/services/DataPlainService.java index dbd30a5ba..16ca311e0 100644 --- a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/services/DataPlainService.java +++ b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/services/DataPlainService.java @@ -35,7 +35,6 @@ @Service public class DataPlainService extends BaseService { - public static final ConfigUtil configuration = new ConfigUtil(); public DataPlainService() throws ServiceInitializationException { this.checkEmptyVariables(); } From f616eb650e0a604b07ac341eaff47473bb3c22fe Mon Sep 17 00:00:00 2001 From: Mathias Brunkow Moser Date: Mon, 5 Jun 2023 09:24:16 +0200 Subject: [PATCH 03/35] feat: added edc-consumer in version v0.4.1 --- deployment/helm/edc-consumer/.helmignore | 45 - deployment/helm/edc-consumer/Chart.lock | 12 + deployment/helm/edc-consumer/Chart.yaml | 84 +- deployment/helm/edc-consumer/README.md.gotmpl | 26 + .../helm/edc-consumer/templates/_helpers.tpl | 84 -- .../helm/edc-consumer/templates/secret.yaml | 74 -- deployment/helm/edc-consumer/values-beta.yaml | 340 ------- deployment/helm/edc-consumer/values-dev.yaml | 334 ------- deployment/helm/edc-consumer/values-int.yaml | 838 +++++++++++------- deployment/helm/edc-consumer/values.yaml | 586 ++++++++++++ 10 files changed, 1217 insertions(+), 1206 deletions(-) delete mode 100644 deployment/helm/edc-consumer/.helmignore create mode 100644 deployment/helm/edc-consumer/Chart.lock create mode 100644 deployment/helm/edc-consumer/README.md.gotmpl delete mode 100644 deployment/helm/edc-consumer/templates/_helpers.tpl delete mode 100644 deployment/helm/edc-consumer/templates/secret.yaml delete mode 100644 deployment/helm/edc-consumer/values-beta.yaml delete mode 100644 deployment/helm/edc-consumer/values-dev.yaml create mode 100644 deployment/helm/edc-consumer/values.yaml diff --git a/deployment/helm/edc-consumer/.helmignore b/deployment/helm/edc-consumer/.helmignore deleted file mode 100644 index 916bb9632..000000000 --- a/deployment/helm/edc-consumer/.helmignore +++ /dev/null @@ -1,45 +0,0 @@ -################################################################################# -# Catena-X - Product Passport Consumer Application -# -# 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. -# -# This program and the accompanying materials are made available under the -# terms of the Apache License, Version 2.0 which is available at -# https://www.apache.org/licenses/LICENSE-2.0. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -# either express or implied. See the -# License for the specific language govern in permissions and limitations -# under the License. -# -# SPDX-License-Identifier: Apache-2.0 -################################################################################## - -# Patterns to ignore when building packages. -# This supports shell glob matching, relative path matching, and -# negation (prefixed with !). Only one pattern per line. -.DS_Store -# Common VCS dirs -.git/ -.gitignore -.bzr/ -.bzrignore -.hg/ -.hgignore -.svn/ -# Common backup files -*.swp -*.bak -*.tmp -*.orig -*~ -# Various IDEs -.project -.idea/ -*.tmproj -.vscode/ diff --git a/deployment/helm/edc-consumer/Chart.lock b/deployment/helm/edc-consumer/Chart.lock new file mode 100644 index 000000000..2e725a1d5 --- /dev/null +++ b/deployment/helm/edc-consumer/Chart.lock @@ -0,0 +1,12 @@ +dependencies: +- name: backend-service + repository: file://backend-service + version: 0.0.6 +- name: tractusx-connector + repository: https://eclipse-tractusx.github.io/charts/dev + version: 0.4.0 +- name: postgresql + repository: https://charts.bitnami.com/bitnami + version: 12.1.6 +digest: sha256:4cc46e7425e2188f1bd3c27688f1b15ee44bbb7e48c3a90272c36d251a577aa8 +generated: "2023-05-31T12:18:51.7515595+02:00" diff --git a/deployment/helm/edc-consumer/Chart.yaml b/deployment/helm/edc-consumer/Chart.yaml index 6dfa9e967..ca5ae6e4a 100644 --- a/deployment/helm/edc-consumer/Chart.yaml +++ b/deployment/helm/edc-consumer/Chart.yaml @@ -1,50 +1,68 @@ -################################################################################# -# Catena-X - Product Passport Consumer Frontend # -# Copyright (c) 2022, 2023 BASF SE, BMW AG, Henkel AG & Co. KGaA +# Copyright (c) 2023 ZF Friedrichshafen AG +# Copyright (c) 2023 Mercedes-Benz Tech Innovation GmbH +# Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +# Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation # -# See the NOTICE file(s) distributed with this work for additional -# information regarding copyright ownership. +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. # -# This program and the accompanying materials are made available under the -# terms of the Apache License, Version 2.0 which is available at -# https://www.apache.org/licenses/LICENSE-2.0. +# This program and the accompanying materials are made available under the +# terms of the Apache License, Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 # -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -# either express or implied. See the -# License for the specific language govern in permissions and limitations -# under the License. +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +# SPDX-License-Identifier: Apache-2.0 # -# SPDX-License-Identifier: Apache-2.0 -################################################################################## --- apiVersion: v2 -name: edc -description: A Helm chart for Kubernetes +name: tractusx-connector +description: | + A Helm chart for Tractus-X Eclipse Data Space Connector. The connector deployment consists of two runtime consists of a + Control Plane and a Data Plane. Note that _no_ external dependencies such as a PostgreSQL database and HashiCorp Vault are included. + + This chart is intended for use with an _existing_ PostgreSQL database and an _existing_ HashiCorp Vault. +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. type: application -version: 0.0.3 -appVersion: "0.4.3" +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.3.3 +# 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: "0.4.1" +home: https://github.com/eclipse-tractusx/tractusx-edc/tree/main/charts/tractusx-connector +sources: + - https://github.com/eclipse-tractusx/tractusx-edc/tree/main/charts/tractusx-connector +urls: + - https://github.com/eclipse-tractusx/tractusx-edc/releases/download/tractusx-connector-0.4.1/tractusx-connector-0.4.1.tgz dependencies: - - name: edc-controlplane - alias: controlplane - version: "0.1.6" - repository: https://catenax-ng.github.io/product-edc - condition: controlplane.enabled - - name: edc-dataplane - alias: dataplane - version: "0.1.6" - repository: https://catenax-ng.github.io/product-edc - condition: dataplane.enabled + - name: tractusx-connector + version: 0.4.1 + repository: https://eclipse-tractusx.github.io/charts/dev + condition: enabled - name: backend-service version: "0.0.6" repository: file://backend-service alias: consumerbackendapplication condition: consumerbackendapplication.enabled - name: postgresql - alias: postgres - version: 12.1.5 + alias: postgresql + version: 12.1.6 repository: https://charts.bitnami.com/bitnami - condition: postgres.enabled + condition: postgresql.enabled diff --git a/deployment/helm/edc-consumer/README.md.gotmpl b/deployment/helm/edc-consumer/README.md.gotmpl new file mode 100644 index 000000000..b1671f5a2 --- /dev/null +++ b/deployment/helm/edc-consumer/README.md.gotmpl @@ -0,0 +1,26 @@ +{{ template "chart.header" . }} + +{{ template "chart.deprecationWarning" . }} + +{{ template "chart.badgesSection" . }} + +{{ template "chart.description" . }} + +{{ template "chart.homepageLine" . }} + +## TL;DR + +```shell +helm repo add tractusx-edc https://eclipse-tractusx.github.io/charts/dev +helm install my-release tractusx-edc/tractusx-connector --version {{ .Version }} +``` + +{{ template "chart.maintainersSection" . }} + +{{ template "chart.sourcesSection" . }} + +{{ template "chart.requirementsSection" . }} + +{{ template "chart.valuesSection" . }} + +{{ template "helm-docs.versionFooter" . }} diff --git a/deployment/helm/edc-consumer/templates/_helpers.tpl b/deployment/helm/edc-consumer/templates/_helpers.tpl deleted file mode 100644 index 45cc0d883..000000000 --- a/deployment/helm/edc-consumer/templates/_helpers.tpl +++ /dev/null @@ -1,84 +0,0 @@ -################################################################################# -# Catena-X - Product Passport Consumer Frontend -# -# 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. -# -# This program and the accompanying materials are made available under the -# terms of the Apache License, Version 2.0 which is available at -# https://www.apache.org/licenses/LICENSE-2.0. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -# either express or implied. See the -# License for the specific language govern in permissions and limitations -# under the License. -# -# SPDX-License-Identifier: Apache-2.0 -################################################################################## - -{{/* -Expand the name of the chart. -*/}} -{{- define "edc-consumer.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. -*/}} -{{- define "edc-consumer.fullname" -}} -{{- if .Values.fullnameOverride }} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- $name := default .Chart.Name .Values.nameOverride }} -{{- if contains $name .Release.Name }} -{{- .Release.Name | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} -{{- end }} -{{- end }} -{{- end }} - -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "edc-consumer.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Common labels -*/}} -{{- define "edc-consumer.labels" -}} -helm.sh/chart: {{ include "edc-consumer.chart" . }} -{{ include "edc-consumer.selectorLabels" . }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- end }} - -{{/* -Selector labels -*/}} -{{- define "edc-consumer.selectorLabels" -}} -app.kubernetes.io/name: {{ include "edc-consumer.name" . }} -app.kubernetes.io/instance: {{ .Release.Name }} -{{- end }} - -{{/* -Create the name of the service account to use -*/}} -{{- define "edc-consumer.serviceAccountName" -}} -{{- if .Values.serviceAccount.create }} -{{- default (include "edc-consumer.fullname" .) .Values.serviceAccount.name }} -{{- else }} -{{- default "default" .Values.serviceAccount.name }} -{{- end }} -{{- end }} diff --git a/deployment/helm/edc-consumer/templates/secret.yaml b/deployment/helm/edc-consumer/templates/secret.yaml deleted file mode 100644 index 1988e93b6..000000000 --- a/deployment/helm/edc-consumer/templates/secret.yaml +++ /dev/null @@ -1,74 +0,0 @@ -################################################################################# -# Catena-X - Product Passport Consumer Frontend -# -# 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. -# -# This program and the accompanying materials are made available under the -# terms of the Apache License, Version 2.0 which is available at -# https://www.apache.org/licenses/LICENSE-2.0. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -# either express or implied. See the -# License for the specific language govern in permissions and limitations -# under the License. -# -# SPDX-License-Identifier: Apache-2.0 -################################################################################## - ---- - -# When deploying an EDC, there are various configuration parameters that should not be part of the configuration file. -# To not serve a bad example, this demo will set some settings using secrets as well. In a productive environment this secrets would probably be deployed independently. - - - -{{- $psql_password := .Values.postgres.auth.password -}} -{{- $api_auth_key := .Values.controlplane.env.EDC_API_AUTH_KEY -}} -{{- $vault_token := .Values.controlplane.env.EDC_VAULT_HASHICORP_TOKEN -}} - ---- - -apiVersion: v1 -kind: Secret -metadata: - name: consumer-controlplane-secret - namespace: {{ .Release.Namespace | default "default" | quote }} - labels: - {{- include "edc-consumer.labels" . | nindent 4 }} -type: Opaque -stringData: - # see extension https://github.com/eclipse-dataspaceconnector/DataSpaceConnector/tree/main/extensions/api/auth-tokenbased - EDC_API_AUTH_KEY: {{ $api_auth_key | toString | quote }} - # see extension https://github.com/eclipse-dataspaceconnector/DataSpaceConnector/tree/main/extensions/sql/asset-index-sql - EDC_DATASOURCE_ASSET_PASSWORD: {{ $psql_password | toString | quote }} - # see extension https://github.com/eclipse-dataspaceconnector/DataSpaceConnector/tree/main/extensions/sql/contract-definition-store-sql - EDC_DATASOURCE_CONTRACTDEFINITION_PASSWORD: {{ $psql_password | toString | quote }} - # see extension https://github.com/eclipse-dataspaceconnector/DataSpaceConnector/tree/main/extensions/sql/contract-negotiation-store-sql - EDC_DATASOURCE_CONTRACTNEGOTIATION_PASSWORD: {{ $psql_password | toString | quote }} - # see extension https://github.com/eclipse-dataspaceconnector/DataSpaceConnector/tree/main/extensions/sql/policy-store-sql - EDC_DATASOURCE_POLICY_PASSWORD: {{ $psql_password | toString | quote }} - # see extension https://github.com/eclipse-dataspaceconnector/DataSpaceConnector/tree/main/extensions/sql/transfer-process-store-sql - EDC_DATASOURCE_TRANSFERPROCESS_PASSWORD: {{ $psql_password | toString | quote }} - # see extension https://github.com/catenax-ng/product-edc/tree/develop/edc-extensions/hashicorp-vault - EDC_VAULT_HASHICORP_TOKEN: {{ $vault_token | toString | quote }} - ---- - -apiVersion: v1 -kind: Secret -metadata: - name: consumer-dataplane-secret - namespace: {{ .Release.Namespace | default "default" | quote }} - labels: - {{- include "edc-consumer.labels" . | nindent 4 }} -type: Opaque -stringData: - # see extension https://github.com/catenax-ng/product-edc/tree/develop/edc-extensions/hashicorp-vault - EDC_VAULT_HASHICORP_TOKEN: {{ $vault_token | toString | quote }} - - diff --git a/deployment/helm/edc-consumer/values-beta.yaml b/deployment/helm/edc-consumer/values-beta.yaml deleted file mode 100644 index 01ea5aa9b..000000000 --- a/deployment/helm/edc-consumer/values-beta.yaml +++ /dev/null @@ -1,340 +0,0 @@ -################################################################################# -# Catena-X - Product Passport Consumer Frontend -# -# 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. -# -# This program and the accompanying materials are made available under the -# terms of the Apache License, Version 2.0 which is available at -# https://www.apache.org/licenses/LICENSE-2.0. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -# either express or implied. See the -# License for the specific language govern in permissions and limitations -# under the License. -# -# SPDX-License-Identifier: Apache-2.0 -################################################################################## - ---- -consumerbackendapplication: - enabled: true - fullnameOverride: "materialpass-edc-backend" - service: - type: NodePort - frontend: - port: 80 - backend: - port: 8081 - -postgres: - enabled: true - fullnameOverride: "consumer-postgresql" - auth: - password: - username: &psqlUsername - database: "edc" - persistence: - enabled: true - -dataplane: - image: - repository: ghcr.io/catenax-ng/product-edc/edc-dataplane-hashicorp-vault - tag: 0.1.6 - pullPolicy: IfNotPresent - envSecretName: "consumer-dataplane-secret" - fullnameOverride: "materialpass-edc-dataplane" - edc: - endpoints: - default: - port: 8080 - path: /consumer/api - public: - port: 8185 - path: /consumer/api/public - control: - port: 9999 - path: /consumer/api/dataplane/control - metrics: - port: 9090 - path: /consumer/metrics - ingresses: - - enabled: true - hostname: "materialpass.beta.demo.catena-x.net" - endpoints: - - default - - public - - control - - metrics - className: "nginx" - # # -- Enables TLS on the ingress resource - # tls: true - # secretName: tls-secret - tls: - # -- Enables TLS on the ingress resource - enabled: true - # -- If present overwrites the default secret name - secretName: "tls-secret" - - opentelemetry: - properties: |- - otel.javaagent.enabled=false - otel.javaagent.debug=false - env: - - ############# - ## GENERAL ## - ############# - - JAVA_TOOL_OPTIONS: "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=1044" - EDC_DATAPLANE_TOKEN_VALIDATION_ENDPOINT: http://materialpass-edc-controlplane:8182/consumer/validation/token - - ############### - ## KEY VAULT ## - ############### - - EDC_VAULT_HASHICORP_URL: - EDC_VAULT_HASHICORP_API_SECRET_PATH: - EDC_VAULT_HASHICORP_TOKEN: - EDC_OAUTH_TOKEN_URL: https://daps.beta.demo.catena-x.net/token - EDC_OAUTH_PROVIDER_JWKS_URL: https://daps.beta.demo.catena-x.net/.well-known/jwks.json - EDC_OAUTH_PROVIDER_AUDIENCE: idsc:IDS_CONNECTORS_ALL - EDC_VAULT_HASHICORP_HEALTH_CHECK_STANDBY_OK: "true" - -controlplane: - enabled: true - fullnameOverride: "materialpass-edc-controlplane" - image: - repository: ghcr.io/catenax-ng/product-edc/edc-controlplane-postgresql-hashicorp-vault - tag: 0.1.6 - pullPolicy: IfNotPresent - envSecretName: "consumer-controlplane-secret" - edc: - endpoints: - default: - port: 8080 - path: /consumer/controlplane/api - data: - port: 8181 - path: /consumer/data - validation: - port: 8182 - path: /consumer/validation - control: - port: 9999 - path: /consumer/api/controlplane/control - ids: - port: 8282 - path: /consumer/api/v1/ids - metrics: - port: 9090 - path: /consumer/controlplane/metrics - ingresses: - - enabled: true - hostname: "materialpass.beta.demo.catena-x.net" - endpoints: - - default - - data - - validation - - control - - ids - - metrics - className: "nginx" - tls: - # -- Enables TLS on the ingress resource - enabled: true - # -- If present overwrites the default secret name - secretName: "tls-secret" - - ## Private / Intranet facing Ingress - - enabled: false - # -- The hostname to be used to precisely map incoming traffic onto the underlying network service - hostname: "edc-controlplane.intranet" - # -- EDC endpoints exposed by this ingress resource - endpoints: - - data - - control - # -- Defines the [ingress class](https://kubernetes.io/docs/concepts/services-networking/ingress/#ingress-class) to use - className: "nginx" - tls: - # -- Enables TLS on the ingress resource - enabled: true - # -- If present overwrites the default secret name - secretName: "tls-secret" - - opentelemetry: - properties: |- - otel.javaagent.enabled=false - otel.javaagent.debug=false - env: - JAVA_TOOL_OPTIONS: "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=1044" - EDC_DATASOURCE_ASSET_NAME: asset - EDC_DATASOURCE_ASSET_USER: *psqlUsername - EDC_DATASOURCE_ASSET_URL: &psqlJdbcUrl "jdbc:postgresql://consumer-postgresql:5432/edc" - EDC_DATASOURCE_CONTRACTDEFINITION_NAME: contractdefinition - EDC_DATASOURCE_CONTRACTDEFINITION_USER: *psqlUsername - EDC_DATASOURCE_CONTRACTDEFINITION_URL: *psqlJdbcUrl - EDC_DATASOURCE_CONTRACTNEGOTIATION_NAME: contractnegotiation - EDC_DATASOURCE_CONTRACTNEGOTIATION_USER: *psqlUsername - EDC_DATASOURCE_CONTRACTNEGOTIATION_URL: *psqlJdbcUrl - EDC_DATASOURCE_POLICY_NAME: policy - EDC_DATASOURCE_POLICY_USER: *psqlUsername - EDC_DATASOURCE_POLICY_URL: *psqlJdbcUrl - EDC_DATASOURCE_TRANSFERPROCESS_NAME: transferprocess - EDC_DATASOURCE_TRANSFERPROCESS_USER: *psqlUsername - EDC_DATASOURCE_TRANSFERPROCESS_URL: *psqlJdbcUrl - EDC_VAULT_HASHICORP_URL: - EDC_VAULT_HASHICORP_API_SECRET_PATH: - EDC_VAULT_HASHICORP_TOKEN: - EDC_API_AUTH_KEY: - - # see extension https://github.com/catenax-ng/product-edc/tree/develop/edc-extensions/dataplane-selector-configuration - EDC_DATAPLANE_SELECTOR_CONSUMERPLANE_URL: http://materialpass-edc-dataplane:9999/consumer/api/dataplane/control - EDC_DATAPLANE_SELECTOR_CONSUMERPLANE_SOURCETYPES : HttpData - EDC_DATAPLANE_SELECTOR_CONSUMERPLANE_DESTINATIONTYPES: HttpProxy - EDC_DATAPLANE_SELECTOR_CONSUMERPLANE_PROPERTIES: >- - { - "publicApiUrl": "http://materialpass-edc-dataplane:8185/consumer/api/public/" - } - - # EDC_DATAPLANE_SELECTOR_HTTPPROXY_PROPERTIES: >- - # { - # "publicApiUrl": "https://materialpass.beta.demo.catena-x.net/consumer/dataplane/api/public" - # } - - configuration: - properties: |- - #edc.api.auth.key= - # edc.atomikos.checkpoint.interval= - # edc.atomikos.directory= - # edc.atomikos.logging= - # edc.atomikos.threaded2pc= - # edc.atomikos.timeout= - # edc.aws.access.key= - # edc.aws.provision.retry.retries.max= - # edc.aws.provision.role.duration.session.max= - # edc.aws.secret.access.key= - # edc.blobstore.endpoint= - # edc.controlplane.validation-endpoint= - # edc.core.retry.backoff.max= - # edc.core.retry.backoff.min= - # edc.core.retry.retries.max= - # edc.core.system.health.check.liveness-period= - # edc.core.system.health.check.readiness-period= - # edc.core.system.health.check.startup-period= - # edc.core.system.health.check.threadpool-size= - # edc.dataplane.queue.capacity= - # edc.dataplane.wait= - # edc.dataplane.workers= - edc.datasource.asset.name=asset - edc.datasource.asset.user= - edc.datasource.asset.url=jdbc:postgresql://consumer-postgresql:5432/edc - - edc.datasource.contractdefinition.name=contractdefinition - edc.datasource.contractdefinition.user= - edc.datasource.contractdefinition.url=jdbc:postgresql://consumer-postgresql:5432/edc - - edc.datasource.contractnegotiation.name=contractnegotiation - edc.datasource.contractnegotiation.user= - edc.datasource.contractnegotiation.url=jdbc:postgresql://consumer-postgresql:5432/edc - - edc.datasource.policy.name=policy - edc.datasource.policy.user= - edc.datasource.policy.url=jdbc:postgresql://consumer-postgresql:5432/edc - - edc.datasource.transferprocess.name=transferprocess - edc.datasource.transferprocess.user= - edc.datasource.transferprocess.url=jdbc:postgresql://consumer-postgresql:5432/edc - - - # edc.datasource.default.pool.maxIdleConnections= - # edc.datasource.default.pool.maxTotalConnections= - # edc.datasource.default.pool.minIdleConnections= - # edc.datasource.default.pool.testConnectionOnBorrow= - # edc.datasource.default.pool.testConnectionOnCreate= - # edc.datasource.default.pool.testConnectionOnReturn= - # edc.datasource.default.pool.testConnectionWhileIdle= - # edc.datasource.default.pool.testQuery= - edc.datasource.default.url= - edc.datasource.default.user= - edc.datasource.default.password= - - edc.data.encryption.algorithm=NONE - edc.data.encryption.keys.alias=edc-encryption-key - # edc.dataplane.selector.httpproxy.url=https://materialpass-edc-dataplane:9999/consumer/api/dataplane/control - - # edc.dpf.selector.url= - # edc.events.topic.endpoint= - # edc.events.topic.name= - # edc.fs.config= - # edc.hostname= - # edc.identity.did.url= - # edc.ids.catalog.id= - # edc.ids.curator= - edc.ids.description="Consumer Control Plane" - edc.ids.endpoint=https://materialpass.beta.demo.catena-x.net/consumer/api/v1/ids - edc.ids.endpoint.audience=https://materialpass.beta.demo.catena-x.net/consumer/api/v1/ids/data - - # localhost configuration - # edc.ids.endpoint=http://materialpass-edc-controlplane:8282/consumer/api/v1/ids - # edc.ids.endpoint.audience=http://materialpass-edc-controlplane:8282/consumer/api/v1/ids/data - # localhost configuration - - # edc.ids.id= - # edc.ids.maintainer= - # edc.ids.security.profile= - # edc.ids.title= - # edc.ids.validation.referringconnector= - # edc.ion.crawler.did-type= - # edc.ion.crawler.interval-minutes= - # edc.ion.crawler.ion.url= - # edc.metrics.enabled= - # edc.metrics.executor.enabled= - # edc.metrics.jersey.enabled= - # edc.metrics.jetty.enabled= - # edc.metrics.okhttp.enabled= - # edc.metrics.system.enabled= - # edc.negotiation.consumer.state-machine.batch-size= - # edc.negotiation.provider.state-machine.batch-size= - edc.oauth.client.id= - edc.oauth.private.key.alias=ids-daps_key - edc.oauth.provider.audience=idsc:IDS_CONNECTORS_ALL - # edc.oauth.provider.jwks.refresh= - edc.oauth.provider.jwks.url=https://daps.beta.demo.catena-x.net/.well-known/jwks.json - edc.oauth.public.key.alias=ids-daps_crt - edc.oauth.token.url=https://daps.beta.demo.catena-x.net/token - # edc.oauth.validation.nbf.leeway= - # edc.receiver.http.auth-code= - # edc.receiver.http.auth-key= - edc.receiver.http.endpoint=http://materialpass-edc-backend - edc.transfer.proxy.endpoint=http://materialpass-edc-dataplane:8185/consumer/api/public - # edc.transfer.proxy.token.validity.seconds= - edc.transfer.proxy.token.signer.privatekey.alias=ids-daps_key - edc.transfer.proxy.token.verifier.publickey.alias=ids-daps_crt - # edc.transfer.functions.check.endpoint= - # edc.transfer.functions.enabled.protocols= - # edc.transfer.functions.transfer.endpoint= - # edc.transfer-process-store.database.name= - # edc.transfer.state-machine.batch-size= - # edc.vault= - # edc.vault.certificate= - # edc.vault.clientid= - # edc.vault.clientsecret= - # edc.vault.name= - # edc.vault.tenantid= - edc.vault.hashicorp.url= - edc.vault.hashicorp.token= - edc.vault.hashicorp.api.secret.path= - edc.vault.hashicorp.health.check.standby.ok=true - # edc.vault.hashicorp.timeout.seconds= - # edc.webdid.doh.url= - # edc.web.rest.cors.enabled= - # edc.web.rest.cors.headers= - # edc.web.rest.cors.methods= - # edc.web.rest.cors.origins= - ids.webhook.address=https://materialpass.beta.demo.catena-x.net - # ids.webhook.address=http://materialpass-edc-controlplane:8282 diff --git a/deployment/helm/edc-consumer/values-dev.yaml b/deployment/helm/edc-consumer/values-dev.yaml deleted file mode 100644 index dec3560b6..000000000 --- a/deployment/helm/edc-consumer/values-dev.yaml +++ /dev/null @@ -1,334 +0,0 @@ -################################################################################# -# Catena-X - Product Passport Consumer Frontend -# -# 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. -# -# This program and the accompanying materials are made available under the -# terms of the Apache License, Version 2.0 which is available at -# https://www.apache.org/licenses/LICENSE-2.0. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -# either express or implied. See the -# License for the specific language govern in permissions and limitations -# under the License. -# -# SPDX-License-Identifier: Apache-2.0 -################################################################################## - ---- -consumerbackendapplication: - enabled: true - fullnameOverride: "materialpass-edc-backend" - service: - type: NodePort - frontend: - port: 80 - backend: - port: 8081 - -postgres: - enabled: true - fullnameOverride: "consumer-postgresql" - auth: - password: - username: &psqlUsername - database: "edc" - persistence: - enabled: true - -dataplane: - image: - repository: ghcr.io/catenax-ng/product-edc/edc-dataplane-hashicorp-vault - tag: 0.1.6 - pullPolicy: IfNotPresent - envSecretName: "consumer-dataplane-secret" - fullnameOverride: "materialpass-edc-dataplane" - edc: - endpoints: - default: - port: 8080 - path: /consumer/api - public: - port: 8185 - path: /consumer/api/public - control: - port: 9999 - path: /consumer/api/dataplane/control - metrics: - port: 9090 - path: /consumer/metrics - ingresses: - - enabled: true - hostname: "materialpass.dev.demo.catena-x.net" - endpoints: - - default - - public - - control - - metrics - className: "nginx" - # # -- Enables TLS on the ingress resource - # tls: true - # secretName: tls-secret - tls: - # -- Enables TLS on the ingress resource - enabled: true - # -- If present overwrites the default secret name - secretName: "tls-secret" - - opentelemetry: - properties: |- - otel.javaagent.enabled=false - otel.javaagent.debug=false - env: - - ############# - ## GENERAL ## - ############# - - JAVA_TOOL_OPTIONS: "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=1044" - EDC_DATAPLANE_TOKEN_VALIDATION_ENDPOINT: http://materialpass-edc-controlplane:8182/consumer/validation/token - - ############### - ## KEY VAULT ## - ############### - - EDC_VAULT_HASHICORP_URL: - EDC_VAULT_HASHICORP_API_SECRET_PATH: - EDC_VAULT_HASHICORP_TOKEN: - EDC_OAUTH_TOKEN_URL: https://daps1.int.demo.catena-x.net/token - EDC_OAUTH_PROVIDER_JWKS_URL: https://daps1.int.demo.catena-x.net/.well-known/jwks.json - EDC_OAUTH_PROVIDER_AUDIENCE: idsc:IDS_CONNECTORS_ALL - EDC_VAULT_HASHICORP_HEALTH_CHECK_STANDBY_OK: "true" - -controlplane: - enabled: true - fullnameOverride: "materialpass-edc-controlplane" - image: - repository: ghcr.io/catenax-ng/product-edc/edc-controlplane-postgresql-hashicorp-vault - tag: 0.1.6 - pullPolicy: IfNotPresent - envSecretName: "consumer-controlplane-secret" - edc: - endpoints: - default: - port: 8080 - path: /consumer/controlplane/api - data: - port: 8181 - path: /consumer/data - validation: - port: 8182 - path: /consumer/validation - control: - port: 9999 - path: /consumer/api/controlplane/control - ids: - port: 8282 - path: /consumer/api/v1/ids - metrics: - port: 9090 - path: /consumer/controlplane/metrics - ingresses: - - enabled: true - hostname: "materialpass.dev.demo.catena-x.net" - endpoints: - - default - - data - - validation - - control - - ids - - metrics - className: "nginx" - tls: - # -- Enables TLS on the ingress resource - enabled: true - # -- If present overwrites the default secret name - secretName: "tls-secret" - - ## Private / Intranet facing Ingress - - enabled: false - # -- The hostname to be used to precisely map incoming traffic onto the underlying network service - hostname: "edc-controlplane.intranet" - # -- EDC endpoints exposed by this ingress resource - endpoints: - - data - - control - # -- Defines the [ingress class](https://kubernetes.io/docs/concepts/services-networking/ingress/#ingress-class) to use - className: "nginx" - tls: - # -- Enables TLS on the ingress resource - enabled: true - # -- If present overwrites the default secret name - secretName: "tls-secret" - - opentelemetry: - properties: |- - otel.javaagent.enabled=false - otel.javaagent.debug=false - env: - JAVA_TOOL_OPTIONS: "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=1044" - EDC_DATASOURCE_ASSET_NAME: asset - EDC_DATASOURCE_ASSET_USER: *psqlUsername - EDC_DATASOURCE_ASSET_URL: &psqlJdbcUrl "jdbc:postgresql://consumer-postgresql:5432/edc" - EDC_DATASOURCE_CONTRACTDEFINITION_NAME: contractdefinition - EDC_DATASOURCE_CONTRACTDEFINITION_USER: *psqlUsername - EDC_DATASOURCE_CONTRACTDEFINITION_URL: *psqlJdbcUrl - EDC_DATASOURCE_CONTRACTNEGOTIATION_NAME: contractnegotiation - EDC_DATASOURCE_CONTRACTNEGOTIATION_USER: *psqlUsername - EDC_DATASOURCE_CONTRACTNEGOTIATION_URL: *psqlJdbcUrl - EDC_DATASOURCE_POLICY_NAME: policy - EDC_DATASOURCE_POLICY_USER: *psqlUsername - EDC_DATASOURCE_POLICY_URL: *psqlJdbcUrl - EDC_DATASOURCE_TRANSFERPROCESS_NAME: transferprocess - EDC_DATASOURCE_TRANSFERPROCESS_USER: *psqlUsername - EDC_DATASOURCE_TRANSFERPROCESS_URL: *psqlJdbcUrl - EDC_VAULT_HASHICORP_URL: - EDC_VAULT_HASHICORP_API_SECRET_PATH: - EDC_VAULT_HASHICORP_TOKEN: - EDC_API_AUTH_KEY: - - # see extension https://github.com/catenax-ng/product-edc/tree/develop/edc-extensions/dataplane-selector-configuration - EDC_DATAPLANE_SELECTOR_CONSUMERPLANE_URL: http://materialpass-edc-dataplane:9999/consumer/api/dataplane/control - EDC_DATAPLANE_SELECTOR_CONSUMERPLANE_SOURCETYPES : HttpData - EDC_DATAPLANE_SELECTOR_CONSUMERPLANE_DESTINATIONTYPES: HttpProxy - EDC_DATAPLANE_SELECTOR_CONSUMERPLANE_PROPERTIES: >- - { - "publicApiUrl": "http://materialpass-edc-dataplane:8185/consumer/api/public/" - } - - # EDC_DATAPLANE_SELECTOR_HTTPPROXY_PROPERTIES: >- - # { - # "publicApiUrl": "https://materialpass.dev.demo.catena-x.net/consumer/dataplane/api/public" - # } - - configuration: - properties: |- - #edc.api.auth.key= - # edc.atomikos.checkpoint.interval= - # edc.atomikos.directory= - # edc.atomikos.logging= - # edc.atomikos.threaded2pc= - # edc.atomikos.timeout= - # edc.aws.access.key= - # edc.aws.provision.retry.retries.max= - # edc.aws.provision.role.duration.session.max= - # edc.aws.secret.access.key= - # edc.blobstore.endpoint= - # edc.controlplane.validation-endpoint= - # edc.core.retry.backoff.max= - # edc.core.retry.backoff.min= - # edc.core.retry.retries.max= - # edc.core.system.health.check.liveness-period= - # edc.core.system.health.check.readiness-period= - # edc.core.system.health.check.startup-period= - # edc.core.system.health.check.threadpool-size= - # edc.dataplane.queue.capacity= - # edc.dataplane.wait= - # edc.dataplane.workers= - edc.datasource.asset.name=asset - edc.datasource.asset.user= - edc.datasource.asset.url=jdbc:postgresql://consumer-postgresql:5432/edc - - edc.datasource.contractdefinition.name=contractdefinition - edc.datasource.contractdefinition.user= - edc.datasource.contractdefinition.url=jdbc:postgresql://consumer-postgresql:5432/edc - - edc.datasource.contractnegotiation.name=contractnegotiation - edc.datasource.contractnegotiation.user= - edc.datasource.contractnegotiation.url=jdbc:postgresql://consumer-postgresql:5432/edc - - edc.datasource.policy.name=policy - edc.datasource.policy.user= - edc.datasource.policy.url=jdbc:postgresql://consumer-postgresql:5432/edc - - edc.datasource.transferprocess.name=transferprocess - edc.datasource.transferprocess.user= - edc.datasource.transferprocess.url=jdbc:postgresql://consumer-postgresql:5432/edc - - - # edc.datasource.default.pool.maxIdleConnections= - # edc.datasource.default.pool.maxTotalConnections= - # edc.datasource.default.pool.minIdleConnections= - # edc.datasource.default.pool.testConnectionOnBorrow= - # edc.datasource.default.pool.testConnectionOnCreate= - # edc.datasource.default.pool.testConnectionOnReturn= - # edc.datasource.default.pool.testConnectionWhileIdle= - # edc.datasource.default.pool.testQuery= - edc.datasource.default.url= - edc.datasource.default.user= - edc.datasource.default.password= - - edc.data.encryption.algorithm=NONE - edc.data.encryption.keys.alias=edc-encryption-key - # edc.dataplane.selector.httpproxy.url=https://materialpass-edc-dataplane:9999/consumer/api/dataplane/control - - # edc.dpf.selector.url= - # edc.events.topic.endpoint= - # edc.events.topic.name= - # edc.fs.config= - # edc.hostname= - # edc.identity.did.url= - # edc.ids.catalog.id= - # edc.ids.curator= - edc.ids.description="Consumer Control Plane" - edc.ids.endpoint=https://materialpass.dev.demo.catena-x.net/consumer/api/v1/ids - edc.ids.endpoint.audience=https://materialpass.dev.demo.catena-x.net/consumer/api/v1/ids/data - - # edc.ids.id= - # edc.ids.maintainer= - # edc.ids.security.profile= - # edc.ids.title= - # edc.ids.validation.referringconnector= - # edc.ion.crawler.did-type= - # edc.ion.crawler.interval-minutes= - # edc.ion.crawler.ion.url= - # edc.metrics.enabled= - # edc.metrics.executor.enabled= - # edc.metrics.jersey.enabled= - # edc.metrics.jetty.enabled= - # edc.metrics.okhttp.enabled= - # edc.metrics.system.enabled= - # edc.negotiation.consumer.state-machine.batch-size= - # edc.negotiation.provider.state-machine.batch-size= - edc.oauth.client.id= - edc.oauth.private.key.alias=daps-key-dev - edc.oauth.provider.audience=idsc:IDS_CONNECTORS_ALL - # edc.oauth.provider.jwks.refresh= - edc.oauth.provider.jwks.url=https://daps1.int.demo.catena-x.net/.well-known/jwks.json - edc.oauth.public.key.alias=daps-crt-dev - edc.oauth.token.url=https://daps1.int.demo.catena-x.net/token - # edc.oauth.validation.nbf.leeway= - # edc.receiver.http.auth-code= - # edc.receiver.http.auth-key= - edc.receiver.http.endpoint=http://materialpass-edc-backend - edc.transfer.proxy.endpoint=http://materialpass-edc-dataplane:8185/consumer/api/public - # edc.transfer.proxy.token.validity.seconds= - edc.transfer.proxy.token.signer.privatekey.alias=daps-key-dev - edc.transfer.proxy.token.verifier.publickey.alias=daps-crt-dev - # edc.transfer.functions.check.endpoint= - # edc.transfer.functions.enabled.protocols= - # edc.transfer.functions.transfer.endpoint= - # edc.transfer-process-store.database.name= - # edc.transfer.state-machine.batch-size= - # edc.vault= - # edc.vault.certificate= - # edc.vault.clientid= - # edc.vault.clientsecret= - # edc.vault.name= - # edc.vault.tenantid= - edc.vault.hashicorp.url= - edc.vault.hashicorp.token= - edc.vault.hashicorp.api.secret.path= - edc.vault.hashicorp.health.check.standby.ok=true - # edc.vault.hashicorp.timeout.seconds= - # edc.webdid.doh.url= - # edc.web.rest.cors.enabled= - # edc.web.rest.cors.headers= - # edc.web.rest.cors.methods= - # edc.web.rest.cors.origins= - ids.webhook.address=https://materialpass.dev.demo.catena-x.net diff --git a/deployment/helm/edc-consumer/values-int.yaml b/deployment/helm/edc-consumer/values-int.yaml index 09c5e1db1..e9cca412b 100644 --- a/deployment/helm/edc-consumer/values-int.yaml +++ b/deployment/helm/edc-consumer/values-int.yaml @@ -1,29 +1,33 @@ -################################################################################# -# Catena-X - Product Passport Consumer Frontend # -# Copyright (c) 2022, 2023 BASF SE, BMW AG, Henkel AG & Co. KGaA +# Copyright (c) 2023 ZF Friedrichshafen AG +# Copyright (c) 2023 Mercedes-Benz Tech Innovation GmbH +# Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +# Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation # -# See the NOTICE file(s) distributed with this work for additional -# information regarding copyright ownership. +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. # -# This program and the accompanying materials are made available under the -# terms of the Apache License, Version 2.0 which is available at -# https://www.apache.org/licenses/LICENSE-2.0. +# This program and the accompanying materials are made available under the +# terms of the Apache License, Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 # -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -# either express or implied. See the -# License for the specific language govern in permissions and limitations -# under the License. +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. # -# SPDX-License-Identifier: Apache-2.0 -################################################################################## +# SPDX-License-Identifier: Apache-2.0 +# + --- -consumerbackendapplication: +# Default values for eclipse-dataspace-connector. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. +mockbackend: enabled: true - fullnameOverride: "materialpass-edc-backend" + fullnameOverride: "dpp-edc-consumer-backend" service: type: NodePort frontend: @@ -31,310 +35,552 @@ consumerbackendapplication: backend: port: 8081 -postgres: - enabled: true - fullnameOverride: "consumer-postgresql" - auth: - password: - username: &psqlUsername - database: "edc" - persistence: - enabled: true -dataplane: - image: - repository: ghcr.io/catenax-ng/product-edc/edc-dataplane-hashicorp-vault - tag: 0.1.6 - pullPolicy: IfNotPresent - envSecretName: "consumer-dataplane-secret" - fullnameOverride: "materialpass-edc-dataplane" - edc: +tractusx-connector: + install: + daps: false + postgresql: false + vault: false + fullnameOverride: "dpp-edc-consumer" + nameOverride: "" + # -- Existing image pull secret to use to [obtain the container image from private registries](https://kubernetes.io/docs/concepts/containers/images/#using-a-private-registry) + imagePullSecrets: [] + customLabels: {} + + + participant: + id: &bpnNumber "" + + controlplane: + enabled: true + image: + # -- Which derivate of the control plane to use. when left empty the deployment will select the correct image automatically + repository: "tractusx/edc-controlplane-postgresql-hashicorp-vault" + # -- [Kubernetes image pull policy](https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy) to use + pullPolicy: IfNotPresent + # -- Overrides the image tag whose default is the chart appVersion + tag: "0.4.1" + initContainers: [] + debug: + enabled: false + port: 1044 + suspendOnStart: false + internationalDataSpaces: + id: TXDC + description: Tractus-X Eclipse IDS Data Space Connector + title: "" + maintainer: "" + curator: "" + catalogId: TXDC-Catalog + livenessProbe: + # -- Whether to enable kubernetes [liveness-probe](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) + enabled: true + # -- seconds to wait before performing the first liveness check + initialDelaySeconds: 30 + # -- this fields specifies that kubernetes should perform a liveness check every 10 seconds + periodSeconds: 10 + # -- number of seconds after which the probe times out + timeoutSeconds: 5 + # -- when a probe fails kubernetes will try 6 times before giving up + failureThreshold: 6 + # -- number of consecutive successes for the probe to be considered successful after having failed + successThreshold: 1 + readinessProbe: + # -- Whether to enable kubernetes [readiness-probes](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) + enabled: true + # -- seconds to wait before performing the first readiness check + initialDelaySeconds: 30 + # -- this fields specifies that kubernetes should perform a readiness check every 10 seconds + periodSeconds: 10 + # -- number of seconds after which the probe times out + timeoutSeconds: 5 + # -- when a probe fails kubernetes will try 6 times before giving up + failureThreshold: 6 + # -- number of consecutive successes for the probe to be considered successful after having failed + successThreshold: 1 + # -- endpoints of the control plane endpoints: + # -- default api for health checks, should not be added to any ingress default: + # -- port for incoming api calls port: 8080 + # -- path for incoming api calls path: /consumer/api - public: - port: 8185 - path: /consumer/api/public + # -- data management api, used by internal users, can be added to an ingress and must not be internet facing + management: + # -- port for incoming api calls + port: 8081 + # -- path for incoming api calls + path: /consumer/management + # -- authentication key, must be attached to each 'X-Api-Key' request header + authKey: + # -- control api, used for internal control calls. can be added to the internal ingress, but should probably not control: - port: 9999 - path: /consumer/api/dataplane/control + # -- port for incoming api calls + port: 8083 + # -- path for incoming api calls + path: /consumer/control + # -- ids api, used for inter connector communication and must be internet facing + protocol: + # -- port for incoming api calls + port: 8084 + # -- path for incoming api calls + path: /consumer/api/v1/dsp + # -- metrics api, used for application metrics, must not be internet facing metrics: + # -- port for incoming api calls port: 9090 + # -- path for incoming api calls path: /consumer/metrics - ingresses: - - enabled: true - hostname: "materialpass.int.demo.catena-x.net" - endpoints: - - default - - public - - control - - metrics - className: "nginx" - # # -- Enables TLS on the ingress resource - # tls: true - # secretName: tls-secret - tls: - # -- Enables TLS on the ingress resource - enabled: true - # -- If present overwrites the default secret name - secretName: "tls-secret" - - opentelemetry: - properties: |- - otel.javaagent.enabled=false - otel.javaagent.debug=false - env: + # -- observability api with unsecured access, must not be internet facing + observability: + # -- port for incoming API calls + port: 8085 + # -- observability api, provides /health /readiness and /liveness endpoints + path: /consumer/observability + # -- allow or disallow insecure access, i.e. access without authentication + insecure: true + businessPartnerValidation: + log: + agreementValidation: true + service: + # -- [Service type](https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types) to expose the running application on a set of Pods as a network service. + type: ClusterIP + annotations: {} + # -- additional labels for the pod + podLabels: {} + # -- additional annotations for the pod + podAnnotations: {} + # -- The [pod security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod) defines privilege and access control settings for a Pod within the deployment + podSecurityContext: + seccompProfile: + # -- Restrict a Container's Syscalls with seccomp + type: RuntimeDefault + # -- Runs all processes within a pod with a special uid + runAsUser: 10001 + # -- Processes within a pod will belong to this guid + runAsGroup: 10001 + # -- The owner for volumes and any files created within volumes will belong to this guid + fsGroup: 10001 + # The [container security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container) defines privilege and access control settings for a Container within a pod + securityContext: + capabilities: + # -- Specifies which capabilities to drop to reduce syscall attack surface + drop: + - ALL + # -- Specifies which capabilities to add to issue specialized syscalls + add: [] + # -- Whether the root filesystem is mounted in read-only mode + readOnlyRootFilesystem: true + # -- Controls [Privilege Escalation](https://kubernetes.io/docs/concepts/security/pod-security-policy/#privilege-escalation) enabling setuid binaries changing the effective user ID + allowPrivilegeEscalation: false + # -- Requires the container to run without root privileges + runAsNonRoot: true + # -- The container's process will run with the specified uid + runAsUser: 10001 + # Extra environment variables that will be pass onto deployment pods + env: {} + # ENV_NAME: value - ############# - ## GENERAL ## - ############# + # "valueFrom" environment variable references that will be added to deployment pods. Name is templated. + # ref: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.19/#envvarsource-v1-core + envValueFrom: {} + # ENV_NAME: + # configMapKeyRef: + # name: configmap-name + # key: value_key + # secretKeyRef: + # name: secret-name + # key: value_key - JAVA_TOOL_OPTIONS: "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=1044" - EDC_DATAPLANE_TOKEN_VALIDATION_ENDPOINT: http://materialpass-edc-controlplane:8182/consumer/validation/token + # [Kubernetes Secret Resource](https://kubernetes.io/docs/concepts/configuration/secret/) names to load environment variables from + envSecretNames: [] + # - first-secret + # - second-secret - ############### - ## KEY VAULT ## - ############### + # [Kubernetes ConfigMap Resource](https://kubernetes.io/docs/concepts/configuration/configmap/) names to load environment variables from + envConfigMapNames: [] + # - first-config-map + # - second-config-map - EDC_VAULT_HASHICORP_URL: - EDC_VAULT_HASHICORP_API_SECRET_PATH: - EDC_VAULT_HASHICORP_TOKEN: - EDC_OAUTH_TOKEN_URL: https://daps1.int.demo.catena-x.net/token - EDC_OAUTH_PROVIDER_JWKS_URL: https://daps1.int.demo.catena-x.net/.well-known/jwks.json - EDC_OAUTH_PROVIDER_AUDIENCE: idsc:IDS_CONNECTORS_ALL - EDC_VAULT_HASHICORP_HEALTH_CHECK_STANDBY_OK: "true" - -controlplane: - enabled: true - fullnameOverride: "materialpass-edc-controlplane" - image: - repository: ghcr.io/catenax-ng/product-edc/edc-controlplane-postgresql-hashicorp-vault - tag: 0.1.6 - pullPolicy: IfNotPresent - envSecretName: "consumer-controlplane-secret" - edc: + ## Ingress declaration to expose the network service. + ingresses: + ## Public / Internet facing Ingress + - enabled: true + # -- The hostname to be used to precisely map incoming traffic onto the underlying network service + hostname: "materialpass.int.demo.catena-x.net" + # -- Additional ingress annotations to add + annotations: {} + # -- EDC endpoints exposed by this ingress resource + endpoints: + - default + - management + - control + - protocol + - metrics + - observability + # -- Defines the [ingress class](https://kubernetes.io/docs/concepts/services-networking/ingress/#ingress-class) to use + className: "nginx" + # -- TLS [tls class](https://kubernetes.io/docs/concepts/services-networking/ingress/#tls) applied to the ingress resource + tls: + # -- Enables TLS on the ingress resource + enabled: true + # -- If present overwrites the default secret name + secretName: "tls-secret" + ## Adds [cert-manager](https://cert-manager.io/docs/) annotations to the ingress resource + certManager: + # -- If preset enables certificate generation via cert-manager namespace scoped issuer + issuer: "" + # -- If preset enables certificate generation via cert-manager cluster-wide issuer + clusterIssuer: "" + ## Private / Intranet facing Ingress + - enabled: false + # -- The hostname to be used to precisely map incoming traffic onto the underlying network service + hostname: "edc-control.intranet" + # -- Additional ingress annotations to add + annotations: {} + # -- EDC endpoints exposed by this ingress resource + endpoints: + - management + - control + # -- Defines the [ingress class](https://kubernetes.io/docs/concepts/services-networking/ingress/#ingress-class) to use + className: "nginx" + # -- TLS [tls class](https://kubernetes.io/docs/concepts/services-networking/ingress/#tls) applied to the ingress resource + tls: + # -- Enables TLS on the ingress resource + enabled: true + # -- If present overwrites the default secret name + secretName: "tls-secret" + ## Adds [cert-manager](https://cert-manager.io/docs/) annotations to the ingress resource + certManager: + # -- If preset enables certificate generation via cert-manager namespace scoped issuer + issuer: "" + # -- If preset enables certificate generation via cert-manager cluster-wide issuer + clusterIssuer: "" + # -- declare where to mount [volumes](https://kubernetes.io/docs/concepts/storage/volumes/) into the container + volumeMounts: [] + # -- [volume](https://kubernetes.io/docs/concepts/storage/volumes/) directories + volumes: [] + # -- [resource management](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) for the container + resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + replicaCount: 1 + autoscaling: + # -- Enables [horizontal pod autoscaling](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/) + enabled: false + # -- Minimal replicas if resource consumption falls below resource threshholds + minReplicas: 1 + # -- Maximum replicas if resource consumption exceeds resource threshholds + maxReplicas: 100 + # -- targetAverageUtilization of cpu provided to a pod + targetCPUUtilizationPercentage: 80 + # -- targetAverageUtilization of memory provided to a pod + targetMemoryUtilizationPercentage: 80 + # -- configuration of the [Open Telemetry Agent](https://opentelemetry.io/docs/instrumentation/java/automatic/agent-config/) to collect and expose metrics + opentelemetry: |- + otel.javaagent.enabled=false + otel.javaagent.debug=false + # -- configuration of the [Java Util Logging Facade](https://docs.oracle.com/javase/7/docs/technotes/guides/logging/overview.html) + logging: |- + .level=INFO + org.eclipse.edc.level=ALL + handlers=java.util.logging.ConsoleHandler + java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter + java.util.logging.ConsoleHandler.level=ALL + java.util.logging.SimpleFormatter.format=[%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS] [%4$-7s] %5$s%6$s%n + # [node selector](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector) to constrain pods to nodes + nodeSelector: {} + # [tolerations](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) to configure preferred nodes + tolerations: [] + # [affinity](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity) to configure which nodes the pods can be scheduled on + affinity: {} + url: + # -- Explicitly declared url for reaching the ids api (e.g. if ingresses not used) + ids: "" + dataplane: + enabled: true + image: + # -- Which derivate of the data plane to use. when left empty the deployment will select the correct image automatically + repository: "tractusx/edc-dataplane-hashicorp-vault" + # -- [Kubernetes image pull policy](https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy) to use + pullPolicy: IfNotPresent + # -- Overrides the image tag whose default is the chart appVersion + tag: "0.4.1" + initContainers: [] + debug: + enabled: false + port: 1044 + suspendOnStart: false + livenessProbe: + # -- Whether to enable kubernetes [liveness-probe](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) + enabled: true + # -- seconds to wait before performing the first liveness check + initialDelaySeconds: 30 + # -- this fields specifies that kubernetes should perform a liveness check every 10 seconds + periodSeconds: 10 + # -- number of seconds after which the probe times out + timeoutSeconds: 5 + # -- when a probe fails kubernetes will try 6 times before giving up + failureThreshold: 6 + # -- number of consecutive successes for the probe to be considered successful after having failed + successThreshold: 1 + readinessProbe: + # -- Whether to enable kubernetes [readiness-probes](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) + enabled: true + # -- seconds to wait before performing the first readiness check + initialDelaySeconds: 30 + # -- this fields specifies that kubernetes should perform a liveness check every 10 seconds + periodSeconds: 10 + # -- number of seconds after which the probe times out + timeoutSeconds: 5 + # -- when a probe fails kubernetes will try 6 times before giving up + failureThreshold: 6 + # -- number of consecutive successes for the probe to be considered successful after having failed + successThreshold: 1 + service: + # -- [Service type](https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types) to expose the running application on a set of Pods as a network service. + type: ClusterIP + port: 80 endpoints: default: port: 8080 - path: /consumer/controlplane/api - data: - port: 8181 - path: /consumer/data - validation: - port: 8182 - path: /consumer/validation + path: /consumer/api + public: + port: 8081 + path: /consumer/api/public control: - port: 9999 - path: /consumer/api/controlplane/control - ids: - port: 8282 - path: /consumer/api/v1/ids + port: 8083 + path: /consumer/api/dataplane/control + proxy: + port: 8186 + path: /consumer/proxy + observability: + # -- port for incoming API calls + port: 8085 + # -- observability api, provides /health /readiness and /liveness endpoints + path: /consumer/observability + # -- allow or disallow insecure access, i.e. access without authentication + insecure: true metrics: port: 9090 - path: /consumer/controlplane/metrics - ingresses: - - enabled: true - hostname: "materialpass.int.demo.catena-x.net" - endpoints: - - default - - data - - validation - - control - - ids - - metrics - className: "nginx" - tls: - # -- Enables TLS on the ingress resource - enabled: true - # -- If present overwrites the default secret name - secretName: "tls-secret" - - ## Private / Intranet facing Ingress - - enabled: false - # -- The hostname to be used to precisely map incoming traffic onto the underlying network service - hostname: "edc-controlplane.intranet" - # -- EDC endpoints exposed by this ingress resource - endpoints: - - data - - control - # -- Defines the [ingress class](https://kubernetes.io/docs/concepts/services-networking/ingress/#ingress-class) to use - className: "nginx" - tls: - # -- Enables TLS on the ingress resource - enabled: true - # -- If present overwrites the default secret name - secretName: "tls-secret" - - opentelemetry: - properties: |- - otel.javaagent.enabled=false - otel.javaagent.debug=false - env: - JAVA_TOOL_OPTIONS: "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=1044" - EDC_DATASOURCE_ASSET_NAME: asset - EDC_DATASOURCE_ASSET_USER: *psqlUsername - EDC_DATASOURCE_ASSET_URL: &psqlJdbcUrl "jdbc:postgresql://consumer-postgresql:5432/edc" - EDC_DATASOURCE_CONTRACTDEFINITION_NAME: contractdefinition - EDC_DATASOURCE_CONTRACTDEFINITION_USER: *psqlUsername - EDC_DATASOURCE_CONTRACTDEFINITION_URL: *psqlJdbcUrl - EDC_DATASOURCE_CONTRACTNEGOTIATION_NAME: contractnegotiation - EDC_DATASOURCE_CONTRACTNEGOTIATION_USER: *psqlUsername - EDC_DATASOURCE_CONTRACTNEGOTIATION_URL: *psqlJdbcUrl - EDC_DATASOURCE_POLICY_NAME: policy - EDC_DATASOURCE_POLICY_USER: *psqlUsername - EDC_DATASOURCE_POLICY_URL: *psqlJdbcUrl - EDC_DATASOURCE_TRANSFERPROCESS_NAME: transferprocess - EDC_DATASOURCE_TRANSFERPROCESS_USER: *psqlUsername - EDC_DATASOURCE_TRANSFERPROCESS_URL: *psqlJdbcUrl - EDC_VAULT_HASHICORP_URL: - EDC_VAULT_HASHICORP_API_SECRET_PATH: - EDC_VAULT_HASHICORP_TOKEN: - EDC_API_AUTH_KEY: - - # see extension https://github.com/catenax-ng/product-edc/tree/develop/edc-extensions/dataplane-selector-configuration - EDC_DATAPLANE_SELECTOR_CONSUMERPLANE_URL: http://materialpass-edc-dataplane:9999/consumer/api/dataplane/control - EDC_DATAPLANE_SELECTOR_CONSUMERPLANE_SOURCETYPES : HttpData - EDC_DATAPLANE_SELECTOR_CONSUMERPLANE_DESTINATIONTYPES: HttpProxy - EDC_DATAPLANE_SELECTOR_CONSUMERPLANE_PROPERTIES: >- - { - "publicApiUrl": "http://materialpass-edc-dataplane:8185/consumer/api/public/" - } - - # EDC_DATAPLANE_SELECTOR_HTTPPROXY_PROPERTIES: >- - # { - # "publicApiUrl": "https://materialpass.int.demo.catena-x.net/consumer/dataplane/api/public" - # } + path: /consumer/metrics + aws: + endpointOverride: "" + accessKeyId: "" + secretAccessKey: "" + # -- additional labels for the pod + podLabels: {} + # -- additional annotations for the pod + podAnnotations: {} + # -- The [pod security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod) defines privilege and access control settings for a Pod within the deployment + podSecurityContext: + seccompProfile: + # -- Restrict a Container's Syscalls with seccomp + type: RuntimeDefault + # -- Runs all processes within a pod with a special uid + runAsUser: 10001 + # -- Processes within a pod will belong to this guid + runAsGroup: 10001 + # -- The owner for volumes and any files created within volumes will belong to this guid + fsGroup: 10001 + # The [container security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container) defines privilege and access control settings for a Container within a pod + securityContext: + capabilities: + # -- Specifies which capabilities to drop to reduce syscall attack surface + drop: + - ALL + # -- Specifies which capabilities to add to issue specialized syscalls + add: [] + # -- Whether the root filesystem is mounted in read-only mode + readOnlyRootFilesystem: true + # -- Controls [Privilege Escalation](https://kubernetes.io/docs/concepts/security/pod-security-policy/#privilege-escalation) enabling setuid binaries changing the effective user ID + allowPrivilegeEscalation: false + # -- Requires the container to run without root privileges + runAsNonRoot: true + # -- The container's process will run with the specified uid + runAsUser: 10001 + # Extra environment variables that will be pass onto deployment pods + env: {} + # ENV_NAME: value - configuration: - properties: |- - #edc.api.auth.key= - # edc.atomikos.checkpoint.interval= - # edc.atomikos.directory= - # edc.atomikos.logging= - # edc.atomikos.threaded2pc= - # edc.atomikos.timeout= - # edc.aws.access.key= - # edc.aws.provision.retry.retries.max= - # edc.aws.provision.role.duration.session.max= - # edc.aws.secret.access.key= - # edc.blobstore.endpoint= - # edc.controlplane.validation-endpoint= - # edc.core.retry.backoff.max= - # edc.core.retry.backoff.min= - # edc.core.retry.retries.max= - # edc.core.system.health.check.liveness-period= - # edc.core.system.health.check.readiness-period= - # edc.core.system.health.check.startup-period= - # edc.core.system.health.check.threadpool-size= - # edc.dataplane.queue.capacity= - # edc.dataplane.wait= - # edc.dataplane.workers= - edc.datasource.asset.name=asset - edc.datasource.asset.user= - edc.datasource.asset.url=jdbc:postgresql://consumer-postgresql:5432/edc - - edc.datasource.contractdefinition.name=contractdefinition - edc.datasource.contractdefinition.user= - edc.datasource.contractdefinition.url=jdbc:postgresql://consumer-postgresql:5432/edc + # "valueFrom" environment variable references that will be added to deployment pods. Name is templated. + # ref: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.19/#envvarsource-v1-core + envValueFrom: {} + # ENV_NAME: + # configMapKeyRef: + # name: configmap-name + # key: value_key + # secretKeyRef: + # name: secret-name + # key: value_key - edc.datasource.contractnegotiation.name=contractnegotiation - edc.datasource.contractnegotiation.user= - edc.datasource.contractnegotiation.url=jdbc:postgresql://consumer-postgresql:5432/edc + # [Kubernetes Secret Resource](https://kubernetes.io/docs/concepts/configuration/secret/) names to load environment variables from + envSecretNames: [] + # - first-secret + # - second-secret - edc.datasource.policy.name=policy - edc.datasource.policy.user= - edc.datasource.policy.url=jdbc:postgresql://consumer-postgresql:5432/edc + # [Kubernetes ConfigMap Resource](https://kubernetes.io/docs/concepts/configuration/configmap/) names to load environment variables from + envConfigMapNames: [] + # - first-config-map + # - second-config-map - edc.datasource.transferprocess.name=transferprocess - edc.datasource.transferprocess.user= - edc.datasource.transferprocess.url=jdbc:postgresql://consumer-postgresql:5432/edc + ## Ingress declaration to expose the network service. + ingresses: + ## Public / Internet facing Ingress + - enabled: true + # -- The hostname to be used to precisely map incoming traffic onto the underlying network service + hostname: "materialpass.int.demo.catena-x.net" + # -- Additional ingress annotations to add + annotations: {} + # -- EDC endpoints exposed by this ingress resource + endpoints: + - public + # -- Defines the [ingress class](https://kubernetes.io/docs/concepts/services-networking/ingress/#ingress-class) to use + className: "nginx" + # -- TLS [tls class](https://kubernetes.io/docs/concepts/services-networking/ingress/#tls) applied to the ingress resource + tls: + # -- Enables TLS on the ingress resource + enabled: true + # -- If present overwrites the default secret name + secretName: "tls-secret" + ## Adds [cert-manager](https://cert-manager.io/docs/) annotations to the ingress resource + certManager: + # -- If preset enables certificate generation via cert-manager namespace scoped issuer + issuer: "" + # -- If preset enables certificate generation via cert-manager cluster-wide issuer + clusterIssuer: "" + # -- declare where to mount [volumes](https://kubernetes.io/docs/concepts/storage/volumes/) into the container + volumeMounts: [] + # -- [volume](https://kubernetes.io/docs/concepts/storage/volumes/) directories + volumes: [] + # -- [resource management](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) for the container + resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + replicaCount: 1 + autoscaling: + # -- Enables [horizontal pod autoscaling](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/) + enabled: false + # -- Minimal replicas if resource consumption falls below resource threshholds + minReplicas: 1 + # -- Maximum replicas if resource consumption exceeds resource threshholds + maxReplicas: 100 + # -- targetAverageUtilization of cpu provided to a pod + targetCPUUtilizationPercentage: 80 + # -- targetAverageUtilization of memory provided to a pod + targetMemoryUtilizationPercentage: 80 + # -- configuration of the [Open Telemetry Agent](https://opentelemetry.io/docs/instrumentation/java/automatic/agent-config/) to collect and expose metrics + opentelemetry: |- + otel.javaagent.enabled=false + otel.javaagent.debug=false + # -- configuration of the [Java Util Logging Facade](https://docs.oracle.com/javase/7/docs/technotes/guides/logging/overview.html) + logging: |- + .level=INFO + org.eclipse.edc.level=ALL + handlers=java.util.logging.ConsoleHandler + java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter + java.util.logging.ConsoleHandler.level=ALL + java.util.logging.SimpleFormatter.format=[%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS] [%4$-7s] %5$s%6$s%n + # [node selector](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector) to constrain pods to nodes + nodeSelector: {} + # [tolerations](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) to configure preferred nodes + tolerations: [] + # [affinity](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity) to configure which nodes the pods can be scheduled on + affinity: {} + url: + # -- Explicitly declared url for reaching the public api (e.g. if ingresses not used) + public: "" + postgresql: + jdbcUrl: "jdbc:postgresql://postgresql:5432/edc" + fullnameOverride: "postgresql" + username: + password: + auth: + database: "edc" + username: + password: - # edc.datasource.default.pool.maxIdleConnections= - # edc.datasource.default.pool.maxTotalConnections= - # edc.datasource.default.pool.minIdleConnections= - # edc.datasource.default.pool.testConnectionOnBorrow= - # edc.datasource.default.pool.testConnectionOnCreate= - # edc.datasource.default.pool.testConnectionOnReturn= - # edc.datasource.default.pool.testConnectionWhileIdle= - # edc.datasource.default.pool.testQuery= - edc.datasource.default.url= - edc.datasource.default.user= - edc.datasource.default.password= + vault: + fullnameOverride: "vault" + injector: + enabled: false + server: + dev: + enabled: true + devRootToken: "root" + # Must be the same certificate that is configured in section 'daps' + postStart: # must be set externally! + hashicorp: + url: + token: + timeout: 30 + healthCheck: + enabled: true + standbyOk: true + paths: + secret: + health: /v1/sys/health + secretNames: + transferProxyTokenSignerPrivateKey: ids-daps_key + transferProxyTokenSignerPublicKey: ids-daps_crt + transferProxyTokenEncryptionAesKey: edc-encryption-key + dapsPrivateKey: ids-daps_key + dapsPublicKey: ids-daps_crt - edc.data.encryption.algorithm=NONE - edc.data.encryption.keys.alias=edc-encryption-key - # edc.dataplane.selector.httpproxy.url=https://materialpass-edc-dataplane:9999/consumer/api/dataplane/control + daps: + fullnameOverride: "daps" + url: "https://daps1.int.demo.catena-x.net" + clientId: + paths: + jwks: /.well-known/jwks.json + token: /token - # edc.dpf.selector.url= - # edc.events.topic.endpoint= - # edc.events.topic.name= - # edc.fs.config= - # edc.hostname= - # edc.identity.did.url= - # edc.ids.catalog.id= - # edc.ids.curator= - edc.ids.description="Consumer Control Plane" - edc.ids.endpoint=https://materialpass.int.demo.catena-x.net/consumer/api/v1/ids - edc.ids.endpoint.audience=https://materialpass.int.demo.catena-x.net/consumer/api/v1/ids/data + backendService: + httpProxyTokenReceiverUrl: "http://dpp-edc-consumer-backend" - # localhost configuration - # edc.ids.endpoint=http://materialpass-edc-controlplane:8282/consumer/api/v1/ids - # edc.ids.endpoint.audience=http://materialpass-edc-controlplane:8282/consumer/api/v1/ids/data - # localhost configuration + serviceAccount: + # Specifies whether a service account should be created + create: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + # -- Existing image pull secret bound to the service account to use to [obtain the container image from private registries](https://kubernetes.io/docs/concepts/containers/images/#using-a-private-registry) + imagePullSecrets: [] + + idsdaps: + connectors: + - certificate: - # edc.ids.id= - # edc.ids.maintainer= - # edc.ids.security.profile= - # edc.ids.title= - # edc.ids.validation.referringconnector= - # edc.ion.crawler.did-type= - # edc.ion.crawler.interval-minutes= - # edc.ion.crawler.ion.url= - # edc.metrics.enabled= - # edc.metrics.executor.enabled= - # edc.metrics.jersey.enabled= - # edc.metrics.jetty.enabled= - # edc.metrics.okhttp.enabled= - # edc.metrics.system.enabled= - # edc.negotiation.consumer.state-machine.batch-size= - # edc.negotiation.provider.state-machine.batch-size= - edc.oauth.client.id= - edc.oauth.private.key.alias=ids-daps_key - edc.oauth.provider.audience=idsc:IDS_CONNECTORS_ALL - # edc.oauth.provider.jwks.refresh= - edc.oauth.provider.jwks.url=https://daps1.int.demo.catena-x.net/.well-known/jwks.json - edc.oauth.public.key.alias=ids-daps_crt - edc.oauth.token.url=https://daps1.int.demo.catena-x.net/token - # edc.oauth.validation.nbf.leeway= - # edc.receiver.http.auth-code= - # edc.receiver.http.auth-key= - edc.receiver.http.endpoint=http://materialpass-edc-backend - edc.transfer.proxy.endpoint=http://materialpass-edc-dataplane:8185/consumer/api/public - # edc.transfer.proxy.token.validity.seconds= - edc.transfer.proxy.token.signer.privatekey.alias=ids-daps_key - edc.transfer.proxy.token.verifier.publickey.alias=ids-daps_crt - # edc.transfer.functions.check.endpoint= - # edc.transfer.functions.enabled.protocols= - # edc.transfer.functions.transfer.endpoint= - # edc.transfer-process-store.database.name= - # edc.transfer.state-machine.batch-size= - # edc.vault= - # edc.vault.certificate= - # edc.vault.clientid= - # edc.vault.clientsecret= - # edc.vault.name= - # edc.vault.tenantid= - edc.vault.hashicorp.url= - edc.vault.hashicorp.token= - edc.vault.hashicorp.api.secret.path= - edc.vault.hashicorp.health.check.standby.ok=true - # edc.vault.hashicorp.timeout.seconds= - # edc.webdid.doh.url= - # edc.web.rest.cors.enabled= - # edc.web.rest.cors.headers= - # edc.web.rest.cors.methods= - # edc.web.rest.cors.origins= - ids.webhook.address=https://materialpass.int.demo.catena-x.net - # ids.webhook.address=http://materialpass-edc-controlplane:8282 +postgresql: + jdbcUrl: "jdbc:postgresql://postgresql:5432/edc" + fullnameOverride: "postgresql" + primary: + persistence: + enabled: true + readReplicas: + persistence: + enabled: true + auth: + database: "edc" + username: + password: \ No newline at end of file diff --git a/deployment/helm/edc-consumer/values.yaml b/deployment/helm/edc-consumer/values.yaml new file mode 100644 index 000000000..7c1faff99 --- /dev/null +++ b/deployment/helm/edc-consumer/values.yaml @@ -0,0 +1,586 @@ +# +# Copyright (c) 2023 ZF Friedrichshafen AG +# Copyright (c) 2023 Mercedes-Benz Tech Innovation GmbH +# Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +# Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License, Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +# SPDX-License-Identifier: Apache-2.0 +# + + +--- +# Default values for eclipse-dataspace-connector. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. +mockbackend: + enabled: true + fullnameOverride: "dpp-edc-consumer-backend" + service: + type: NodePort + frontend: + port: 80 + backend: + port: 8081 + + +tractusx-connector: + install: + daps: false + postgresql: false + vault: false + fullnameOverride: "dpp-edc-consumer" + nameOverride: "" + # -- Existing image pull secret to use to [obtain the container image from private registries](https://kubernetes.io/docs/concepts/containers/images/#using-a-private-registry) + imagePullSecrets: [] + customLabels: {} + + + participant: + id: &bpnNumber "" + + controlplane: + enabled: true + image: + # -- Which derivate of the control plane to use. when left empty the deployment will select the correct image automatically + repository: "tractusx/edc-controlplane-postgresql-hashicorp-vault" + # -- [Kubernetes image pull policy](https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy) to use + pullPolicy: IfNotPresent + # -- Overrides the image tag whose default is the chart appVersion + tag: "0.4.1" + initContainers: [] + debug: + enabled: true + port: 1044 + suspendOnStart: false + internationalDataSpaces: + id: TXDC + description: Tractus-X Eclipse IDS Data Space Connector + title: "" + maintainer: "" + curator: "" + catalogId: TXDC-Catalog + livenessProbe: + # -- Whether to enable kubernetes [liveness-probe](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) + enabled: true + # -- seconds to wait before performing the first liveness check + initialDelaySeconds: 30 + # -- this fields specifies that kubernetes should perform a liveness check every 10 seconds + periodSeconds: 10 + # -- number of seconds after which the probe times out + timeoutSeconds: 5 + # -- when a probe fails kubernetes will try 6 times before giving up + failureThreshold: 6 + # -- number of consecutive successes for the probe to be considered successful after having failed + successThreshold: 1 + readinessProbe: + # -- Whether to enable kubernetes [readiness-probes](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) + enabled: true + # -- seconds to wait before performing the first readiness check + initialDelaySeconds: 30 + # -- this fields specifies that kubernetes should perform a readiness check every 10 seconds + periodSeconds: 10 + # -- number of seconds after which the probe times out + timeoutSeconds: 5 + # -- when a probe fails kubernetes will try 6 times before giving up + failureThreshold: 6 + # -- number of consecutive successes for the probe to be considered successful after having failed + successThreshold: 1 + # -- endpoints of the control plane + endpoints: + # -- default api for health checks, should not be added to any ingress + default: + # -- port for incoming api calls + port: 8080 + # -- path for incoming api calls + path: /consumer/api + # -- data management api, used by internal users, can be added to an ingress and must not be internet facing + management: + # -- port for incoming api calls + port: 8081 + # -- path for incoming api calls + path: /consumer/management + # -- authentication key, must be attached to each 'X-Api-Key' request header + authKey: + # -- control api, used for internal control calls. can be added to the internal ingress, but should probably not + control: + # -- port for incoming api calls + port: 8083 + # -- path for incoming api calls + path: /consumer/control + # -- ids api, used for inter connector communication and must be internet facing + protocol: + # -- port for incoming api calls + port: 8084 + # -- path for incoming api calls + path: /consumer/api/v1/dsp + # -- metrics api, used for application metrics, must not be internet facing + metrics: + # -- port for incoming api calls + port: 9090 + # -- path for incoming api calls + path: /consumer/metrics + # -- observability api with unsecured access, must not be internet facing + observability: + # -- port for incoming API calls + port: 8085 + # -- observability api, provides /health /readiness and /liveness endpoints + path: /consumer/observability + # -- allow or disallow insecure access, i.e. access without authentication + insecure: true + businessPartnerValidation: + log: + agreementValidation: true + service: + # -- [Service type](https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types) to expose the running application on a set of Pods as a network service. + type: ClusterIP + annotations: {} + # -- additional labels for the pod + podLabels: {} + # -- additional annotations for the pod + podAnnotations: {} + # -- The [pod security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod) defines privilege and access control settings for a Pod within the deployment + podSecurityContext: + seccompProfile: + # -- Restrict a Container's Syscalls with seccomp + type: RuntimeDefault + # -- Runs all processes within a pod with a special uid + runAsUser: 10001 + # -- Processes within a pod will belong to this guid + runAsGroup: 10001 + # -- The owner for volumes and any files created within volumes will belong to this guid + fsGroup: 10001 + # The [container security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container) defines privilege and access control settings for a Container within a pod + securityContext: + capabilities: + # -- Specifies which capabilities to drop to reduce syscall attack surface + drop: + - ALL + # -- Specifies which capabilities to add to issue specialized syscalls + add: [] + # -- Whether the root filesystem is mounted in read-only mode + readOnlyRootFilesystem: true + # -- Controls [Privilege Escalation](https://kubernetes.io/docs/concepts/security/pod-security-policy/#privilege-escalation) enabling setuid binaries changing the effective user ID + allowPrivilegeEscalation: false + # -- Requires the container to run without root privileges + runAsNonRoot: true + # -- The container's process will run with the specified uid + runAsUser: 10001 + # Extra environment variables that will be pass onto deployment pods + env: {} + # ENV_NAME: value + + # "valueFrom" environment variable references that will be added to deployment pods. Name is templated. + # ref: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.19/#envvarsource-v1-core + envValueFrom: {} + # ENV_NAME: + # configMapKeyRef: + # name: configmap-name + # key: value_key + # secretKeyRef: + # name: secret-name + # key: value_key + + # [Kubernetes Secret Resource](https://kubernetes.io/docs/concepts/configuration/secret/) names to load environment variables from + envSecretNames: [] + # - first-secret + # - second-secret + + # [Kubernetes ConfigMap Resource](https://kubernetes.io/docs/concepts/configuration/configmap/) names to load environment variables from + envConfigMapNames: [] + # - first-config-map + # - second-config-map + + ## Ingress declaration to expose the network service. + ingresses: + ## Public / Internet facing Ingress + - enabled: true + # -- The hostname to be used to precisely map incoming traffic onto the underlying network service + hostname: "materialpass.dev.demo.catena-x.net" + # -- Additional ingress annotations to add + annotations: {} + # -- EDC endpoints exposed by this ingress resource + endpoints: + - default + - management + - control + - protocol + - metrics + - observability + # -- Defines the [ingress class](https://kubernetes.io/docs/concepts/services-networking/ingress/#ingress-class) to use + className: "nginx" + # -- TLS [tls class](https://kubernetes.io/docs/concepts/services-networking/ingress/#tls) applied to the ingress resource + tls: + # -- Enables TLS on the ingress resource + enabled: true + # -- If present overwrites the default secret name + secretName: "tls-secret" + ## Adds [cert-manager](https://cert-manager.io/docs/) annotations to the ingress resource + certManager: + # -- If preset enables certificate generation via cert-manager namespace scoped issuer + issuer: "" + # -- If preset enables certificate generation via cert-manager cluster-wide issuer + clusterIssuer: "" + ## Private / Intranet facing Ingress + - enabled: false + # -- The hostname to be used to precisely map incoming traffic onto the underlying network service + hostname: "edc-control.intranet" + # -- Additional ingress annotations to add + annotations: {} + # -- EDC endpoints exposed by this ingress resource + endpoints: + - management + - control + # -- Defines the [ingress class](https://kubernetes.io/docs/concepts/services-networking/ingress/#ingress-class) to use + className: "nginx" + # -- TLS [tls class](https://kubernetes.io/docs/concepts/services-networking/ingress/#tls) applied to the ingress resource + tls: + # -- Enables TLS on the ingress resource + enabled: true + # -- If present overwrites the default secret name + secretName: "tls-secret" + ## Adds [cert-manager](https://cert-manager.io/docs/) annotations to the ingress resource + certManager: + # -- If preset enables certificate generation via cert-manager namespace scoped issuer + issuer: "" + # -- If preset enables certificate generation via cert-manager cluster-wide issuer + clusterIssuer: "" + # -- declare where to mount [volumes](https://kubernetes.io/docs/concepts/storage/volumes/) into the container + volumeMounts: [] + # -- [volume](https://kubernetes.io/docs/concepts/storage/volumes/) directories + volumes: [] + # -- [resource management](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) for the container + resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + replicaCount: 1 + autoscaling: + # -- Enables [horizontal pod autoscaling](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/) + enabled: false + # -- Minimal replicas if resource consumption falls below resource threshholds + minReplicas: 1 + # -- Maximum replicas if resource consumption exceeds resource threshholds + maxReplicas: 100 + # -- targetAverageUtilization of cpu provided to a pod + targetCPUUtilizationPercentage: 80 + # -- targetAverageUtilization of memory provided to a pod + targetMemoryUtilizationPercentage: 80 + # -- configuration of the [Open Telemetry Agent](https://opentelemetry.io/docs/instrumentation/java/automatic/agent-config/) to collect and expose metrics + opentelemetry: |- + otel.javaagent.enabled=false + otel.javaagent.debug=false + # -- configuration of the [Java Util Logging Facade](https://docs.oracle.com/javase/7/docs/technotes/guides/logging/overview.html) + logging: |- + .level=INFO + org.eclipse.edc.level=ALL + handlers=java.util.logging.ConsoleHandler + java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter + java.util.logging.ConsoleHandler.level=ALL + java.util.logging.SimpleFormatter.format=[%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS] [%4$-7s] %5$s%6$s%n + # [node selector](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector) to constrain pods to nodes + nodeSelector: {} + # [tolerations](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) to configure preferred nodes + tolerations: [] + # [affinity](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity) to configure which nodes the pods can be scheduled on + affinity: {} + url: + # -- Explicitly declared url for reaching the ids api (e.g. if ingresses not used) + ids: "" + dataplane: + enabled: true + image: + # -- Which derivate of the data plane to use. when left empty the deployment will select the correct image automatically + repository: "tractusx/edc-dataplane-hashicorp-vault" + # -- [Kubernetes image pull policy](https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy) to use + pullPolicy: IfNotPresent + # -- Overrides the image tag whose default is the chart appVersion + tag: "0.4.1" + initContainers: [] + debug: + enabled: true + port: 1044 + suspendOnStart: false + livenessProbe: + # -- Whether to enable kubernetes [liveness-probe](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) + enabled: true + # -- seconds to wait before performing the first liveness check + initialDelaySeconds: 30 + # -- this fields specifies that kubernetes should perform a liveness check every 10 seconds + periodSeconds: 10 + # -- number of seconds after which the probe times out + timeoutSeconds: 5 + # -- when a probe fails kubernetes will try 6 times before giving up + failureThreshold: 6 + # -- number of consecutive successes for the probe to be considered successful after having failed + successThreshold: 1 + readinessProbe: + # -- Whether to enable kubernetes [readiness-probes](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) + enabled: true + # -- seconds to wait before performing the first readiness check + initialDelaySeconds: 30 + # -- this fields specifies that kubernetes should perform a liveness check every 10 seconds + periodSeconds: 10 + # -- number of seconds after which the probe times out + timeoutSeconds: 5 + # -- when a probe fails kubernetes will try 6 times before giving up + failureThreshold: 6 + # -- number of consecutive successes for the probe to be considered successful after having failed + successThreshold: 1 + service: + # -- [Service type](https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types) to expose the running application on a set of Pods as a network service. + type: ClusterIP + port: 80 + endpoints: + default: + port: 8080 + path: /consumer/api + public: + port: 8081 + path: /consumer/api/public + control: + port: 8083 + path: /consumer/api/dataplane/control + proxy: + port: 8186 + path: /consumer/proxy + observability: + # -- port for incoming API calls + port: 8085 + # -- observability api, provides /health /readiness and /liveness endpoints + path: /consumer/observability + # -- allow or disallow insecure access, i.e. access without authentication + insecure: true + metrics: + port: 9090 + path: /consumer/metrics + aws: + endpointOverride: "" + accessKeyId: "" + secretAccessKey: "" + # -- additional labels for the pod + podLabels: {} + # -- additional annotations for the pod + podAnnotations: {} + # -- The [pod security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod) defines privilege and access control settings for a Pod within the deployment + podSecurityContext: + seccompProfile: + # -- Restrict a Container's Syscalls with seccomp + type: RuntimeDefault + # -- Runs all processes within a pod with a special uid + runAsUser: 10001 + # -- Processes within a pod will belong to this guid + runAsGroup: 10001 + # -- The owner for volumes and any files created within volumes will belong to this guid + fsGroup: 10001 + # The [container security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container) defines privilege and access control settings for a Container within a pod + securityContext: + capabilities: + # -- Specifies which capabilities to drop to reduce syscall attack surface + drop: + - ALL + # -- Specifies which capabilities to add to issue specialized syscalls + add: [] + # -- Whether the root filesystem is mounted in read-only mode + readOnlyRootFilesystem: true + # -- Controls [Privilege Escalation](https://kubernetes.io/docs/concepts/security/pod-security-policy/#privilege-escalation) enabling setuid binaries changing the effective user ID + allowPrivilegeEscalation: false + # -- Requires the container to run without root privileges + runAsNonRoot: true + # -- The container's process will run with the specified uid + runAsUser: 10001 + # Extra environment variables that will be pass onto deployment pods + env: {} + # ENV_NAME: value + + # "valueFrom" environment variable references that will be added to deployment pods. Name is templated. + # ref: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.19/#envvarsource-v1-core + envValueFrom: {} + # ENV_NAME: + # configMapKeyRef: + # name: configmap-name + # key: value_key + # secretKeyRef: + # name: secret-name + # key: value_key + + # [Kubernetes Secret Resource](https://kubernetes.io/docs/concepts/configuration/secret/) names to load environment variables from + envSecretNames: [] + # - first-secret + # - second-secret + + # [Kubernetes ConfigMap Resource](https://kubernetes.io/docs/concepts/configuration/configmap/) names to load environment variables from + envConfigMapNames: [] + # - first-config-map + # - second-config-map + + ## Ingress declaration to expose the network service. + ingresses: + ## Public / Internet facing Ingress + - enabled: true + # -- The hostname to be used to precisely map incoming traffic onto the underlying network service + hostname: "materialpass.dev.demo.catena-x.net" + # -- Additional ingress annotations to add + annotations: {} + # -- EDC endpoints exposed by this ingress resource + endpoints: + - public + # -- Defines the [ingress class](https://kubernetes.io/docs/concepts/services-networking/ingress/#ingress-class) to use + className: "nginx" + # -- TLS [tls class](https://kubernetes.io/docs/concepts/services-networking/ingress/#tls) applied to the ingress resource + tls: + # -- Enables TLS on the ingress resource + enabled: true + # -- If present overwrites the default secret name + secretName: "tls-secret" + ## Adds [cert-manager](https://cert-manager.io/docs/) annotations to the ingress resource + certManager: + # -- If preset enables certificate generation via cert-manager namespace scoped issuer + issuer: "" + # -- If preset enables certificate generation via cert-manager cluster-wide issuer + clusterIssuer: "" + # -- declare where to mount [volumes](https://kubernetes.io/docs/concepts/storage/volumes/) into the container + volumeMounts: [] + # -- [volume](https://kubernetes.io/docs/concepts/storage/volumes/) directories + volumes: [] + # -- [resource management](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) for the container + resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + replicaCount: 1 + autoscaling: + # -- Enables [horizontal pod autoscaling](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/) + enabled: false + # -- Minimal replicas if resource consumption falls below resource threshholds + minReplicas: 1 + # -- Maximum replicas if resource consumption exceeds resource threshholds + maxReplicas: 100 + # -- targetAverageUtilization of cpu provided to a pod + targetCPUUtilizationPercentage: 80 + # -- targetAverageUtilization of memory provided to a pod + targetMemoryUtilizationPercentage: 80 + # -- configuration of the [Open Telemetry Agent](https://opentelemetry.io/docs/instrumentation/java/automatic/agent-config/) to collect and expose metrics + opentelemetry: |- + otel.javaagent.enabled=false + otel.javaagent.debug=false + # -- configuration of the [Java Util Logging Facade](https://docs.oracle.com/javase/7/docs/technotes/guides/logging/overview.html) + logging: |- + .level=INFO + org.eclipse.edc.level=ALL + handlers=java.util.logging.ConsoleHandler + java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter + java.util.logging.ConsoleHandler.level=ALL + java.util.logging.SimpleFormatter.format=[%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS] [%4$-7s] %5$s%6$s%n + # [node selector](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector) to constrain pods to nodes + nodeSelector: {} + # [tolerations](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) to configure preferred nodes + tolerations: [] + # [affinity](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity) to configure which nodes the pods can be scheduled on + affinity: {} + url: + # -- Explicitly declared url for reaching the public api (e.g. if ingresses not used) + public: "" + + postgresql: + jdbcUrl: "jdbc:postgresql://postgresql:5432/edc" + fullnameOverride: "postgresql" + username: + password: + auth: + database: "edc" + username: + password: + + vault: + fullnameOverride: "vault" + injector: + enabled: false + server: + dev: + enabled: true + devRootToken: "root" + # Must be the same certificate that is configured in section 'daps' + postStart: # must be set externally! + hashicorp: + url: + token: + timeout: 30 + healthCheck: + enabled: true + standbyOk: true + paths: + secret: + health: /v1/sys/health + secretNames: + transferProxyTokenSignerPrivateKey: daps-key-dev + transferProxyTokenSignerPublicKey: daps-crt-dev + transferProxyTokenEncryptionAesKey: edc-encryption-key + dapsPrivateKey: daps-key-dev + dapsPublicKey: daps-crt-dev + + daps: + fullnameOverride: "daps" + url: "https://daps.dev.demo.catena-x.net" + clientId: + paths: + jwks: /jwks.json + token: /token + + backendService: + httpProxyTokenReceiverUrl: "http://dpp-edc-consumer-backend" + + serviceAccount: + # Specifies whether a service account should be created + create: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + # -- Existing image pull secret bound to the service account to use to [obtain the container image from private registries](https://kubernetes.io/docs/concepts/containers/images/#using-a-private-registry) + imagePullSecrets: [] + + idsdaps: + connectors: + - certificate: + +postgresql: + jdbcUrl: "jdbc:postgresql://postgresql:5432/edc" + fullnameOverride: "postgresql" + primary: + persistence: + enabled: true + readReplicas: + persistence: + enabled: true + auth: + database: "edc" + username: + password: \ No newline at end of file From 8668f5cd8bd9826110b1739f9dede923230369af Mon Sep 17 00:00:00 2001 From: Mathias Brunkow Moser Date: Mon, 5 Jun 2023 09:25:23 +0200 Subject: [PATCH 04/35] feat: added edc-provider in version v0.4.1 --- deployment/helm/edc-provider/Chart.lock | 15 - deployment/helm/edc-provider/Chart.yaml | 89 +- .../helm/edc-provider/templates/_helpers.tpl | 84 -- .../helm/edc-provider/templates/secret.yaml | 74 -- deployment/helm/edc-provider/values-beta.yaml | 307 ------- deployment/helm/edc-provider/values-dev.yaml | 293 ------- deployment/helm/edc-provider/values-int.yaml | 811 ++++++++++++------ 7 files changed, 590 insertions(+), 1083 deletions(-) delete mode 100644 deployment/helm/edc-provider/Chart.lock delete mode 100644 deployment/helm/edc-provider/templates/_helpers.tpl delete mode 100644 deployment/helm/edc-provider/templates/secret.yaml delete mode 100644 deployment/helm/edc-provider/values-beta.yaml delete mode 100644 deployment/helm/edc-provider/values-dev.yaml diff --git a/deployment/helm/edc-provider/Chart.lock b/deployment/helm/edc-provider/Chart.lock deleted file mode 100644 index 6b6582310..000000000 --- a/deployment/helm/edc-provider/Chart.lock +++ /dev/null @@ -1,15 +0,0 @@ -dependencies: -- name: edc-controlplane - repository: https://catenax-ng.github.io/product-edc - version: 0.1.6 -- name: edc-dataplane - repository: https://catenax-ng.github.io/product-edc - version: 0.1.6 -- name: backend-service - repository: https://denisneuling.github.io/cx-backend-service - version: 0.0.6 -- name: postgresql - repository: https://charts.bitnami.com/bitnami - version: 12.1.5 -digest: sha256:a3598076f2cd809542558467ea71c9172610100b5c0cd5a21df945adfdb6bc24 -generated: "2023-03-16T11:02:25.7771022+01:00" diff --git a/deployment/helm/edc-provider/Chart.yaml b/deployment/helm/edc-provider/Chart.yaml index 9fff56cb5..202bc868c 100644 --- a/deployment/helm/edc-provider/Chart.yaml +++ b/deployment/helm/edc-provider/Chart.yaml @@ -1,50 +1,63 @@ -################################################################################# -# Catena-X - Product Passport Consumer Frontend # -# Copyright (c) 2022, 2023 BASF SE, BMW AG, Henkel AG & Co. KGaA +# Copyright (c) 2023 ZF Friedrichshafen AG +# Copyright (c) 2023 Mercedes-Benz Tech Innovation GmbH +# Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +# Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation # -# See the NOTICE file(s) distributed with this work for additional -# information regarding copyright ownership. +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. # -# This program and the accompanying materials are made available under the -# terms of the Apache License, Version 2.0 which is available at -# https://www.apache.org/licenses/LICENSE-2.0. +# This program and the accompanying materials are made available under the +# terms of the Apache License, Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 # -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -# either express or implied. See the -# License for the specific language govern in permissions and limitations -# under the License. +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +# SPDX-License-Identifier: Apache-2.0 # -# SPDX-License-Identifier: Apache-2.0 -################################################################################## --- apiVersion: v2 -name: edc -description: A Helm chart for Kubernetes +name: tractusx-connector +description: | + A Helm chart for Tractus-X Eclipse Data Space Connector. The connector deployment consists of two runtime consists of a + Control Plane and a Data Plane. Note that _no_ external dependencies such as a PostgreSQL database and HashiCorp Vault are included. + + This chart is intended for use with an _existing_ PostgreSQL database and an _existing_ HashiCorp Vault. +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. type: application -version: 0.0.2 -appVersion: "0.4.3" +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.3.3 +# 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: "0.4.1" +home: https://github.com/eclipse-tractusx/tractusx-edc/tree/main/charts/tractusx-connector +sources: + - https://github.com/eclipse-tractusx/tractusx-edc/tree/main/charts/tractusx-connector +urls: + - https://github.com/eclipse-tractusx/tractusx-edc/releases/download/tractusx-connector-0.4.0/tractusx-connector-0.4.0.tgz dependencies: - - name: edc-controlplane - alias: controlplane - version: "0.1.6" - repository: https://catenax-ng.github.io/product-edc - condition: controlplane.enabled - - name: edc-dataplane - alias: dataplane - version: "0.1.6" - repository: https://catenax-ng.github.io/product-edc - condition: dataplane.enabled - - name: backend-service - version: "0.0.6" - repository: https://denisneuling.github.io/cx-backend-service - alias: providerbackendapplication - condition: providerbackendapplication.enabled + - name: tractusx-connector + version: 0.4.1 + repository: https://eclipse-tractusx.github.io/charts/dev + condition: enabled - name: postgresql - alias: postgres - version: 12.1.5 + alias: postgresql + version: 12.1.6 repository: https://charts.bitnami.com/bitnami - condition: postgres.enabled + condition: postgresql.enabled diff --git a/deployment/helm/edc-provider/templates/_helpers.tpl b/deployment/helm/edc-provider/templates/_helpers.tpl deleted file mode 100644 index bde0f74fd..000000000 --- a/deployment/helm/edc-provider/templates/_helpers.tpl +++ /dev/null @@ -1,84 +0,0 @@ -################################################################################# -# Catena-X - Product Passport Consumer Frontend -# -# 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. -# -# This program and the accompanying materials are made available under the -# terms of the Apache License, Version 2.0 which is available at -# https://www.apache.org/licenses/LICENSE-2.0. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -# either express or implied. See the -# License for the specific language govern in permissions and limitations -# under the License. -# -# SPDX-License-Identifier: Apache-2.0 -################################################################################## - -{{/* -Expand the name of the chart. -*/}} -{{- define "edc-provider.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. -*/}} -{{- define "edc-provider.fullname" -}} -{{- if .Values.fullnameOverride }} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- $name := default .Chart.Name .Values.nameOverride }} -{{- if contains $name .Release.Name }} -{{- .Release.Name | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} -{{- end }} -{{- end }} -{{- end }} - -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "edc-provider.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Common labels -*/}} -{{- define "edc-provider.labels" -}} -helm.sh/chart: {{ include "edc-provider.chart" . }} -{{ include "edc-provider.selectorLabels" . }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- end }} - -{{/* -Selector labels -*/}} -{{- define "edc-provider.selectorLabels" -}} -app.kubernetes.io/name: {{ include "edc-provider.name" . }} -app.kubernetes.io/instance: {{ .Release.Name }} -{{- end }} - -{{/* -Create the name of the service account to use -*/}} -{{- define "edc-provider.serviceAccountName" -}} -{{- if .Values.serviceAccount.create }} -{{- default (include "edc-provider.fullname" .) .Values.serviceAccount.name }} -{{- else }} -{{- default "default" .Values.serviceAccount.name }} -{{- end }} -{{- end }} diff --git a/deployment/helm/edc-provider/templates/secret.yaml b/deployment/helm/edc-provider/templates/secret.yaml deleted file mode 100644 index 59969c6a8..000000000 --- a/deployment/helm/edc-provider/templates/secret.yaml +++ /dev/null @@ -1,74 +0,0 @@ -################################################################################# -# Catena-X - Product Passport Consumer Frontend -# -# 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. -# -# This program and the accompanying materials are made available under the -# terms of the Apache License, Version 2.0 which is available at -# https://www.apache.org/licenses/LICENSE-2.0. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -# either express or implied. See the -# License for the specific language govern in permissions and limitations -# under the License. -# -# SPDX-License-Identifier: Apache-2.0 -################################################################################## - ---- - -# When deploying an EDC, there are various configuration parameters that should not be part of the configuration file. -# To not serve a bad example, this demo will set some settings using secrets as well. In a productive environment this secrets would probably be deployed independently. - - -{{- $provider_psql_password := .Values.postgres.auth.password -}} -{{- $api_auth_key := .Values.controlplane.env.EDC_API_AUTH_KEY -}} -{{- $vault_token := .Values.controlplane.env.EDC_VAULT_HASHICORP_TOKEN -}} - - ---- - -apiVersion: v1 -kind: Secret -metadata: - name: provider-controlplane-secret - namespace: {{ .Release.Namespace | default "default" | quote }} - labels: - {{- include "edc-provider.labels" . | nindent 4 }} -type: Opaque -stringData: - # see extension https://github.com/eclipse-dataspaceconnector/DataSpaceConnector/tree/main/extensions/api/auth-tokenbased - EDC_API_AUTH_KEY: {{ $api_auth_key | toString | quote }} - # see extension https://github.com/eclipse-dataspaceconnector/DataSpaceConnector/tree/main/extensions/sql/asset-index-sql - EDC_DATASOURCE_ASSET_PASSWORD: {{ $provider_psql_password | toString | quote }} - # see extension https://github.com/eclipse-dataspaceconnector/DataSpaceConnector/tree/main/extensions/sql/contract-definition-store-sql - EDC_DATASOURCE_CONTRACTDEFINITION_PASSWORD: {{ $provider_psql_password | toString | quote }} - # see extension https://github.com/eclipse-dataspaceconnector/DataSpaceConnector/tree/main/extensions/sql/contract-negotiation-store-sql - EDC_DATASOURCE_CONTRACTNEGOTIATION_PASSWORD: {{ $provider_psql_password | toString | quote }} - # see extension https://github.com/eclipse-dataspaceconnector/DataSpaceConnector/tree/main/extensions/sql/policy-store-sql - EDC_DATASOURCE_POLICY_PASSWORD: {{ $provider_psql_password | toString | quote }} - # see extension https://github.com/eclipse-dataspaceconnector/DataSpaceConnector/tree/main/extensions/sql/transfer-process-store-sql - EDC_DATASOURCE_TRANSFERPROCESS_PASSWORD: {{ $provider_psql_password | toString | quote }} - # see extension https://github.com/catenax-ng/product-edc/tree/develop/edc-extensions/hashicorp-vault - EDC_VAULT_HASHICORP_TOKEN: {{ $vault_token | toString | quote }} - ---- - -apiVersion: v1 -kind: Secret -metadata: - name: provider-dataplane-secret - namespace: {{ .Release.Namespace | default "default" | quote }} - labels: - {{- include "edc-provider.labels" . | nindent 4 }} -type: Opaque -stringData: - # see extension https://github.com/catenax-ng/product-edc/tree/develop/edc-extensions/hashicorp-vault - EDC_VAULT_HASHICORP_TOKEN: {{ $vault_token | toString | quote }} - - diff --git a/deployment/helm/edc-provider/values-beta.yaml b/deployment/helm/edc-provider/values-beta.yaml deleted file mode 100644 index ffd9905ba..000000000 --- a/deployment/helm/edc-provider/values-beta.yaml +++ /dev/null @@ -1,307 +0,0 @@ -################################################################################# -# Catena-X - Product Passport Consumer Frontend -# -# 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. -# -# This program and the accompanying materials are made available under the -# terms of the Apache License, Version 2.0 which is available at -# https://www.apache.org/licenses/LICENSE-2.0. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -# either express or implied. See the -# License for the specific language govern in permissions and limitations -# under the License. -# -# SPDX-License-Identifier: Apache-2.0 -################################################################################## - ---- -providerbackendapplication: - enabled: true - fullnameOverride: "materialpass-edc-provider-backend" - service: - type: NodePort - frontend: - port: 80 - backend: - port: 8081 - -postgres: - enabled: true - fullnameOverride: "provider-postgresql" - auth: - password: - username: &psqlUsername - database: "edc" - persistence: - enabled: true - -dataplane: - enabled: true - fullnameOverride: "materialpass-edc-provider-dataplane" - image: - repository: ghcr.io/catenax-ng/product-edc/edc-dataplane-hashicorp-vault - tag: 0.1.6 - pullPolicy: IfNotPresent - envSecretName: "provider-dataplane-secret" - edc: - endpoints: - default: - port: 8080 - path: /BPNL000000000000/api - public: - port: 8185 - path: /BPNL000000000000/api/public - control: - port: 9999 - path: /BPNL000000000000/api/dataplane/control - metrics: - port: 9090 - path: /BPNL000000000000/metrics - ingresses: - - enabled: true - hostname: "materialpass.beta.demo.catena-x.net" - endpoints: - - default - - public - - control - - metrics - className: "nginx" - tls: - # -- Enables TLS on the ingress resource - enabled: true - # -- If present overwrites the default secret name - secretName: "tls-secret" - opentelemetry: - properties: |- - otel.javaagent.enabled=false - otel.javaagent.debug=false - env: - JAVA_TOOL_OPTIONS: "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=1044" - EDC_DATAPLANE_TOKEN_VALIDATION_ENDPOINT: http://materialpass-edc-provider-controlplane:8182/BPNL000000000000/validation/token - - EDC_VAULT_HASHICORP_URL: - EDC_VAULT_HASHICORP_API_SECRET_PATH: - EDC_VAULT_HASHICORP_TOKEN: - EDC_OAUTH_TOKEN_URL: https://daps.beta.demo.catena-x.net/token - EDC_OAUTH_PROVIDER_JWKS_URL: https://daps.beta.demo.catena-x.net/.well-known/jwks.json - EDC_OAUTH_PROVIDER_AUDIENCE: idsc:IDS_CONNECTORS_ALL - EDC_VAULT_HASHICORP_HEALTH_CHECK_STANDBY_OK: "true" - -controlplane: - enabled: true - fullnameOverride: "materialpass-edc-provider-controlplane" - image: - repository: ghcr.io/catenax-ng/product-edc/edc-controlplane-postgresql-hashicorp-vault - tag: 0.1.6 - pullPolicy: IfNotPresent - edc: - endpoints: - default: - port: 8080 - path: /BPNL000000000000/controlplane/api - data: - port: 8181 - path: /BPNL000000000000/data - validation: - port: 8182 - path: /BPNL000000000000/validation - control: - port: 9999 - path: /BPNL000000000000/api/controlplane/control - ids: - port: 8282 - path: /BPNL000000000000/api/v1/ids - metrics: - port: 9090 - path: /BPNL000000000000/controlplane/metrics - ingresses: - - enabled: true - hostname: "materialpass.beta.demo.catena-x.net" - endpoints: - - default - - data - - validation - - control - - ids - - metrics - className: "nginx" - tls: - # -- Enables TLS on the ingress resource - enabled: true - # -- If present overwrites the default secret name - secretName: "tls-secret" - opentelemetry: - properties: |- - otel.javaagent.enabled=false - otel.javaagent.debug=false - envSecretName: "provider-controlplane-secret" - env: - JAVA_TOOL_OPTIONS: "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=1044" - EDC_DATASOURCE_ASSET_NAME: asset - EDC_DATASOURCE_ASSET_USER: *psqlUsername - EDC_DATASOURCE_ASSET_URL: &psqlJdbcUrl "jdbc:postgresql://provider-postgresql:5432/edc" - EDC_DATASOURCE_CONTRACTDEFINITION_NAME: contractdefinition - EDC_DATASOURCE_CONTRACTDEFINITION_USER: *psqlUsername - EDC_DATASOURCE_CONTRACTDEFINITION_URL: *psqlJdbcUrl - EDC_DATASOURCE_CONTRACTNEGOTIATION_NAME: contractnegotiation - EDC_DATASOURCE_CONTRACTNEGOTIATION_USER: *psqlUsername - EDC_DATASOURCE_CONTRACTNEGOTIATION_URL: *psqlJdbcUrl - EDC_DATASOURCE_POLICY_NAME: policy - EDC_DATASOURCE_POLICY_USER: *psqlUsername - EDC_DATASOURCE_POLICY_URL: *psqlJdbcUrl - EDC_DATASOURCE_TRANSFERPROCESS_NAME: transferprocess - EDC_DATASOURCE_TRANSFERPROCESS_USER: *psqlUsername - EDC_DATASOURCE_TRANSFERPROCESS_URL: *psqlJdbcUrl - EDC_API_AUTH_KEY: - EDC_VAULT_HASHICORP_URL: - EDC_VAULT_HASHICORP_API_SECRET_PATH: - EDC_VAULT_HASHICORP_TOKEN: - EDC_VAULT_HASHICORP_HEALTH_CHECK_STANDBY_OK: "true" - - - EDC_DATAPLANE_SELECTOR_PROVIDERPLANE_URL: http://materialpass-edc-provider-dataplane:9999/BPNL000000000000/api/dataplane/control - EDC_DATAPLANE_SELECTOR_PROVIDERPLANE_SOURCETYPES : HttpData - EDC_DATAPLANE_SELECTOR_PROVIDERPLANE_DESTINATIONTYPES: HttpProxy - EDC_DATAPLANE_SELECTOR_PROVIDERPLANE_PROPERTIES: >- - { - "publicApiUrl": "http://materialpass-edc-provider-dataplane:8185/BPNL000000000000/api/public" - } - - configuration: - properties: |- - #edc.api.auth.key= - # edc.atomikos.checkpoint.interval= - # edc.atomikos.directory= - # edc.atomikos.logging= - # edc.atomikos.threaded2pc= - # edc.atomikos.timeout= - # edc.aws.access.key= - # edc.aws.provision.retry.retries.max= - # edc.aws.provision.role.duration.session.max= - # edc.aws.secret.access.key= - # edc.blobstore.endpoint= - # edc.controlplane.validation-endpoint= - # edc.core.retry.backoff.max= - # edc.core.retry.backoff.min= - # edc.core.retry.retries.max= - # edc.core.system.health.check.liveness-period= - # edc.core.system.health.check.readiness-period= - # edc.core.system.health.check.startup-period= - # edc.core.system.health.check.threadpool-size= - # edc.dataplane.queue.capacity= - # edc.dataplane.wait= - # edc.dataplane.workers= - edc.datasource.asset.name=asset - edc.datasource.asset.user= - edc.datasource.asset.url=jdbc:postgresql://provider-postgresql:5432/edc - - edc.datasource.contractdefinition.name=contractdefinition - edc.datasource.contractdefinition.user= - edc.datasource.contractdefinition.url=jdbc:postgresql://provider-postgresql:5432/edc - - edc.datasource.contractnegotiation.name=contractnegotiation - edc.datasource.contractnegotiation.user= - edc.datasource.contractnegotiation.url=jdbc:postgresql://provider-postgresql:5432/edc - - edc.datasource.policy.name=policy - edc.datasource.policy.user= - edc.datasource.policy.url=jdbc:postgresql://provider-postgresql:5432/edc - - edc.datasource.transferprocess.name=transferprocess - edc.datasource.transferprocess.user= - edc.datasource.transferprocess.url=jdbc:postgresql://provider-postgresql:5432/edc - - - # edc.datasource.default.pool.maxIdleConnections= - # edc.datasource.default.pool.maxTotalConnections= - # edc.datasource.default.pool.minIdleConnections= - # edc.datasource.default.pool.testConnectionOnBorrow= - # edc.datasource.default.pool.testConnectionOnCreate= - # edc.datasource.default.pool.testConnectionOnReturn= - # edc.datasource.default.pool.testConnectionWhileIdle= - # edc.datasource.default.pool.testQuery= - edc.datasource.default.url=jdbc:postgresql://provider-postgresql:5432/edc - edc.datasource.default.user= - edc.datasource.default.password= - - edc.data.encryption.algorithm=NONE - edc.data.encryption.keys.alias=edc-encryption-key - # edc.dataplane.selector.httpproxy.url=http://materialpass-edc-provider-dataplane:9999/BPNL000000000000/api/dataplane/control - - # edc.dpf.selector.url= - # edc.events.topic.endpoint= - # edc.events.topic.name= - # edc.fs.config= - # edc.hostname= - # edc.identity.did.url= - # edc.ids.catalog.id= - # edc.ids.curator= - edc.ids.description="Provider Control Plane" - edc.ids.endpoint=https://materialpass.beta.demo.catena-x.net/BPNL000000000000/api/v1/ids - edc.ids.endpoint.audience=https://materialpass.beta.demo.catena-x.net/BPNL000000000000/api/v1/ids/data - - # localhost configuration - # edc.ids.endpoint=http://materialpass-edc-provider-controlplane:8282/BPNL000000000000/api/v1/ids - # edc.ids.endpoint.audience=http://materialpass-edc-provider-controlplane:8282/BPNL000000000000/api/v1/ids/data - # localhost configuration - - # edc.ids.id= - # edc.ids.maintainer= - # edc.ids.security.profile= - # edc.ids.title= - # edc.ids.validation.referringconnector= - # edc.ion.crawler.did-type= - # edc.ion.crawler.interval-minutes= - # edc.ion.crawler.ion.url= - # edc.metrics.enabled= - # edc.metrics.executor.enabled= - # edc.metrics.jersey.enabled= - # edc.metrics.jetty.enabled= - # edc.metrics.okhttp.enabled= - # edc.metrics.system.enabled= - # edc.negotiation.provider.state-machine.batch-size= - # edc.negotiation.provider.state-machine.batch-size= - edc.oauth.client.id= - edc.oauth.private.key.alias=ids-daps_key - edc.oauth.provider.audience=idsc:IDS_CONNECTORS_ALL - # edc.oauth.provider.jwks.refresh= - edc.oauth.provider.jwks.url=https://daps.beta.demo.catena-x.net/.well-known/jwks.json - edc.oauth.public.key.alias=ids-daps_crt - edc.oauth.token.url=https://daps.beta.demo.catena-x.net/token - # edc.oauth.validation.nbf.leeway= - # edc.receiver.http.auth-code= - # edc.receiver.http.auth-key= - edc.receiver.http.endpoint=http://materialpass-edc-provider-backend - edc.transfer.proxy.endpoint=http://materialpass-edc-provider-dataplane:8185/BPNL000000000000/api/public - # edc.transfer.proxy.token.validity.seconds= - edc.transfer.proxy.token.signer.privatekey.alias=ids-daps_key - edc.transfer.proxy.token.verifier.publickey.alias=ids-daps_crt - # edc.transfer.functions.check.endpoint= - # edc.transfer.functions.enabled.protocols= - # edc.transfer.functions.transfer.endpoint= - # edc.transfer-process-store.database.name= - # edc.transfer.state-machine.batch-size= - # edc.vault= - # edc.vault.certificate= - # edc.vault.clientid= - # edc.vault.clientsecret= - # edc.vault.name= - # edc.vault.tenantid= - edc.vault.hashicorp.url= - edc.vault.hashicorp.token= - edc.vault.hashicorp.api.secret.path= - edc.vault.hashicorp.health.check.standby.ok=true - # edc.vault.hashicorp.timeout.seconds= - # edc.webdid.doh.url= - # edc.web.rest.cors.enabled= - # edc.web.rest.cors.headers= - # edc.web.rest.cors.methods= - # edc.web.rest.cors.origins= - ids.webhook.address=https://materialpass.beta.demo.catena-x.net - # ids.webhook.address=http://materialpass-edc-provider-controlplane:8282 diff --git a/deployment/helm/edc-provider/values-dev.yaml b/deployment/helm/edc-provider/values-dev.yaml deleted file mode 100644 index f4efb034a..000000000 --- a/deployment/helm/edc-provider/values-dev.yaml +++ /dev/null @@ -1,293 +0,0 @@ -################################################################################# -# Catena-X - Product Passport Consumer Frontend -# -# 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. -# -# This program and the accompanying materials are made available under the -# terms of the Apache License, Version 2.0 which is available at -# https://www.apache.org/licenses/LICENSE-2.0. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -# either express or implied. See the -# License for the specific language govern in permissions and limitations -# under the License. -# -# SPDX-License-Identifier: Apache-2.0 -################################################################################## - ---- -providerbackendapplication: - enabled: true - fullnameOverride: "materialpass-edc-provider-backend" - service: - type: NodePort - frontend: - port: 80 - backend: - port: 8081 - -postgres: - enabled: true - fullnameOverride: "provider-postgresql" - auth: - password: - username: &psqlUsername - database: "edc" - persistence: - enabled: true - -dataplane: - enabled: true - fullnameOverride: "materialpass-edc-provider-dataplane" - image: - repository: ghcr.io/catenax-ng/product-edc/edc-dataplane-hashicorp-vault - tag: 0.1.6 - pullPolicy: IfNotPresent - envSecretName: "provider-dataplane-secret" - edc: - endpoints: - default: - port: 8080 - path: /BPNL000000000000/api - public: - port: 8185 - path: /BPNL000000000000/api/public - control: - port: 9999 - path: /BPNL000000000000/api/dataplane/control - metrics: - port: 9090 - path: /BPNL000000000000/metrics - ingresses: - - enabled: true - hostname: "materialpass.dev.demo.catena-x.net" - endpoints: - - default - - public - - control - - metrics - className: "nginx" - tls: - # -- Enables TLS on the ingress resource - enabled: true - # -- If present overwrites the default secret name - secretName: "tls-secret" - opentelemetry: - properties: |- - otel.javaagent.enabled=false - otel.javaagent.debug=false - env: - JAVA_TOOL_OPTIONS: "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=1044" - EDC_DATAPLANE_TOKEN_VALIDATION_ENDPOINT: http://materialpass-edc-provider-controlplane:8182/BPNL000000000000/validation/token - - EDC_VAULT_HASHICORP_URL: - EDC_VAULT_HASHICORP_API_SECRET_PATH: - EDC_VAULT_HASHICORP_TOKEN: - EDC_OAUTH_TOKEN_URL: https://daps1.int.demo.catena-x.net/token - EDC_OAUTH_PROVIDER_JWKS_URL: https://daps1.int.demo.catena-x.net/.well-known/jwks.json - EDC_OAUTH_PROVIDER_AUDIENCE: idsc:IDS_CONNECTORS_ALL - EDC_VAULT_HASHICORP_HEALTH_CHECK_STANDBY_OK: "true" - -controlplane: - enabled: true - fullnameOverride: "materialpass-edc-provider-controlplane" - image: - repository: ghcr.io/catenax-ng/product-edc/edc-controlplane-postgresql-hashicorp-vault - tag: 0.1.6 - pullPolicy: IfNotPresent - edc: - endpoints: - default: - port: 8080 - path: /BPNL000000000000/controlplane/api - data: - port: 8181 - path: /BPNL000000000000/data - validation: - port: 8182 - path: /BPNL000000000000/validation - control: - port: 9999 - path: /BPNL000000000000/api/controlplane/control - ids: - port: 8282 - path: /BPNL000000000000/api/v1/ids - metrics: - port: 9090 - path: /BPNL000000000000/controlplane/metrics - ingresses: - - enabled: true - hostname: "materialpass.dev.demo.catena-x.net" - endpoints: - - default - - data - - validation - - control - - ids - - metrics - className: "nginx" - tls: - # -- Enables TLS on the ingress resource - enabled: true - # -- If present overwrites the default secret name - secretName: "tls-secret" - opentelemetry: - properties: |- - otel.javaagent.enabled=false - otel.javaagent.debug=false - envSecretName: "provider-controlplane-secret" - env: - JAVA_TOOL_OPTIONS: "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=1044" - EDC_DATASOURCE_ASSET_NAME: asset - EDC_DATASOURCE_ASSET_USER: *psqlUsername - EDC_DATASOURCE_ASSET_URL: &psqlJdbcUrl "jdbc:postgresql://provider-postgresql:5432/edc" - EDC_DATASOURCE_CONTRACTDEFINITION_NAME: contractdefinition - EDC_DATASOURCE_CONTRACTDEFINITION_USER: *psqlUsername - EDC_DATASOURCE_CONTRACTDEFINITION_URL: *psqlJdbcUrl - EDC_DATASOURCE_CONTRACTNEGOTIATION_NAME: contractnegotiation - EDC_DATASOURCE_CONTRACTNEGOTIATION_USER: *psqlUsername - EDC_DATASOURCE_CONTRACTNEGOTIATION_URL: *psqlJdbcUrl - EDC_DATASOURCE_POLICY_NAME: policy - EDC_DATASOURCE_POLICY_USER: *psqlUsername - EDC_DATASOURCE_POLICY_URL: *psqlJdbcUrl - EDC_DATASOURCE_TRANSFERPROCESS_NAME: transferprocess - EDC_DATASOURCE_TRANSFERPROCESS_USER: *psqlUsername - EDC_DATASOURCE_TRANSFERPROCESS_URL: *psqlJdbcUrl - EDC_API_AUTH_KEY: - EDC_VAULT_HASHICORP_URL: - EDC_VAULT_HASHICORP_API_SECRET_PATH: - EDC_VAULT_HASHICORP_TOKEN: - EDC_VAULT_HASHICORP_HEALTH_CHECK_STANDBY_OK: "true" - - - EDC_DATAPLANE_SELECTOR_PROVIDERPLANE_URL: http://materialpass-edc-provider-dataplane:9999/BPNL000000000000/api/dataplane/control - EDC_DATAPLANE_SELECTOR_PROVIDERPLANE_SOURCETYPES : HttpData - EDC_DATAPLANE_SELECTOR_PROVIDERPLANE_DESTINATIONTYPES: HttpProxy - EDC_DATAPLANE_SELECTOR_PROVIDERPLANE_PROPERTIES: >- - { - "publicApiUrl": "http://materialpass-edc-provider-dataplane:8185/BPNL000000000000/api/public" - } - - configuration: - properties: |- - #edc.api.auth.key= - # edc.atomikos.checkpoint.interval= - # edc.atomikos.directory= - # edc.atomikos.logging= - # edc.atomikos.threaded2pc= - # edc.atomikos.timeout= - # edc.aws.access.key= - # edc.aws.provision.retry.retries.max= - # edc.aws.provision.role.duration.session.max= - # edc.aws.secret.access.key= - # edc.blobstore.endpoint= - # edc.controlplane.validation-endpoint= - # edc.core.retry.backoff.max= - # edc.core.retry.backoff.min= - # edc.core.retry.retries.max= - # edc.core.system.health.check.liveness-period= - # edc.core.system.health.check.readiness-period= - # edc.core.system.health.check.startup-period= - # edc.core.system.health.check.threadpool-size= - # edc.dataplane.queue.capacity= - # edc.dataplane.wait= - # edc.dataplane.workers= - edc.datasource.asset.name=asset - edc.datasource.asset.user= - edc.datasource.asset.url=jdbc:postgresql://provider-postgresql:5432/edc - - edc.datasource.contractdefinition.name=contractdefinition - edc.datasource.contractdefinition.user= - edc.datasource.contractdefinition.url=jdbc:postgresql://provider-postgresql:5432/edc - edc.datasource.contractnegotiation.name=contractnegotiation - edc.datasource.contractnegotiation.user= - edc.datasource.contractnegotiation.url=jdbc:postgresql://provider-postgresql:5432/edc - edc.datasource.policy.name=policy - edc.datasource.policy.user= - edc.datasource.policy.url=jdbc:postgresql://provider-postgresql:5432/edc - edc.datasource.transferprocess.name=transferprocess - edc.datasource.transferprocess.user= - edc.datasource.transferprocess.url=jdbc:postgresql://provider-postgresql:5432/edc - # edc.datasource.default.pool.maxIdleConnections= - # edc.datasource.default.pool.maxTotalConnections= - # edc.datasource.default.pool.minIdleConnections= - # edc.datasource.default.pool.testConnectionOnBorrow= - # edc.datasource.default.pool.testConnectionOnCreate= - # edc.datasource.default.pool.testConnectionOnReturn= - # edc.datasource.default.pool.testConnectionWhileIdle= - # edc.datasource.default.pool.testQuery= - edc.datasource.default.url=jdbc:postgresql://provider-postgresql:5432/edc - edc.datasource.default.user= - edc.datasource.default.password=psql_password - edc.data.encryption.algorithm=NONE - edc.data.encryption.keys.alias=edc-encryption-key - # edc.dataplane.selector.httpproxy.url=http://materialpass-edc-provider-dataplane:9999/BPNL000000000000/api/dataplane/control - # edc.dpf.selector.url= - # edc.events.topic.endpoint= - # edc.events.topic.name= - # edc.fs.config= - # edc.hostname= - # edc.identity.did.url= - # edc.ids.catalog.id= - # edc.ids.curator= - edc.ids.description="Provider Control Plane" - edc.ids.endpoint=https://materialpass.dev.demo.catena-x.net/BPNL000000000000/api/v1/ids - edc.ids.endpoint.audience=https://materialpass.dev.demo.catena-x.net/BPNL000000000000/api/v1/ids/data - # edc.ids.id= - # edc.ids.maintainer= - # edc.ids.security.profile= - # edc.ids.title= - # edc.ids.validation.referringconnector= - # edc.ion.crawler.did-type= - # edc.ion.crawler.interval-minutes= - # edc.ion.crawler.ion.url= - # edc.metrics.enabled= - # edc.metrics.executor.enabled= - # edc.metrics.jersey.enabled= - # edc.metrics.jetty.enabled= - # edc.metrics.okhttp.enabled= - # edc.metrics.system.enabled= - # edc.negotiation.provider.state-machine.batch-size= - # edc.negotiation.provider.state-machine.batch-size= - edc.oauth.client.id= - edc.oauth.private.key.alias=daps-key-dev - edc.oauth.provider.audience=idsc:IDS_CONNECTORS_ALL - # edc.oauth.provider.jwks.refresh= - edc.oauth.provider.jwks.url=https://daps1.int.demo.catena-x.net/.well-known/jwks.json - edc.oauth.public.key.alias=daps-crt-dev - edc.oauth.token.url=https://daps1.int.demo.catena-x.net/token - # edc.oauth.validation.nbf.leeway= - # edc.receiver.http.auth-code= - # edc.receiver.http.auth-key= - edc.receiver.http.endpoint=http://materialpass-edc-provider-backend - edc.transfer.proxy.endpoint=http://materialpass-edc-provider-dataplane:8185/BPNL000000000000/api/public - # edc.transfer.proxy.token.validity.seconds= - edc.transfer.proxy.token.signer.privatekey.alias=daps-key-dev - edc.transfer.proxy.token.verifier.publickey.alias=daps-crt-dev - # edc.transfer.functions.check.endpoint= - # edc.transfer.functions.enabled.protocols= - # edc.transfer.functions.transfer.endpoint= - # edc.transfer-process-store.database.name= - # edc.transfer.state-machine.batch-size= - # edc.vault= - # edc.vault.certificate= - # edc.vault.clientid= - # edc.vault.clientsecret= - # edc.vault.name= - # edc.vault.tenantid= - edc.vault.hashicorp.url= - edc.vault.hashicorp.token= - edc.vault.hashicorp.api.secret.path= - edc.vault.hashicorp.health.check.standby.ok=true - # edc.vault.hashicorp.timeout.seconds= - # edc.webdid.doh.url= - # edc.web.rest.cors.enabled= - # edc.web.rest.cors.headers= - # edc.web.rest.cors.methods= - # edc.web.rest.cors.origins= - ids.webhook.address=https://materialpass.dev.demo.catena-x.net diff --git a/deployment/helm/edc-provider/values-int.yaml b/deployment/helm/edc-provider/values-int.yaml index b15ee92e9..9412b750d 100644 --- a/deployment/helm/edc-provider/values-int.yaml +++ b/deployment/helm/edc-provider/values-int.yaml @@ -1,307 +1,574 @@ -################################################################################# -# Catena-X - Product Passport Consumer Frontend # -# Copyright (c) 2022, 2023 BASF SE, BMW AG, Henkel AG & Co. KGaA +# Copyright (c) 2023 ZF Friedrichshafen AG +# Copyright (c) 2023 Mercedes-Benz Tech Innovation GmbH +# Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +# Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation # -# See the NOTICE file(s) distributed with this work for additional -# information regarding copyright ownership. +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. # -# This program and the accompanying materials are made available under the -# terms of the Apache License, Version 2.0 which is available at -# https://www.apache.org/licenses/LICENSE-2.0. +# This program and the accompanying materials are made available under the +# terms of the Apache License, Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 # -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -# either express or implied. See the -# License for the specific language govern in permissions and limitations -# under the License. +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. # -# SPDX-License-Identifier: Apache-2.0 -################################################################################## +# SPDX-License-Identifier: Apache-2.0 +# + --- -providerbackendapplication: - enabled: true - fullnameOverride: "materialpass-edc-provider-backend" - service: - type: NodePort - frontend: - port: 80 - backend: - port: 8081 -postgres: - enabled: true - fullnameOverride: "provider-postgresql" - auth: - password: - username: &psqlUsername - database: "edc" - persistence: - enabled: true -dataplane: - enabled: true - fullnameOverride: "materialpass-edc-provider-dataplane" - image: - repository: ghcr.io/catenax-ng/product-edc/edc-dataplane-hashicorp-vault - tag: 0.1.6 - pullPolicy: IfNotPresent - envSecretName: "provider-dataplane-secret" - edc: +tractusx-connector: + install: + daps: false + postgresql: false + vault: false + fullnameOverride: "dpp-edc-provider" + nameOverride: "" + # -- Existing image pull secret to use to [obtain the container image from private registries](https://kubernetes.io/docs/concepts/containers/images/#using-a-private-registry) + imagePullSecrets: [] + customLabels: {} + + + participant: + id: &bpnNumber "" + + controlplane: + enabled: true + image: + # -- Which derivate of the control plane to use. when left empty the deployment will select the correct image automatically + repository: "tractusx/edc-controlplane-postgresql-hashicorp-vault" + # -- [Kubernetes image pull policy](https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy) to use + pullPolicy: IfNotPresent + # -- Overrides the image tag whose default is the chart appVersion + tag: "0.4.1" + initContainers: [] + debug: + enabled: false + port: 1044 + suspendOnStart: false + internationalDataSpaces: + id: TXDC + description: Tractus-X Eclipse IDS Data Space Connector + title: "" + maintainer: "" + curator: "" + catalogId: TXDC-Catalog + livenessProbe: + # -- Whether to enable kubernetes [liveness-probe](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) + enabled: true + # -- seconds to wait before performing the first liveness check + initialDelaySeconds: 30 + # -- this fields specifies that kubernetes should perform a liveness check every 10 seconds + periodSeconds: 10 + # -- number of seconds after which the probe times out + timeoutSeconds: 5 + # -- when a probe fails kubernetes will try 6 times before giving up + failureThreshold: 6 + # -- number of consecutive successes for the probe to be considered successful after having failed + successThreshold: 1 + readinessProbe: + # -- Whether to enable kubernetes [readiness-probes](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) + enabled: true + # -- seconds to wait before performing the first readiness check + initialDelaySeconds: 30 + # -- this fields specifies that kubernetes should perform a readiness check every 10 seconds + periodSeconds: 10 + # -- number of seconds after which the probe times out + timeoutSeconds: 5 + # -- when a probe fails kubernetes will try 6 times before giving up + failureThreshold: 6 + # -- number of consecutive successes for the probe to be considered successful after having failed + successThreshold: 1 + # -- endpoints of the control plane endpoints: + # -- default api for health checks, should not be added to any ingress default: + # -- port for incoming api calls port: 8080 + # -- path for incoming api calls path: /BPNL000000000000/api - public: - port: 8185 - path: /BPNL000000000000/api/public + # -- data management api, used by internal users, can be added to an ingress and must not be internet facing + management: + # -- port for incoming api calls + port: 8081 + # -- path for incoming api calls + path: /BPNL000000000000/management + # -- authentication key, must be attached to each 'X-Api-Key' request header + authKey: + # -- control api, used for internal control calls. can be added to the internal ingress, but should probably not control: - port: 9999 - path: /BPNL000000000000/api/dataplane/control + # -- port for incoming api calls + port: 8083 + # -- path for incoming api calls + path: /BPNL000000000000/control + # -- ids api, used for inter connector communication and must be internet facing + protocol: + # -- port for incoming api calls + port: 8084 + # -- path for incoming api calls + path: /BPNL000000000000/api/v1/dsp + # -- metrics api, used for application metrics, must not be internet facing metrics: + # -- port for incoming api calls port: 9090 + # -- path for incoming api calls path: /BPNL000000000000/metrics - ingresses: - - enabled: true - hostname: "materialpass.int.demo.catena-x.net" - endpoints: - - default - - public - - control - - metrics - className: "nginx" - tls: - # -- Enables TLS on the ingress resource - enabled: true - # -- If present overwrites the default secret name - secretName: "tls-secret" - opentelemetry: - properties: |- - otel.javaagent.enabled=false - otel.javaagent.debug=false - env: - JAVA_TOOL_OPTIONS: "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=1044" - EDC_DATAPLANE_TOKEN_VALIDATION_ENDPOINT: http://materialpass-edc-provider-controlplane:8182/BPNL000000000000/validation/token + # -- observability api with unsecured access, must not be internet facing + observability: + # -- port for incoming API calls + port: 8085 + # -- observability api, provides /health /readiness and /liveness endpoints + path: /BPNL000000000000/observability + # -- allow or disallow insecure access, i.e. access without authentication + insecure: true + businessPartnerValidation: + log: + agreementValidation: true + service: + # -- [Service type](https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types) to expose the running application on a set of Pods as a network service. + type: ClusterIP + annotations: {} + # -- additional labels for the pod + podLabels: {} + # -- additional annotations for the pod + podAnnotations: {} + # -- The [pod security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod) defines privilege and access control settings for a Pod within the deployment + podSecurityContext: + seccompProfile: + # -- Restrict a Container's Syscalls with seccomp + type: RuntimeDefault + # -- Runs all processes within a pod with a special uid + runAsUser: 10001 + # -- Processes within a pod will belong to this guid + runAsGroup: 10001 + # -- The owner for volumes and any files created within volumes will belong to this guid + fsGroup: 10001 + # The [container security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container) defines privilege and access control settings for a Container within a pod + securityContext: + capabilities: + # -- Specifies which capabilities to drop to reduce syscall attack surface + drop: + - ALL + # -- Specifies which capabilities to add to issue specialized syscalls + add: [] + # -- Whether the root filesystem is mounted in read-only mode + readOnlyRootFilesystem: true + # -- Controls [Privilege Escalation](https://kubernetes.io/docs/concepts/security/pod-security-policy/#privilege-escalation) enabling setuid binaries changing the effective user ID + allowPrivilegeEscalation: false + # -- Requires the container to run without root privileges + runAsNonRoot: true + # -- The container's process will run with the specified uid + runAsUser: 10001 + # Extra environment variables that will be pass onto deployment pods + env: {} + # ENV_NAME: value + + # "valueFrom" environment variable references that will be added to deployment pods. Name is templated. + # ref: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.19/#envvarsource-v1-core + envValueFrom: {} + # ENV_NAME: + # configMapKeyRef: + # name: configmap-name + # key: value_key + # secretKeyRef: + # name: secret-name + # key: value_key - EDC_VAULT_HASHICORP_URL: - EDC_VAULT_HASHICORP_API_SECRET_PATH: - EDC_VAULT_HASHICORP_TOKEN: - EDC_OAUTH_TOKEN_URL: https://daps1.int.demo.catena-x.net/token - EDC_OAUTH_PROVIDER_JWKS_URL: https://daps1.int.demo.catena-x.net/.well-known/jwks.json - EDC_OAUTH_PROVIDER_AUDIENCE: idsc:IDS_CONNECTORS_ALL - EDC_VAULT_HASHICORP_HEALTH_CHECK_STANDBY_OK: "true" + # [Kubernetes Secret Resource](https://kubernetes.io/docs/concepts/configuration/secret/) names to load environment variables from + envSecretNames: [] + # - first-secret + # - second-secret -controlplane: - enabled: true - fullnameOverride: "materialpass-edc-provider-controlplane" - image: - repository: ghcr.io/catenax-ng/product-edc/edc-controlplane-postgresql-hashicorp-vault - tag: 0.1.6 - pullPolicy: IfNotPresent - edc: + # [Kubernetes ConfigMap Resource](https://kubernetes.io/docs/concepts/configuration/configmap/) names to load environment variables from + envConfigMapNames: [] + # - first-config-map + # - second-config-map + + ## Ingress declaration to expose the network service. + ingresses: + ## Public / Internet facing Ingress + - enabled: true + # -- The hostname to be used to precisely map incoming traffic onto the underlying network service + hostname: "materialpass.int.demo.catena-x.net" + # -- Additional ingress annotations to add + annotations: {} + # -- EDC endpoints exposed by this ingress resource + endpoints: + - default + - management + - control + - protocol + - metrics + - observability + # -- Defines the [ingress class](https://kubernetes.io/docs/concepts/services-networking/ingress/#ingress-class) to use + className: "nginx" + # -- TLS [tls class](https://kubernetes.io/docs/concepts/services-networking/ingress/#tls) applied to the ingress resource + tls: + # -- Enables TLS on the ingress resource + enabled: true + # -- If present overwrites the default secret name + secretName: "tls-secret" + ## Adds [cert-manager](https://cert-manager.io/docs/) annotations to the ingress resource + certManager: + # -- If preset enables certificate generation via cert-manager namespace scoped issuer + issuer: "" + # -- If preset enables certificate generation via cert-manager cluster-wide issuer + clusterIssuer: "" + ## Private / Intranet facing Ingress + - enabled: false + # -- The hostname to be used to precisely map incoming traffic onto the underlying network service + hostname: "edc-control.intranet" + # -- Additional ingress annotations to add + annotations: {} + # -- EDC endpoints exposed by this ingress resource + endpoints: + - management + - control + # -- Defines the [ingress class](https://kubernetes.io/docs/concepts/services-networking/ingress/#ingress-class) to use + className: "nginx" + # -- TLS [tls class](https://kubernetes.io/docs/concepts/services-networking/ingress/#tls) applied to the ingress resource + tls: + # -- Enables TLS on the ingress resource + enabled: true + # -- If present overwrites the default secret name + secretName: "tls-secret" + ## Adds [cert-manager](https://cert-manager.io/docs/) annotations to the ingress resource + certManager: + # -- If preset enables certificate generation via cert-manager namespace scoped issuer + issuer: "" + # -- If preset enables certificate generation via cert-manager cluster-wide issuer + clusterIssuer: "" + # -- declare where to mount [volumes](https://kubernetes.io/docs/concepts/storage/volumes/) into the container + volumeMounts: [] + # -- [volume](https://kubernetes.io/docs/concepts/storage/volumes/) directories + volumes: [] + # -- [resource management](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) for the container + resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + replicaCount: 1 + autoscaling: + # -- Enables [horizontal pod autoscaling](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/) + enabled: false + # -- Minimal replicas if resource consumption falls below resource threshholds + minReplicas: 1 + # -- Maximum replicas if resource consumption exceeds resource threshholds + maxReplicas: 100 + # -- targetAverageUtilization of cpu provided to a pod + targetCPUUtilizationPercentage: 80 + # -- targetAverageUtilization of memory provided to a pod + targetMemoryUtilizationPercentage: 80 + # -- configuration of the [Open Telemetry Agent](https://opentelemetry.io/docs/instrumentation/java/automatic/agent-config/) to collect and expose metrics + opentelemetry: |- + otel.javaagent.enabled=false + otel.javaagent.debug=false + # -- configuration of the [Java Util Logging Facade](https://docs.oracle.com/javase/7/docs/technotes/guides/logging/overview.html) + logging: |- + .level=INFO + org.eclipse.edc.level=ALL + handlers=java.util.logging.ConsoleHandler + java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter + java.util.logging.ConsoleHandler.level=ALL + java.util.logging.SimpleFormatter.format=[%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS] [%4$-7s] %5$s%6$s%n + # [node selector](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector) to constrain pods to nodes + nodeSelector: {} + # [tolerations](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) to configure preferred nodes + tolerations: [] + # [affinity](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity) to configure which nodes the pods can be scheduled on + affinity: {} + url: + # -- Explicitly declared url for reaching the ids api (e.g. if ingresses not used) + ids: "" + dataplane: + enabled: true + image: + # -- Which derivate of the data plane to use. when left empty the deployment will select the correct image automatically + repository: "tractusx/edc-dataplane-hashicorp-vault" + # -- [Kubernetes image pull policy](https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy) to use + pullPolicy: IfNotPresent + # -- Overrides the image tag whose default is the chart appVersion + tag: "0.4.1" + initContainers: [] + debug: + enabled: false + port: 1044 + suspendOnStart: false + livenessProbe: + # -- Whether to enable kubernetes [liveness-probe](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) + enabled: true + # -- seconds to wait before performing the first liveness check + initialDelaySeconds: 30 + # -- this fields specifies that kubernetes should perform a liveness check every 10 seconds + periodSeconds: 10 + # -- number of seconds after which the probe times out + timeoutSeconds: 5 + # -- when a probe fails kubernetes will try 6 times before giving up + failureThreshold: 6 + # -- number of consecutive successes for the probe to be considered successful after having failed + successThreshold: 1 + readinessProbe: + # -- Whether to enable kubernetes [readiness-probes](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) + enabled: true + # -- seconds to wait before performing the first readiness check + initialDelaySeconds: 30 + # -- this fields specifies that kubernetes should perform a liveness check every 10 seconds + periodSeconds: 10 + # -- number of seconds after which the probe times out + timeoutSeconds: 5 + # -- when a probe fails kubernetes will try 6 times before giving up + failureThreshold: 6 + # -- number of consecutive successes for the probe to be considered successful after having failed + successThreshold: 1 + service: + # -- [Service type](https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types) to expose the running application on a set of Pods as a network service. + type: ClusterIP + port: 80 endpoints: default: port: 8080 - path: /BPNL000000000000/controlplane/api - data: - port: 8181 - path: /BPNL000000000000/data - validation: - port: 8182 - path: /BPNL000000000000/validation + path: /BPNL000000000000/api + public: + port: 8081 + path: /BPNL000000000000/api/public control: - port: 9999 - path: /BPNL000000000000/api/controlplane/control - ids: - port: 8282 - path: /BPNL000000000000/api/v1/ids + port: 8083 + path: /BPNL000000000000/api/dataplane/control + proxy: + port: 8186 + path: /BPNL000000000000/proxy + observability: + # -- port for incoming API calls + port: 8085 + # -- observability api, provides /health /readiness and /liveness endpoints + path: /BPNL000000000000/observability + # -- allow or disallow insecure access, i.e. access without authentication + insecure: true metrics: port: 9090 - path: /BPNL000000000000/controlplane/metrics - ingresses: - - enabled: true - hostname: "materialpass.int.demo.catena-x.net" - endpoints: - - default - - data - - validation - - control - - ids - - metrics - className: "nginx" - tls: - # -- Enables TLS on the ingress resource - enabled: true - # -- If present overwrites the default secret name - secretName: "tls-secret" - opentelemetry: - properties: |- - otel.javaagent.enabled=false - otel.javaagent.debug=false - envSecretName: "provider-controlplane-secret" - env: - JAVA_TOOL_OPTIONS: "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=1044" - EDC_DATASOURCE_ASSET_NAME: asset - EDC_DATASOURCE_ASSET_USER: *psqlUsername - EDC_DATASOURCE_ASSET_URL: &psqlJdbcUrl "jdbc:postgresql://provider-postgresql:5432/edc" - EDC_DATASOURCE_CONTRACTDEFINITION_NAME: contractdefinition - EDC_DATASOURCE_CONTRACTDEFINITION_USER: *psqlUsername - EDC_DATASOURCE_CONTRACTDEFINITION_URL: *psqlJdbcUrl - EDC_DATASOURCE_CONTRACTNEGOTIATION_NAME: contractnegotiation - EDC_DATASOURCE_CONTRACTNEGOTIATION_USER: *psqlUsername - EDC_DATASOURCE_CONTRACTNEGOTIATION_URL: *psqlJdbcUrl - EDC_DATASOURCE_POLICY_NAME: policy - EDC_DATASOURCE_POLICY_USER: *psqlUsername - EDC_DATASOURCE_POLICY_URL: *psqlJdbcUrl - EDC_DATASOURCE_TRANSFERPROCESS_NAME: transferprocess - EDC_DATASOURCE_TRANSFERPROCESS_USER: *psqlUsername - EDC_DATASOURCE_TRANSFERPROCESS_URL: *psqlJdbcUrl - EDC_API_AUTH_KEY: - EDC_VAULT_HASHICORP_URL: - EDC_VAULT_HASHICORP_API_SECRET_PATH: - EDC_VAULT_HASHICORP_TOKEN: - EDC_VAULT_HASHICORP_HEALTH_CHECK_STANDBY_OK: "true" + path: /BPNL000000000000/metrics + aws: + endpointOverride: "" + accessKeyId: "" + secretAccessKey: "" + # -- additional labels for the pod + podLabels: {} + # -- additional annotations for the pod + podAnnotations: {} + # -- The [pod security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod) defines privilege and access control settings for a Pod within the deployment + podSecurityContext: + seccompProfile: + # -- Restrict a Container's Syscalls with seccomp + type: RuntimeDefault + # -- Runs all processes within a pod with a special uid + runAsUser: 10001 + # -- Processes within a pod will belong to this guid + runAsGroup: 10001 + # -- The owner for volumes and any files created within volumes will belong to this guid + fsGroup: 10001 + # The [container security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container) defines privilege and access control settings for a Container within a pod + securityContext: + capabilities: + # -- Specifies which capabilities to drop to reduce syscall attack surface + drop: + - ALL + # -- Specifies which capabilities to add to issue specialized syscalls + add: [] + # -- Whether the root filesystem is mounted in read-only mode + readOnlyRootFilesystem: true + # -- Controls [Privilege Escalation](https://kubernetes.io/docs/concepts/security/pod-security-policy/#privilege-escalation) enabling setuid binaries changing the effective user ID + allowPrivilegeEscalation: false + # -- Requires the container to run without root privileges + runAsNonRoot: true + # -- The container's process will run with the specified uid + runAsUser: 10001 + # Extra environment variables that will be pass onto deployment pods + env: {} + # ENV_NAME: value - - EDC_DATAPLANE_SELECTOR_PROVIDERPLANE_URL: http://materialpass-edc-provider-dataplane:9999/BPNL000000000000/api/dataplane/control - EDC_DATAPLANE_SELECTOR_PROVIDERPLANE_SOURCETYPES : HttpData - EDC_DATAPLANE_SELECTOR_PROVIDERPLANE_DESTINATIONTYPES: HttpProxy - EDC_DATAPLANE_SELECTOR_PROVIDERPLANE_PROPERTIES: >- - { - "publicApiUrl": "http://materialpass-edc-provider-dataplane:8185/BPNL000000000000/api/public" - } - - configuration: - properties: |- - #edc.api.auth.key= - # edc.atomikos.checkpoint.interval= - # edc.atomikos.directory= - # edc.atomikos.logging= - # edc.atomikos.threaded2pc= - # edc.atomikos.timeout= - # edc.aws.access.key= - # edc.aws.provision.retry.retries.max= - # edc.aws.provision.role.duration.session.max= - # edc.aws.secret.access.key= - # edc.blobstore.endpoint= - # edc.controlplane.validation-endpoint= - # edc.core.retry.backoff.max= - # edc.core.retry.backoff.min= - # edc.core.retry.retries.max= - # edc.core.system.health.check.liveness-period= - # edc.core.system.health.check.readiness-period= - # edc.core.system.health.check.startup-period= - # edc.core.system.health.check.threadpool-size= - # edc.dataplane.queue.capacity= - # edc.dataplane.wait= - # edc.dataplane.workers= - edc.datasource.asset.name=asset - edc.datasource.asset.user= - edc.datasource.asset.url=jdbc:postgresql://provider-postgresql:5432/edc - - edc.datasource.contractdefinition.name=contractdefinition - edc.datasource.contractdefinition.user= - edc.datasource.contractdefinition.url=jdbc:postgresql://provider-postgresql:5432/edc + # "valueFrom" environment variable references that will be added to deployment pods. Name is templated. + # ref: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.19/#envvarsource-v1-core + envValueFrom: {} + # ENV_NAME: + # configMapKeyRef: + # name: configmap-name + # key: value_key + # secretKeyRef: + # name: secret-name + # key: value_key - edc.datasource.contractnegotiation.name=contractnegotiation - edc.datasource.contractnegotiation.user= - edc.datasource.contractnegotiation.url=jdbc:postgresql://provider-postgresql:5432/edc + # [Kubernetes Secret Resource](https://kubernetes.io/docs/concepts/configuration/secret/) names to load environment variables from + envSecretNames: [] + # - first-secret + # - second-secret - edc.datasource.policy.name=policy - edc.datasource.policy.user= - edc.datasource.policy.url=jdbc:postgresql://provider-postgresql:5432/edc + # [Kubernetes ConfigMap Resource](https://kubernetes.io/docs/concepts/configuration/configmap/) names to load environment variables from + envConfigMapNames: [] + # - first-config-map + # - second-config-map - edc.datasource.transferprocess.name=transferprocess - edc.datasource.transferprocess.user= - edc.datasource.transferprocess.url=jdbc:postgresql://provider-postgresql:5432/edc + ## Ingress declaration to expose the network service. + ingresses: + ## Public / Internet facing Ingress + - enabled: true + # -- The hostname to be used to precisely map incoming traffic onto the underlying network service + hostname: "materialpass.int.demo.catena-x.net" + # -- Additional ingress annotations to add + annotations: {} + # -- EDC endpoints exposed by this ingress resource + endpoints: + - public + # -- Defines the [ingress class](https://kubernetes.io/docs/concepts/services-networking/ingress/#ingress-class) to use + className: "nginx" + # -- TLS [tls class](https://kubernetes.io/docs/concepts/services-networking/ingress/#tls) applied to the ingress resource + tls: + # -- Enables TLS on the ingress resource + enabled: true + # -- If present overwrites the default secret name + secretName: "tls-secret" + ## Adds [cert-manager](https://cert-manager.io/docs/) annotations to the ingress resource + certManager: + # -- If preset enables certificate generation via cert-manager namespace scoped issuer + issuer: "" + # -- If preset enables certificate generation via cert-manager cluster-wide issuer + clusterIssuer: "" + # -- declare where to mount [volumes](https://kubernetes.io/docs/concepts/storage/volumes/) into the container + volumeMounts: [] + # -- [volume](https://kubernetes.io/docs/concepts/storage/volumes/) directories + volumes: [] + # -- [resource management](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) for the container + resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + replicaCount: 1 + autoscaling: + # -- Enables [horizontal pod autoscaling](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/) + enabled: false + # -- Minimal replicas if resource consumption falls below resource threshholds + minReplicas: 1 + # -- Maximum replicas if resource consumption exceeds resource threshholds + maxReplicas: 100 + # -- targetAverageUtilization of cpu provided to a pod + targetCPUUtilizationPercentage: 80 + # -- targetAverageUtilization of memory provided to a pod + targetMemoryUtilizationPercentage: 80 + # -- configuration of the [Open Telemetry Agent](https://opentelemetry.io/docs/instrumentation/java/automatic/agent-config/) to collect and expose metrics + opentelemetry: |- + otel.javaagent.enabled=false + otel.javaagent.debug=false + # -- configuration of the [Java Util Logging Facade](https://docs.oracle.com/javase/7/docs/technotes/guides/logging/overview.html) + logging: |- + .level=INFO + org.eclipse.edc.level=ALL + handlers=java.util.logging.ConsoleHandler + java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter + java.util.logging.ConsoleHandler.level=ALL + java.util.logging.SimpleFormatter.format=[%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS] [%4$-7s] %5$s%6$s%n + # [node selector](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector) to constrain pods to nodes + nodeSelector: {} + # [tolerations](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) to configure preferred nodes + tolerations: [] + # [affinity](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity) to configure which nodes the pods can be scheduled on + affinity: {} + url: + # -- Explicitly declared url for reaching the public api (e.g. if ingresses not used) + public: "" + postgresql: + jdbcUrl: "jdbc:postgresql://postgresqlprovider:5432/edc" + fullnameOverride: "postgresql" + username: + password: + auth: + database: "edc" + username: + password: - # edc.datasource.default.pool.maxIdleConnections= - # edc.datasource.default.pool.maxTotalConnections= - # edc.datasource.default.pool.minIdleConnections= - # edc.datasource.default.pool.testConnectionOnBorrow= - # edc.datasource.default.pool.testConnectionOnCreate= - # edc.datasource.default.pool.testConnectionOnReturn= - # edc.datasource.default.pool.testConnectionWhileIdle= - # edc.datasource.default.pool.testQuery= - edc.datasource.default.url=jdbc:postgresql://provider-postgresql:5432/edc - edc.datasource.default.user= - edc.datasource.default.password= + vault: + fullnameOverride: "vault" + injector: + enabled: false + server: + dev: + enabled: true + devRootToken: "root" + # Must be the same certificate that is configured in section 'daps' + postStart: # must be set externally! + hashicorp: + url: + token: + timeout: 30 + healthCheck: + enabled: true + standbyOk: true + paths: + secret: + health: /v1/sys/health + secretNames: + transferProxyTokenSignerPrivateKey: ids-daps_key + transferProxyTokenSignerPublicKey: ids-daps_crt + transferProxyTokenEncryptionAesKey: edc-encryption-key + dapsPrivateKey: ids-daps_key + dapsPublicKey: ids-daps_crt - edc.data.encryption.algorithm=NONE - edc.data.encryption.keys.alias=edc-encryption-key - # edc.dataplane.selector.httpproxy.url=http://materialpass-edc-provider-dataplane:9999/BPNL000000000000/api/dataplane/control + daps: + fullnameOverride: "daps" + url: "https://daps1.int.demo.catena-x.net" + clientId: + paths: + jwks: /.well-known/jwks.json + token: /token - # edc.dpf.selector.url= - # edc.events.topic.endpoint= - # edc.events.topic.name= - # edc.fs.config= - # edc.hostname= - # edc.identity.did.url= - # edc.ids.catalog.id= - # edc.ids.curator= - edc.ids.description="Provider Control Plane" - edc.ids.endpoint=https://materialpass.int.demo.catena-x.net/BPNL000000000000/api/v1/ids - edc.ids.endpoint.audience=https://materialpass.int.demo.catena-x.net/BPNL000000000000/api/v1/ids/data + backendService: + httpProxyTokenReceiverUrl: "http://dpp-edc-consumer-backend" - # localhost configuration - # edc.ids.endpoint=http://materialpass-edc-provider-controlplane:8282/BPNL000000000000/api/v1/ids - # edc.ids.endpoint.audience=http://materialpass-edc-provider-controlplane:8282/BPNL000000000000/api/v1/ids/data - # localhost configuration + serviceAccount: + # Specifies whether a service account should be created + create: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + # -- Existing image pull secret bound to the service account to use to [obtain the container image from private registries](https://kubernetes.io/docs/concepts/containers/images/#using-a-private-registry) + imagePullSecrets: [] + + idsdaps: + connectors: + - certificate: - # edc.ids.id= - # edc.ids.maintainer= - # edc.ids.security.profile= - # edc.ids.title= - # edc.ids.validation.referringconnector= - # edc.ion.crawler.did-type= - # edc.ion.crawler.interval-minutes= - # edc.ion.crawler.ion.url= - # edc.metrics.enabled= - # edc.metrics.executor.enabled= - # edc.metrics.jersey.enabled= - # edc.metrics.jetty.enabled= - # edc.metrics.okhttp.enabled= - # edc.metrics.system.enabled= - # edc.negotiation.provider.state-machine.batch-size= - # edc.negotiation.provider.state-machine.batch-size= - edc.oauth.client.id= - edc.oauth.private.key.alias=ids-daps_key - edc.oauth.provider.audience=idsc:IDS_CONNECTORS_ALL - # edc.oauth.provider.jwks.refresh= - edc.oauth.provider.jwks.url=https://daps1.int.demo.catena-x.net/.well-known/jwks.json - edc.oauth.public.key.alias=ids-daps_crt - edc.oauth.token.url=https://daps1.int.demo.catena-x.net/token - # edc.oauth.validation.nbf.leeway= - # edc.receiver.http.auth-code= - # edc.receiver.http.auth-key= - edc.receiver.http.endpoint=http://materialpass-edc-provider-backend - edc.transfer.proxy.endpoint=http://materialpass-edc-provider-dataplane:8185/BPNL000000000000/api/public - # edc.transfer.proxy.token.validity.seconds= - edc.transfer.proxy.token.signer.privatekey.alias=ids-daps_key - edc.transfer.proxy.token.verifier.publickey.alias=ids-daps_crt - # edc.transfer.functions.check.endpoint= - # edc.transfer.functions.enabled.protocols= - # edc.transfer.functions.transfer.endpoint= - # edc.transfer-process-store.database.name= - # edc.transfer.state-machine.batch-size= - # edc.vault= - # edc.vault.certificate= - # edc.vault.clientid= - # edc.vault.clientsecret= - # edc.vault.name= - # edc.vault.tenantid= - edc.vault.hashicorp.url= - edc.vault.hashicorp.token= - edc.vault.hashicorp.api.secret.path= - edc.vault.hashicorp.health.check.standby.ok=true - # edc.vault.hashicorp.timeout.seconds= - # edc.webdid.doh.url= - # edc.web.rest.cors.enabled= - # edc.web.rest.cors.headers= - # edc.web.rest.cors.methods= - # edc.web.rest.cors.origins= - ids.webhook.address=https://materialpass.int.demo.catena-x.net - # ids.webhook.address=http://materialpass-edc-provider-controlplane:8282 +postgresql: + jdbcUrl: "jdbc:postgresql://postgresqlprovider:5432/edc" + fullnameOverride: "postgresqlprovider" + primary: + persistence: + enabled: true + readReplicas: + persistence: + enabled: true + auth: + database: "edc" + username: + password: \ No newline at end of file From 50fadf6329e217e6b8195e6df4cd4c1f110c976e Mon Sep 17 00:00:00 2001 From: Mathias Brunkow Moser Date: Mon, 5 Jun 2023 09:29:31 +0200 Subject: [PATCH 05/35] feat: added edc-provider in version v0.4.1 --- deployment/helm/edc-provider/README.md.gotmpl | 26 + deployment/helm/edc-provider/values.yaml | 574 ++++++++++++++++++ 2 files changed, 600 insertions(+) create mode 100644 deployment/helm/edc-provider/README.md.gotmpl create mode 100644 deployment/helm/edc-provider/values.yaml diff --git a/deployment/helm/edc-provider/README.md.gotmpl b/deployment/helm/edc-provider/README.md.gotmpl new file mode 100644 index 000000000..b1671f5a2 --- /dev/null +++ b/deployment/helm/edc-provider/README.md.gotmpl @@ -0,0 +1,26 @@ +{{ template "chart.header" . }} + +{{ template "chart.deprecationWarning" . }} + +{{ template "chart.badgesSection" . }} + +{{ template "chart.description" . }} + +{{ template "chart.homepageLine" . }} + +## TL;DR + +```shell +helm repo add tractusx-edc https://eclipse-tractusx.github.io/charts/dev +helm install my-release tractusx-edc/tractusx-connector --version {{ .Version }} +``` + +{{ template "chart.maintainersSection" . }} + +{{ template "chart.sourcesSection" . }} + +{{ template "chart.requirementsSection" . }} + +{{ template "chart.valuesSection" . }} + +{{ template "helm-docs.versionFooter" . }} diff --git a/deployment/helm/edc-provider/values.yaml b/deployment/helm/edc-provider/values.yaml new file mode 100644 index 000000000..3a4ca1191 --- /dev/null +++ b/deployment/helm/edc-provider/values.yaml @@ -0,0 +1,574 @@ +# +# Copyright (c) 2023 ZF Friedrichshafen AG +# Copyright (c) 2023 Mercedes-Benz Tech Innovation GmbH +# Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +# Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License, Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +# SPDX-License-Identifier: Apache-2.0 +# + + +--- + + +tractusx-connector: + install: + daps: false + postgresql: false + vault: false + fullnameOverride: "dpp-edc-provider" + nameOverride: "" + # -- Existing image pull secret to use to [obtain the container image from private registries](https://kubernetes.io/docs/concepts/containers/images/#using-a-private-registry) + imagePullSecrets: [] + customLabels: {} + + + participant: + id: &bpnNumber "" + + controlplane: + enabled: true + image: + # -- Which derivate of the control plane to use. when left empty the deployment will select the correct image automatically + repository: "tractusx/edc-controlplane-postgresql-hashicorp-vault" + # -- [Kubernetes image pull policy](https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy) to use + pullPolicy: IfNotPresent + # -- Overrides the image tag whose default is the chart appVersion + tag: "0.4.1" + initContainers: [] + debug: + enabled: false + port: 1044 + suspendOnStart: false + internationalDataSpaces: + id: TXDC + description: Tractus-X Eclipse IDS Data Space Connector + title: "" + maintainer: "" + curator: "" + catalogId: TXDC-Catalog + livenessProbe: + # -- Whether to enable kubernetes [liveness-probe](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) + enabled: true + # -- seconds to wait before performing the first liveness check + initialDelaySeconds: 30 + # -- this fields specifies that kubernetes should perform a liveness check every 10 seconds + periodSeconds: 10 + # -- number of seconds after which the probe times out + timeoutSeconds: 5 + # -- when a probe fails kubernetes will try 6 times before giving up + failureThreshold: 6 + # -- number of consecutive successes for the probe to be considered successful after having failed + successThreshold: 1 + readinessProbe: + # -- Whether to enable kubernetes [readiness-probes](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) + enabled: true + # -- seconds to wait before performing the first readiness check + initialDelaySeconds: 30 + # -- this fields specifies that kubernetes should perform a readiness check every 10 seconds + periodSeconds: 10 + # -- number of seconds after which the probe times out + timeoutSeconds: 5 + # -- when a probe fails kubernetes will try 6 times before giving up + failureThreshold: 6 + # -- number of consecutive successes for the probe to be considered successful after having failed + successThreshold: 1 + # -- endpoints of the control plane + endpoints: + # -- default api for health checks, should not be added to any ingress + default: + # -- port for incoming api calls + port: 8080 + # -- path for incoming api calls + path: /BPNL000000000000/api + # -- data management api, used by internal users, can be added to an ingress and must not be internet facing + management: + # -- port for incoming api calls + port: 8081 + # -- path for incoming api calls + path: /BPNL000000000000/management + # -- authentication key, must be attached to each 'X-Api-Key' request header + authKey: + # -- control api, used for internal control calls. can be added to the internal ingress, but should probably not + control: + # -- port for incoming api calls + port: 8083 + # -- path for incoming api calls + path: /BPNL000000000000/control + # -- ids api, used for inter connector communication and must be internet facing + protocol: + # -- port for incoming api calls + port: 8084 + # -- path for incoming api calls + path: /BPNL000000000000/api/v1/dsp + # -- metrics api, used for application metrics, must not be internet facing + metrics: + # -- port for incoming api calls + port: 9090 + # -- path for incoming api calls + path: /BPNL000000000000/metrics + # -- observability api with unsecured access, must not be internet facing + observability: + # -- port for incoming API calls + port: 8085 + # -- observability api, provides /health /readiness and /liveness endpoints + path: /BPNL000000000000/observability + # -- allow or disallow insecure access, i.e. access without authentication + insecure: true + businessPartnerValidation: + log: + agreementValidation: true + service: + # -- [Service type](https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types) to expose the running application on a set of Pods as a network service. + type: ClusterIP + annotations: {} + # -- additional labels for the pod + podLabels: {} + # -- additional annotations for the pod + podAnnotations: {} + # -- The [pod security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod) defines privilege and access control settings for a Pod within the deployment + podSecurityContext: + seccompProfile: + # -- Restrict a Container's Syscalls with seccomp + type: RuntimeDefault + # -- Runs all processes within a pod with a special uid + runAsUser: 10001 + # -- Processes within a pod will belong to this guid + runAsGroup: 10001 + # -- The owner for volumes and any files created within volumes will belong to this guid + fsGroup: 10001 + # The [container security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container) defines privilege and access control settings for a Container within a pod + securityContext: + capabilities: + # -- Specifies which capabilities to drop to reduce syscall attack surface + drop: + - ALL + # -- Specifies which capabilities to add to issue specialized syscalls + add: [] + # -- Whether the root filesystem is mounted in read-only mode + readOnlyRootFilesystem: true + # -- Controls [Privilege Escalation](https://kubernetes.io/docs/concepts/security/pod-security-policy/#privilege-escalation) enabling setuid binaries changing the effective user ID + allowPrivilegeEscalation: false + # -- Requires the container to run without root privileges + runAsNonRoot: true + # -- The container's process will run with the specified uid + runAsUser: 10001 + # Extra environment variables that will be pass onto deployment pods + env: {} + # ENV_NAME: value + + # "valueFrom" environment variable references that will be added to deployment pods. Name is templated. + # ref: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.19/#envvarsource-v1-core + envValueFrom: {} + # ENV_NAME: + # configMapKeyRef: + # name: configmap-name + # key: value_key + # secretKeyRef: + # name: secret-name + # key: value_key + + # [Kubernetes Secret Resource](https://kubernetes.io/docs/concepts/configuration/secret/) names to load environment variables from + envSecretNames: [] + # - first-secret + # - second-secret + + # [Kubernetes ConfigMap Resource](https://kubernetes.io/docs/concepts/configuration/configmap/) names to load environment variables from + envConfigMapNames: [] + # - first-config-map + # - second-config-map + + ## Ingress declaration to expose the network service. + ingresses: + ## Public / Internet facing Ingress + - enabled: true + # -- The hostname to be used to precisely map incoming traffic onto the underlying network service + hostname: "materialpass.dev.demo.catena-x.net" + # -- Additional ingress annotations to add + annotations: {} + # -- EDC endpoints exposed by this ingress resource + endpoints: + - default + - management + - control + - protocol + - metrics + - observability + # -- Defines the [ingress class](https://kubernetes.io/docs/concepts/services-networking/ingress/#ingress-class) to use + className: "nginx" + # -- TLS [tls class](https://kubernetes.io/docs/concepts/services-networking/ingress/#tls) applied to the ingress resource + tls: + # -- Enables TLS on the ingress resource + enabled: true + # -- If present overwrites the default secret name + secretName: "tls-secret" + ## Adds [cert-manager](https://cert-manager.io/docs/) annotations to the ingress resource + certManager: + # -- If preset enables certificate generation via cert-manager namespace scoped issuer + issuer: "" + # -- If preset enables certificate generation via cert-manager cluster-wide issuer + clusterIssuer: "" + ## Private / Intranet facing Ingress + - enabled: false + # -- The hostname to be used to precisely map incoming traffic onto the underlying network service + hostname: "edc-control.intranet" + # -- Additional ingress annotations to add + annotations: {} + # -- EDC endpoints exposed by this ingress resource + endpoints: + - management + - control + # -- Defines the [ingress class](https://kubernetes.io/docs/concepts/services-networking/ingress/#ingress-class) to use + className: "nginx" + # -- TLS [tls class](https://kubernetes.io/docs/concepts/services-networking/ingress/#tls) applied to the ingress resource + tls: + # -- Enables TLS on the ingress resource + enabled: true + # -- If present overwrites the default secret name + secretName: "tls-secret" + ## Adds [cert-manager](https://cert-manager.io/docs/) annotations to the ingress resource + certManager: + # -- If preset enables certificate generation via cert-manager namespace scoped issuer + issuer: "" + # -- If preset enables certificate generation via cert-manager cluster-wide issuer + clusterIssuer: "" + # -- declare where to mount [volumes](https://kubernetes.io/docs/concepts/storage/volumes/) into the container + volumeMounts: [] + # -- [volume](https://kubernetes.io/docs/concepts/storage/volumes/) directories + volumes: [] + # -- [resource management](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) for the container + resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + replicaCount: 1 + autoscaling: + # -- Enables [horizontal pod autoscaling](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/) + enabled: false + # -- Minimal replicas if resource consumption falls below resource threshholds + minReplicas: 1 + # -- Maximum replicas if resource consumption exceeds resource threshholds + maxReplicas: 100 + # -- targetAverageUtilization of cpu provided to a pod + targetCPUUtilizationPercentage: 80 + # -- targetAverageUtilization of memory provided to a pod + targetMemoryUtilizationPercentage: 80 + # -- configuration of the [Open Telemetry Agent](https://opentelemetry.io/docs/instrumentation/java/automatic/agent-config/) to collect and expose metrics + opentelemetry: |- + otel.javaagent.enabled=false + otel.javaagent.debug=false + # -- configuration of the [Java Util Logging Facade](https://docs.oracle.com/javase/7/docs/technotes/guides/logging/overview.html) + logging: |- + .level=INFO + org.eclipse.edc.level=ALL + handlers=java.util.logging.ConsoleHandler + java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter + java.util.logging.ConsoleHandler.level=ALL + java.util.logging.SimpleFormatter.format=[%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS] [%4$-7s] %5$s%6$s%n + # [node selector](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector) to constrain pods to nodes + nodeSelector: {} + # [tolerations](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) to configure preferred nodes + tolerations: [] + # [affinity](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity) to configure which nodes the pods can be scheduled on + affinity: {} + url: + # -- Explicitly declared url for reaching the ids api (e.g. if ingresses not used) + ids: "" + dataplane: + enabled: true + image: + # -- Which derivate of the data plane to use. when left empty the deployment will select the correct image automatically + repository: "tractusx/edc-dataplane-hashicorp-vault" + # -- [Kubernetes image pull policy](https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy) to use + pullPolicy: IfNotPresent + # -- Overrides the image tag whose default is the chart appVersion + tag: "0.4.1" + initContainers: [] + debug: + enabled: false + port: 1044 + suspendOnStart: false + livenessProbe: + # -- Whether to enable kubernetes [liveness-probe](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) + enabled: true + # -- seconds to wait before performing the first liveness check + initialDelaySeconds: 30 + # -- this fields specifies that kubernetes should perform a liveness check every 10 seconds + periodSeconds: 10 + # -- number of seconds after which the probe times out + timeoutSeconds: 5 + # -- when a probe fails kubernetes will try 6 times before giving up + failureThreshold: 6 + # -- number of consecutive successes for the probe to be considered successful after having failed + successThreshold: 1 + readinessProbe: + # -- Whether to enable kubernetes [readiness-probes](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) + enabled: true + # -- seconds to wait before performing the first readiness check + initialDelaySeconds: 30 + # -- this fields specifies that kubernetes should perform a liveness check every 10 seconds + periodSeconds: 10 + # -- number of seconds after which the probe times out + timeoutSeconds: 5 + # -- when a probe fails kubernetes will try 6 times before giving up + failureThreshold: 6 + # -- number of consecutive successes for the probe to be considered successful after having failed + successThreshold: 1 + service: + # -- [Service type](https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types) to expose the running application on a set of Pods as a network service. + type: ClusterIP + port: 80 + endpoints: + default: + port: 8080 + path: /BPNL000000000000/api + public: + port: 8081 + path: /BPNL000000000000/api/public + control: + port: 8083 + path: /BPNL000000000000/api/dataplane/control + proxy: + port: 8186 + path: /BPNL000000000000/proxy + observability: + # -- port for incoming API calls + port: 8085 + # -- observability api, provides /health /readiness and /liveness endpoints + path: /BPNL000000000000/observability + # -- allow or disallow insecure access, i.e. access without authentication + insecure: true + metrics: + port: 9090 + path: /BPNL000000000000/metrics + aws: + endpointOverride: "" + accessKeyId: "" + secretAccessKey: "" + # -- additional labels for the pod + podLabels: {} + # -- additional annotations for the pod + podAnnotations: {} + # -- The [pod security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod) defines privilege and access control settings for a Pod within the deployment + podSecurityContext: + seccompProfile: + # -- Restrict a Container's Syscalls with seccomp + type: RuntimeDefault + # -- Runs all processes within a pod with a special uid + runAsUser: 10001 + # -- Processes within a pod will belong to this guid + runAsGroup: 10001 + # -- The owner for volumes and any files created within volumes will belong to this guid + fsGroup: 10001 + # The [container security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container) defines privilege and access control settings for a Container within a pod + securityContext: + capabilities: + # -- Specifies which capabilities to drop to reduce syscall attack surface + drop: + - ALL + # -- Specifies which capabilities to add to issue specialized syscalls + add: [] + # -- Whether the root filesystem is mounted in read-only mode + readOnlyRootFilesystem: true + # -- Controls [Privilege Escalation](https://kubernetes.io/docs/concepts/security/pod-security-policy/#privilege-escalation) enabling setuid binaries changing the effective user ID + allowPrivilegeEscalation: false + # -- Requires the container to run without root privileges + runAsNonRoot: true + # -- The container's process will run with the specified uid + runAsUser: 10001 + # Extra environment variables that will be pass onto deployment pods + env: {} + # ENV_NAME: value + + # "valueFrom" environment variable references that will be added to deployment pods. Name is templated. + # ref: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.19/#envvarsource-v1-core + envValueFrom: {} + # ENV_NAME: + # configMapKeyRef: + # name: configmap-name + # key: value_key + # secretKeyRef: + # name: secret-name + # key: value_key + + # [Kubernetes Secret Resource](https://kubernetes.io/docs/concepts/configuration/secret/) names to load environment variables from + envSecretNames: [] + # - first-secret + # - second-secret + + # [Kubernetes ConfigMap Resource](https://kubernetes.io/docs/concepts/configuration/configmap/) names to load environment variables from + envConfigMapNames: [] + # - first-config-map + # - second-config-map + + ## Ingress declaration to expose the network service. + ingresses: + ## Public / Internet facing Ingress + - enabled: true + # -- The hostname to be used to precisely map incoming traffic onto the underlying network service + hostname: "materialpass.dev.demo.catena-x.net" + # -- Additional ingress annotations to add + annotations: {} + # -- EDC endpoints exposed by this ingress resource + endpoints: + - public + # -- Defines the [ingress class](https://kubernetes.io/docs/concepts/services-networking/ingress/#ingress-class) to use + className: "nginx" + # -- TLS [tls class](https://kubernetes.io/docs/concepts/services-networking/ingress/#tls) applied to the ingress resource + tls: + # -- Enables TLS on the ingress resource + enabled: true + # -- If present overwrites the default secret name + secretName: "tls-secret" + ## Adds [cert-manager](https://cert-manager.io/docs/) annotations to the ingress resource + certManager: + # -- If preset enables certificate generation via cert-manager namespace scoped issuer + issuer: "" + # -- If preset enables certificate generation via cert-manager cluster-wide issuer + clusterIssuer: "" + # -- declare where to mount [volumes](https://kubernetes.io/docs/concepts/storage/volumes/) into the container + volumeMounts: [] + # -- [volume](https://kubernetes.io/docs/concepts/storage/volumes/) directories + volumes: [] + # -- [resource management](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) for the container + resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + replicaCount: 1 + autoscaling: + # -- Enables [horizontal pod autoscaling](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/) + enabled: false + # -- Minimal replicas if resource consumption falls below resource threshholds + minReplicas: 1 + # -- Maximum replicas if resource consumption exceeds resource threshholds + maxReplicas: 100 + # -- targetAverageUtilization of cpu provided to a pod + targetCPUUtilizationPercentage: 80 + # -- targetAverageUtilization of memory provided to a pod + targetMemoryUtilizationPercentage: 80 + # -- configuration of the [Open Telemetry Agent](https://opentelemetry.io/docs/instrumentation/java/automatic/agent-config/) to collect and expose metrics + opentelemetry: |- + otel.javaagent.enabled=false + otel.javaagent.debug=false + # -- configuration of the [Java Util Logging Facade](https://docs.oracle.com/javase/7/docs/technotes/guides/logging/overview.html) + logging: |- + .level=INFO + org.eclipse.edc.level=ALL + handlers=java.util.logging.ConsoleHandler + java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter + java.util.logging.ConsoleHandler.level=ALL + java.util.logging.SimpleFormatter.format=[%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS] [%4$-7s] %5$s%6$s%n + # [node selector](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector) to constrain pods to nodes + nodeSelector: {} + # [tolerations](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) to configure preferred nodes + tolerations: [] + # [affinity](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity) to configure which nodes the pods can be scheduled on + affinity: {} + url: + # -- Explicitly declared url for reaching the public api (e.g. if ingresses not used) + public: "" + + postgresql: + jdbcUrl: "jdbc:postgresql://postgresqlprovider:5432/edc" + fullnameOverride: "postgresql" + username: + password: + auth: + database: "edc" + username: + password: + + vault: + fullnameOverride: "vault" + injector: + enabled: false + server: + dev: + enabled: true + devRootToken: "root" + # Must be the same certificate that is configured in section 'daps' + postStart: # must be set externally! + hashicorp: + url: + token: + timeout: 30 + healthCheck: + enabled: true + standbyOk: true + paths: + secret: + health: /v1/sys/health + secretNames: + transferProxyTokenSignerPrivateKey: daps-key-dev + transferProxyTokenSignerPublicKey: daps-crt-dev + transferProxyTokenEncryptionAesKey: edc-encryption-key + dapsPrivateKey: daps-key-dev + dapsPublicKey: daps-crt-dev + + daps: + fullnameOverride: "daps" + url: "https://daps.dev.demo.catena-x.net" + clientId: + paths: + jwks: /jwks.json + token: /token + + backendService: + httpProxyTokenReceiverUrl: "http://dpp-edc-consumer-backend" + + serviceAccount: + # Specifies whether a service account should be created + create: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + # -- Existing image pull secret bound to the service account to use to [obtain the container image from private registries](https://kubernetes.io/docs/concepts/containers/images/#using-a-private-registry) + imagePullSecrets: [] + + idsdaps: + connectors: + - certificate: + +postgresql: + jdbcUrl: "jdbc:postgresql://postgresqlprovider:5432/edc" + fullnameOverride: "postgresqlprovider" + primary: + persistence: + enabled: true + readReplicas: + persistence: + enabled: true + auth: + database: "edc" + username: + password: \ No newline at end of file From d55149a53d2167e13adaee011802c89eb5aca61a Mon Sep 17 00:00:00 2001 From: Mathias Brunkow Moser Date: Mon, 5 Jun 2023 13:23:54 +0200 Subject: [PATCH 06/35] feat: added connector in daps configurations --- deployment/helm/edc-consumer/values-int.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/deployment/helm/edc-consumer/values-int.yaml b/deployment/helm/edc-consumer/values-int.yaml index e9cca412b..366b17050 100644 --- a/deployment/helm/edc-consumer/values-int.yaml +++ b/deployment/helm/edc-consumer/values-int.yaml @@ -552,6 +552,13 @@ tractusx-connector: paths: jwks: /.well-known/jwks.json token: /token + connectors: + - id: + name: edcconector + attributes: + referringConnector: "https://materialpass.int.demo.catena-x.net/consumer/" + # Must be the same certificate that is stores in section 'sokrates-vault' + certificate: backendService: httpProxyTokenReceiverUrl: "http://dpp-edc-consumer-backend" From 8a47d19ecc136159e94f21af455a45ae58e8c907 Mon Sep 17 00:00:00 2001 From: Mathias Brunkow Moser Date: Mon, 5 Jun 2023 13:24:51 +0200 Subject: [PATCH 07/35] feat: added connector in provider daps configurations --- deployment/helm/edc-provider/values-int.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/deployment/helm/edc-provider/values-int.yaml b/deployment/helm/edc-provider/values-int.yaml index 9412b750d..1f98da8b3 100644 --- a/deployment/helm/edc-provider/values-int.yaml +++ b/deployment/helm/edc-provider/values-int.yaml @@ -540,6 +540,12 @@ tractusx-connector: paths: jwks: /.well-known/jwks.json token: /token + connectors: + - id: + name: edcconector + attributes: + referringConnector: "https://materialpass.int.demo.catena-x.net/consumer/" + certificate: backendService: httpProxyTokenReceiverUrl: "http://dpp-edc-consumer-backend" From e815650ff11279137c77ee728e0cd2ad321db595 Mon Sep 17 00:00:00 2001 From: Mathias Brunkow Moser Date: Mon, 5 Jun 2023 15:10:17 +0200 Subject: [PATCH 08/35] chore: added print for debugging --- .../http/controllers/AppController.java | 40 +++++++++---------- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/http/controllers/AppController.java b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/http/controllers/AppController.java index 68e6b2ad6..11f1216b0 100644 --- a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/http/controllers/AppController.java +++ b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/http/controllers/AppController.java @@ -32,10 +32,7 @@ import org.eclipse.tractusx.productpass.models.edc.Jwt; import org.eclipse.tractusx.productpass.models.http.Response; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import utils.CatenaXUtil; import utils.DateTimeUtil; import utils.HttpUtil; @@ -61,12 +58,24 @@ public Response index(){ return httpUtil.getResponse("Redirect to UI"); } - @PostMapping("/endpoint") - @Operation(summary = "Receives the calls from the EDC", responses = { - @ApiResponse(description = "Get call from EDC", responseCode = "200", content = @Content(mediaType = "application/json", + + @GetMapping("/health") + @Operation(summary = "Returns the backend health status", responses = { + @ApiResponse(description = "Gets the application health", responseCode = "200", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))) }) - public Response endpoint(){ + public Response health(){ + Response response = httpUtil.getResponse( + "RUNNING", + 200 + ); + response.data = DateTimeUtil.getDateTimeFormatted(null); + return response; + } + + @RequestMapping(value = "/endpoint", method = RequestMethod.POST) + public Response endpoint(@RequestBody Object body){ + LogUtil.printMessage("Body: ["+ body.toString()+"]"); String token = httpUtil.getAuthorizationToken(httpRequest); if(token == null){ return httpUtil.buildResponse(httpUtil.getNotAuthorizedResponse(), httpResponse); @@ -80,18 +89,5 @@ public Response endpoint(){ } - @GetMapping("/health") - @Operation(summary = "Returns the backend health status", responses = { - @ApiResponse(description = "Gets the application health", responseCode = "200", content = @Content(mediaType = "application/json", - schema = @Schema(implementation = Response.class))) - }) - public Response health(){ - Response response = httpUtil.getResponse( - "RUNNING", - 200 - ); - response.data = DateTimeUtil.getDateTimeFormatted(null); - return response; - } - + } From 72f2dca43371c3d323511f30371134bc3efe2cde Mon Sep 17 00:00:00 2001 From: Mathias Brunkow Moser Date: Mon, 5 Jun 2023 16:36:28 +0200 Subject: [PATCH 09/35] feat: added necesarry structure for receiving token from EDC --- .../http/controllers/AppController.java | 50 +++++--- .../models/edc/DataPlaneEndpoint.java | 108 ++++++++++++++++++ ...lainService.java => DataPlaneService.java} | 19 ++- .../src/main/java/utils/EdcUtil.java | 50 ++++++++ .../src/main/java/utils/HttpUtil.java | 7 ++ .../src/main/java/utils/JsonUtil.java | 16 +++ .../src/main/java/utils/PassportUtil.java | 43 +++++++ 7 files changed, 273 insertions(+), 20 deletions(-) create mode 100644 consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/edc/DataPlaneEndpoint.java rename consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/services/{DataPlainService.java => DataPlaneService.java} (72%) create mode 100644 consumer-backend/productpass/src/main/java/utils/EdcUtil.java create mode 100644 consumer-backend/productpass/src/main/java/utils/PassportUtil.java diff --git a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/http/controllers/AppController.java b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/http/controllers/AppController.java index 11f1216b0..1f7b8818d 100644 --- a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/http/controllers/AppController.java +++ b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/http/controllers/AppController.java @@ -29,17 +29,17 @@ import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.tags.Tag; -import org.eclipse.tractusx.productpass.models.edc.Jwt; +import org.eclipse.tractusx.productpass.exceptions.ControllerException; +import org.eclipse.tractusx.productpass.models.edc.DataPlaneEndpoint; import org.eclipse.tractusx.productpass.models.http.Response; +import org.eclipse.tractusx.productpass.models.passports.Passport; +import org.eclipse.tractusx.productpass.services.DataPlaneService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; -import utils.CatenaXUtil; -import utils.DateTimeUtil; -import utils.HttpUtil; +import utils.*; import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; -import utils.LogUtil; @RestController @Tag(name = "Public Controller") @@ -50,6 +50,15 @@ public class AppController { @Autowired HttpUtil httpUtil; + @Autowired + EdcUtil edcUtil; + + @Autowired + PassportUtil passportUtil; + + @Autowired + DataPlaneService dataPlaneService; + @GetMapping("/") @Hidden // hides this endpoint from api documentation - swagger-ui @@ -75,17 +84,28 @@ public Response health(){ @RequestMapping(value = "/endpoint", method = RequestMethod.POST) public Response endpoint(@RequestBody Object body){ - LogUtil.printMessage("Body: ["+ body.toString()+"]"); - String token = httpUtil.getAuthorizationToken(httpRequest); - if(token == null){ - return httpUtil.buildResponse(httpUtil.getNotAuthorizedResponse(), httpResponse); + try{ + + DataPlaneEndpoint endpointData = edcUtil.parseDataPlaneEndpoint(body); + if(endpointData == null){ + throw new ControllerException(this.getClass().getName(),"The endpoint data request is empty!"); + } + if(endpointData.getEndpoint().isEmpty()){ + throw new ControllerException(this.getClass().getName(),"The data plane endpoint address is empty!"); + } + if(endpointData.getAuthCode().isEmpty()){ + throw new ControllerException(this.getClass().getName(),"The authorization code is empty!"); + } + + Passport passport = dataPlaneService.getPassport(endpointData); + String passportPath = passportUtil.savePassport(passport, endpointData); + LogUtil.printMessage("[EDC] Passport Transfer Data ["+endpointData.getId()+"] Saved Successfully in ["+passportPath+"]!"); + + }catch(Exception e) { + LogUtil.printException(e, "This request is not allowed! It must contain the valid attributes from an EDC endpoint"); + return httpUtil.buildResponse(httpUtil.getForbiddenResponse(), httpResponse); } - LogUtil.printMessage("Request Received in Endpoint"); - Jwt data = httpUtil.parseToken(token); - return httpUtil.getResponse( - "RUNNING", - data - ); + return httpUtil.buildResponse(httpUtil.getResponse(), httpResponse); } diff --git a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/edc/DataPlaneEndpoint.java b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/edc/DataPlaneEndpoint.java new file mode 100644 index 000000000..233e01992 --- /dev/null +++ b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/edc/DataPlaneEndpoint.java @@ -0,0 +1,108 @@ +/********************************************************************************* + * + * 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. + * + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the + * License for the specific language govern in permissions and limitations + * under the License. + * + * SPDX-License-Identifier: Apache-2.0 + ********************************************************************************/ + +package org.eclipse.tractusx.productpass.models.edc; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class DataPlaneEndpoint { + @JsonProperty("id") + String id; + + @JsonProperty("endpoint") + String endpoint; + + @JsonProperty("authKey") + String authKey; + + @JsonProperty("authCode") + String authCode; + + @JsonProperty("properties") + Properties properties; + + public DataPlaneEndpoint(String id, String endpoint, String authKey, String authCode, Properties properties) { + this.id = id; + this.endpoint = endpoint; + this.authKey = authKey; + this.authCode = authCode; + this.properties = properties; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getEndpoint() { + return endpoint; + } + + public void setEndpoint(String endpoint) { + this.endpoint = endpoint; + } + + public String getAuthKey() { + return authKey; + } + + public void setAuthKey(String authKey) { + this.authKey = authKey; + } + + public String getAuthCode() { + return authCode; + } + + public void setAuthCode(String authCode) { + this.authCode = authCode; + } + + public Properties getProperties() { + return properties; + } + + public void setProperties(Properties properties) { + this.properties = properties; + } + + public void setOfferId(String offerId) { + this.properties.offerId = offerId; + } + + public String getOfferId() { + return this.properties.offerId; + } + + static class Properties { + @JsonProperty("https://w3id.org/edc/v0.0.1/ns/cid") + String offerId; + } + + +} diff --git a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/services/DataPlainService.java b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/services/DataPlaneService.java similarity index 72% rename from consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/services/DataPlainService.java rename to consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/services/DataPlaneService.java index 16ca311e0..da1298e03 100644 --- a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/services/DataPlainService.java +++ b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/services/DataPlaneService.java @@ -25,20 +25,29 @@ import org.eclipse.tractusx.productpass.exceptions.ServiceException; import org.eclipse.tractusx.productpass.exceptions.ServiceInitializationException; +import org.eclipse.tractusx.productpass.models.edc.DataPlaneEndpoint; +import org.eclipse.tractusx.productpass.models.passports.Passport; import org.eclipse.tractusx.productpass.models.service.BaseService; import org.springframework.stereotype.Service; -import utils.*; import java.util.ArrayList; import java.util.List; -import java.util.Map; @Service -public class DataPlainService extends BaseService { - public DataPlainService() throws ServiceInitializationException { +public class DataPlaneService extends BaseService { + public DataPlaneService() throws ServiceInitializationException { this.checkEmptyVariables(); } - public Object getTransferData(String transferId) { + public Object getTransferData(DataPlaneEndpoint endpointData) { + try { + return null; + }catch (Exception e){ + throw new ServiceException(this.getClass().getName()+"."+"getTransferData", + e, + "It was not possible to get transfer from transfer id!"); + } + } + public Passport getPassport(DataPlaneEndpoint endpointData) { try { return null; }catch (Exception e){ diff --git a/consumer-backend/productpass/src/main/java/utils/EdcUtil.java b/consumer-backend/productpass/src/main/java/utils/EdcUtil.java new file mode 100644 index 000000000..452d760a9 --- /dev/null +++ b/consumer-backend/productpass/src/main/java/utils/EdcUtil.java @@ -0,0 +1,50 @@ +/********************************************************************************* + * + * 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. + * + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the + * License for the specific language govern in permissions and limitations + * under the License. + * + * SPDX-License-Identifier: Apache-2.0 + ********************************************************************************/ + +package utils; + +import org.eclipse.tractusx.productpass.models.edc.DataPlaneEndpoint; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import utils.exceptions.UtilException; + +@Component +public class EdcUtil { + + private final JsonUtil jsonUtil; + @Autowired + public EdcUtil(JsonUtil jsonUtil) { + this.jsonUtil = jsonUtil; + } + public DataPlaneEndpoint parseDataPlaneEndpoint(Object body){ + try { + return (DataPlaneEndpoint) this.jsonUtil.bindObject(body, DataPlaneEndpoint.class); + }catch (Exception e){ + throw new UtilException(EdcUtil.class, e, "It was not possible to parse the data plain endpoint"); + } + } + + +} diff --git a/consumer-backend/productpass/src/main/java/utils/HttpUtil.java b/consumer-backend/productpass/src/main/java/utils/HttpUtil.java index 4a490a4ac..18471cbf1 100644 --- a/consumer-backend/productpass/src/main/java/utils/HttpUtil.java +++ b/consumer-backend/productpass/src/main/java/utils/HttpUtil.java @@ -257,6 +257,13 @@ public Response getResponse(String message, Object data) { data ); } + + public Response getForbiddenResponse() { + return new Response( + "Forbidden", + 403 + ); + } public Response getNotAuthorizedResponse() { return new Response( "Not Authorized", diff --git a/consumer-backend/productpass/src/main/java/utils/JsonUtil.java b/consumer-backend/productpass/src/main/java/utils/JsonUtil.java index f0076396e..e71619ed9 100644 --- a/consumer-backend/productpass/src/main/java/utils/JsonUtil.java +++ b/consumer-backend/productpass/src/main/java/utils/JsonUtil.java @@ -269,4 +269,20 @@ public Object bindJsonNode(JsonNode jsonNode, Class bindClass){ throw new UtilException(JsonUtil.class, "It was not possible to parse json -> [" + e.getMessage() + "]"); } } + public Object bindMap(Map json, Class bindClass){ + ObjectMapper mapper = new ObjectMapper(); + try { + return mapper.convertValue(json, bindClass); + } catch (Exception e) { + throw new UtilException(JsonUtil.class, "It was not possible to parse json -> [" + e.getMessage() + "]"); + } + } + public Object bindObject(Object json, Class bindClass){ + ObjectMapper mapper = new ObjectMapper(); + try { + return mapper.convertValue(json, bindClass); + } catch (Exception e) { + throw new UtilException(JsonUtil.class, "It was not possible to parse json -> [" + e.getMessage() + "]"); + } + } } diff --git a/consumer-backend/productpass/src/main/java/utils/PassportUtil.java b/consumer-backend/productpass/src/main/java/utils/PassportUtil.java new file mode 100644 index 000000000..def352acb --- /dev/null +++ b/consumer-backend/productpass/src/main/java/utils/PassportUtil.java @@ -0,0 +1,43 @@ +/********************************************************************************* + * + * 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. + * + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the + * License for the specific language govern in permissions and limitations + * under the License. + * + * SPDX-License-Identifier: Apache-2.0 + ********************************************************************************/ + +package utils; + +import org.eclipse.tractusx.productpass.models.edc.DataPlaneEndpoint; +import org.eclipse.tractusx.productpass.models.passports.Passport; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +@Component +public class PassportUtil { + private final JsonUtil jsonUtil; + @Autowired + public PassportUtil(JsonUtil jsonUtil) { + this.jsonUtil = jsonUtil; + } + public String savePassport(Passport passport, DataPlaneEndpoint endpointData){ + return "/path/to/passport/json"; + } +} From 1bf22f281535cd4e3d535a232c40aef6f7246878 Mon Sep 17 00:00:00 2001 From: Mathias Brunkow Moser Date: Mon, 5 Jun 2023 17:55:08 +0200 Subject: [PATCH 10/35] feat: added final retrieval of passport and persistance --- .../http/controllers/AppController.java | 4 ++- .../services/DataPlaneService.java | 30 +++++++++++++++---- .../src/main/java/utils/PassportUtil.java | 21 +++++++++++-- .../src/main/resources/application.yml | 1 + 4 files changed, 48 insertions(+), 8 deletions(-) diff --git a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/http/controllers/AppController.java b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/http/controllers/AppController.java index 1f7b8818d..45de26c25 100644 --- a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/http/controllers/AppController.java +++ b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/http/controllers/AppController.java @@ -96,11 +96,13 @@ public Response endpoint(@RequestBody Object body){ if(endpointData.getAuthCode().isEmpty()){ throw new ControllerException(this.getClass().getName(),"The authorization code is empty!"); } + if(endpointData.getOfferId().isEmpty()){ + throw new ControllerException(this.getClass().getName(),"The Offer Id is empty!"); + } Passport passport = dataPlaneService.getPassport(endpointData); String passportPath = passportUtil.savePassport(passport, endpointData); LogUtil.printMessage("[EDC] Passport Transfer Data ["+endpointData.getId()+"] Saved Successfully in ["+passportPath+"]!"); - }catch(Exception e) { LogUtil.printException(e, "This request is not allowed! It must contain the valid attributes from an EDC endpoint"); return httpUtil.buildResponse(httpUtil.getForbiddenResponse(), httpResponse); diff --git a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/services/DataPlaneService.java b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/services/DataPlaneService.java index da1298e03..b45c8acf9 100644 --- a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/services/DataPlaneService.java +++ b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/services/DataPlaneService.java @@ -25,35 +25,55 @@ import org.eclipse.tractusx.productpass.exceptions.ServiceException; import org.eclipse.tractusx.productpass.exceptions.ServiceInitializationException; +import org.eclipse.tractusx.productpass.models.auth.JwtToken; +import org.eclipse.tractusx.productpass.models.dtregistry.DigitalTwin; import org.eclipse.tractusx.productpass.models.edc.DataPlaneEndpoint; import org.eclipse.tractusx.productpass.models.passports.Passport; +import org.eclipse.tractusx.productpass.models.passports.PassportV3; import org.eclipse.tractusx.productpass.models.service.BaseService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpHeaders; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Service; +import utils.HttpUtil; +import utils.JsonUtil; import java.util.ArrayList; import java.util.List; +import java.util.Map; @Service public class DataPlaneService extends BaseService { + + @Autowired + HttpUtil httpUtil; + + @Autowired + JsonUtil jsonUtil; + public DataPlaneService() throws ServiceInitializationException { this.checkEmptyVariables(); } public Object getTransferData(DataPlaneEndpoint endpointData) { try { - return null; + Map params = httpUtil.getParams(); + HttpHeaders headers = new HttpHeaders(); + headers.add(endpointData.getAuthKey(), endpointData.getAuthCode()); + ResponseEntity response = httpUtil.doGet(endpointData.getEndpoint(), Object.class, headers, params, true, true); + return response.getBody(); }catch (Exception e){ throw new ServiceException(this.getClass().getName()+"."+"getTransferData", e, - "It was not possible to get transfer from transfer id!"); + "It was not possible to get transfer from transfer id ["+endpointData.getId()+"]"); } } public Passport getPassport(DataPlaneEndpoint endpointData) { try { - return null; + return (PassportV3) jsonUtil.bindObject(this.getTransferData(endpointData), PassportV3.class); }catch (Exception e){ - throw new ServiceException(this.getClass().getName()+"."+"getTransferData", + throw new ServiceException(this.getClass().getName()+"."+"getPassport", e, - "It was not possible to get transfer from transfer id!"); + "It was not possible to get and parse passport for transfer ["+endpointData.getId()+"]"); } } diff --git a/consumer-backend/productpass/src/main/java/utils/PassportUtil.java b/consumer-backend/productpass/src/main/java/utils/PassportUtil.java index def352acb..1430e4316 100644 --- a/consumer-backend/productpass/src/main/java/utils/PassportUtil.java +++ b/consumer-backend/productpass/src/main/java/utils/PassportUtil.java @@ -28,16 +28,33 @@ import org.eclipse.tractusx.productpass.models.edc.DataPlaneEndpoint; import org.eclipse.tractusx.productpass.models.passports.Passport; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.env.Environment; import org.springframework.stereotype.Component; +import utils.exceptions.UtilException; + +import java.io.File; +import java.nio.file.Path; @Component public class PassportUtil { private final JsonUtil jsonUtil; + private final FileUtil fileUtil; + private final String transferDir; + + @Autowired - public PassportUtil(JsonUtil jsonUtil) { + public PassportUtil(JsonUtil jsonUtil, FileUtil fileUtil, Environment env) { + this.transferDir = env.getProperty("passport.transferDir", String.class, "data/transfer"); this.jsonUtil = jsonUtil; + this.fileUtil = fileUtil; } public String savePassport(Passport passport, DataPlaneEndpoint endpointData){ - return "/path/to/passport/json"; + try { + fileUtil.createDir(this.transferDir); + String path = Path.of(this.transferDir, endpointData.getId() + ".json").toAbsolutePath().toString(); + return jsonUtil.toJsonFile(path, passport, true); + }catch (Exception e){ + throw new UtilException(PassportUtil.class, e, "Something went wrong while saving the passport for transfer ["+endpointData.getId()+"]"); + } } } diff --git a/consumer-backend/productpass/src/main/resources/application.yml b/consumer-backend/productpass/src/main/resources/application.yml index 9236dc900..772587199 100644 --- a/consumer-backend/productpass/src/main/resources/application.yml +++ b/consumer-backend/productpass/src/main/resources/application.yml @@ -46,6 +46,7 @@ configuration: registryUrl: 'https://semantics.dev.demo.catena-x.net' passport: + transferDir: "data/transfer" versions: - 'v3.0.1' From 4b2c99335ad61a86aad69d480c475a62837e8c84 Mon Sep 17 00:00:00 2001 From: Mathias Brunkow Moser Date: Mon, 5 Jun 2023 18:05:09 +0200 Subject: [PATCH 11/35] fix: added default contructure to dataplane endpoint --- .../productpass/models/edc/DataPlaneEndpoint.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/edc/DataPlaneEndpoint.java b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/edc/DataPlaneEndpoint.java index 233e01992..42ea5cc04 100644 --- a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/edc/DataPlaneEndpoint.java +++ b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/edc/DataPlaneEndpoint.java @@ -43,12 +43,15 @@ public class DataPlaneEndpoint { @JsonProperty("properties") Properties properties; - public DataPlaneEndpoint(String id, String endpoint, String authKey, String authCode, Properties properties) { + public DataPlaneEndpoint(String id, String endpoint, String authKey, String authCode, String offerId) { this.id = id; this.endpoint = endpoint; this.authKey = authKey; this.authCode = authCode; - this.properties = properties; + this.properties = new Properties(offerId); + } + + public DataPlaneEndpoint() { } public String getId() { @@ -102,6 +105,10 @@ public String getOfferId() { static class Properties { @JsonProperty("https://w3id.org/edc/v0.0.1/ns/cid") String offerId; + + public Properties(String offerId) { + this.offerId = offerId; + } } From 7cc30fc408d3c82f6e39ca2bd4acf401ea342a5e Mon Sep 17 00:00:00 2001 From: Mathias Brunkow Moser Date: Tue, 6 Jun 2023 14:57:50 +0200 Subject: [PATCH 12/35] fix: fixed version and object mapper --- consumer-backend/productpass/pom.xml | 2 +- consumer-backend/productpass/readme.md | 2 +- .../tractusx/productpass/models/edc/DataPlaneEndpoint.java | 7 ++----- .../productpass/src/main/java/utils/JsonUtil.java | 4 ++-- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/consumer-backend/productpass/pom.xml b/consumer-backend/productpass/pom.xml index ff4d3f6de..80868fcdb 100644 --- a/consumer-backend/productpass/pom.xml +++ b/consumer-backend/productpass/pom.xml @@ -33,7 +33,7 @@ org.eclipse.tractusx productpass - 0.6.0-SNAPSHOT + 0.7.0-SNAPSHOT jar Catena-X Digital Product Passport Backend Product Passport Consumer Backend System for Product Passport Consumer Frontend Application diff --git a/consumer-backend/productpass/readme.md b/consumer-backend/productpass/readme.md index ded93da76..dde76cffa 100644 --- a/consumer-backend/productpass/readme.md +++ b/consumer-backend/productpass/readme.md @@ -23,7 +23,7 @@

  Digital Product Pass Backend

-

Version: 0.6.0-SNAPSHOT

+

Version: 0.7.0-SNAPSHOT


diff --git a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/edc/DataPlaneEndpoint.java b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/edc/DataPlaneEndpoint.java index 42ea5cc04..338336a32 100644 --- a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/edc/DataPlaneEndpoint.java +++ b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/edc/DataPlaneEndpoint.java @@ -43,12 +43,12 @@ public class DataPlaneEndpoint { @JsonProperty("properties") Properties properties; - public DataPlaneEndpoint(String id, String endpoint, String authKey, String authCode, String offerId) { + public DataPlaneEndpoint(String id, String endpoint, String authKey, String authCode, Properties properties) { this.id = id; this.endpoint = endpoint; this.authKey = authKey; this.authCode = authCode; - this.properties = new Properties(offerId); + this.properties = properties; } public DataPlaneEndpoint() { @@ -106,9 +106,6 @@ static class Properties { @JsonProperty("https://w3id.org/edc/v0.0.1/ns/cid") String offerId; - public Properties(String offerId) { - this.offerId = offerId; - } } diff --git a/consumer-backend/productpass/src/main/java/utils/JsonUtil.java b/consumer-backend/productpass/src/main/java/utils/JsonUtil.java index e71619ed9..8fdaba02d 100644 --- a/consumer-backend/productpass/src/main/java/utils/JsonUtil.java +++ b/consumer-backend/productpass/src/main/java/utils/JsonUtil.java @@ -272,7 +272,7 @@ public Object bindJsonNode(JsonNode jsonNode, Class bindClass){ public Object bindMap(Map json, Class bindClass){ ObjectMapper mapper = new ObjectMapper(); try { - return mapper.convertValue(json, bindClass); + return mapper.convertValue(mapper.valueToTree(json), bindClass); } catch (Exception e) { throw new UtilException(JsonUtil.class, "It was not possible to parse json -> [" + e.getMessage() + "]"); } @@ -280,7 +280,7 @@ public Object bindMap(Map json, Class bindClass){ public Object bindObject(Object json, Class bindClass){ ObjectMapper mapper = new ObjectMapper(); try { - return mapper.convertValue(json, bindClass); + return this.bindJsonNode(mapper.valueToTree(json), bindClass); } catch (Exception e) { throw new UtilException(JsonUtil.class, "It was not possible to parse json -> [" + e.getMessage() + "]"); } From 6c97f5ede336a030117f19b7c911360c4d4033d8 Mon Sep 17 00:00:00 2001 From: Mathias Brunkow Moser Date: Tue, 6 Jun 2023 16:16:07 +0200 Subject: [PATCH 13/35] feat: added aes encryption in passport paytload storage --- .../http/controllers/AppController.java | 8 ++- .../src/main/java/utils/CrypUtil.java | 61 ++++++++++++++++++- .../src/main/java/utils/FileUtil.java | 3 - .../src/main/java/utils/PassportUtil.java | 11 ++-- .../src/main/resources/application.yml | 5 +- 5 files changed, 78 insertions(+), 10 deletions(-) diff --git a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/http/controllers/AppController.java b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/http/controllers/AppController.java index 45de26c25..ef3312a59 100644 --- a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/http/controllers/AppController.java +++ b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/http/controllers/AppController.java @@ -35,6 +35,7 @@ import org.eclipse.tractusx.productpass.models.passports.Passport; import org.eclipse.tractusx.productpass.services.DataPlaneService; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.env.Environment; import org.springframework.web.bind.annotation.*; import utils.*; @@ -53,6 +54,9 @@ public class AppController { @Autowired EdcUtil edcUtil; + @Autowired + Environment env; + @Autowired PassportUtil passportUtil; @@ -101,7 +105,9 @@ public Response endpoint(@RequestBody Object body){ } Passport passport = dataPlaneService.getPassport(endpointData); - String passportPath = passportUtil.savePassport(passport, endpointData); + Boolean prettyPrint = env.getProperty("passport.dataTransfer.indent", Boolean.class, true); + Boolean encrypt = env.getProperty("passport.dataTransfer.encrypt", Boolean.class, true); + String passportPath = passportUtil.savePassport(passport, endpointData, prettyPrint, encrypt); LogUtil.printMessage("[EDC] Passport Transfer Data ["+endpointData.getId()+"] Saved Successfully in ["+passportPath+"]!"); }catch(Exception e) { LogUtil.printException(e, "This request is not allowed! It must contain the valid attributes from an EDC endpoint"); diff --git a/consumer-backend/productpass/src/main/java/utils/CrypUtil.java b/consumer-backend/productpass/src/main/java/utils/CrypUtil.java index 26c49239b..0a31dc88f 100644 --- a/consumer-backend/productpass/src/main/java/utils/CrypUtil.java +++ b/consumer-backend/productpass/src/main/java/utils/CrypUtil.java @@ -24,11 +24,26 @@ package utils; import com.google.common.hash.Hashing; +import utils.exceptions.UtilException; +import javax.crypto.Cipher; +import javax.crypto.spec.SecretKeySpec; +import java.io.UnsupportedEncodingException; import java.net.URLDecoder; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; import java.util.Base64; +import java.io.UnsupportedEncodingException; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.util.Arrays; +import java.util.Base64; + +import javax.crypto.Cipher; +import javax.crypto.spec.SecretKeySpec; + public final class CrypUtil { private CrypUtil() { @@ -37,9 +52,15 @@ private CrypUtil() { public static String toBase64(String str){ return Base64.getEncoder().encodeToString(str.getBytes()); } + public static String toBase64(byte[] bytes){ + return Base64.getEncoder().encodeToString(bytes); + } public static String fromBase64(String base64){ return new String(Base64.getDecoder().decode(base64)); } + public static byte[] fromBase64ToByte(String base64){ + return Base64.getDecoder().decode(base64); + } public static String toBase64Url(String str){ return Base64.getUrlEncoder().encodeToString(str.getBytes()); } @@ -48,16 +69,54 @@ public static String fromBase64Url(String base64){ } - public static String sha256(String digest){ + public static String sha256(final String digest){ return Hashing.sha256() .hashString(digest, StandardCharsets.UTF_8) .toString(); } + + public static byte[] sha1Bytes(final String digest){ + try { + return MessageDigest.getInstance("SHA-1").digest(digest.getBytes("UTF-8")); + } catch (Exception e) + { + throw new UtilException(CrypUtil.class,"It was not possible to generate sha1 hash" + e.getMessage()) ; + } + } public static String decodeFromUtf8(String encodedURL){ return URLDecoder.decode(encodedURL, StandardCharsets.UTF_8); } public static String encodeToUtf8(String decodedURL){ return URLEncoder.encode(decodedURL, StandardCharsets.UTF_8); } + public static SecretKeySpec buildAesKey(final String secret) { + try { + byte[] bytesKey = CrypUtil.sha1Bytes(secret); + return new SecretKeySpec(Arrays.copyOf(bytesKey, 16), "AES"); + } catch (Exception e) { + throw new UtilException(CrypUtil.class,"It was not possible to set key " + e.getMessage()) ; + } + } + public static String encryptAes(final String decoded, final String key) { + try { + SecretKeySpec secretKey = CrypUtil.buildAesKey(key); + Cipher encryptor = Cipher.getInstance("AES/ECB/PKCS5Padding"); + encryptor.init(Cipher.ENCRYPT_MODE, secretKey); + return CrypUtil.toBase64(encryptor.doFinal(decoded.getBytes("UTF-8"))); + } catch (Exception e) { + throw new UtilException(CrypUtil.class,"It was not possible encrypt data" + e.getMessage()) ; + } + } + + public static String decryptAes(final String encoded, final String key) { + try { + SecretKeySpec secretKey = CrypUtil.buildAesKey(key); + Cipher decryptor = Cipher.getInstance("AES/ECB/PKCS5Padding"); + decryptor.init(Cipher.DECRYPT_MODE, secretKey); + return new String(decryptor.doFinal(CrypUtil.fromBase64ToByte(encoded))); + } catch (Exception e) { + throw new UtilException(CrypUtil.class, "It was not possible encrypt dat" + e.getMessage()); + } + } } diff --git a/consumer-backend/productpass/src/main/java/utils/FileUtil.java b/consumer-backend/productpass/src/main/java/utils/FileUtil.java index 171842bc0..a14bf010e 100644 --- a/consumer-backend/productpass/src/main/java/utils/FileUtil.java +++ b/consumer-backend/productpass/src/main/java/utils/FileUtil.java @@ -67,9 +67,6 @@ public String createFile(String filePath){ try { File myObj = new File(filePath); myObj.getParentFile().mkdirs(); - if (myObj.createNewFile()) { - LogUtil.printMessage("File created in path [" + filePath + "]"); - } return myObj.getPath(); } catch (Exception e) { throw new UtilException(FileUtil.class,"It was not possible to create new file at ["+filePath+"], " + e.getMessage()) ; diff --git a/consumer-backend/productpass/src/main/java/utils/PassportUtil.java b/consumer-backend/productpass/src/main/java/utils/PassportUtil.java index 1430e4316..e6040edf9 100644 --- a/consumer-backend/productpass/src/main/java/utils/PassportUtil.java +++ b/consumer-backend/productpass/src/main/java/utils/PassportUtil.java @@ -41,18 +41,21 @@ public class PassportUtil { private final FileUtil fileUtil; private final String transferDir; - @Autowired public PassportUtil(JsonUtil jsonUtil, FileUtil fileUtil, Environment env) { - this.transferDir = env.getProperty("passport.transferDir", String.class, "data/transfer"); + this.transferDir = env.getProperty("passport.dataTransfer.dir", String.class, "data/transfer"); this.jsonUtil = jsonUtil; this.fileUtil = fileUtil; } - public String savePassport(Passport passport, DataPlaneEndpoint endpointData){ + public String savePassport(Passport passport, DataPlaneEndpoint endpointData, Boolean prettyPrint, Boolean encrypted){ try { fileUtil.createDir(this.transferDir); String path = Path.of(this.transferDir, endpointData.getId() + ".json").toAbsolutePath().toString(); - return jsonUtil.toJsonFile(path, passport, true); + if(!encrypted) { + return jsonUtil.toJsonFile(path, passport, prettyPrint); // Store the plain JSON + }else{ + return fileUtil.toFile(path, CrypUtil.encryptAes(jsonUtil.toJson(passport, prettyPrint), endpointData.getOfferId()), false); // Store Encrypted + } }catch (Exception e){ throw new UtilException(PassportUtil.class, e, "Something went wrong while saving the passport for transfer ["+endpointData.getId()+"]"); } diff --git a/consumer-backend/productpass/src/main/resources/application.yml b/consumer-backend/productpass/src/main/resources/application.yml index 772587199..7252ccbdb 100644 --- a/consumer-backend/productpass/src/main/resources/application.yml +++ b/consumer-backend/productpass/src/main/resources/application.yml @@ -46,7 +46,10 @@ configuration: registryUrl: 'https://semantics.dev.demo.catena-x.net' passport: - transferDir: "data/transfer" + dataTransfer: + encrypted: true + indented: true + dir: "data/transfer" versions: - 'v3.0.1' From 2ed38471f1f113e4bd9a7344a8a53feede62a61c Mon Sep 17 00:00:00 2001 From: Mathias Brunkow Moser Date: Tue, 6 Jun 2023 16:39:58 +0200 Subject: [PATCH 14/35] feat: added aes encryption unit tests --- .../src/test/java/utils/CrypUtilTest.java | 31 ++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/consumer-backend/productpass/src/test/java/utils/CrypUtilTest.java b/consumer-backend/productpass/src/test/java/utils/CrypUtilTest.java index 2b30b3b0e..e43627b32 100644 --- a/consumer-backend/productpass/src/test/java/utils/CrypUtilTest.java +++ b/consumer-backend/productpass/src/test/java/utils/CrypUtilTest.java @@ -32,6 +32,10 @@ class CrypUtilTest { String text = "I am a @Test!"; + String testKey = "123456789"; + + String textEncryptedAes = "6QhWJ8RatgUqMr47BV0FhQ=="; + String encodedText = "SSBhbSBhIEBUZXN0IQ=="; String encodedTextUrl = "SSBhbSBhIEBUZXN0IQ=="; @@ -91,11 +95,36 @@ void sha256() { String hash = null; try{ hash = CrypUtil.sha256(text); - LogUtil.printTest("[CrypUtil.toBase64] Text HASH: ["+hash+"]"); + LogUtil.printTest("[CrypUtil.sha256] Text HASH: ["+hash+"]"); } catch(Exception e){ fail("It was not possible to decode from base64: " + e.getMessage()); } assertEquals(textHash, hash); } + @Test + void encryptAes() { + String encrypted = null; + try{ + encrypted = CrypUtil.encryptAes(text, testKey); + LogUtil.printTest("[CrypUtil.encryptAes] Text Encrypted: ["+encrypted+"]"); + } catch(Exception e){ + fail("It was not possible to decrypt from AES: " + e.getMessage()); + } + assertEquals(textEncryptedAes, encrypted); + } + + @Test + void decryptAes() { + String decrypted = null; + try{ + decrypted = CrypUtil.decryptAes(textEncryptedAes, testKey); + LogUtil.printTest("[CrypUtil.decryptAes] Text Decrypted: ["+decrypted+"]"); + } catch(Exception e){ + fail("It was not possible to decrypt from AES: " + e.getMessage()); + } + assertEquals(text, decrypted); + } + } + From 6c35343331dbba1a71b3665a47190fa282e382ad Mon Sep 17 00:00:00 2001 From: Mathias Brunkow Moser Date: Tue, 6 Jun 2023 17:44:36 +0200 Subject: [PATCH 15/35] chore: updated helm charts, encryption and application yaml --- charts/digital-product-pass/Chart.yaml | 4 ++-- charts/digital-product-pass/values-beta.yaml | 4 ++++ charts/digital-product-pass/values-dev.yaml | 4 ++++ charts/digital-product-pass/values-int.yaml | 4 ++++ charts/digital-product-pass/values.yaml | 4 ++++ .../tractusx/productpass/http/controllers/AppController.java | 1 + .../productpass/src/main/java/utils/PassportUtil.java | 2 +- .../productpass/src/main/resources/application.yml | 4 ++-- 8 files changed, 22 insertions(+), 5 deletions(-) diff --git a/charts/digital-product-pass/Chart.yaml b/charts/digital-product-pass/Chart.yaml index d1011fe1e..ad74d4164 100644 --- a/charts/digital-product-pass/Chart.yaml +++ b/charts/digital-product-pass/Chart.yaml @@ -37,10 +37,10 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.3.3 +version: 0.3.5 # 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: "0.8.0" +appVersion: "0.9.0" diff --git a/charts/digital-product-pass/values-beta.yaml b/charts/digital-product-pass/values-beta.yaml index 44c178fe1..6aec2971a 100644 --- a/charts/digital-product-pass/values-beta.yaml +++ b/charts/digital-product-pass/values-beta.yaml @@ -106,6 +106,10 @@ backend: registryUrl: 'https://semantics.beta.demo.catena-x.net' passport: + dataTransfer: + encrypt: true + indent: true + dir: "data/transfer" versions: - 'v3.0.1' diff --git a/charts/digital-product-pass/values-dev.yaml b/charts/digital-product-pass/values-dev.yaml index 2f0112617..7462ec1e8 100644 --- a/charts/digital-product-pass/values-dev.yaml +++ b/charts/digital-product-pass/values-dev.yaml @@ -106,6 +106,10 @@ backend: registryUrl: 'https://semantics.dev.demo.catena-x.net' passport: + dataTransfer: + encrypt: true + indent: true + dir: "data/transfer" versions: - 'v3.0.1' diff --git a/charts/digital-product-pass/values-int.yaml b/charts/digital-product-pass/values-int.yaml index ec089be96..6244002c6 100644 --- a/charts/digital-product-pass/values-int.yaml +++ b/charts/digital-product-pass/values-int.yaml @@ -106,6 +106,10 @@ backend: registryUrl: 'https://semantics.int.demo.catena-x.net' passport: + dataTransfer: + encrypt: true + indent: true + dir: "data/transfer" versions: - 'v3.0.1' diff --git a/charts/digital-product-pass/values.yaml b/charts/digital-product-pass/values.yaml index f68057105..68050fc77 100644 --- a/charts/digital-product-pass/values.yaml +++ b/charts/digital-product-pass/values.yaml @@ -117,6 +117,10 @@ backend: registryUrl: 'https://semantics.dev.demo.catena-x.net' passport: + dataTransfer: + encrypt: true + indent: true + dir: "data/transfer" versions: - 'v3.0.1' diff --git a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/http/controllers/AppController.java b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/http/controllers/AppController.java index ef3312a59..775cca583 100644 --- a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/http/controllers/AppController.java +++ b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/http/controllers/AppController.java @@ -109,6 +109,7 @@ public Response endpoint(@RequestBody Object body){ Boolean encrypt = env.getProperty("passport.dataTransfer.encrypt", Boolean.class, true); String passportPath = passportUtil.savePassport(passport, endpointData, prettyPrint, encrypt); LogUtil.printMessage("[EDC] Passport Transfer Data ["+endpointData.getId()+"] Saved Successfully in ["+passportPath+"]!"); + }catch(Exception e) { LogUtil.printException(e, "This request is not allowed! It must contain the valid attributes from an EDC endpoint"); return httpUtil.buildResponse(httpUtil.getForbiddenResponse(), httpResponse); diff --git a/consumer-backend/productpass/src/main/java/utils/PassportUtil.java b/consumer-backend/productpass/src/main/java/utils/PassportUtil.java index e6040edf9..1b2f76842 100644 --- a/consumer-backend/productpass/src/main/java/utils/PassportUtil.java +++ b/consumer-backend/productpass/src/main/java/utils/PassportUtil.java @@ -54,7 +54,7 @@ public String savePassport(Passport passport, DataPlaneEndpoint endpointData, Bo if(!encrypted) { return jsonUtil.toJsonFile(path, passport, prettyPrint); // Store the plain JSON }else{ - return fileUtil.toFile(path, CrypUtil.encryptAes(jsonUtil.toJson(passport, prettyPrint), endpointData.getOfferId()), false); // Store Encrypted + return fileUtil.toFile(path, CrypUtil.encryptAes(jsonUtil.toJson(passport, prettyPrint), endpointData.getOfferId()+endpointData.getId()), false); // Store Encrypted } }catch (Exception e){ throw new UtilException(PassportUtil.class, e, "Something went wrong while saving the passport for transfer ["+endpointData.getId()+"]"); diff --git a/consumer-backend/productpass/src/main/resources/application.yml b/consumer-backend/productpass/src/main/resources/application.yml index 7252ccbdb..c1d8ca6c3 100644 --- a/consumer-backend/productpass/src/main/resources/application.yml +++ b/consumer-backend/productpass/src/main/resources/application.yml @@ -47,8 +47,8 @@ configuration: passport: dataTransfer: - encrypted: true - indented: true + encrypt: true + indent: true dir: "data/transfer" versions: - 'v3.0.1' From c57afb76b2d1b064219ad7a7c54d9ef63be5a7d7 Mon Sep 17 00:00:00 2001 From: Mathias Brunkow Moser Date: Tue, 6 Jun 2023 18:05:18 +0200 Subject: [PATCH 16/35] chore: removed decrepated cx-backend service and updated charts and versions --- CHANGELOG.md | 18 ++ .../http/controllers/AppController.java | 3 +- deployment/helm/edc-consumer/Chart.yaml | 5 - .../edc-consumer/backend-service/.helmignore | 45 ----- .../edc-consumer/backend-service/Chart.yaml | 31 ---- .../backend-service/templates/NOTES.txt | 38 ---- .../backend-service/templates/_helpers.tpl | 84 --------- .../backend-service/templates/deployment.yaml | 101 ----------- .../backend-service/templates/hpa.yaml | 51 ------ .../backend-service/templates/ingress.yaml | 80 --------- .../backend-service/templates/pvc.yaml | 48 ----- .../backend-service/templates/service.yaml | 42 ----- .../templates/serviceaccount.yaml | 35 ---- .../backend-service/values-beta.yaml | 164 ------------------ .../backend-service/values-dev.yaml | 164 ------------------ .../backend-service/values-int.yaml | 164 ------------------ .../edc-consumer/backend-service/values.yaml | 164 ------------------ deployment/helm/edc-consumer/values-beta.yaml | 11 +- deployment/helm/edc-consumer/values-dev.yaml | 11 +- deployment/helm/edc-consumer/values-int.yaml | 12 +- deployment/helm/edc-provider/Chart.yaml | 5 - .../helm/edc-provider/data-service/Chart.lock | 6 - deployment/helm/edc-provider/values-beta.yaml | 12 +- deployment/helm/edc-provider/values-dev.yaml | 12 +- deployment/helm/edc-provider/values-int.yaml | 12 +- docs/RELEASE_USER.md | 7 + package-lock.json | 2 +- package.json | 2 +- 28 files changed, 34 insertions(+), 1295 deletions(-) delete mode 100644 deployment/helm/edc-consumer/backend-service/.helmignore delete mode 100644 deployment/helm/edc-consumer/backend-service/Chart.yaml delete mode 100644 deployment/helm/edc-consumer/backend-service/templates/NOTES.txt delete mode 100644 deployment/helm/edc-consumer/backend-service/templates/_helpers.tpl delete mode 100644 deployment/helm/edc-consumer/backend-service/templates/deployment.yaml delete mode 100644 deployment/helm/edc-consumer/backend-service/templates/hpa.yaml delete mode 100644 deployment/helm/edc-consumer/backend-service/templates/ingress.yaml delete mode 100644 deployment/helm/edc-consumer/backend-service/templates/pvc.yaml delete mode 100644 deployment/helm/edc-consumer/backend-service/templates/service.yaml delete mode 100644 deployment/helm/edc-consumer/backend-service/templates/serviceaccount.yaml delete mode 100644 deployment/helm/edc-consumer/backend-service/values-beta.yaml delete mode 100644 deployment/helm/edc-consumer/backend-service/values-dev.yaml delete mode 100644 deployment/helm/edc-consumer/backend-service/values-int.yaml delete mode 100644 deployment/helm/edc-consumer/backend-service/values.yaml delete mode 100644 deployment/helm/edc-provider/data-service/Chart.lock diff --git a/CHANGELOG.md b/CHANGELOG.md index e9ee1249e..970725cc8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,24 @@ The changelog format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [in preparation] +## [0.9.0] - xxxx-xx-xx + +## Deleted + +- Deleted the cx-backend-service from the EDC Consumer and Provider deployments + +## Added +- Added new `/endpoint` api to store the payload incomming from the EDC data plane +- Added the encryption and decryption in AES from passport payload. +- Added AES unit tests +- Added the DataPlane service in the backend to comunicate with the data plane. + +## Updated +- Updated charts configurations related to the backend. +- Updated the EDC test charts to remote the cx-backend-service configurations + + ## [released] ## [0.8.0] - 2023-05-19 diff --git a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/http/controllers/AppController.java b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/http/controllers/AppController.java index 775cca583..5922bc290 100644 --- a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/http/controllers/AppController.java +++ b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/http/controllers/AppController.java @@ -109,12 +109,11 @@ public Response endpoint(@RequestBody Object body){ Boolean encrypt = env.getProperty("passport.dataTransfer.encrypt", Boolean.class, true); String passportPath = passportUtil.savePassport(passport, endpointData, prettyPrint, encrypt); LogUtil.printMessage("[EDC] Passport Transfer Data ["+endpointData.getId()+"] Saved Successfully in ["+passportPath+"]!"); - }catch(Exception e) { LogUtil.printException(e, "This request is not allowed! It must contain the valid attributes from an EDC endpoint"); return httpUtil.buildResponse(httpUtil.getForbiddenResponse(), httpResponse); } - return httpUtil.buildResponse(httpUtil.getResponse(), httpResponse); + return httpUtil.buildResponse(httpUtil.getResponse("ok"), httpResponse); } diff --git a/deployment/helm/edc-consumer/Chart.yaml b/deployment/helm/edc-consumer/Chart.yaml index 6dfa9e967..5efe1f8e9 100644 --- a/deployment/helm/edc-consumer/Chart.yaml +++ b/deployment/helm/edc-consumer/Chart.yaml @@ -38,11 +38,6 @@ dependencies: version: "0.1.6" repository: https://catenax-ng.github.io/product-edc condition: dataplane.enabled - - name: backend-service - version: "0.0.6" - repository: file://backend-service - alias: consumerbackendapplication - condition: consumerbackendapplication.enabled - name: postgresql alias: postgres version: 12.1.5 diff --git a/deployment/helm/edc-consumer/backend-service/.helmignore b/deployment/helm/edc-consumer/backend-service/.helmignore deleted file mode 100644 index 916bb9632..000000000 --- a/deployment/helm/edc-consumer/backend-service/.helmignore +++ /dev/null @@ -1,45 +0,0 @@ -################################################################################# -# Catena-X - Product Passport Consumer Application -# -# 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. -# -# This program and the accompanying materials are made available under the -# terms of the Apache License, Version 2.0 which is available at -# https://www.apache.org/licenses/LICENSE-2.0. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -# either express or implied. See the -# License for the specific language govern in permissions and limitations -# under the License. -# -# SPDX-License-Identifier: Apache-2.0 -################################################################################## - -# Patterns to ignore when building packages. -# This supports shell glob matching, relative path matching, and -# negation (prefixed with !). Only one pattern per line. -.DS_Store -# Common VCS dirs -.git/ -.gitignore -.bzr/ -.bzrignore -.hg/ -.hgignore -.svn/ -# Common backup files -*.swp -*.bak -*.tmp -*.orig -*~ -# Various IDEs -.project -.idea/ -*.tmproj -.vscode/ diff --git a/deployment/helm/edc-consumer/backend-service/Chart.yaml b/deployment/helm/edc-consumer/backend-service/Chart.yaml deleted file mode 100644 index f309bf910..000000000 --- a/deployment/helm/edc-consumer/backend-service/Chart.yaml +++ /dev/null @@ -1,31 +0,0 @@ -################################################################################# -# Catena-X - Product Passport Consumer Frontend -# -# 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. -# -# This program and the accompanying materials are made available under the -# terms of the Apache License, Version 2.0 which is available at -# https://www.apache.org/licenses/LICENSE-2.0. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -# either express or implied. See the -# License for the specific language govern in permissions and limitations -# under the License. -# -# SPDX-License-Identifier: Apache-2.0 -################################################################################## - ---- -apiVersion: v2 -name: backend-service -description: Small CX Backend Service Implementation for Testing Purposes -home: https://github.com/denisneuling/cx-backend-service -type: application -version: 0.0.6 -appVersion: "0.0.6" -maintainers: [] diff --git a/deployment/helm/edc-consumer/backend-service/templates/NOTES.txt b/deployment/helm/edc-consumer/backend-service/templates/NOTES.txt deleted file mode 100644 index c952ffd09..000000000 --- a/deployment/helm/edc-consumer/backend-service/templates/NOTES.txt +++ /dev/null @@ -1,38 +0,0 @@ -################################################################################# -# Catena-X - Product Passport Consumer Application -# -# 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. -# -# This program and the accompanying materials are made available under the -# terms of the Apache License, Version 2.0 which is available at -# https://www.apache.org/licenses/LICENSE-2.0. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -# either express or implied. See the -# License for the specific language govern in permissions and limitations -# under the License. -# -# SPDX-License-Identifier: Apache-2.0 -################################################################################## - -1. Get the application URL by running these commands: -{{- if contains "NodePort" .Values.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "backend-service.fullname" . }}) - export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - echo http://$NODE_IP:$NODE_PORT -{{- else if contains "LoadBalancer" .Values.service.type }} - NOTE: It may take a few minutes for the LoadBalancer IP to be available. - You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "backend-service.fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "backend-service.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo http://$SERVICE_IP:{{ .Values.service.port }} -{{- else if contains "ClusterIP" .Values.service.type }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "backend-service.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") - export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") - echo "Visit http://127.0.0.1:8080 to use your application" - kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT -{{- end }} diff --git a/deployment/helm/edc-consumer/backend-service/templates/_helpers.tpl b/deployment/helm/edc-consumer/backend-service/templates/_helpers.tpl deleted file mode 100644 index 5d26f41d0..000000000 --- a/deployment/helm/edc-consumer/backend-service/templates/_helpers.tpl +++ /dev/null @@ -1,84 +0,0 @@ -################################################################################# -# Catena-X - Product Passport Consumer Frontend -# -# 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. -# -# This program and the accompanying materials are made available under the -# terms of the Apache License, Version 2.0 which is available at -# https://www.apache.org/licenses/LICENSE-2.0. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -# either express or implied. See the -# License for the specific language govern in permissions and limitations -# under the License. -# -# SPDX-License-Identifier: Apache-2.0 -################################################################################## - -{{/* -Expand the name of the chart. -*/}} -{{- define "backend-service.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. -*/}} -{{- define "backend-service.fullname" -}} -{{- if .Values.fullnameOverride }} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- $name := default .Chart.Name .Values.nameOverride }} -{{- if contains $name .Release.Name }} -{{- .Release.Name | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} -{{- end }} -{{- end }} -{{- end }} - -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "backend-service.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Common labels -*/}} -{{- define "backend-service.labels" -}} -helm.sh/chart: {{ include "backend-service.chart" . }} -{{ include "backend-service.selectorLabels" . }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- end }} - -{{/* -Selector labels -*/}} -{{- define "backend-service.selectorLabels" -}} -app.kubernetes.io/name: {{ include "backend-service.name" . }} -app.kubernetes.io/instance: {{ .Release.Name }} -{{- end }} - -{{/* -Create the name of the service account to use -*/}} -{{- define "backend-service.serviceAccountName" -}} -{{- if .Values.serviceAccount.create }} -{{- default (include "backend-service.fullname" .) .Values.serviceAccount.name }} -{{- else }} -{{- default "default" .Values.serviceAccount.name }} -{{- end }} -{{- end }} diff --git a/deployment/helm/edc-consumer/backend-service/templates/deployment.yaml b/deployment/helm/edc-consumer/backend-service/templates/deployment.yaml deleted file mode 100644 index f276109f9..000000000 --- a/deployment/helm/edc-consumer/backend-service/templates/deployment.yaml +++ /dev/null @@ -1,101 +0,0 @@ -################################################################################# -# Catena-X - Product Passport Consumer Frontend -# -# 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. -# -# This program and the accompanying materials are made available under the -# terms of the Apache License, Version 2.0 which is available at -# https://www.apache.org/licenses/LICENSE-2.0. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -# either express or implied. See the -# License for the specific language govern in permissions and limitations -# under the License. -# -# SPDX-License-Identifier: Apache-2.0 -################################################################################## - ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ include "backend-service.fullname" . }} - labels: - {{- include "backend-service.labels" . | nindent 4 }} -spec: - {{- if not .Values.autoscaling.enabled }} - replicas: {{ .Values.replicaCount }} - {{- end }} - selector: - matchLabels: - {{- include "backend-service.selectorLabels" . | nindent 6 }} - template: - metadata: - {{- with .Values.podAnnotations }} - annotations: - {{- toYaml . | nindent 8 }} - {{- end }} - labels: - {{- include "backend-service.selectorLabels" . | nindent 8 }} - spec: - {{- with .Values.imagePullSecrets }} - imagePullSecrets: - {{- toYaml . | nindent 8 }} - {{- end }} - serviceAccountName: {{ include "backend-service.serviceAccountName" . }} - automountServiceAccountToken: {{ .Values.automountServiceAccountToken }} - securityContext: - {{- toYaml .Values.podSecurityContext | nindent 8 }} - containers: - - name: {{ .Chart.Name }} - securityContext: - {{- toYaml .Values.securityContext | nindent 12 }} - image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} - {{ if .Values.livenessProbe -}} - livenessProbe: - {{ toYaml .Values.livenessProbe | nindent 12 }} - {{ end -}} - {{ if .Values.readinessProbe -}} - readinessProbe: - {{ toYaml .Values.readinessProbe | nindent 12 }} - {{ end -}} - volumeMounts: - - name: data - mountPath: /mnt/data - env: - - name: BACKEND_SERVICE_DATA_DIR - value: /mnt/data - ports: - - containerPort: 8080 - protocol: TCP - name: frontend - - containerPort: 8081 - protocol: TCP - name: backend - volumes: - - name: data - {{- if .Values.persistence.enabled }} - persistentVolumeClaim: - claimName: {{ include "backend-service.fullname" . }}-pvc - {{ else }} - emptyDir: - {} - {{- end }} - {{- with .Values.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.affinity }} - affinity: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.tolerations }} - tolerations: - {{- toYaml . | nindent 8 }} - {{- end }} diff --git a/deployment/helm/edc-consumer/backend-service/templates/hpa.yaml b/deployment/helm/edc-consumer/backend-service/templates/hpa.yaml deleted file mode 100644 index 6c5747f60..000000000 --- a/deployment/helm/edc-consumer/backend-service/templates/hpa.yaml +++ /dev/null @@ -1,51 +0,0 @@ -################################################################################# -# Catena-X - Product Passport Consumer Frontend -# -# 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. -# -# This program and the accompanying materials are made available under the -# terms of the Apache License, Version 2.0 which is available at -# https://www.apache.org/licenses/LICENSE-2.0. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -# either express or implied. See the -# License for the specific language govern in permissions and limitations -# under the License. -# -# SPDX-License-Identifier: Apache-2.0 -################################################################################## - -{{- if .Values.autoscaling.enabled }} ---- -apiVersion: autoscaling/v2beta1 -kind: HorizontalPodAutoscaler -metadata: - name: {{ include "backend-service.fullname" . }} - labels: - {{- include "backend-service.labels" . | nindent 4 }} -spec: - scaleTargetRef: - apiVersion: apps/v1 - kind: Deployment - name: {{ include "backend-service.fullname" . }} - minReplicas: {{ .Values.autoscaling.minReplicas }} - maxReplicas: {{ .Values.autoscaling.maxReplicas }} - metrics: - {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} - - type: Resource - resource: - name: cpu - targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} - {{- end }} - {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} - - type: Resource - resource: - name: memory - targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} - {{- end }} - {{- end }} diff --git a/deployment/helm/edc-consumer/backend-service/templates/ingress.yaml b/deployment/helm/edc-consumer/backend-service/templates/ingress.yaml deleted file mode 100644 index 0d14dcf5e..000000000 --- a/deployment/helm/edc-consumer/backend-service/templates/ingress.yaml +++ /dev/null @@ -1,80 +0,0 @@ -################################################################################# -# Catena-X - Product Passport Consumer Frontend -# -# 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. -# -# This program and the accompanying materials are made available under the -# terms of the Apache License, Version 2.0 which is available at -# https://www.apache.org/licenses/LICENSE-2.0. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -# either express or implied. See the -# License for the specific language govern in permissions and limitations -# under the License. -# -# SPDX-License-Identifier: Apache-2.0 -################################################################################## - -{{- if .Values.ingress.enabled -}} -{{- $fullName := include "backend-service.fullname" . -}} -{{- $svcPort := .Values.service.port -}} -{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} - {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} - {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} - {{- end }} -{{- end }} - - -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - name: {{ $fullName }} - namespace: {{ .Values.namespace }} - labels: - {{- include "backend-service.labels" . | nindent 4 }} - {{- with .Values.ingress.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -spec: - {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} - ingressClassName: {{ .Values.ingress.className }} - {{- end }} - {{- if .Values.ingress.tls }} - tls: - {{- range .Values.ingress.tls }} - - hosts: - {{- range .hosts }} - - {{ . | quote }} - {{- end }} - secretName: {{ .secretName }} - {{- end }} - {{- end }} - rules: - {{- range .Values.ingress.hosts }} - - host: {{ .host | quote }} - http: - paths: - {{- range .paths }} - - path: {{ .path }} - {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} - pathType: {{ .pathType }} - {{- end }} - backend: - {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} - service: - name: {{ $fullName }} - port: - number: 8081 - {{- else }} - serviceName: {{ $fullName }} - servicePort: 8081 - {{- end }} - {{- end }} - {{- end }} -{{- end }} diff --git a/deployment/helm/edc-consumer/backend-service/templates/pvc.yaml b/deployment/helm/edc-consumer/backend-service/templates/pvc.yaml deleted file mode 100644 index fcb5bdbc6..000000000 --- a/deployment/helm/edc-consumer/backend-service/templates/pvc.yaml +++ /dev/null @@ -1,48 +0,0 @@ -################################################################################# -# Catena-X - Product Passport Consumer Frontend -# -# 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. -# -# This program and the accompanying materials are made available under the -# terms of the Apache License, Version 2.0 which is available at -# https://www.apache.org/licenses/LICENSE-2.0. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -# either express or implied. See the -# License for the specific language govern in permissions and limitations -# under the License. -# -# SPDX-License-Identifier: Apache-2.0 -################################################################################## - -{{ if .Values.persistence.enabled -}} ---- -apiVersion: "v1" -kind: PersistentVolumeClaim -metadata: - name: {{ include "backend-service.fullname" . }}-pvc - labels: - {{- include "backend-service.labels" . | nindent 4 }} -spec: - {{- if .Values.persistence.storageClassName }} - storageClassName: {{ .Values.persistence.storageClassName | quote }} - {{- end }} - accessModes: - {{- if .Values.persistence.accessMode }} - - {{ .Values.persistence.accessMode | quote }} - {{ else }} - {{- if .Values.autoscaling.enabled }} - - ReadWriteMany - {{ else }} - - ReadWriteOnce - {{- end }} - {{- end }} - resources: - requests: - storage: {{ .Values.persistence.capacity | quote }} -{{ end -}} diff --git a/deployment/helm/edc-consumer/backend-service/templates/service.yaml b/deployment/helm/edc-consumer/backend-service/templates/service.yaml deleted file mode 100644 index 6a9d7a4b1..000000000 --- a/deployment/helm/edc-consumer/backend-service/templates/service.yaml +++ /dev/null @@ -1,42 +0,0 @@ -################################################################################# -# Catena-X - Product Passport Consumer Frontend -# -# 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. -# -# This program and the accompanying materials are made available under the -# terms of the Apache License, Version 2.0 which is available at -# https://www.apache.org/licenses/LICENSE-2.0. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -# either express or implied. See the -# License for the specific language govern in permissions and limitations -# under the License. -# -# SPDX-License-Identifier: Apache-2.0 -################################################################################## - ---- -apiVersion: v1 -kind: Service -metadata: - name: {{ include "backend-service.fullname" . }} - labels: - {{- include "backend-service.labels" . | nindent 4 }} -spec: - type: {{ .Values.service.type }} - ports: - - port: {{ .Values.service.frontend.port }} - targetPort: frontend - protocol: TCP - name: frontend - - port: {{ .Values.service.backend.port }} - targetPort: backend - protocol: TCP - name: backend - selector: - {{- include "backend-service.selectorLabels" . | nindent 4 }} diff --git a/deployment/helm/edc-consumer/backend-service/templates/serviceaccount.yaml b/deployment/helm/edc-consumer/backend-service/templates/serviceaccount.yaml deleted file mode 100644 index 9aafdc13a..000000000 --- a/deployment/helm/edc-consumer/backend-service/templates/serviceaccount.yaml +++ /dev/null @@ -1,35 +0,0 @@ -################################################################################# -# Catena-X - Product Passport Consumer Frontend -# -# 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. -# -# This program and the accompanying materials are made available under the -# terms of the Apache License, Version 2.0 which is available at -# https://www.apache.org/licenses/LICENSE-2.0. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -# either express or implied. See the -# License for the specific language govern in permissions and limitations -# under the License. -# -# SPDX-License-Identifier: Apache-2.0 -################################################################################## - -{{- if .Values.serviceAccount.create -}} ---- -apiVersion: v1 -kind: ServiceAccount -metadata: - name: {{ include "backend-service.serviceAccountName" . }} - labels: - {{- include "backend-service.labels" . | nindent 4 }} - {{- with .Values.serviceAccount.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} - {{- end }} diff --git a/deployment/helm/edc-consumer/backend-service/values-beta.yaml b/deployment/helm/edc-consumer/backend-service/values-beta.yaml deleted file mode 100644 index 17192d3c2..000000000 --- a/deployment/helm/edc-consumer/backend-service/values-beta.yaml +++ /dev/null @@ -1,164 +0,0 @@ -################################################################################# -# Catena-X - Product Passport Consumer Frontend -# -# 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. -# -# This program and the accompanying materials are made available under the -# terms of the Apache License, Version 2.0 which is available at -# https://www.apache.org/licenses/LICENSE-2.0. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -# either express or implied. See the -# License for the specific language govern in permissions and limitations -# under the License. -# -# SPDX-License-Identifier: Apache-2.0 -################################################################################## - -# Default values for .. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. - -replicaCount: 1 - -image: - # -- Which container image to use - repository: ghcr.io/denisneuling/cx-backend-service - # -- [Kubernetes image pull policy](https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy) to use - pullPolicy: IfNotPresent - # -- Overrides the image tag whose default is the chart appVersion - tag: "0.0.6" - -# -- Image pull secret to create to [obtain the container image from private registries](https://kubernetes.io/docs/concepts/containers/images/#using-a-private-registry) -imagePullSecrets: [] - -# -- Overrides the charts name -nameOverride: "" - -# -- Overrides the releases full name -fullnameOverride: "" - -serviceAccount: - # -- Specifies whether a [service account](https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/) should be created per release - create: true - # -- [Annotations](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) to add to the service account - annotations: {} - # -- The name of the service account to use. If not set and create is true, a name is generated using the release's fullname template - name: "" - -# -- Whether to [automount kubernetes API credentials](https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/#use-the-default-service-account-to-access-the-api-server) into the pod -automountServiceAccountToken: false - -# -- [Annotations](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) added to deployed [pods](https://kubernetes.io/docs/concepts/workloads/pods/) -podAnnotations: {} - -# The [pod security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod) defines privilege and access control settings for a Pod within the deployment -podSecurityContext: {} - -# The [container security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container) defines privilege and access control settings for a Container within a pod -securityContext: {} - -service: - # -- [Service type](https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types) to expose the running application on a set of Pods as a network service. - type: ClusterIP - frontend: - # -- Port on which to run the "frontend" api - port: 8080 - backend: - # -- Port on which to run the "backend" api - port: 8081 - -ingress: - enabled: true - className: "nginx" - annotations: - #kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" - nginx.ingress.kubernetes.io/force-ssl-redirect: "true" - nginx.ingress.kubernetes.io/ssl-passthrough: "false" - nginx.ingress.kubernetes.io/rewrite-target: /$2 - nginx.ingress.kubernetes.io/backend-protocol: "HTTP" - hosts: - - host: materialpass.beta.demo.catena-x.net - paths: - - path: /consumer_backend(/|$)(.*) - pathType: Prefix - tls: - - secretName: tls-secret - hosts: - - materialpass.beta.demo.catena-x.net - -# -- [Resource management](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) applied to the deployed pod -resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - -autoscaling: - # -- Enables [horizontal pod autoscaling](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/) - enabled: false - # -- Minimal replicas if resource consumption falls below resource threshholds - minReplicas: 1 - # -- Maximum replicas if resource consumption exceeds resource threshholds - maxReplicas: 100 - # -- targetAverageUtilization of cpu provided to a pod - targetCPUUtilizationPercentage: 80 - # -- targetAverageUtilization of memory provided to a pod - targetMemoryUtilizationPercentage: 80 - -# -- [Liveness-Probe](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#define-a-liveness-command) to detect and remedy broken applications -livenessProbe: - # -- exec command for liveness check - exec: - command: - - /bin/bash - - -c - - /bin/ps -ef | grep backend-service | grep -v grep - # -- initialDelaySeconds before performing the first probe - initialDelaySeconds: 10 - # -- periodSeconds between each probe - periodSeconds: 10 - -# -- [Readiness-Probe](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#define-readiness-probes) to detect ready applications to receive traffic -readinessProbe: - # -- exec command for readiness check - exec: - command: - - /bin/bash - - -c - - /bin/ps -ef | grep backend-service | grep -v grep - # -- initialDelaySeconds before performing the first probe - initialDelaySeconds: 10 - # -- periodSeconds between each probe - periodSeconds: 10 - -# -- [Node-Selector](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector) to constrain the Pod to nodes with specific labels. -nodeSelector: {} - -# -- [Tolerations](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) are applied to Pods to schedule onto nodes with matching taints. -tolerations: [] - -# -- [Affinity](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity) constrains which nodes the Pod can be scheduled on based on node labels. -affinity: {} - -persistence: - # -- Whether to enable persistence via [PersistentVolumeClaim](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#reserving-a-persistentvolume) - enabled: false - # -- [PersistentVolume Access Modes](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes) Access mode to use. One of (ReadOnlyMany, ReadWriteOnce, ReadWriteMany, ReadWriteOncePod) - accessMode: - # -- Storage class to use together with the claimed [PersistentVolume](https://kubernetes.io/docs/concepts/storage/persistent-volumes/) - storageClassName: - # -- Capacity given to the claimed [PersistentVolume](https://kubernetes.io/docs/concepts/storage/persistent-volumes/) - capacity: 100M diff --git a/deployment/helm/edc-consumer/backend-service/values-dev.yaml b/deployment/helm/edc-consumer/backend-service/values-dev.yaml deleted file mode 100644 index c3ebefc45..000000000 --- a/deployment/helm/edc-consumer/backend-service/values-dev.yaml +++ /dev/null @@ -1,164 +0,0 @@ -################################################################################# -# Catena-X - Product Passport Consumer Frontend -# -# 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. -# -# This program and the accompanying materials are made available under the -# terms of the Apache License, Version 2.0 which is available at -# https://www.apache.org/licenses/LICENSE-2.0. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -# either express or implied. See the -# License for the specific language govern in permissions and limitations -# under the License. -# -# SPDX-License-Identifier: Apache-2.0 -################################################################################## - -# Default values for .. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. - -replicaCount: 1 - -image: - # -- Which container image to use - repository: ghcr.io/denisneuling/cx-backend-service - # -- [Kubernetes image pull policy](https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy) to use - pullPolicy: IfNotPresent - # -- Overrides the image tag whose default is the chart appVersion - tag: "0.0.6" - -# -- Image pull secret to create to [obtain the container image from private registries](https://kubernetes.io/docs/concepts/containers/images/#using-a-private-registry) -imagePullSecrets: [] - -# -- Overrides the charts name -nameOverride: "" - -# -- Overrides the releases full name -fullnameOverride: "" - -serviceAccount: - # -- Specifies whether a [service account](https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/) should be created per release - create: true - # -- [Annotations](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) to add to the service account - annotations: {} - # -- The name of the service account to use. If not set and create is true, a name is generated using the release's fullname template - name: "" - -# -- Whether to [automount kubernetes API credentials](https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/#use-the-default-service-account-to-access-the-api-server) into the pod -automountServiceAccountToken: false - -# -- [Annotations](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) added to deployed [pods](https://kubernetes.io/docs/concepts/workloads/pods/) -podAnnotations: {} - -# The [pod security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod) defines privilege and access control settings for a Pod within the deployment -podSecurityContext: {} - -# The [container security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container) defines privilege and access control settings for a Container within a pod -securityContext: {} - -service: - # -- [Service type](https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types) to expose the running application on a set of Pods as a network service. - type: ClusterIP - frontend: - # -- Port on which to run the "frontend" api - port: 8080 - backend: - # -- Port on which to run the "backend" api - port: 8081 - -ingress: - enabled: true - className: "nginx" - annotations: - #kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" - nginx.ingress.kubernetes.io/force-ssl-redirect: "true" - nginx.ingress.kubernetes.io/ssl-passthrough: "false" - nginx.ingress.kubernetes.io/rewrite-target: /$2 - nginx.ingress.kubernetes.io/backend-protocol: "HTTP" - hosts: - - host: materialpass.dev.demo.catena-x.net - paths: - - path: /consumer_backend(/|$)(.*) - pathType: Prefix - tls: - - secretName: tls-secret - hosts: - - materialpass.dev.demo.catena-x.net - -# -- [Resource management](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) applied to the deployed pod -resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - -autoscaling: - # -- Enables [horizontal pod autoscaling](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/) - enabled: false - # -- Minimal replicas if resource consumption falls below resource threshholds - minReplicas: 1 - # -- Maximum replicas if resource consumption exceeds resource threshholds - maxReplicas: 100 - # -- targetAverageUtilization of cpu provided to a pod - targetCPUUtilizationPercentage: 80 - # -- targetAverageUtilization of memory provided to a pod - targetMemoryUtilizationPercentage: 80 - -# -- [Liveness-Probe](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#define-a-liveness-command) to detect and remedy broken applications -livenessProbe: - # -- exec command for liveness check - exec: - command: - - /bin/bash - - -c - - /bin/ps -ef | grep backend-service | grep -v grep - # -- initialDelaySeconds before performing the first probe - initialDelaySeconds: 10 - # -- periodSeconds between each probe - periodSeconds: 10 - -# -- [Readiness-Probe](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#define-readiness-probes) to detect ready applications to receive traffic -readinessProbe: - # -- exec command for readiness check - exec: - command: - - /bin/bash - - -c - - /bin/ps -ef | grep backend-service | grep -v grep - # -- initialDelaySeconds before performing the first probe - initialDelaySeconds: 10 - # -- periodSeconds between each probe - periodSeconds: 10 - -# -- [Node-Selector](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector) to constrain the Pod to nodes with specific labels. -nodeSelector: {} - -# -- [Tolerations](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) are applied to Pods to schedule onto nodes with matching taints. -tolerations: [] - -# -- [Affinity](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity) constrains which nodes the Pod can be scheduled on based on node labels. -affinity: {} - -persistence: - # -- Whether to enable persistence via [PersistentVolumeClaim](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#reserving-a-persistentvolume) - enabled: false - # -- [PersistentVolume Access Modes](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes) Access mode to use. One of (ReadOnlyMany, ReadWriteOnce, ReadWriteMany, ReadWriteOncePod) - accessMode: - # -- Storage class to use together with the claimed [PersistentVolume](https://kubernetes.io/docs/concepts/storage/persistent-volumes/) - storageClassName: - # -- Capacity given to the claimed [PersistentVolume](https://kubernetes.io/docs/concepts/storage/persistent-volumes/) - capacity: 100M diff --git a/deployment/helm/edc-consumer/backend-service/values-int.yaml b/deployment/helm/edc-consumer/backend-service/values-int.yaml deleted file mode 100644 index 43a07de13..000000000 --- a/deployment/helm/edc-consumer/backend-service/values-int.yaml +++ /dev/null @@ -1,164 +0,0 @@ -################################################################################# -# Catena-X - Product Passport Consumer Frontend -# -# 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. -# -# This program and the accompanying materials are made available under the -# terms of the Apache License, Version 2.0 which is available at -# https://www.apache.org/licenses/LICENSE-2.0. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -# either express or implied. See the -# License for the specific language govern in permissions and limitations -# under the License. -# -# SPDX-License-Identifier: Apache-2.0 -################################################################################## - -# Default values for .. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. - -replicaCount: 1 - -image: - # -- Which container image to use - repository: ghcr.io/denisneuling/cx-backend-service - # -- [Kubernetes image pull policy](https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy) to use - pullPolicy: IfNotPresent - # -- Overrides the image tag whose default is the chart appVersion - tag: "0.0.6" - -# -- Image pull secret to create to [obtain the container image from private registries](https://kubernetes.io/docs/concepts/containers/images/#using-a-private-registry) -imagePullSecrets: [] - -# -- Overrides the charts name -nameOverride: "" - -# -- Overrides the releases full name -fullnameOverride: "" - -serviceAccount: - # -- Specifies whether a [service account](https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/) should be created per release - create: true - # -- [Annotations](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) to add to the service account - annotations: {} - # -- The name of the service account to use. If not set and create is true, a name is generated using the release's fullname template - name: "" - -# -- Whether to [automount kubernetes API credentials](https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/#use-the-default-service-account-to-access-the-api-server) into the pod -automountServiceAccountToken: false - -# -- [Annotations](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) added to deployed [pods](https://kubernetes.io/docs/concepts/workloads/pods/) -podAnnotations: {} - -# The [pod security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod) defines privilege and access control settings for a Pod within the deployment -podSecurityContext: {} - -# The [container security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container) defines privilege and access control settings for a Container within a pod -securityContext: {} - -service: - # -- [Service type](https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types) to expose the running application on a set of Pods as a network service. - type: ClusterIP - frontend: - # -- Port on which to run the "frontend" api - port: 8080 - backend: - # -- Port on which to run the "backend" api - port: 8081 - -ingress: - enabled: true - className: "nginx" - annotations: - #kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" - nginx.ingress.kubernetes.io/force-ssl-redirect: "true" - nginx.ingress.kubernetes.io/ssl-passthrough: "false" - nginx.ingress.kubernetes.io/rewrite-target: /$2 - nginx.ingress.kubernetes.io/backend-protocol: "HTTP" - hosts: - - host: materialpass.int.demo.catena-x.net - paths: - - path: /consumer_backend(/|$)(.*) - pathType: Prefix - tls: - - secretName: tls-secret - hosts: - - materialpass.int.demo.catena-x.net - -# -- [Resource management](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) applied to the deployed pod -resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - -autoscaling: - # -- Enables [horizontal pod autoscaling](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/) - enabled: false - # -- Minimal replicas if resource consumption falls below resource threshholds - minReplicas: 1 - # -- Maximum replicas if resource consumption exceeds resource threshholds - maxReplicas: 100 - # -- targetAverageUtilization of cpu provided to a pod - targetCPUUtilizationPercentage: 80 - # -- targetAverageUtilization of memory provided to a pod - targetMemoryUtilizationPercentage: 80 - -# -- [Liveness-Probe](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#define-a-liveness-command) to detect and remedy broken applications -livenessProbe: - # -- exec command for liveness check - exec: - command: - - /bin/bash - - -c - - /bin/ps -ef | grep backend-service | grep -v grep - # -- initialDelaySeconds before performing the first probe - initialDelaySeconds: 10 - # -- periodSeconds between each probe - periodSeconds: 10 - -# -- [Readiness-Probe](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#define-readiness-probes) to detect ready applications to receive traffic -readinessProbe: - # -- exec command for readiness check - exec: - command: - - /bin/bash - - -c - - /bin/ps -ef | grep backend-service | grep -v grep - # -- initialDelaySeconds before performing the first probe - initialDelaySeconds: 10 - # -- periodSeconds between each probe - periodSeconds: 10 - -# -- [Node-Selector](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector) to constrain the Pod to nodes with specific labels. -nodeSelector: {} - -# -- [Tolerations](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) are applied to Pods to schedule onto nodes with matching taints. -tolerations: [] - -# -- [Affinity](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity) constrains which nodes the Pod can be scheduled on based on node labels. -affinity: {} - -persistence: - # -- Whether to enable persistence via [PersistentVolumeClaim](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#reserving-a-persistentvolume) - enabled: false - # -- [PersistentVolume Access Modes](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes) Access mode to use. One of (ReadOnlyMany, ReadWriteOnce, ReadWriteMany, ReadWriteOncePod) - accessMode: - # -- Storage class to use together with the claimed [PersistentVolume](https://kubernetes.io/docs/concepts/storage/persistent-volumes/) - storageClassName: - # -- Capacity given to the claimed [PersistentVolume](https://kubernetes.io/docs/concepts/storage/persistent-volumes/) - capacity: 100M diff --git a/deployment/helm/edc-consumer/backend-service/values.yaml b/deployment/helm/edc-consumer/backend-service/values.yaml deleted file mode 100644 index 43a07de13..000000000 --- a/deployment/helm/edc-consumer/backend-service/values.yaml +++ /dev/null @@ -1,164 +0,0 @@ -################################################################################# -# Catena-X - Product Passport Consumer Frontend -# -# 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. -# -# This program and the accompanying materials are made available under the -# terms of the Apache License, Version 2.0 which is available at -# https://www.apache.org/licenses/LICENSE-2.0. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -# either express or implied. See the -# License for the specific language govern in permissions and limitations -# under the License. -# -# SPDX-License-Identifier: Apache-2.0 -################################################################################## - -# Default values for .. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. - -replicaCount: 1 - -image: - # -- Which container image to use - repository: ghcr.io/denisneuling/cx-backend-service - # -- [Kubernetes image pull policy](https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy) to use - pullPolicy: IfNotPresent - # -- Overrides the image tag whose default is the chart appVersion - tag: "0.0.6" - -# -- Image pull secret to create to [obtain the container image from private registries](https://kubernetes.io/docs/concepts/containers/images/#using-a-private-registry) -imagePullSecrets: [] - -# -- Overrides the charts name -nameOverride: "" - -# -- Overrides the releases full name -fullnameOverride: "" - -serviceAccount: - # -- Specifies whether a [service account](https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/) should be created per release - create: true - # -- [Annotations](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) to add to the service account - annotations: {} - # -- The name of the service account to use. If not set and create is true, a name is generated using the release's fullname template - name: "" - -# -- Whether to [automount kubernetes API credentials](https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/#use-the-default-service-account-to-access-the-api-server) into the pod -automountServiceAccountToken: false - -# -- [Annotations](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) added to deployed [pods](https://kubernetes.io/docs/concepts/workloads/pods/) -podAnnotations: {} - -# The [pod security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod) defines privilege and access control settings for a Pod within the deployment -podSecurityContext: {} - -# The [container security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container) defines privilege and access control settings for a Container within a pod -securityContext: {} - -service: - # -- [Service type](https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types) to expose the running application on a set of Pods as a network service. - type: ClusterIP - frontend: - # -- Port on which to run the "frontend" api - port: 8080 - backend: - # -- Port on which to run the "backend" api - port: 8081 - -ingress: - enabled: true - className: "nginx" - annotations: - #kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" - nginx.ingress.kubernetes.io/force-ssl-redirect: "true" - nginx.ingress.kubernetes.io/ssl-passthrough: "false" - nginx.ingress.kubernetes.io/rewrite-target: /$2 - nginx.ingress.kubernetes.io/backend-protocol: "HTTP" - hosts: - - host: materialpass.int.demo.catena-x.net - paths: - - path: /consumer_backend(/|$)(.*) - pathType: Prefix - tls: - - secretName: tls-secret - hosts: - - materialpass.int.demo.catena-x.net - -# -- [Resource management](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) applied to the deployed pod -resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - -autoscaling: - # -- Enables [horizontal pod autoscaling](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/) - enabled: false - # -- Minimal replicas if resource consumption falls below resource threshholds - minReplicas: 1 - # -- Maximum replicas if resource consumption exceeds resource threshholds - maxReplicas: 100 - # -- targetAverageUtilization of cpu provided to a pod - targetCPUUtilizationPercentage: 80 - # -- targetAverageUtilization of memory provided to a pod - targetMemoryUtilizationPercentage: 80 - -# -- [Liveness-Probe](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#define-a-liveness-command) to detect and remedy broken applications -livenessProbe: - # -- exec command for liveness check - exec: - command: - - /bin/bash - - -c - - /bin/ps -ef | grep backend-service | grep -v grep - # -- initialDelaySeconds before performing the first probe - initialDelaySeconds: 10 - # -- periodSeconds between each probe - periodSeconds: 10 - -# -- [Readiness-Probe](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#define-readiness-probes) to detect ready applications to receive traffic -readinessProbe: - # -- exec command for readiness check - exec: - command: - - /bin/bash - - -c - - /bin/ps -ef | grep backend-service | grep -v grep - # -- initialDelaySeconds before performing the first probe - initialDelaySeconds: 10 - # -- periodSeconds between each probe - periodSeconds: 10 - -# -- [Node-Selector](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector) to constrain the Pod to nodes with specific labels. -nodeSelector: {} - -# -- [Tolerations](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) are applied to Pods to schedule onto nodes with matching taints. -tolerations: [] - -# -- [Affinity](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity) constrains which nodes the Pod can be scheduled on based on node labels. -affinity: {} - -persistence: - # -- Whether to enable persistence via [PersistentVolumeClaim](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#reserving-a-persistentvolume) - enabled: false - # -- [PersistentVolume Access Modes](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes) Access mode to use. One of (ReadOnlyMany, ReadWriteOnce, ReadWriteMany, ReadWriteOncePod) - accessMode: - # -- Storage class to use together with the claimed [PersistentVolume](https://kubernetes.io/docs/concepts/storage/persistent-volumes/) - storageClassName: - # -- Capacity given to the claimed [PersistentVolume](https://kubernetes.io/docs/concepts/storage/persistent-volumes/) - capacity: 100M diff --git a/deployment/helm/edc-consumer/values-beta.yaml b/deployment/helm/edc-consumer/values-beta.yaml index 01ea5aa9b..c8e967f07 100644 --- a/deployment/helm/edc-consumer/values-beta.yaml +++ b/deployment/helm/edc-consumer/values-beta.yaml @@ -21,15 +21,6 @@ ################################################################################## --- -consumerbackendapplication: - enabled: true - fullnameOverride: "materialpass-edc-backend" - service: - type: NodePort - frontend: - port: 80 - backend: - port: 8081 postgres: enabled: true @@ -310,7 +301,7 @@ controlplane: # edc.oauth.validation.nbf.leeway= # edc.receiver.http.auth-code= # edc.receiver.http.auth-key= - edc.receiver.http.endpoint=http://materialpass-edc-backend + edc.receiver.http.endpoint=https://materialpass.beta.demo.catena-x.net/endpoint edc.transfer.proxy.endpoint=http://materialpass-edc-dataplane:8185/consumer/api/public # edc.transfer.proxy.token.validity.seconds= edc.transfer.proxy.token.signer.privatekey.alias=ids-daps_key diff --git a/deployment/helm/edc-consumer/values-dev.yaml b/deployment/helm/edc-consumer/values-dev.yaml index dec3560b6..b5f20bc50 100644 --- a/deployment/helm/edc-consumer/values-dev.yaml +++ b/deployment/helm/edc-consumer/values-dev.yaml @@ -21,15 +21,6 @@ ################################################################################## --- -consumerbackendapplication: - enabled: true - fullnameOverride: "materialpass-edc-backend" - service: - type: NodePort - frontend: - port: 80 - backend: - port: 8081 postgres: enabled: true @@ -305,7 +296,7 @@ controlplane: # edc.oauth.validation.nbf.leeway= # edc.receiver.http.auth-code= # edc.receiver.http.auth-key= - edc.receiver.http.endpoint=http://materialpass-edc-backend + edc.receiver.http.endpoint=https://materialpass.dev.demo.catena-x.net/endpoint edc.transfer.proxy.endpoint=http://materialpass-edc-dataplane:8185/consumer/api/public # edc.transfer.proxy.token.validity.seconds= edc.transfer.proxy.token.signer.privatekey.alias=daps-key-dev diff --git a/deployment/helm/edc-consumer/values-int.yaml b/deployment/helm/edc-consumer/values-int.yaml index 09c5e1db1..ebff8236e 100644 --- a/deployment/helm/edc-consumer/values-int.yaml +++ b/deployment/helm/edc-consumer/values-int.yaml @@ -21,16 +21,6 @@ ################################################################################## --- -consumerbackendapplication: - enabled: true - fullnameOverride: "materialpass-edc-backend" - service: - type: NodePort - frontend: - port: 80 - backend: - port: 8081 - postgres: enabled: true fullnameOverride: "consumer-postgresql" @@ -310,7 +300,7 @@ controlplane: # edc.oauth.validation.nbf.leeway= # edc.receiver.http.auth-code= # edc.receiver.http.auth-key= - edc.receiver.http.endpoint=http://materialpass-edc-backend + edc.receiver.http.endpoint=https://materialpass.int.demo.catena-x.net/endpoint edc.transfer.proxy.endpoint=http://materialpass-edc-dataplane:8185/consumer/api/public # edc.transfer.proxy.token.validity.seconds= edc.transfer.proxy.token.signer.privatekey.alias=ids-daps_key diff --git a/deployment/helm/edc-provider/Chart.yaml b/deployment/helm/edc-provider/Chart.yaml index 9fff56cb5..8c9c45089 100644 --- a/deployment/helm/edc-provider/Chart.yaml +++ b/deployment/helm/edc-provider/Chart.yaml @@ -38,11 +38,6 @@ dependencies: version: "0.1.6" repository: https://catenax-ng.github.io/product-edc condition: dataplane.enabled - - name: backend-service - version: "0.0.6" - repository: https://denisneuling.github.io/cx-backend-service - alias: providerbackendapplication - condition: providerbackendapplication.enabled - name: postgresql alias: postgres version: 12.1.5 diff --git a/deployment/helm/edc-provider/data-service/Chart.lock b/deployment/helm/edc-provider/data-service/Chart.lock deleted file mode 100644 index 17a6b5113..000000000 --- a/deployment/helm/edc-provider/data-service/Chart.lock +++ /dev/null @@ -1,6 +0,0 @@ -dependencies: -- name: backend-service - repository: https://denisneuling.github.io/cx-backend-service - version: 0.0.6 -digest: sha256:72b2ae445dd7411c6337efa4a99b45d74b220c357ea55dcded13130d8bc62508 -generated: "2022-10-18T14:57:07.8599852+02:00" diff --git a/deployment/helm/edc-provider/values-beta.yaml b/deployment/helm/edc-provider/values-beta.yaml index ffd9905ba..9a5912eb4 100644 --- a/deployment/helm/edc-provider/values-beta.yaml +++ b/deployment/helm/edc-provider/values-beta.yaml @@ -21,16 +21,6 @@ ################################################################################## --- -providerbackendapplication: - enabled: true - fullnameOverride: "materialpass-edc-provider-backend" - service: - type: NodePort - frontend: - port: 80 - backend: - port: 8081 - postgres: enabled: true fullnameOverride: "provider-postgresql" @@ -277,7 +267,7 @@ controlplane: # edc.oauth.validation.nbf.leeway= # edc.receiver.http.auth-code= # edc.receiver.http.auth-key= - edc.receiver.http.endpoint=http://materialpass-edc-provider-backend + edc.receiver.http.endpoint=https://materialpass.beta.demo.catena-x.net/endpoint edc.transfer.proxy.endpoint=http://materialpass-edc-provider-dataplane:8185/BPNL000000000000/api/public # edc.transfer.proxy.token.validity.seconds= edc.transfer.proxy.token.signer.privatekey.alias=ids-daps_key diff --git a/deployment/helm/edc-provider/values-dev.yaml b/deployment/helm/edc-provider/values-dev.yaml index f4efb034a..01caa8312 100644 --- a/deployment/helm/edc-provider/values-dev.yaml +++ b/deployment/helm/edc-provider/values-dev.yaml @@ -21,16 +21,6 @@ ################################################################################## --- -providerbackendapplication: - enabled: true - fullnameOverride: "materialpass-edc-provider-backend" - service: - type: NodePort - frontend: - port: 80 - backend: - port: 8081 - postgres: enabled: true fullnameOverride: "provider-postgresql" @@ -264,7 +254,7 @@ controlplane: # edc.oauth.validation.nbf.leeway= # edc.receiver.http.auth-code= # edc.receiver.http.auth-key= - edc.receiver.http.endpoint=http://materialpass-edc-provider-backend + edc.receiver.http.endpoint=https://materialpass.dev.demo.catena-x.net/endpoint edc.transfer.proxy.endpoint=http://materialpass-edc-provider-dataplane:8185/BPNL000000000000/api/public # edc.transfer.proxy.token.validity.seconds= edc.transfer.proxy.token.signer.privatekey.alias=daps-key-dev diff --git a/deployment/helm/edc-provider/values-int.yaml b/deployment/helm/edc-provider/values-int.yaml index b15ee92e9..c6e788b09 100644 --- a/deployment/helm/edc-provider/values-int.yaml +++ b/deployment/helm/edc-provider/values-int.yaml @@ -21,16 +21,6 @@ ################################################################################## --- -providerbackendapplication: - enabled: true - fullnameOverride: "materialpass-edc-provider-backend" - service: - type: NodePort - frontend: - port: 80 - backend: - port: 8081 - postgres: enabled: true fullnameOverride: "provider-postgresql" @@ -277,7 +267,7 @@ controlplane: # edc.oauth.validation.nbf.leeway= # edc.receiver.http.auth-code= # edc.receiver.http.auth-key= - edc.receiver.http.endpoint=http://materialpass-edc-provider-backend + edc.receiver.http.endpoint=https://materialpass.int.demo.catena-x.net/endpoint edc.transfer.proxy.endpoint=http://materialpass-edc-provider-dataplane:8185/BPNL000000000000/api/public # edc.transfer.proxy.token.validity.seconds= edc.transfer.proxy.token.signer.privatekey.alias=ids-daps_key diff --git a/docs/RELEASE_USER.md b/docs/RELEASE_USER.md index 832396260..44f271ce4 100644 --- a/docs/RELEASE_USER.md +++ b/docs/RELEASE_USER.md @@ -23,6 +23,13 @@ # Release Notes Digital Product Pass Application User friendly relase notes without especific technical details. +**xxxx xx xxxx (Version 0.9.0)** +*xx.xx.xxxx* + +## Removed cx-backend-service support +The backend application fully substituted the cx-backend-service by unwrapping the token and storing the information encrypted (an improvement in comparation with the cx-backend-service) +The API that should be used is `/endpoint` + **May 18 2023 (Version 0.8.0)** *18.05.2023* diff --git a/package-lock.json b/package-lock.json index 238848c8f..3f6e3517d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "productpass-consumer-ui", - "version": "0.8.0", + "version": "0.9.0", "lockfileVersion": 2, "requires": true, "packages": { diff --git a/package.json b/package.json index 75928a98e..135f148cf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "productpass-consumer-ui", - "version": "0.8.0", + "version": "0.9.0", "private": true, "scripts": { "serve": "vite --host localhost", From 573ce0ece0c9df698c8f6746cbc261161d89c2b3 Mon Sep 17 00:00:00 2001 From: Mathias Brunkow Moser Date: Wed, 7 Jun 2023 12:27:31 +0200 Subject: [PATCH 17/35] fix: updated charts from dev env and removed cx backend service reference --- deployment/helm/edc-consumer/Chart.lock | 12 -- deployment/helm/edc-consumer/Chart.yaml | 5 - .../edc-consumer/backend-service/.helmignore | 45 ----- .../edc-consumer/backend-service/Chart.yaml | 31 ---- .../backend-service/templates/NOTES.txt | 38 ---- .../backend-service/templates/_helpers.tpl | 84 --------- .../backend-service/templates/deployment.yaml | 101 ----------- .../backend-service/templates/hpa.yaml | 51 ------ .../backend-service/templates/ingress.yaml | 80 --------- .../backend-service/templates/pvc.yaml | 48 ----- .../backend-service/templates/service.yaml | 42 ----- .../templates/serviceaccount.yaml | 35 ---- .../backend-service/values-beta.yaml | 164 ------------------ .../backend-service/values-dev.yaml | 164 ------------------ .../backend-service/values-int.yaml | 164 ------------------ .../edc-consumer/backend-service/values.yaml | 164 ------------------ deployment/helm/edc-consumer/values-int.yaml | 4 +- deployment/helm/edc-consumer/values.yaml | 32 ++-- deployment/helm/edc-provider/values-int.yaml | 4 +- deployment/helm/edc-provider/values.yaml | 16 +- 20 files changed, 29 insertions(+), 1255 deletions(-) delete mode 100644 deployment/helm/edc-consumer/Chart.lock delete mode 100644 deployment/helm/edc-consumer/backend-service/.helmignore delete mode 100644 deployment/helm/edc-consumer/backend-service/Chart.yaml delete mode 100644 deployment/helm/edc-consumer/backend-service/templates/NOTES.txt delete mode 100644 deployment/helm/edc-consumer/backend-service/templates/_helpers.tpl delete mode 100644 deployment/helm/edc-consumer/backend-service/templates/deployment.yaml delete mode 100644 deployment/helm/edc-consumer/backend-service/templates/hpa.yaml delete mode 100644 deployment/helm/edc-consumer/backend-service/templates/ingress.yaml delete mode 100644 deployment/helm/edc-consumer/backend-service/templates/pvc.yaml delete mode 100644 deployment/helm/edc-consumer/backend-service/templates/service.yaml delete mode 100644 deployment/helm/edc-consumer/backend-service/templates/serviceaccount.yaml delete mode 100644 deployment/helm/edc-consumer/backend-service/values-beta.yaml delete mode 100644 deployment/helm/edc-consumer/backend-service/values-dev.yaml delete mode 100644 deployment/helm/edc-consumer/backend-service/values-int.yaml delete mode 100644 deployment/helm/edc-consumer/backend-service/values.yaml diff --git a/deployment/helm/edc-consumer/Chart.lock b/deployment/helm/edc-consumer/Chart.lock deleted file mode 100644 index 2e725a1d5..000000000 --- a/deployment/helm/edc-consumer/Chart.lock +++ /dev/null @@ -1,12 +0,0 @@ -dependencies: -- name: backend-service - repository: file://backend-service - version: 0.0.6 -- name: tractusx-connector - repository: https://eclipse-tractusx.github.io/charts/dev - version: 0.4.0 -- name: postgresql - repository: https://charts.bitnami.com/bitnami - version: 12.1.6 -digest: sha256:4cc46e7425e2188f1bd3c27688f1b15ee44bbb7e48c3a90272c36d251a577aa8 -generated: "2023-05-31T12:18:51.7515595+02:00" diff --git a/deployment/helm/edc-consumer/Chart.yaml b/deployment/helm/edc-consumer/Chart.yaml index ca5ae6e4a..5290350fd 100644 --- a/deployment/helm/edc-consumer/Chart.yaml +++ b/deployment/helm/edc-consumer/Chart.yaml @@ -56,11 +56,6 @@ dependencies: version: 0.4.1 repository: https://eclipse-tractusx.github.io/charts/dev condition: enabled - - name: backend-service - version: "0.0.6" - repository: file://backend-service - alias: consumerbackendapplication - condition: consumerbackendapplication.enabled - name: postgresql alias: postgresql version: 12.1.6 diff --git a/deployment/helm/edc-consumer/backend-service/.helmignore b/deployment/helm/edc-consumer/backend-service/.helmignore deleted file mode 100644 index 916bb9632..000000000 --- a/deployment/helm/edc-consumer/backend-service/.helmignore +++ /dev/null @@ -1,45 +0,0 @@ -################################################################################# -# Catena-X - Product Passport Consumer Application -# -# 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. -# -# This program and the accompanying materials are made available under the -# terms of the Apache License, Version 2.0 which is available at -# https://www.apache.org/licenses/LICENSE-2.0. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -# either express or implied. See the -# License for the specific language govern in permissions and limitations -# under the License. -# -# SPDX-License-Identifier: Apache-2.0 -################################################################################## - -# Patterns to ignore when building packages. -# This supports shell glob matching, relative path matching, and -# negation (prefixed with !). Only one pattern per line. -.DS_Store -# Common VCS dirs -.git/ -.gitignore -.bzr/ -.bzrignore -.hg/ -.hgignore -.svn/ -# Common backup files -*.swp -*.bak -*.tmp -*.orig -*~ -# Various IDEs -.project -.idea/ -*.tmproj -.vscode/ diff --git a/deployment/helm/edc-consumer/backend-service/Chart.yaml b/deployment/helm/edc-consumer/backend-service/Chart.yaml deleted file mode 100644 index f309bf910..000000000 --- a/deployment/helm/edc-consumer/backend-service/Chart.yaml +++ /dev/null @@ -1,31 +0,0 @@ -################################################################################# -# Catena-X - Product Passport Consumer Frontend -# -# 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. -# -# This program and the accompanying materials are made available under the -# terms of the Apache License, Version 2.0 which is available at -# https://www.apache.org/licenses/LICENSE-2.0. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -# either express or implied. See the -# License for the specific language govern in permissions and limitations -# under the License. -# -# SPDX-License-Identifier: Apache-2.0 -################################################################################## - ---- -apiVersion: v2 -name: backend-service -description: Small CX Backend Service Implementation for Testing Purposes -home: https://github.com/denisneuling/cx-backend-service -type: application -version: 0.0.6 -appVersion: "0.0.6" -maintainers: [] diff --git a/deployment/helm/edc-consumer/backend-service/templates/NOTES.txt b/deployment/helm/edc-consumer/backend-service/templates/NOTES.txt deleted file mode 100644 index c952ffd09..000000000 --- a/deployment/helm/edc-consumer/backend-service/templates/NOTES.txt +++ /dev/null @@ -1,38 +0,0 @@ -################################################################################# -# Catena-X - Product Passport Consumer Application -# -# 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. -# -# This program and the accompanying materials are made available under the -# terms of the Apache License, Version 2.0 which is available at -# https://www.apache.org/licenses/LICENSE-2.0. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -# either express or implied. See the -# License for the specific language govern in permissions and limitations -# under the License. -# -# SPDX-License-Identifier: Apache-2.0 -################################################################################## - -1. Get the application URL by running these commands: -{{- if contains "NodePort" .Values.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "backend-service.fullname" . }}) - export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - echo http://$NODE_IP:$NODE_PORT -{{- else if contains "LoadBalancer" .Values.service.type }} - NOTE: It may take a few minutes for the LoadBalancer IP to be available. - You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "backend-service.fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "backend-service.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo http://$SERVICE_IP:{{ .Values.service.port }} -{{- else if contains "ClusterIP" .Values.service.type }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "backend-service.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") - export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") - echo "Visit http://127.0.0.1:8080 to use your application" - kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT -{{- end }} diff --git a/deployment/helm/edc-consumer/backend-service/templates/_helpers.tpl b/deployment/helm/edc-consumer/backend-service/templates/_helpers.tpl deleted file mode 100644 index 5d26f41d0..000000000 --- a/deployment/helm/edc-consumer/backend-service/templates/_helpers.tpl +++ /dev/null @@ -1,84 +0,0 @@ -################################################################################# -# Catena-X - Product Passport Consumer Frontend -# -# 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. -# -# This program and the accompanying materials are made available under the -# terms of the Apache License, Version 2.0 which is available at -# https://www.apache.org/licenses/LICENSE-2.0. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -# either express or implied. See the -# License for the specific language govern in permissions and limitations -# under the License. -# -# SPDX-License-Identifier: Apache-2.0 -################################################################################## - -{{/* -Expand the name of the chart. -*/}} -{{- define "backend-service.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. -*/}} -{{- define "backend-service.fullname" -}} -{{- if .Values.fullnameOverride }} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- $name := default .Chart.Name .Values.nameOverride }} -{{- if contains $name .Release.Name }} -{{- .Release.Name | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} -{{- end }} -{{- end }} -{{- end }} - -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "backend-service.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Common labels -*/}} -{{- define "backend-service.labels" -}} -helm.sh/chart: {{ include "backend-service.chart" . }} -{{ include "backend-service.selectorLabels" . }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- end }} - -{{/* -Selector labels -*/}} -{{- define "backend-service.selectorLabels" -}} -app.kubernetes.io/name: {{ include "backend-service.name" . }} -app.kubernetes.io/instance: {{ .Release.Name }} -{{- end }} - -{{/* -Create the name of the service account to use -*/}} -{{- define "backend-service.serviceAccountName" -}} -{{- if .Values.serviceAccount.create }} -{{- default (include "backend-service.fullname" .) .Values.serviceAccount.name }} -{{- else }} -{{- default "default" .Values.serviceAccount.name }} -{{- end }} -{{- end }} diff --git a/deployment/helm/edc-consumer/backend-service/templates/deployment.yaml b/deployment/helm/edc-consumer/backend-service/templates/deployment.yaml deleted file mode 100644 index f276109f9..000000000 --- a/deployment/helm/edc-consumer/backend-service/templates/deployment.yaml +++ /dev/null @@ -1,101 +0,0 @@ -################################################################################# -# Catena-X - Product Passport Consumer Frontend -# -# 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. -# -# This program and the accompanying materials are made available under the -# terms of the Apache License, Version 2.0 which is available at -# https://www.apache.org/licenses/LICENSE-2.0. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -# either express or implied. See the -# License for the specific language govern in permissions and limitations -# under the License. -# -# SPDX-License-Identifier: Apache-2.0 -################################################################################## - ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ include "backend-service.fullname" . }} - labels: - {{- include "backend-service.labels" . | nindent 4 }} -spec: - {{- if not .Values.autoscaling.enabled }} - replicas: {{ .Values.replicaCount }} - {{- end }} - selector: - matchLabels: - {{- include "backend-service.selectorLabels" . | nindent 6 }} - template: - metadata: - {{- with .Values.podAnnotations }} - annotations: - {{- toYaml . | nindent 8 }} - {{- end }} - labels: - {{- include "backend-service.selectorLabels" . | nindent 8 }} - spec: - {{- with .Values.imagePullSecrets }} - imagePullSecrets: - {{- toYaml . | nindent 8 }} - {{- end }} - serviceAccountName: {{ include "backend-service.serviceAccountName" . }} - automountServiceAccountToken: {{ .Values.automountServiceAccountToken }} - securityContext: - {{- toYaml .Values.podSecurityContext | nindent 8 }} - containers: - - name: {{ .Chart.Name }} - securityContext: - {{- toYaml .Values.securityContext | nindent 12 }} - image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} - {{ if .Values.livenessProbe -}} - livenessProbe: - {{ toYaml .Values.livenessProbe | nindent 12 }} - {{ end -}} - {{ if .Values.readinessProbe -}} - readinessProbe: - {{ toYaml .Values.readinessProbe | nindent 12 }} - {{ end -}} - volumeMounts: - - name: data - mountPath: /mnt/data - env: - - name: BACKEND_SERVICE_DATA_DIR - value: /mnt/data - ports: - - containerPort: 8080 - protocol: TCP - name: frontend - - containerPort: 8081 - protocol: TCP - name: backend - volumes: - - name: data - {{- if .Values.persistence.enabled }} - persistentVolumeClaim: - claimName: {{ include "backend-service.fullname" . }}-pvc - {{ else }} - emptyDir: - {} - {{- end }} - {{- with .Values.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.affinity }} - affinity: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.tolerations }} - tolerations: - {{- toYaml . | nindent 8 }} - {{- end }} diff --git a/deployment/helm/edc-consumer/backend-service/templates/hpa.yaml b/deployment/helm/edc-consumer/backend-service/templates/hpa.yaml deleted file mode 100644 index 6c5747f60..000000000 --- a/deployment/helm/edc-consumer/backend-service/templates/hpa.yaml +++ /dev/null @@ -1,51 +0,0 @@ -################################################################################# -# Catena-X - Product Passport Consumer Frontend -# -# 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. -# -# This program and the accompanying materials are made available under the -# terms of the Apache License, Version 2.0 which is available at -# https://www.apache.org/licenses/LICENSE-2.0. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -# either express or implied. See the -# License for the specific language govern in permissions and limitations -# under the License. -# -# SPDX-License-Identifier: Apache-2.0 -################################################################################## - -{{- if .Values.autoscaling.enabled }} ---- -apiVersion: autoscaling/v2beta1 -kind: HorizontalPodAutoscaler -metadata: - name: {{ include "backend-service.fullname" . }} - labels: - {{- include "backend-service.labels" . | nindent 4 }} -spec: - scaleTargetRef: - apiVersion: apps/v1 - kind: Deployment - name: {{ include "backend-service.fullname" . }} - minReplicas: {{ .Values.autoscaling.minReplicas }} - maxReplicas: {{ .Values.autoscaling.maxReplicas }} - metrics: - {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} - - type: Resource - resource: - name: cpu - targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} - {{- end }} - {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} - - type: Resource - resource: - name: memory - targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} - {{- end }} - {{- end }} diff --git a/deployment/helm/edc-consumer/backend-service/templates/ingress.yaml b/deployment/helm/edc-consumer/backend-service/templates/ingress.yaml deleted file mode 100644 index 0d14dcf5e..000000000 --- a/deployment/helm/edc-consumer/backend-service/templates/ingress.yaml +++ /dev/null @@ -1,80 +0,0 @@ -################################################################################# -# Catena-X - Product Passport Consumer Frontend -# -# 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. -# -# This program and the accompanying materials are made available under the -# terms of the Apache License, Version 2.0 which is available at -# https://www.apache.org/licenses/LICENSE-2.0. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -# either express or implied. See the -# License for the specific language govern in permissions and limitations -# under the License. -# -# SPDX-License-Identifier: Apache-2.0 -################################################################################## - -{{- if .Values.ingress.enabled -}} -{{- $fullName := include "backend-service.fullname" . -}} -{{- $svcPort := .Values.service.port -}} -{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} - {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} - {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} - {{- end }} -{{- end }} - - -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - name: {{ $fullName }} - namespace: {{ .Values.namespace }} - labels: - {{- include "backend-service.labels" . | nindent 4 }} - {{- with .Values.ingress.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -spec: - {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} - ingressClassName: {{ .Values.ingress.className }} - {{- end }} - {{- if .Values.ingress.tls }} - tls: - {{- range .Values.ingress.tls }} - - hosts: - {{- range .hosts }} - - {{ . | quote }} - {{- end }} - secretName: {{ .secretName }} - {{- end }} - {{- end }} - rules: - {{- range .Values.ingress.hosts }} - - host: {{ .host | quote }} - http: - paths: - {{- range .paths }} - - path: {{ .path }} - {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} - pathType: {{ .pathType }} - {{- end }} - backend: - {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} - service: - name: {{ $fullName }} - port: - number: 8081 - {{- else }} - serviceName: {{ $fullName }} - servicePort: 8081 - {{- end }} - {{- end }} - {{- end }} -{{- end }} diff --git a/deployment/helm/edc-consumer/backend-service/templates/pvc.yaml b/deployment/helm/edc-consumer/backend-service/templates/pvc.yaml deleted file mode 100644 index fcb5bdbc6..000000000 --- a/deployment/helm/edc-consumer/backend-service/templates/pvc.yaml +++ /dev/null @@ -1,48 +0,0 @@ -################################################################################# -# Catena-X - Product Passport Consumer Frontend -# -# 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. -# -# This program and the accompanying materials are made available under the -# terms of the Apache License, Version 2.0 which is available at -# https://www.apache.org/licenses/LICENSE-2.0. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -# either express or implied. See the -# License for the specific language govern in permissions and limitations -# under the License. -# -# SPDX-License-Identifier: Apache-2.0 -################################################################################## - -{{ if .Values.persistence.enabled -}} ---- -apiVersion: "v1" -kind: PersistentVolumeClaim -metadata: - name: {{ include "backend-service.fullname" . }}-pvc - labels: - {{- include "backend-service.labels" . | nindent 4 }} -spec: - {{- if .Values.persistence.storageClassName }} - storageClassName: {{ .Values.persistence.storageClassName | quote }} - {{- end }} - accessModes: - {{- if .Values.persistence.accessMode }} - - {{ .Values.persistence.accessMode | quote }} - {{ else }} - {{- if .Values.autoscaling.enabled }} - - ReadWriteMany - {{ else }} - - ReadWriteOnce - {{- end }} - {{- end }} - resources: - requests: - storage: {{ .Values.persistence.capacity | quote }} -{{ end -}} diff --git a/deployment/helm/edc-consumer/backend-service/templates/service.yaml b/deployment/helm/edc-consumer/backend-service/templates/service.yaml deleted file mode 100644 index 6a9d7a4b1..000000000 --- a/deployment/helm/edc-consumer/backend-service/templates/service.yaml +++ /dev/null @@ -1,42 +0,0 @@ -################################################################################# -# Catena-X - Product Passport Consumer Frontend -# -# 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. -# -# This program and the accompanying materials are made available under the -# terms of the Apache License, Version 2.0 which is available at -# https://www.apache.org/licenses/LICENSE-2.0. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -# either express or implied. See the -# License for the specific language govern in permissions and limitations -# under the License. -# -# SPDX-License-Identifier: Apache-2.0 -################################################################################## - ---- -apiVersion: v1 -kind: Service -metadata: - name: {{ include "backend-service.fullname" . }} - labels: - {{- include "backend-service.labels" . | nindent 4 }} -spec: - type: {{ .Values.service.type }} - ports: - - port: {{ .Values.service.frontend.port }} - targetPort: frontend - protocol: TCP - name: frontend - - port: {{ .Values.service.backend.port }} - targetPort: backend - protocol: TCP - name: backend - selector: - {{- include "backend-service.selectorLabels" . | nindent 4 }} diff --git a/deployment/helm/edc-consumer/backend-service/templates/serviceaccount.yaml b/deployment/helm/edc-consumer/backend-service/templates/serviceaccount.yaml deleted file mode 100644 index 9aafdc13a..000000000 --- a/deployment/helm/edc-consumer/backend-service/templates/serviceaccount.yaml +++ /dev/null @@ -1,35 +0,0 @@ -################################################################################# -# Catena-X - Product Passport Consumer Frontend -# -# 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. -# -# This program and the accompanying materials are made available under the -# terms of the Apache License, Version 2.0 which is available at -# https://www.apache.org/licenses/LICENSE-2.0. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -# either express or implied. See the -# License for the specific language govern in permissions and limitations -# under the License. -# -# SPDX-License-Identifier: Apache-2.0 -################################################################################## - -{{- if .Values.serviceAccount.create -}} ---- -apiVersion: v1 -kind: ServiceAccount -metadata: - name: {{ include "backend-service.serviceAccountName" . }} - labels: - {{- include "backend-service.labels" . | nindent 4 }} - {{- with .Values.serviceAccount.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} - {{- end }} diff --git a/deployment/helm/edc-consumer/backend-service/values-beta.yaml b/deployment/helm/edc-consumer/backend-service/values-beta.yaml deleted file mode 100644 index 17192d3c2..000000000 --- a/deployment/helm/edc-consumer/backend-service/values-beta.yaml +++ /dev/null @@ -1,164 +0,0 @@ -################################################################################# -# Catena-X - Product Passport Consumer Frontend -# -# 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. -# -# This program and the accompanying materials are made available under the -# terms of the Apache License, Version 2.0 which is available at -# https://www.apache.org/licenses/LICENSE-2.0. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -# either express or implied. See the -# License for the specific language govern in permissions and limitations -# under the License. -# -# SPDX-License-Identifier: Apache-2.0 -################################################################################## - -# Default values for .. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. - -replicaCount: 1 - -image: - # -- Which container image to use - repository: ghcr.io/denisneuling/cx-backend-service - # -- [Kubernetes image pull policy](https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy) to use - pullPolicy: IfNotPresent - # -- Overrides the image tag whose default is the chart appVersion - tag: "0.0.6" - -# -- Image pull secret to create to [obtain the container image from private registries](https://kubernetes.io/docs/concepts/containers/images/#using-a-private-registry) -imagePullSecrets: [] - -# -- Overrides the charts name -nameOverride: "" - -# -- Overrides the releases full name -fullnameOverride: "" - -serviceAccount: - # -- Specifies whether a [service account](https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/) should be created per release - create: true - # -- [Annotations](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) to add to the service account - annotations: {} - # -- The name of the service account to use. If not set and create is true, a name is generated using the release's fullname template - name: "" - -# -- Whether to [automount kubernetes API credentials](https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/#use-the-default-service-account-to-access-the-api-server) into the pod -automountServiceAccountToken: false - -# -- [Annotations](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) added to deployed [pods](https://kubernetes.io/docs/concepts/workloads/pods/) -podAnnotations: {} - -# The [pod security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod) defines privilege and access control settings for a Pod within the deployment -podSecurityContext: {} - -# The [container security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container) defines privilege and access control settings for a Container within a pod -securityContext: {} - -service: - # -- [Service type](https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types) to expose the running application on a set of Pods as a network service. - type: ClusterIP - frontend: - # -- Port on which to run the "frontend" api - port: 8080 - backend: - # -- Port on which to run the "backend" api - port: 8081 - -ingress: - enabled: true - className: "nginx" - annotations: - #kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" - nginx.ingress.kubernetes.io/force-ssl-redirect: "true" - nginx.ingress.kubernetes.io/ssl-passthrough: "false" - nginx.ingress.kubernetes.io/rewrite-target: /$2 - nginx.ingress.kubernetes.io/backend-protocol: "HTTP" - hosts: - - host: materialpass.beta.demo.catena-x.net - paths: - - path: /consumer_backend(/|$)(.*) - pathType: Prefix - tls: - - secretName: tls-secret - hosts: - - materialpass.beta.demo.catena-x.net - -# -- [Resource management](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) applied to the deployed pod -resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - -autoscaling: - # -- Enables [horizontal pod autoscaling](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/) - enabled: false - # -- Minimal replicas if resource consumption falls below resource threshholds - minReplicas: 1 - # -- Maximum replicas if resource consumption exceeds resource threshholds - maxReplicas: 100 - # -- targetAverageUtilization of cpu provided to a pod - targetCPUUtilizationPercentage: 80 - # -- targetAverageUtilization of memory provided to a pod - targetMemoryUtilizationPercentage: 80 - -# -- [Liveness-Probe](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#define-a-liveness-command) to detect and remedy broken applications -livenessProbe: - # -- exec command for liveness check - exec: - command: - - /bin/bash - - -c - - /bin/ps -ef | grep backend-service | grep -v grep - # -- initialDelaySeconds before performing the first probe - initialDelaySeconds: 10 - # -- periodSeconds between each probe - periodSeconds: 10 - -# -- [Readiness-Probe](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#define-readiness-probes) to detect ready applications to receive traffic -readinessProbe: - # -- exec command for readiness check - exec: - command: - - /bin/bash - - -c - - /bin/ps -ef | grep backend-service | grep -v grep - # -- initialDelaySeconds before performing the first probe - initialDelaySeconds: 10 - # -- periodSeconds between each probe - periodSeconds: 10 - -# -- [Node-Selector](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector) to constrain the Pod to nodes with specific labels. -nodeSelector: {} - -# -- [Tolerations](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) are applied to Pods to schedule onto nodes with matching taints. -tolerations: [] - -# -- [Affinity](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity) constrains which nodes the Pod can be scheduled on based on node labels. -affinity: {} - -persistence: - # -- Whether to enable persistence via [PersistentVolumeClaim](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#reserving-a-persistentvolume) - enabled: false - # -- [PersistentVolume Access Modes](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes) Access mode to use. One of (ReadOnlyMany, ReadWriteOnce, ReadWriteMany, ReadWriteOncePod) - accessMode: - # -- Storage class to use together with the claimed [PersistentVolume](https://kubernetes.io/docs/concepts/storage/persistent-volumes/) - storageClassName: - # -- Capacity given to the claimed [PersistentVolume](https://kubernetes.io/docs/concepts/storage/persistent-volumes/) - capacity: 100M diff --git a/deployment/helm/edc-consumer/backend-service/values-dev.yaml b/deployment/helm/edc-consumer/backend-service/values-dev.yaml deleted file mode 100644 index c3ebefc45..000000000 --- a/deployment/helm/edc-consumer/backend-service/values-dev.yaml +++ /dev/null @@ -1,164 +0,0 @@ -################################################################################# -# Catena-X - Product Passport Consumer Frontend -# -# 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. -# -# This program and the accompanying materials are made available under the -# terms of the Apache License, Version 2.0 which is available at -# https://www.apache.org/licenses/LICENSE-2.0. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -# either express or implied. See the -# License for the specific language govern in permissions and limitations -# under the License. -# -# SPDX-License-Identifier: Apache-2.0 -################################################################################## - -# Default values for .. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. - -replicaCount: 1 - -image: - # -- Which container image to use - repository: ghcr.io/denisneuling/cx-backend-service - # -- [Kubernetes image pull policy](https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy) to use - pullPolicy: IfNotPresent - # -- Overrides the image tag whose default is the chart appVersion - tag: "0.0.6" - -# -- Image pull secret to create to [obtain the container image from private registries](https://kubernetes.io/docs/concepts/containers/images/#using-a-private-registry) -imagePullSecrets: [] - -# -- Overrides the charts name -nameOverride: "" - -# -- Overrides the releases full name -fullnameOverride: "" - -serviceAccount: - # -- Specifies whether a [service account](https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/) should be created per release - create: true - # -- [Annotations](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) to add to the service account - annotations: {} - # -- The name of the service account to use. If not set and create is true, a name is generated using the release's fullname template - name: "" - -# -- Whether to [automount kubernetes API credentials](https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/#use-the-default-service-account-to-access-the-api-server) into the pod -automountServiceAccountToken: false - -# -- [Annotations](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) added to deployed [pods](https://kubernetes.io/docs/concepts/workloads/pods/) -podAnnotations: {} - -# The [pod security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod) defines privilege and access control settings for a Pod within the deployment -podSecurityContext: {} - -# The [container security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container) defines privilege and access control settings for a Container within a pod -securityContext: {} - -service: - # -- [Service type](https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types) to expose the running application on a set of Pods as a network service. - type: ClusterIP - frontend: - # -- Port on which to run the "frontend" api - port: 8080 - backend: - # -- Port on which to run the "backend" api - port: 8081 - -ingress: - enabled: true - className: "nginx" - annotations: - #kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" - nginx.ingress.kubernetes.io/force-ssl-redirect: "true" - nginx.ingress.kubernetes.io/ssl-passthrough: "false" - nginx.ingress.kubernetes.io/rewrite-target: /$2 - nginx.ingress.kubernetes.io/backend-protocol: "HTTP" - hosts: - - host: materialpass.dev.demo.catena-x.net - paths: - - path: /consumer_backend(/|$)(.*) - pathType: Prefix - tls: - - secretName: tls-secret - hosts: - - materialpass.dev.demo.catena-x.net - -# -- [Resource management](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) applied to the deployed pod -resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - -autoscaling: - # -- Enables [horizontal pod autoscaling](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/) - enabled: false - # -- Minimal replicas if resource consumption falls below resource threshholds - minReplicas: 1 - # -- Maximum replicas if resource consumption exceeds resource threshholds - maxReplicas: 100 - # -- targetAverageUtilization of cpu provided to a pod - targetCPUUtilizationPercentage: 80 - # -- targetAverageUtilization of memory provided to a pod - targetMemoryUtilizationPercentage: 80 - -# -- [Liveness-Probe](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#define-a-liveness-command) to detect and remedy broken applications -livenessProbe: - # -- exec command for liveness check - exec: - command: - - /bin/bash - - -c - - /bin/ps -ef | grep backend-service | grep -v grep - # -- initialDelaySeconds before performing the first probe - initialDelaySeconds: 10 - # -- periodSeconds between each probe - periodSeconds: 10 - -# -- [Readiness-Probe](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#define-readiness-probes) to detect ready applications to receive traffic -readinessProbe: - # -- exec command for readiness check - exec: - command: - - /bin/bash - - -c - - /bin/ps -ef | grep backend-service | grep -v grep - # -- initialDelaySeconds before performing the first probe - initialDelaySeconds: 10 - # -- periodSeconds between each probe - periodSeconds: 10 - -# -- [Node-Selector](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector) to constrain the Pod to nodes with specific labels. -nodeSelector: {} - -# -- [Tolerations](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) are applied to Pods to schedule onto nodes with matching taints. -tolerations: [] - -# -- [Affinity](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity) constrains which nodes the Pod can be scheduled on based on node labels. -affinity: {} - -persistence: - # -- Whether to enable persistence via [PersistentVolumeClaim](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#reserving-a-persistentvolume) - enabled: false - # -- [PersistentVolume Access Modes](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes) Access mode to use. One of (ReadOnlyMany, ReadWriteOnce, ReadWriteMany, ReadWriteOncePod) - accessMode: - # -- Storage class to use together with the claimed [PersistentVolume](https://kubernetes.io/docs/concepts/storage/persistent-volumes/) - storageClassName: - # -- Capacity given to the claimed [PersistentVolume](https://kubernetes.io/docs/concepts/storage/persistent-volumes/) - capacity: 100M diff --git a/deployment/helm/edc-consumer/backend-service/values-int.yaml b/deployment/helm/edc-consumer/backend-service/values-int.yaml deleted file mode 100644 index 43a07de13..000000000 --- a/deployment/helm/edc-consumer/backend-service/values-int.yaml +++ /dev/null @@ -1,164 +0,0 @@ -################################################################################# -# Catena-X - Product Passport Consumer Frontend -# -# 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. -# -# This program and the accompanying materials are made available under the -# terms of the Apache License, Version 2.0 which is available at -# https://www.apache.org/licenses/LICENSE-2.0. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -# either express or implied. See the -# License for the specific language govern in permissions and limitations -# under the License. -# -# SPDX-License-Identifier: Apache-2.0 -################################################################################## - -# Default values for .. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. - -replicaCount: 1 - -image: - # -- Which container image to use - repository: ghcr.io/denisneuling/cx-backend-service - # -- [Kubernetes image pull policy](https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy) to use - pullPolicy: IfNotPresent - # -- Overrides the image tag whose default is the chart appVersion - tag: "0.0.6" - -# -- Image pull secret to create to [obtain the container image from private registries](https://kubernetes.io/docs/concepts/containers/images/#using-a-private-registry) -imagePullSecrets: [] - -# -- Overrides the charts name -nameOverride: "" - -# -- Overrides the releases full name -fullnameOverride: "" - -serviceAccount: - # -- Specifies whether a [service account](https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/) should be created per release - create: true - # -- [Annotations](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) to add to the service account - annotations: {} - # -- The name of the service account to use. If not set and create is true, a name is generated using the release's fullname template - name: "" - -# -- Whether to [automount kubernetes API credentials](https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/#use-the-default-service-account-to-access-the-api-server) into the pod -automountServiceAccountToken: false - -# -- [Annotations](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) added to deployed [pods](https://kubernetes.io/docs/concepts/workloads/pods/) -podAnnotations: {} - -# The [pod security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod) defines privilege and access control settings for a Pod within the deployment -podSecurityContext: {} - -# The [container security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container) defines privilege and access control settings for a Container within a pod -securityContext: {} - -service: - # -- [Service type](https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types) to expose the running application on a set of Pods as a network service. - type: ClusterIP - frontend: - # -- Port on which to run the "frontend" api - port: 8080 - backend: - # -- Port on which to run the "backend" api - port: 8081 - -ingress: - enabled: true - className: "nginx" - annotations: - #kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" - nginx.ingress.kubernetes.io/force-ssl-redirect: "true" - nginx.ingress.kubernetes.io/ssl-passthrough: "false" - nginx.ingress.kubernetes.io/rewrite-target: /$2 - nginx.ingress.kubernetes.io/backend-protocol: "HTTP" - hosts: - - host: materialpass.int.demo.catena-x.net - paths: - - path: /consumer_backend(/|$)(.*) - pathType: Prefix - tls: - - secretName: tls-secret - hosts: - - materialpass.int.demo.catena-x.net - -# -- [Resource management](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) applied to the deployed pod -resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - -autoscaling: - # -- Enables [horizontal pod autoscaling](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/) - enabled: false - # -- Minimal replicas if resource consumption falls below resource threshholds - minReplicas: 1 - # -- Maximum replicas if resource consumption exceeds resource threshholds - maxReplicas: 100 - # -- targetAverageUtilization of cpu provided to a pod - targetCPUUtilizationPercentage: 80 - # -- targetAverageUtilization of memory provided to a pod - targetMemoryUtilizationPercentage: 80 - -# -- [Liveness-Probe](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#define-a-liveness-command) to detect and remedy broken applications -livenessProbe: - # -- exec command for liveness check - exec: - command: - - /bin/bash - - -c - - /bin/ps -ef | grep backend-service | grep -v grep - # -- initialDelaySeconds before performing the first probe - initialDelaySeconds: 10 - # -- periodSeconds between each probe - periodSeconds: 10 - -# -- [Readiness-Probe](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#define-readiness-probes) to detect ready applications to receive traffic -readinessProbe: - # -- exec command for readiness check - exec: - command: - - /bin/bash - - -c - - /bin/ps -ef | grep backend-service | grep -v grep - # -- initialDelaySeconds before performing the first probe - initialDelaySeconds: 10 - # -- periodSeconds between each probe - periodSeconds: 10 - -# -- [Node-Selector](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector) to constrain the Pod to nodes with specific labels. -nodeSelector: {} - -# -- [Tolerations](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) are applied to Pods to schedule onto nodes with matching taints. -tolerations: [] - -# -- [Affinity](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity) constrains which nodes the Pod can be scheduled on based on node labels. -affinity: {} - -persistence: - # -- Whether to enable persistence via [PersistentVolumeClaim](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#reserving-a-persistentvolume) - enabled: false - # -- [PersistentVolume Access Modes](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes) Access mode to use. One of (ReadOnlyMany, ReadWriteOnce, ReadWriteMany, ReadWriteOncePod) - accessMode: - # -- Storage class to use together with the claimed [PersistentVolume](https://kubernetes.io/docs/concepts/storage/persistent-volumes/) - storageClassName: - # -- Capacity given to the claimed [PersistentVolume](https://kubernetes.io/docs/concepts/storage/persistent-volumes/) - capacity: 100M diff --git a/deployment/helm/edc-consumer/backend-service/values.yaml b/deployment/helm/edc-consumer/backend-service/values.yaml deleted file mode 100644 index 43a07de13..000000000 --- a/deployment/helm/edc-consumer/backend-service/values.yaml +++ /dev/null @@ -1,164 +0,0 @@ -################################################################################# -# Catena-X - Product Passport Consumer Frontend -# -# 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. -# -# This program and the accompanying materials are made available under the -# terms of the Apache License, Version 2.0 which is available at -# https://www.apache.org/licenses/LICENSE-2.0. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -# either express or implied. See the -# License for the specific language govern in permissions and limitations -# under the License. -# -# SPDX-License-Identifier: Apache-2.0 -################################################################################## - -# Default values for .. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. - -replicaCount: 1 - -image: - # -- Which container image to use - repository: ghcr.io/denisneuling/cx-backend-service - # -- [Kubernetes image pull policy](https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy) to use - pullPolicy: IfNotPresent - # -- Overrides the image tag whose default is the chart appVersion - tag: "0.0.6" - -# -- Image pull secret to create to [obtain the container image from private registries](https://kubernetes.io/docs/concepts/containers/images/#using-a-private-registry) -imagePullSecrets: [] - -# -- Overrides the charts name -nameOverride: "" - -# -- Overrides the releases full name -fullnameOverride: "" - -serviceAccount: - # -- Specifies whether a [service account](https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/) should be created per release - create: true - # -- [Annotations](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) to add to the service account - annotations: {} - # -- The name of the service account to use. If not set and create is true, a name is generated using the release's fullname template - name: "" - -# -- Whether to [automount kubernetes API credentials](https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/#use-the-default-service-account-to-access-the-api-server) into the pod -automountServiceAccountToken: false - -# -- [Annotations](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) added to deployed [pods](https://kubernetes.io/docs/concepts/workloads/pods/) -podAnnotations: {} - -# The [pod security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod) defines privilege and access control settings for a Pod within the deployment -podSecurityContext: {} - -# The [container security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container) defines privilege and access control settings for a Container within a pod -securityContext: {} - -service: - # -- [Service type](https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types) to expose the running application on a set of Pods as a network service. - type: ClusterIP - frontend: - # -- Port on which to run the "frontend" api - port: 8080 - backend: - # -- Port on which to run the "backend" api - port: 8081 - -ingress: - enabled: true - className: "nginx" - annotations: - #kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" - nginx.ingress.kubernetes.io/force-ssl-redirect: "true" - nginx.ingress.kubernetes.io/ssl-passthrough: "false" - nginx.ingress.kubernetes.io/rewrite-target: /$2 - nginx.ingress.kubernetes.io/backend-protocol: "HTTP" - hosts: - - host: materialpass.int.demo.catena-x.net - paths: - - path: /consumer_backend(/|$)(.*) - pathType: Prefix - tls: - - secretName: tls-secret - hosts: - - materialpass.int.demo.catena-x.net - -# -- [Resource management](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) applied to the deployed pod -resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - -autoscaling: - # -- Enables [horizontal pod autoscaling](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/) - enabled: false - # -- Minimal replicas if resource consumption falls below resource threshholds - minReplicas: 1 - # -- Maximum replicas if resource consumption exceeds resource threshholds - maxReplicas: 100 - # -- targetAverageUtilization of cpu provided to a pod - targetCPUUtilizationPercentage: 80 - # -- targetAverageUtilization of memory provided to a pod - targetMemoryUtilizationPercentage: 80 - -# -- [Liveness-Probe](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#define-a-liveness-command) to detect and remedy broken applications -livenessProbe: - # -- exec command for liveness check - exec: - command: - - /bin/bash - - -c - - /bin/ps -ef | grep backend-service | grep -v grep - # -- initialDelaySeconds before performing the first probe - initialDelaySeconds: 10 - # -- periodSeconds between each probe - periodSeconds: 10 - -# -- [Readiness-Probe](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#define-readiness-probes) to detect ready applications to receive traffic -readinessProbe: - # -- exec command for readiness check - exec: - command: - - /bin/bash - - -c - - /bin/ps -ef | grep backend-service | grep -v grep - # -- initialDelaySeconds before performing the first probe - initialDelaySeconds: 10 - # -- periodSeconds between each probe - periodSeconds: 10 - -# -- [Node-Selector](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector) to constrain the Pod to nodes with specific labels. -nodeSelector: {} - -# -- [Tolerations](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) are applied to Pods to schedule onto nodes with matching taints. -tolerations: [] - -# -- [Affinity](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity) constrains which nodes the Pod can be scheduled on based on node labels. -affinity: {} - -persistence: - # -- Whether to enable persistence via [PersistentVolumeClaim](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#reserving-a-persistentvolume) - enabled: false - # -- [PersistentVolume Access Modes](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes) Access mode to use. One of (ReadOnlyMany, ReadWriteOnce, ReadWriteMany, ReadWriteOncePod) - accessMode: - # -- Storage class to use together with the claimed [PersistentVolume](https://kubernetes.io/docs/concepts/storage/persistent-volumes/) - storageClassName: - # -- Capacity given to the claimed [PersistentVolume](https://kubernetes.io/docs/concepts/storage/persistent-volumes/) - capacity: 100M diff --git a/deployment/helm/edc-consumer/values-int.yaml b/deployment/helm/edc-consumer/values-int.yaml index 366b17050..63bb791fd 100644 --- a/deployment/helm/edc-consumer/values-int.yaml +++ b/deployment/helm/edc-consumer/values-int.yaml @@ -561,7 +561,7 @@ tractusx-connector: certificate: backendService: - httpProxyTokenReceiverUrl: "http://dpp-edc-consumer-backend" + httpProxyTokenReceiverUrl: "https://materialpass.int.demo.catena-x.net/endpoint" serviceAccount: # Specifies whether a service account should be created @@ -590,4 +590,4 @@ postgresql: auth: database: "edc" username: - password: \ No newline at end of file + password: \ No newline at end of file diff --git a/deployment/helm/edc-consumer/values.yaml b/deployment/helm/edc-consumer/values.yaml index 7c1faff99..0e85cc7cc 100644 --- a/deployment/helm/edc-consumer/values.yaml +++ b/deployment/helm/edc-consumer/values.yaml @@ -25,17 +25,6 @@ # Default values for eclipse-dataspace-connector. # This is a YAML-formatted file. # Declare variables to be passed into your templates. -mockbackend: - enabled: true - fullnameOverride: "dpp-edc-consumer-backend" - service: - type: NodePort - frontend: - port: 80 - backend: - port: 8081 - - tractusx-connector: install: daps: false @@ -62,7 +51,7 @@ tractusx-connector: tag: "0.4.1" initContainers: [] debug: - enabled: true + enabled: false port: 1044 suspendOnStart: false internationalDataSpaces: @@ -317,7 +306,7 @@ tractusx-connector: tag: "0.4.1" initContainers: [] debug: - enabled: true + enabled: false port: 1044 suspendOnStart: false livenessProbe: @@ -547,14 +536,21 @@ tractusx-connector: daps: fullnameOverride: "daps" - url: "https://daps.dev.demo.catena-x.net" + url: "https://daps1.int.demo.catena-x.net" clientId: paths: - jwks: /jwks.json + jwks: /.well-known/jwks.json token: /token + connectors: + - id: + name: edcconector + attributes: + referringConnector: "https://materialpass.dev.demo.catena-x.net/consumer/" + certificate: + backendService: - httpProxyTokenReceiverUrl: "http://dpp-edc-consumer-backend" + httpProxyTokenReceiverUrl: "https://materialpass.dev.demo.catena-x.net/endpoint" serviceAccount: # Specifies whether a service account should be created @@ -582,5 +578,5 @@ postgresql: enabled: true auth: database: "edc" - username: - password: \ No newline at end of file + username: + password: \ No newline at end of file diff --git a/deployment/helm/edc-provider/values-int.yaml b/deployment/helm/edc-provider/values-int.yaml index 1f98da8b3..b5bd76152 100644 --- a/deployment/helm/edc-provider/values-int.yaml +++ b/deployment/helm/edc-provider/values-int.yaml @@ -548,7 +548,7 @@ tractusx-connector: certificate: backendService: - httpProxyTokenReceiverUrl: "http://dpp-edc-consumer-backend" + httpProxyTokenReceiverUrl: "https://materialpass.int.demo.catena-x.net/endpoint" serviceAccount: # Specifies whether a service account should be created @@ -577,4 +577,4 @@ postgresql: auth: database: "edc" username: - password: \ No newline at end of file + password: \ No newline at end of file diff --git a/deployment/helm/edc-provider/values.yaml b/deployment/helm/edc-provider/values.yaml index 3a4ca1191..3cd551429 100644 --- a/deployment/helm/edc-provider/values.yaml +++ b/deployment/helm/edc-provider/values.yaml @@ -535,14 +535,20 @@ tractusx-connector: daps: fullnameOverride: "daps" - url: "https://daps.dev.demo.catena-x.net" + url: "https://daps1.int.demo.catena-x.net" clientId: paths: - jwks: /jwks.json + jwks: /.well-known/jwks.json token: /token + connectors: + - id: + name: edcconector + attributes: + referringConnector: "https://materialpass.dev.demo.catena-x.net/consumer/" + certificate: backendService: - httpProxyTokenReceiverUrl: "http://dpp-edc-consumer-backend" + httpProxyTokenReceiverUrl: "https://materialpass.dev.demo.catena-x.net/endpoint" serviceAccount: # Specifies whether a service account should be created @@ -557,7 +563,7 @@ tractusx-connector: idsdaps: connectors: - - certificate: + - certificate: postgresql: jdbcUrl: "jdbc:postgresql://postgresqlprovider:5432/edc" @@ -571,4 +577,4 @@ postgresql: auth: database: "edc" username: - password: \ No newline at end of file + password: \ No newline at end of file From 40f484420bfd826a258fe2ffc6db92d66679cfdc Mon Sep 17 00:00:00 2001 From: Mathias Brunkow Moser Date: Wed, 7 Jun 2023 13:06:36 +0200 Subject: [PATCH 18/35] fix: corrected values.yaml to point to develop --- charts/digital-product-pass/values.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/charts/digital-product-pass/values.yaml b/charts/digital-product-pass/values.yaml index 68050fc77..d7cdbc8d0 100644 --- a/charts/digital-product-pass/values.yaml +++ b/charts/digital-product-pass/values.yaml @@ -43,7 +43,7 @@ frontend: ingress: enabled: false hosts: - - host: materialpass.int.demo.catena-x.net # Default URL + - host: materialpass.dev.demo.catena-x.net # Default URL paths: - path: /passport(/|$)(.*) pathType: Prefix @@ -56,8 +56,8 @@ frontend: # Product Passport UI Configuration productpass: - backend_url: "materialpass.int.demo.catena-x.net" - idp_url: "centralidp.int.demo.catena-x.net/auth/" # Default URL + backend_url: "materialpass.dev.demo.catena-x.net" + idp_url: "centralidp.dev.demo.catena-x.net/auth/" # Default URL passport: version: "v3.0.1" ## Mandatory Field, passport version must be available (Semantic Structure) api: From 92007de6807fe1d6be03a5ab437f3a674cd7763b Mon Sep 17 00:00:00 2001 From: Mathias Brunkow Moser Date: Fri, 9 Jun 2023 14:46:01 +0200 Subject: [PATCH 19/35] chore: added beta values yaml --- deployment/helm/edc-consumer/values-beta.yaml | 593 ++++++++++++++++++ deployment/helm/edc-provider/values-beta.yaml | 580 +++++++++++++++++ 2 files changed, 1173 insertions(+) create mode 100644 deployment/helm/edc-consumer/values-beta.yaml create mode 100644 deployment/helm/edc-provider/values-beta.yaml diff --git a/deployment/helm/edc-consumer/values-beta.yaml b/deployment/helm/edc-consumer/values-beta.yaml new file mode 100644 index 000000000..2bb607f51 --- /dev/null +++ b/deployment/helm/edc-consumer/values-beta.yaml @@ -0,0 +1,593 @@ +# +# Copyright (c) 2023 ZF Friedrichshafen AG +# Copyright (c) 2023 Mercedes-Benz Tech Innovation GmbH +# Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +# Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License, Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +# SPDX-License-Identifier: Apache-2.0 +# + + +--- +# Default values for eclipse-dataspace-connector. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. +mockbackend: + enabled: true + fullnameOverride: "dpp-edc-consumer-backend" + service: + type: NodePort + frontend: + port: 80 + backend: + port: 8081 + + +tractusx-connector: + install: + daps: false + postgresql: false + vault: false + fullnameOverride: "dpp-edc-consumer" + nameOverride: "" + # -- Existing image pull secret to use to [obtain the container image from private registries](https://kubernetes.io/docs/concepts/containers/images/#using-a-private-registry) + imagePullSecrets: [] + customLabels: {} + + + participant: + id: &bpnNumber "" + + controlplane: + enabled: true + image: + # -- Which derivate of the control plane to use. when left empty the deployment will select the correct image automatically + repository: "tractusx/edc-controlplane-postgresql-hashicorp-vault" + # -- [Kubernetes image pull policy](https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy) to use + pullPolicy: IfNotPresent + # -- Overrides the image tag whose default is the chart appVersion + tag: "0.4.1" + initContainers: [] + debug: + enabled: false + port: 1044 + suspendOnStart: false + internationalDataSpaces: + id: TXDC + description: Tractus-X Eclipse IDS Data Space Connector + title: "" + maintainer: "" + curator: "" + catalogId: TXDC-Catalog + livenessProbe: + # -- Whether to enable kubernetes [liveness-probe](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) + enabled: true + # -- seconds to wait before performing the first liveness check + initialDelaySeconds: 30 + # -- this fields specifies that kubernetes should perform a liveness check every 10 seconds + periodSeconds: 10 + # -- number of seconds after which the probe times out + timeoutSeconds: 5 + # -- when a probe fails kubernetes will try 6 times before giving up + failureThreshold: 6 + # -- number of consecutive successes for the probe to be considered successful after having failed + successThreshold: 1 + readinessProbe: + # -- Whether to enable kubernetes [readiness-probes](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) + enabled: true + # -- seconds to wait before performing the first readiness check + initialDelaySeconds: 30 + # -- this fields specifies that kubernetes should perform a readiness check every 10 seconds + periodSeconds: 10 + # -- number of seconds after which the probe times out + timeoutSeconds: 5 + # -- when a probe fails kubernetes will try 6 times before giving up + failureThreshold: 6 + # -- number of consecutive successes for the probe to be considered successful after having failed + successThreshold: 1 + # -- endpoints of the control plane + endpoints: + # -- default api for health checks, should not be added to any ingress + default: + # -- port for incoming api calls + port: 8080 + # -- path for incoming api calls + path: /consumer/api + # -- data management api, used by internal users, can be added to an ingress and must not be internet facing + management: + # -- port for incoming api calls + port: 8081 + # -- path for incoming api calls + path: /consumer/management + # -- authentication key, must be attached to each 'X-Api-Key' request header + authKey: + # -- control api, used for internal control calls. can be added to the internal ingress, but should probably not + control: + # -- port for incoming api calls + port: 8083 + # -- path for incoming api calls + path: /consumer/control + # -- ids api, used for inter connector communication and must be internet facing + protocol: + # -- port for incoming api calls + port: 8084 + # -- path for incoming api calls + path: /consumer/api/v1/dsp + # -- metrics api, used for application metrics, must not be internet facing + metrics: + # -- port for incoming api calls + port: 9090 + # -- path for incoming api calls + path: /consumer/metrics + # -- observability api with unsecured access, must not be internet facing + observability: + # -- port for incoming API calls + port: 8085 + # -- observability api, provides /health /readiness and /liveness endpoints + path: /consumer/observability + # -- allow or disallow insecure access, i.e. access without authentication + insecure: true + businessPartnerValidation: + log: + agreementValidation: true + service: + # -- [Service type](https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types) to expose the running application on a set of Pods as a network service. + type: ClusterIP + annotations: {} + # -- additional labels for the pod + podLabels: {} + # -- additional annotations for the pod + podAnnotations: {} + # -- The [pod security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod) defines privilege and access control settings for a Pod within the deployment + podSecurityContext: + seccompProfile: + # -- Restrict a Container's Syscalls with seccomp + type: RuntimeDefault + # -- Runs all processes within a pod with a special uid + runAsUser: 10001 + # -- Processes within a pod will belong to this guid + runAsGroup: 10001 + # -- The owner for volumes and any files created within volumes will belong to this guid + fsGroup: 10001 + # The [container security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container) defines privilege and access control settings for a Container within a pod + securityContext: + capabilities: + # -- Specifies which capabilities to drop to reduce syscall attack surface + drop: + - ALL + # -- Specifies which capabilities to add to issue specialized syscalls + add: [] + # -- Whether the root filesystem is mounted in read-only mode + readOnlyRootFilesystem: true + # -- Controls [Privilege Escalation](https://kubernetes.io/docs/concepts/security/pod-security-policy/#privilege-escalation) enabling setuid binaries changing the effective user ID + allowPrivilegeEscalation: false + # -- Requires the container to run without root privileges + runAsNonRoot: true + # -- The container's process will run with the specified uid + runAsUser: 10001 + # Extra environment variables that will be pass onto deployment pods + env: {} + # ENV_NAME: value + + # "valueFrom" environment variable references that will be added to deployment pods. Name is templated. + # ref: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.19/#envvarsource-v1-core + envValueFrom: {} + # ENV_NAME: + # configMapKeyRef: + # name: configmap-name + # key: value_key + # secretKeyRef: + # name: secret-name + # key: value_key + + # [Kubernetes Secret Resource](https://kubernetes.io/docs/concepts/configuration/secret/) names to load environment variables from + envSecretNames: [] + # - first-secret + # - second-secret + + # [Kubernetes ConfigMap Resource](https://kubernetes.io/docs/concepts/configuration/configmap/) names to load environment variables from + envConfigMapNames: [] + # - first-config-map + # - second-config-map + + ## Ingress declaration to expose the network service. + ingresses: + ## Public / Internet facing Ingress + - enabled: true + # -- The hostname to be used to precisely map incoming traffic onto the underlying network service + hostname: "materialpass.beta.demo.catena-x.net" + # -- Additional ingress annotations to add + annotations: {} + # -- EDC endpoints exposed by this ingress resource + endpoints: + - default + - management + - control + - protocol + - metrics + - observability + # -- Defines the [ingress class](https://kubernetes.io/docs/concepts/services-networking/ingress/#ingress-class) to use + className: "nginx" + # -- TLS [tls class](https://kubernetes.io/docs/concepts/services-networking/ingress/#tls) applied to the ingress resource + tls: + # -- Enables TLS on the ingress resource + enabled: true + # -- If present overwrites the default secret name + secretName: "tls-secret" + ## Adds [cert-manager](https://cert-manager.io/docs/) annotations to the ingress resource + certManager: + # -- If preset enables certificate generation via cert-manager namespace scoped issuer + issuer: "" + # -- If preset enables certificate generation via cert-manager cluster-wide issuer + clusterIssuer: "" + ## Private / Intranet facing Ingress + - enabled: false + # -- The hostname to be used to precisely map incoming traffic onto the underlying network service + hostname: "edc-control.intranet" + # -- Additional ingress annotations to add + annotations: {} + # -- EDC endpoints exposed by this ingress resource + endpoints: + - management + - control + # -- Defines the [ingress class](https://kubernetes.io/docs/concepts/services-networking/ingress/#ingress-class) to use + className: "nginx" + # -- TLS [tls class](https://kubernetes.io/docs/concepts/services-networking/ingress/#tls) applied to the ingress resource + tls: + # -- Enables TLS on the ingress resource + enabled: true + # -- If present overwrites the default secret name + secretName: "tls-secret" + ## Adds [cert-manager](https://cert-manager.io/docs/) annotations to the ingress resource + certManager: + # -- If preset enables certificate generation via cert-manager namespace scoped issuer + issuer: "" + # -- If preset enables certificate generation via cert-manager cluster-wide issuer + clusterIssuer: "" + # -- declare where to mount [volumes](https://kubernetes.io/docs/concepts/storage/volumes/) into the container + volumeMounts: [] + # -- [volume](https://kubernetes.io/docs/concepts/storage/volumes/) directories + volumes: [] + # -- [resource management](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) for the container + resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + replicaCount: 1 + autoscaling: + # -- Enables [horizontal pod autoscaling](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/) + enabled: false + # -- Minimal replicas if resource consumption falls below resource threshholds + minReplicas: 1 + # -- Maximum replicas if resource consumption exceeds resource threshholds + maxReplicas: 100 + # -- targetAverageUtilization of cpu provided to a pod + targetCPUUtilizationPercentage: 80 + # -- targetAverageUtilization of memory provided to a pod + targetMemoryUtilizationPercentage: 80 + # -- configuration of the [Open Telemetry Agent](https://opentelemetry.io/docs/instrumentation/java/automatic/agent-config/) to collect and expose metrics + opentelemetry: |- + otel.javaagent.enabled=false + otel.javaagent.debug=false + # -- configuration of the [Java Util Logging Facade](https://docs.oracle.com/javase/7/docs/technotes/guides/logging/overview.html) + logging: |- + .level=INFO + org.eclipse.edc.level=ALL + handlers=java.util.logging.ConsoleHandler + java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter + java.util.logging.ConsoleHandler.level=ALL + java.util.logging.SimpleFormatter.format=[%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS] [%4$-7s] %5$s%6$s%n + # [node selector](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector) to constrain pods to nodes + nodeSelector: {} + # [tolerations](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) to configure preferred nodes + tolerations: [] + # [affinity](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity) to configure which nodes the pods can be scheduled on + affinity: {} + url: + # -- Explicitly declared url for reaching the ids api (e.g. if ingresses not used) + ids: "" + dataplane: + enabled: true + image: + # -- Which derivate of the data plane to use. when left empty the deployment will select the correct image automatically + repository: "tractusx/edc-dataplane-hashicorp-vault" + # -- [Kubernetes image pull policy](https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy) to use + pullPolicy: IfNotPresent + # -- Overrides the image tag whose default is the chart appVersion + tag: "0.4.1" + initContainers: [] + debug: + enabled: false + port: 1044 + suspendOnStart: false + livenessProbe: + # -- Whether to enable kubernetes [liveness-probe](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) + enabled: true + # -- seconds to wait before performing the first liveness check + initialDelaySeconds: 30 + # -- this fields specifies that kubernetes should perform a liveness check every 10 seconds + periodSeconds: 10 + # -- number of seconds after which the probe times out + timeoutSeconds: 5 + # -- when a probe fails kubernetes will try 6 times before giving up + failureThreshold: 6 + # -- number of consecutive successes for the probe to be considered successful after having failed + successThreshold: 1 + readinessProbe: + # -- Whether to enable kubernetes [readiness-probes](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) + enabled: true + # -- seconds to wait before performing the first readiness check + initialDelaySeconds: 30 + # -- this fields specifies that kubernetes should perform a liveness check every 10 seconds + periodSeconds: 10 + # -- number of seconds after which the probe times out + timeoutSeconds: 5 + # -- when a probe fails kubernetes will try 6 times before giving up + failureThreshold: 6 + # -- number of consecutive successes for the probe to be considered successful after having failed + successThreshold: 1 + service: + # -- [Service type](https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types) to expose the running application on a set of Pods as a network service. + type: ClusterIP + port: 80 + endpoints: + default: + port: 8080 + path: /consumer/api + public: + port: 8081 + path: /consumer/api/public + control: + port: 8083 + path: /consumer/api/dataplane/control + proxy: + port: 8186 + path: /consumer/proxy + observability: + # -- port for incoming API calls + port: 8085 + # -- observability api, provides /health /readiness and /liveness endpoints + path: /consumer/observability + # -- allow or disallow insecure access, i.e. access without authentication + insecure: true + metrics: + port: 9090 + path: /consumer/metrics + aws: + endpointOverride: "" + accessKeyId: "" + secretAccessKey: "" + # -- additional labels for the pod + podLabels: {} + # -- additional annotations for the pod + podAnnotations: {} + # -- The [pod security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod) defines privilege and access control settings for a Pod within the deployment + podSecurityContext: + seccompProfile: + # -- Restrict a Container's Syscalls with seccomp + type: RuntimeDefault + # -- Runs all processes within a pod with a special uid + runAsUser: 10001 + # -- Processes within a pod will belong to this guid + runAsGroup: 10001 + # -- The owner for volumes and any files created within volumes will belong to this guid + fsGroup: 10001 + # The [container security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container) defines privilege and access control settings for a Container within a pod + securityContext: + capabilities: + # -- Specifies which capabilities to drop to reduce syscall attack surface + drop: + - ALL + # -- Specifies which capabilities to add to issue specialized syscalls + add: [] + # -- Whether the root filesystem is mounted in read-only mode + readOnlyRootFilesystem: true + # -- Controls [Privilege Escalation](https://kubernetes.io/docs/concepts/security/pod-security-policy/#privilege-escalation) enabling setuid binaries changing the effective user ID + allowPrivilegeEscalation: false + # -- Requires the container to run without root privileges + runAsNonRoot: true + # -- The container's process will run with the specified uid + runAsUser: 10001 + # Extra environment variables that will be pass onto deployment pods + env: {} + # ENV_NAME: value + + # "valueFrom" environment variable references that will be added to deployment pods. Name is templated. + # ref: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.19/#envvarsource-v1-core + envValueFrom: {} + # ENV_NAME: + # configMapKeyRef: + # name: configmap-name + # key: value_key + # secretKeyRef: + # name: secret-name + # key: value_key + + # [Kubernetes Secret Resource](https://kubernetes.io/docs/concepts/configuration/secret/) names to load environment variables from + envSecretNames: [] + # - first-secret + # - second-secret + + # [Kubernetes ConfigMap Resource](https://kubernetes.io/docs/concepts/configuration/configmap/) names to load environment variables from + envConfigMapNames: [] + # - first-config-map + # - second-config-map + + ## Ingress declaration to expose the network service. + ingresses: + ## Public / Internet facing Ingress + - enabled: true + # -- The hostname to be used to precisely map incoming traffic onto the underlying network service + hostname: "materialpass.beta.demo.catena-x.net" + # -- Additional ingress annotations to add + annotations: {} + # -- EDC endpoints exposed by this ingress resource + endpoints: + - public + # -- Defines the [ingress class](https://kubernetes.io/docs/concepts/services-networking/ingress/#ingress-class) to use + className: "nginx" + # -- TLS [tls class](https://kubernetes.io/docs/concepts/services-networking/ingress/#tls) applied to the ingress resource + tls: + # -- Enables TLS on the ingress resource + enabled: true + # -- If present overwrites the default secret name + secretName: "tls-secret" + ## Adds [cert-manager](https://cert-manager.io/docs/) annotations to the ingress resource + certManager: + # -- If preset enables certificate generation via cert-manager namespace scoped issuer + issuer: "" + # -- If preset enables certificate generation via cert-manager cluster-wide issuer + clusterIssuer: "" + # -- declare where to mount [volumes](https://kubernetes.io/docs/concepts/storage/volumes/) into the container + volumeMounts: [] + # -- [volume](https://kubernetes.io/docs/concepts/storage/volumes/) directories + volumes: [] + # -- [resource management](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) for the container + resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + replicaCount: 1 + autoscaling: + # -- Enables [horizontal pod autoscaling](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/) + enabled: false + # -- Minimal replicas if resource consumption falls below resource threshholds + minReplicas: 1 + # -- Maximum replicas if resource consumption exceeds resource threshholds + maxReplicas: 100 + # -- targetAverageUtilization of cpu provided to a pod + targetCPUUtilizationPercentage: 80 + # -- targetAverageUtilization of memory provided to a pod + targetMemoryUtilizationPercentage: 80 + # -- configuration of the [Open Telemetry Agent](https://opentelemetry.io/docs/instrumentation/java/automatic/agent-config/) to collect and expose metrics + opentelemetry: |- + otel.javaagent.enabled=false + otel.javaagent.debug=false + # -- configuration of the [Java Util Logging Facade](https://docs.oracle.com/javase/7/docs/technotes/guides/logging/overview.html) + logging: |- + .level=INFO + org.eclipse.edc.level=ALL + handlers=java.util.logging.ConsoleHandler + java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter + java.util.logging.ConsoleHandler.level=ALL + java.util.logging.SimpleFormatter.format=[%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS] [%4$-7s] %5$s%6$s%n + # [node selector](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector) to constrain pods to nodes + nodeSelector: {} + # [tolerations](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) to configure preferred nodes + tolerations: [] + # [affinity](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity) to configure which nodes the pods can be scheduled on + affinity: {} + url: + # -- Explicitly declared url for reaching the public api (e.g. if ingresses not used) + public: "" + + postgresql: + jdbcUrl: "jdbc:postgresql://postgresql:5432/edc" + fullnameOverride: "postgresql" + username: + password: + auth: + database: "edc" + username: + password: + + vault: + fullnameOverride: "vault" + injector: + enabled: false + server: + dev: + enabled: true + devRootToken: "root" + # Must be the same certificate that is configured in section 'daps' + postStart: # must be set externally! + hashicorp: + url: + token: + timeout: 30 + healthCheck: + enabled: true + standbyOk: true + paths: + secret: + health: /v1/sys/health + secretNames: + transferProxyTokenSignerPrivateKey: ids-daps_key + transferProxyTokenSignerPublicKey: ids-daps_crt + transferProxyTokenEncryptionAesKey: edc-encryption-key + dapsPrivateKey: ids-daps_key + dapsPublicKey: ids-daps_crt + + daps: + fullnameOverride: "daps" + url: "https://daps.beta.demo.catena-x.net" + clientId: + paths: + jwks: /.well-known/jwks.json + token: /token + connectors: + - id: + name: edcconector + attributes: + referringConnector: "https://materialpass.beta.demo.catena-x.net/consumer/" + # Must be the same certificate that is stores in section 'sokrates-vault' + certificate: + + backendService: + httpProxyTokenReceiverUrl: "https://materialpass.beta.demo.catena-x.net/endpoint" + + serviceAccount: + # Specifies whether a service account should be created + create: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + # -- Existing image pull secret bound to the service account to use to [obtain the container image from private registries](https://kubernetes.io/docs/concepts/containers/images/#using-a-private-registry) + imagePullSecrets: [] + + idsdaps: + connectors: + - certificate: + +postgresql: + jdbcUrl: "jdbc:postgresql://postgresql:5432/edc" + fullnameOverride: "postgresql" + primary: + persistence: + enabled: true + readReplicas: + persistence: + enabled: true + auth: + database: "edc" + username: + password: \ No newline at end of file diff --git a/deployment/helm/edc-provider/values-beta.yaml b/deployment/helm/edc-provider/values-beta.yaml new file mode 100644 index 000000000..83f3c44b4 --- /dev/null +++ b/deployment/helm/edc-provider/values-beta.yaml @@ -0,0 +1,580 @@ +# +# Copyright (c) 2023 ZF Friedrichshafen AG +# Copyright (c) 2023 Mercedes-Benz Tech Innovation GmbH +# Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +# Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License, Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +# SPDX-License-Identifier: Apache-2.0 +# + + +--- + + +tractusx-connector: + install: + daps: false + postgresql: false + vault: false + fullnameOverride: "dpp-edc-provider" + nameOverride: "" + # -- Existing image pull secret to use to [obtain the container image from private registries](https://kubernetes.io/docs/concepts/containers/images/#using-a-private-registry) + imagePullSecrets: [] + customLabels: {} + + + participant: + id: &bpnNumber "" + + controlplane: + enabled: true + image: + # -- Which derivate of the control plane to use. when left empty the deployment will select the correct image automatically + repository: "tractusx/edc-controlplane-postgresql-hashicorp-vault" + # -- [Kubernetes image pull policy](https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy) to use + pullPolicy: IfNotPresent + # -- Overrides the image tag whose default is the chart appVersion + tag: "0.4.1" + initContainers: [] + debug: + enabled: false + port: 1044 + suspendOnStart: false + internationalDataSpaces: + id: TXDC + description: Tractus-X Eclipse IDS Data Space Connector + title: "" + maintainer: "" + curator: "" + catalogId: TXDC-Catalog + livenessProbe: + # -- Whether to enable kubernetes [liveness-probe](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) + enabled: true + # -- seconds to wait before performing the first liveness check + initialDelaySeconds: 30 + # -- this fields specifies that kubernetes should perform a liveness check every 10 seconds + periodSeconds: 10 + # -- number of seconds after which the probe times out + timeoutSeconds: 5 + # -- when a probe fails kubernetes will try 6 times before giving up + failureThreshold: 6 + # -- number of consecutive successes for the probe to be considered successful after having failed + successThreshold: 1 + readinessProbe: + # -- Whether to enable kubernetes [readiness-probes](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) + enabled: true + # -- seconds to wait before performing the first readiness check + initialDelaySeconds: 30 + # -- this fields specifies that kubernetes should perform a readiness check every 10 seconds + periodSeconds: 10 + # -- number of seconds after which the probe times out + timeoutSeconds: 5 + # -- when a probe fails kubernetes will try 6 times before giving up + failureThreshold: 6 + # -- number of consecutive successes for the probe to be considered successful after having failed + successThreshold: 1 + # -- endpoints of the control plane + endpoints: + # -- default api for health checks, should not be added to any ingress + default: + # -- port for incoming api calls + port: 8080 + # -- path for incoming api calls + path: /BPNL000000000000/api + # -- data management api, used by internal users, can be added to an ingress and must not be internet facing + management: + # -- port for incoming api calls + port: 8081 + # -- path for incoming api calls + path: /BPNL000000000000/management + # -- authentication key, must be attached to each 'X-Api-Key' request header + authKey: + # -- control api, used for internal control calls. can be added to the internal ingress, but should probably not + control: + # -- port for incoming api calls + port: 8083 + # -- path for incoming api calls + path: /BPNL000000000000/control + # -- ids api, used for inter connector communication and must be internet facing + protocol: + # -- port for incoming api calls + port: 8084 + # -- path for incoming api calls + path: /BPNL000000000000/api/v1/dsp + # -- metrics api, used for application metrics, must not be internet facing + metrics: + # -- port for incoming api calls + port: 9090 + # -- path for incoming api calls + path: /BPNL000000000000/metrics + # -- observability api with unsecured access, must not be internet facing + observability: + # -- port for incoming API calls + port: 8085 + # -- observability api, provides /health /readiness and /liveness endpoints + path: /BPNL000000000000/observability + # -- allow or disallow insecure access, i.e. access without authentication + insecure: true + businessPartnerValidation: + log: + agreementValidation: true + service: + # -- [Service type](https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types) to expose the running application on a set of Pods as a network service. + type: ClusterIP + annotations: {} + # -- additional labels for the pod + podLabels: {} + # -- additional annotations for the pod + podAnnotations: {} + # -- The [pod security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod) defines privilege and access control settings for a Pod within the deployment + podSecurityContext: + seccompProfile: + # -- Restrict a Container's Syscalls with seccomp + type: RuntimeDefault + # -- Runs all processes within a pod with a special uid + runAsUser: 10001 + # -- Processes within a pod will belong to this guid + runAsGroup: 10001 + # -- The owner for volumes and any files created within volumes will belong to this guid + fsGroup: 10001 + # The [container security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container) defines privilege and access control settings for a Container within a pod + securityContext: + capabilities: + # -- Specifies which capabilities to drop to reduce syscall attack surface + drop: + - ALL + # -- Specifies which capabilities to add to issue specialized syscalls + add: [] + # -- Whether the root filesystem is mounted in read-only mode + readOnlyRootFilesystem: true + # -- Controls [Privilege Escalation](https://kubernetes.io/docs/concepts/security/pod-security-policy/#privilege-escalation) enabling setuid binaries changing the effective user ID + allowPrivilegeEscalation: false + # -- Requires the container to run without root privileges + runAsNonRoot: true + # -- The container's process will run with the specified uid + runAsUser: 10001 + # Extra environment variables that will be pass onto deployment pods + env: {} + # ENV_NAME: value + + # "valueFrom" environment variable references that will be added to deployment pods. Name is templated. + # ref: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.19/#envvarsource-v1-core + envValueFrom: {} + # ENV_NAME: + # configMapKeyRef: + # name: configmap-name + # key: value_key + # secretKeyRef: + # name: secret-name + # key: value_key + + # [Kubernetes Secret Resource](https://kubernetes.io/docs/concepts/configuration/secret/) names to load environment variables from + envSecretNames: [] + # - first-secret + # - second-secret + + # [Kubernetes ConfigMap Resource](https://kubernetes.io/docs/concepts/configuration/configmap/) names to load environment variables from + envConfigMapNames: [] + # - first-config-map + # - second-config-map + + ## Ingress declaration to expose the network service. + ingresses: + ## Public / Internet facing Ingress + - enabled: true + # -- The hostname to be used to precisely map incoming traffic onto the underlying network service + hostname: "materialpass.beta.demo.catena-x.net" + # -- Additional ingress annotations to add + annotations: {} + # -- EDC endpoints exposed by this ingress resource + endpoints: + - default + - management + - control + - protocol + - metrics + - observability + # -- Defines the [ingress class](https://kubernetes.io/docs/concepts/services-networking/ingress/#ingress-class) to use + className: "nginx" + # -- TLS [tls class](https://kubernetes.io/docs/concepts/services-networking/ingress/#tls) applied to the ingress resource + tls: + # -- Enables TLS on the ingress resource + enabled: true + # -- If present overwrites the default secret name + secretName: "tls-secret" + ## Adds [cert-manager](https://cert-manager.io/docs/) annotations to the ingress resource + certManager: + # -- If preset enables certificate generation via cert-manager namespace scoped issuer + issuer: "" + # -- If preset enables certificate generation via cert-manager cluster-wide issuer + clusterIssuer: "" + ## Private / Intranet facing Ingress + - enabled: false + # -- The hostname to be used to precisely map incoming traffic onto the underlying network service + hostname: "edc-control.intranet" + # -- Additional ingress annotations to add + annotations: {} + # -- EDC endpoints exposed by this ingress resource + endpoints: + - management + - control + # -- Defines the [ingress class](https://kubernetes.io/docs/concepts/services-networking/ingress/#ingress-class) to use + className: "nginx" + # -- TLS [tls class](https://kubernetes.io/docs/concepts/services-networking/ingress/#tls) applied to the ingress resource + tls: + # -- Enables TLS on the ingress resource + enabled: true + # -- If present overwrites the default secret name + secretName: "tls-secret" + ## Adds [cert-manager](https://cert-manager.io/docs/) annotations to the ingress resource + certManager: + # -- If preset enables certificate generation via cert-manager namespace scoped issuer + issuer: "" + # -- If preset enables certificate generation via cert-manager cluster-wide issuer + clusterIssuer: "" + # -- declare where to mount [volumes](https://kubernetes.io/docs/concepts/storage/volumes/) into the container + volumeMounts: [] + # -- [volume](https://kubernetes.io/docs/concepts/storage/volumes/) directories + volumes: [] + # -- [resource management](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) for the container + resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + replicaCount: 1 + autoscaling: + # -- Enables [horizontal pod autoscaling](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/) + enabled: false + # -- Minimal replicas if resource consumption falls below resource threshholds + minReplicas: 1 + # -- Maximum replicas if resource consumption exceeds resource threshholds + maxReplicas: 100 + # -- targetAverageUtilization of cpu provided to a pod + targetCPUUtilizationPercentage: 80 + # -- targetAverageUtilization of memory provided to a pod + targetMemoryUtilizationPercentage: 80 + # -- configuration of the [Open Telemetry Agent](https://opentelemetry.io/docs/instrumentation/java/automatic/agent-config/) to collect and expose metrics + opentelemetry: |- + otel.javaagent.enabled=false + otel.javaagent.debug=false + # -- configuration of the [Java Util Logging Facade](https://docs.oracle.com/javase/7/docs/technotes/guides/logging/overview.html) + logging: |- + .level=INFO + org.eclipse.edc.level=ALL + handlers=java.util.logging.ConsoleHandler + java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter + java.util.logging.ConsoleHandler.level=ALL + java.util.logging.SimpleFormatter.format=[%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS] [%4$-7s] %5$s%6$s%n + # [node selector](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector) to constrain pods to nodes + nodeSelector: {} + # [tolerations](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) to configure preferred nodes + tolerations: [] + # [affinity](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity) to configure which nodes the pods can be scheduled on + affinity: {} + url: + # -- Explicitly declared url for reaching the ids api (e.g. if ingresses not used) + ids: "" + dataplane: + enabled: true + image: + # -- Which derivate of the data plane to use. when left empty the deployment will select the correct image automatically + repository: "tractusx/edc-dataplane-hashicorp-vault" + # -- [Kubernetes image pull policy](https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy) to use + pullPolicy: IfNotPresent + # -- Overrides the image tag whose default is the chart appVersion + tag: "0.4.1" + initContainers: [] + debug: + enabled: false + port: 1044 + suspendOnStart: false + livenessProbe: + # -- Whether to enable kubernetes [liveness-probe](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) + enabled: true + # -- seconds to wait before performing the first liveness check + initialDelaySeconds: 30 + # -- this fields specifies that kubernetes should perform a liveness check every 10 seconds + periodSeconds: 10 + # -- number of seconds after which the probe times out + timeoutSeconds: 5 + # -- when a probe fails kubernetes will try 6 times before giving up + failureThreshold: 6 + # -- number of consecutive successes for the probe to be considered successful after having failed + successThreshold: 1 + readinessProbe: + # -- Whether to enable kubernetes [readiness-probes](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) + enabled: true + # -- seconds to wait before performing the first readiness check + initialDelaySeconds: 30 + # -- this fields specifies that kubernetes should perform a liveness check every 10 seconds + periodSeconds: 10 + # -- number of seconds after which the probe times out + timeoutSeconds: 5 + # -- when a probe fails kubernetes will try 6 times before giving up + failureThreshold: 6 + # -- number of consecutive successes for the probe to be considered successful after having failed + successThreshold: 1 + service: + # -- [Service type](https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types) to expose the running application on a set of Pods as a network service. + type: ClusterIP + port: 80 + endpoints: + default: + port: 8080 + path: /BPNL000000000000/api + public: + port: 8081 + path: /BPNL000000000000/api/public + control: + port: 8083 + path: /BPNL000000000000/api/dataplane/control + proxy: + port: 8186 + path: /BPNL000000000000/proxy + observability: + # -- port for incoming API calls + port: 8085 + # -- observability api, provides /health /readiness and /liveness endpoints + path: /BPNL000000000000/observability + # -- allow or disallow insecure access, i.e. access without authentication + insecure: true + metrics: + port: 9090 + path: /BPNL000000000000/metrics + aws: + endpointOverride: "" + accessKeyId: "" + secretAccessKey: "" + # -- additional labels for the pod + podLabels: {} + # -- additional annotations for the pod + podAnnotations: {} + # -- The [pod security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod) defines privilege and access control settings for a Pod within the deployment + podSecurityContext: + seccompProfile: + # -- Restrict a Container's Syscalls with seccomp + type: RuntimeDefault + # -- Runs all processes within a pod with a special uid + runAsUser: 10001 + # -- Processes within a pod will belong to this guid + runAsGroup: 10001 + # -- The owner for volumes and any files created within volumes will belong to this guid + fsGroup: 10001 + # The [container security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container) defines privilege and access control settings for a Container within a pod + securityContext: + capabilities: + # -- Specifies which capabilities to drop to reduce syscall attack surface + drop: + - ALL + # -- Specifies which capabilities to add to issue specialized syscalls + add: [] + # -- Whether the root filesystem is mounted in read-only mode + readOnlyRootFilesystem: true + # -- Controls [Privilege Escalation](https://kubernetes.io/docs/concepts/security/pod-security-policy/#privilege-escalation) enabling setuid binaries changing the effective user ID + allowPrivilegeEscalation: false + # -- Requires the container to run without root privileges + runAsNonRoot: true + # -- The container's process will run with the specified uid + runAsUser: 10001 + # Extra environment variables that will be pass onto deployment pods + env: {} + # ENV_NAME: value + + # "valueFrom" environment variable references that will be added to deployment pods. Name is templated. + # ref: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.19/#envvarsource-v1-core + envValueFrom: {} + # ENV_NAME: + # configMapKeyRef: + # name: configmap-name + # key: value_key + # secretKeyRef: + # name: secret-name + # key: value_key + + # [Kubernetes Secret Resource](https://kubernetes.io/docs/concepts/configuration/secret/) names to load environment variables from + envSecretNames: [] + # - first-secret + # - second-secret + + # [Kubernetes ConfigMap Resource](https://kubernetes.io/docs/concepts/configuration/configmap/) names to load environment variables from + envConfigMapNames: [] + # - first-config-map + # - second-config-map + + ## Ingress declaration to expose the network service. + ingresses: + ## Public / Internet facing Ingress + - enabled: true + # -- The hostname to be used to precisely map incoming traffic onto the underlying network service + hostname: "materialpass.beta.demo.catena-x.net" + # -- Additional ingress annotations to add + annotations: {} + # -- EDC endpoints exposed by this ingress resource + endpoints: + - public + # -- Defines the [ingress class](https://kubernetes.io/docs/concepts/services-networking/ingress/#ingress-class) to use + className: "nginx" + # -- TLS [tls class](https://kubernetes.io/docs/concepts/services-networking/ingress/#tls) applied to the ingress resource + tls: + # -- Enables TLS on the ingress resource + enabled: true + # -- If present overwrites the default secret name + secretName: "tls-secret" + ## Adds [cert-manager](https://cert-manager.io/docs/) annotations to the ingress resource + certManager: + # -- If preset enables certificate generation via cert-manager namespace scoped issuer + issuer: "" + # -- If preset enables certificate generation via cert-manager cluster-wide issuer + clusterIssuer: "" + # -- declare where to mount [volumes](https://kubernetes.io/docs/concepts/storage/volumes/) into the container + volumeMounts: [] + # -- [volume](https://kubernetes.io/docs/concepts/storage/volumes/) directories + volumes: [] + # -- [resource management](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) for the container + resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + replicaCount: 1 + autoscaling: + # -- Enables [horizontal pod autoscaling](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/) + enabled: false + # -- Minimal replicas if resource consumption falls below resource threshholds + minReplicas: 1 + # -- Maximum replicas if resource consumption exceeds resource threshholds + maxReplicas: 100 + # -- targetAverageUtilization of cpu provided to a pod + targetCPUUtilizationPercentage: 80 + # -- targetAverageUtilization of memory provided to a pod + targetMemoryUtilizationPercentage: 80 + # -- configuration of the [Open Telemetry Agent](https://opentelemetry.io/docs/instrumentation/java/automatic/agent-config/) to collect and expose metrics + opentelemetry: |- + otel.javaagent.enabled=false + otel.javaagent.debug=false + # -- configuration of the [Java Util Logging Facade](https://docs.oracle.com/javase/7/docs/technotes/guides/logging/overview.html) + logging: |- + .level=INFO + org.eclipse.edc.level=ALL + handlers=java.util.logging.ConsoleHandler + java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter + java.util.logging.ConsoleHandler.level=ALL + java.util.logging.SimpleFormatter.format=[%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS] [%4$-7s] %5$s%6$s%n + # [node selector](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector) to constrain pods to nodes + nodeSelector: {} + # [tolerations](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) to configure preferred nodes + tolerations: [] + # [affinity](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity) to configure which nodes the pods can be scheduled on + affinity: {} + url: + # -- Explicitly declared url for reaching the public api (e.g. if ingresses not used) + public: "" + + postgresql: + jdbcUrl: "jdbc:postgresql://postgresqlprovider:5432/edc" + fullnameOverride: "postgresql" + username: + password: + auth: + database: "edc" + username: + password: + + vault: + fullnameOverride: "vault" + injector: + enabled: false + server: + dev: + enabled: true + devRootToken: "root" + # Must be the same certificate that is configured in section 'daps' + postStart: # must be set externally! + hashicorp: + url: + token: + timeout: 30 + healthCheck: + enabled: true + standbyOk: true + paths: + secret: + health: /v1/sys/health + secretNames: + transferProxyTokenSignerPrivateKey: ids-daps_key + transferProxyTokenSignerPublicKey: ids-daps_crt + transferProxyTokenEncryptionAesKey: edc-encryption-key + dapsPrivateKey: ids-daps_key + dapsPublicKey: ids-daps_crt + + daps: + fullnameOverride: "daps" + url: "https://daps.beta.demo.catena-x.net" + clientId: + paths: + jwks: /.well-known/jwks.json + token: /token + connectors: + - id: + name: edcconector + attributes: + referringConnector: "https://materialpass.beta.demo.catena-x.net/consumer/" + certificate: + + backendService: + httpProxyTokenReceiverUrl: "https://materialpass.beta.demo.catena-x.net/endpoint" + + serviceAccount: + # Specifies whether a service account should be created + create: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + # -- Existing image pull secret bound to the service account to use to [obtain the container image from private registries](https://kubernetes.io/docs/concepts/containers/images/#using-a-private-registry) + imagePullSecrets: [] + + idsdaps: + connectors: + - certificate: + +postgresql: + jdbcUrl: "jdbc:postgresql://postgresqlprovider:5432/edc" + fullnameOverride: "postgresqlprovider" + primary: + persistence: + enabled: true + readReplicas: + persistence: + enabled: true + auth: + database: "edc" + username: + password: \ No newline at end of file From 00d2934b370ab57bb89a47451e2aba529049d11c Mon Sep 17 00:00:00 2001 From: Parracho Date: Mon, 26 Jun 2023 10:04:00 +0100 Subject: [PATCH 20/35] feat: added tractus metafile --- .tractusx | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .tractusx diff --git a/.tractusx b/.tractusx new file mode 100644 index 000000000..7178e50f0 --- /dev/null +++ b/.tractusx @@ -0,0 +1,2 @@ +product: "Digital Product Pass" +leadingRepository: "https://github.com/eclipse-tractusx/digital-product-pass" From af72e2e0575b36ba4591d87deb438db588b1f8ac Mon Sep 17 00:00:00 2001 From: Mathias Brunkow Moser Date: Mon, 26 Jun 2023 18:16:27 +0200 Subject: [PATCH 21/35] feat: removed old postman archives and infrastructure --- .../infrastructure/provider/init-provider.sh | 148 -- .../provider/init-provider_dev.sh | 141 -- .../provider/resources/assets/IMR18650V1.json | 14 - .../resources/assets/IMR18650V1_DEV.json | 14 - .../provider/resources/assets/NCR186850B.json | 15 - .../resources/assets/NCR186850B_DEV.json | 15 - .../X123456789012X12345678901234566.json | 14 - .../X123456789012X12345678901234566_DEV.json | 14 - .../contractdefinitions/IMR18650V1.json | 12 - .../contractdefinitions/IMR18650V1_DEV.json | 12 - .../contractdefinitions/NCR186850B.json | 12 - .../contractdefinitions/NCR186850B_DEV.json | 12 - .../X123456789012X12345678901234566.json | 12 - .../X123456789012X12345678901234566_DEV.json | 12 - .../contractpolicies/IMR18650V1.json | 16 - .../contractpolicies/IMR18650V1_DEV.json | 16 - .../contractpolicies/NCR186850B.json | 16 - .../contractpolicies/NCR186850B_DEV.json | 16 - .../X123456789012X12345678901234566.json | 16 - .../X123456789012X12345678901234566_DEV.json | 16 - .../resources/digitaltwins/IMR18650V1.json | 43 - .../digitaltwins/IMR18650V1_DEV.json | 43 - .../resources/digitaltwins/NCR186850B.json | 43 - .../digitaltwins/NCR186850B_DEV.json | 44 - .../X123456789012X12345678901234566.json | 43 - .../X123456789012X12345678901234566_DEV.json | 43 - .../resources/payloads/IMR18650V1.json | 248 --- .../resources/payloads/IMR18650V1_DEV.json | 248 --- .../resources/payloads/NCR186850B.json | 283 ---- .../resources/payloads/NCR186850B_DEV.json | 283 ---- .../X123456789012X12345678901234566.json | 344 ----- .../X123456789012X12345678901234566_DEV.json | 344 ----- .../Battery-Pass_BETA.postman_collection.json | 1080 -------------- .../Battery-Pass_DEV.postman_collection.json | 1124 -------------- .../Battery-Pass_INT.postman_collection.json | 1085 -------------- ...roduct-Pass-v1.0.0.postman_collection.json | 1325 +++++++++++++++++ 36 files changed, 1325 insertions(+), 5841 deletions(-) delete mode 100644 deployment/infrastructure/provider/init-provider.sh delete mode 100644 deployment/infrastructure/provider/init-provider_dev.sh delete mode 100644 deployment/infrastructure/provider/resources/assets/IMR18650V1.json delete mode 100644 deployment/infrastructure/provider/resources/assets/IMR18650V1_DEV.json delete mode 100644 deployment/infrastructure/provider/resources/assets/NCR186850B.json delete mode 100644 deployment/infrastructure/provider/resources/assets/NCR186850B_DEV.json delete mode 100644 deployment/infrastructure/provider/resources/assets/X123456789012X12345678901234566.json delete mode 100644 deployment/infrastructure/provider/resources/assets/X123456789012X12345678901234566_DEV.json delete mode 100644 deployment/infrastructure/provider/resources/contractdefinitions/IMR18650V1.json delete mode 100644 deployment/infrastructure/provider/resources/contractdefinitions/IMR18650V1_DEV.json delete mode 100644 deployment/infrastructure/provider/resources/contractdefinitions/NCR186850B.json delete mode 100644 deployment/infrastructure/provider/resources/contractdefinitions/NCR186850B_DEV.json delete mode 100644 deployment/infrastructure/provider/resources/contractdefinitions/X123456789012X12345678901234566.json delete mode 100644 deployment/infrastructure/provider/resources/contractdefinitions/X123456789012X12345678901234566_DEV.json delete mode 100644 deployment/infrastructure/provider/resources/contractpolicies/IMR18650V1.json delete mode 100644 deployment/infrastructure/provider/resources/contractpolicies/IMR18650V1_DEV.json delete mode 100644 deployment/infrastructure/provider/resources/contractpolicies/NCR186850B.json delete mode 100644 deployment/infrastructure/provider/resources/contractpolicies/NCR186850B_DEV.json delete mode 100644 deployment/infrastructure/provider/resources/contractpolicies/X123456789012X12345678901234566.json delete mode 100644 deployment/infrastructure/provider/resources/contractpolicies/X123456789012X12345678901234566_DEV.json delete mode 100644 deployment/infrastructure/provider/resources/digitaltwins/IMR18650V1.json delete mode 100644 deployment/infrastructure/provider/resources/digitaltwins/IMR18650V1_DEV.json delete mode 100644 deployment/infrastructure/provider/resources/digitaltwins/NCR186850B.json delete mode 100644 deployment/infrastructure/provider/resources/digitaltwins/NCR186850B_DEV.json delete mode 100644 deployment/infrastructure/provider/resources/digitaltwins/X123456789012X12345678901234566.json delete mode 100644 deployment/infrastructure/provider/resources/digitaltwins/X123456789012X12345678901234566_DEV.json delete mode 100644 deployment/infrastructure/provider/resources/payloads/IMR18650V1.json delete mode 100644 deployment/infrastructure/provider/resources/payloads/IMR18650V1_DEV.json delete mode 100644 deployment/infrastructure/provider/resources/payloads/NCR186850B.json delete mode 100644 deployment/infrastructure/provider/resources/payloads/NCR186850B_DEV.json delete mode 100644 deployment/infrastructure/provider/resources/payloads/X123456789012X12345678901234566.json delete mode 100644 deployment/infrastructure/provider/resources/payloads/X123456789012X12345678901234566_DEV.json delete mode 100644 postman/v3.0.1/Battery-Pass_BETA.postman_collection.json delete mode 100644 postman/v3.0.1/Battery-Pass_DEV.postman_collection.json delete mode 100644 postman/v3.0.1/Battery-Pass_INT.postman_collection.json create mode 100644 postman/v3.0.1/Digital-Product-Pass-v1.0.0.postman_collection.json diff --git a/deployment/infrastructure/provider/init-provider.sh b/deployment/infrastructure/provider/init-provider.sh deleted file mode 100644 index 033338cd5..000000000 --- a/deployment/infrastructure/provider/init-provider.sh +++ /dev/null @@ -1,148 +0,0 @@ -#!/bin/bash -################################################################################# -# Catena-X - Product Passport Consumer Application -# -# 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. -# -# This program and the accompanying materials are made available under the -# terms of the Apache License, Version 2.0 which is available at -# https://www.apache.org/licenses/LICENSE-2.0. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -# either express or implied. See the -# License for the specific language govern in permissions and limitations -# under the License. -# -# SPDX-License-Identifier: Apache-2.0 -################################################################################# - - -set -o errexit -set -o errtrace -set -o pipefail -set -o nounset - -DIGITAL_TWIN_1='urn:uuid:32aa72de-297a-4405-9148-13e12744028a' -DIGITAL_TWIN_SUBMODEL_ID_1='urn:uuid:699f1245-f57e-4d6b-acdb-ab763665554a' - -DIGITAL_TWIN_2='urn:uuid:1f4a64f0-aba9-498a-917c-4936c24c50cd' -DIGITAL_TWIN_SUBMODEL_ID_2='urn:uuid:49a06ad2-64b7-46c8-9f3b-a718c462ca23' - -DIGITAL_TWIN_3='urn:uuid:365e6fbe-bb34-11ec-8422-0242ac120002' -DIGITAL_TWIN_SUBMODEL_ID_3='urn:uuid:61125dc3-5e6f-4f4b-838d-447432b97918' -BPN='BPNL000000000000' - -SERVER_URL='https://materialpass.int.demo.catena-x.net' -REGISTRY_URL='https://semantics.int.demo.catena-x.net/registry/registry/shell-descriptors' - - -# put access token without 'Bearer ' prefix -BEARER_TOKEN='' - -API_KEY='' -ASSET_ID_1=${DIGITAL_TWIN_1}-${DIGITAL_TWIN_SUBMODEL_ID_1} -ASSET_ID_2=${DIGITAL_TWIN_2}-${DIGITAL_TWIN_SUBMODEL_ID_2} -ASSET_ID_3=${DIGITAL_TWIN_3}-${DIGITAL_TWIN_SUBMODEL_ID_3} - - -echo '**************************Asset 1 **********************' -echo -# Create Submodel data -echo "Create sample data for asset 1..." -curl -X POST -H 'Content-Type: application/json' -s --data "@resources/payloads/X123456789012X12345678901234566.json" $SERVER_URL/provider_backend/data/${ASSET_ID_1} -echo - -# Create a asset -echo "Create asset 1..." -curl -X POST -H 'Content-Type: application/json' -s --data "@resources/assets/X123456789012X12345678901234566.json" --header 'X-Api-Key: '${API_KEY} $SERVER_URL/${BPN}/data/assets -echo - -# Create a general policy -echo "Create policy for asset 1..." -curl -X POST -H 'Content-Type: application/json' -s --data "@resources/contractpolicies/X123456789012X12345678901234566.json" --header 'X-Api-Key: '${API_KEY} $SERVER_URL/${BPN}/data/policydefinitions -echo - -# Create a contract definition -echo "Create contract definition for asset 1..." -curl -X POST -H 'Content-Type: application/json' -s --data "@resources/contractdefinitions/X123456789012X12345678901234566.json" --header 'X-Api-Key: '${API_KEY} $SERVER_URL/${BPN}/data/contractdefinitions -echo - -# Create a digital twin and register inside CX registry -# To authenticate against CX registry, one needs a valid bearer token which can be issued through postman given the clientId and clientSecret -echo "Create a DT for asset 1 and register it into CX registry..." - -curl -X POST -s --header 'Content-Type: application/json' --header "Authorization: Bearer ${BEARER_TOKEN//[$'\t\r\n ']}" --data "@resources/digitaltwins/X123456789012X12345678901234566.json" $REGISTRY_URL -echo -echo - - - -echo '**************************Asset 2 **********************' - -echo -# Create Submodel data -echo "Create sample data for asset 2..." -curl -X POST -H 'Content-Type: application/json' -s --data "@resources/payloads/NCR186850B.json" $SERVER_URL/provider_backend/data/${ASSET_ID_2} -echo - -# Create a asset -echo "Create asset 2..." -curl -X POST -H 'Content-Type: application/json' -s --data "@resources/assets/NCR186850B.json" --header 'X-Api-Key: '${API_KEY} $SERVER_URL/${BPN}/data/assets -echo - -# Create a general policy -echo "Create policy for asset 2..." -curl -X POST -H 'Content-Type: application/json' -s --data "@resources/contractpolicies/NCR186850B.json" --header 'X-Api-Key: '${API_KEY} $SERVER_URL/${BPN}/data/policydefinitions -echo - -# Create a contract definition -echo "Create contract definition for asset 2..." -curl -X POST -H 'Content-Type: application/json' -s --data "@resources/contractdefinitions/NCR186850B.json" --header 'X-Api-Key: '${API_KEY} $SERVER_URL/${BPN}/data/contractdefinitions -echo - - -# Create a digital twin and register inside CX registry -# To authenticate against CX registry, one needs a valid bearer token which can be issued through postman given the clientId and clientSecret -echo "Create a DT for asset 2 and register it into CX registry..." - -curl -X POST -s --header 'Content-Type: application/json' --header "Authorization: Bearer ${BEARER_TOKEN//[$'\t\r\n ']}" --data "@resources/digitaltwins/NCR186850B.json" $REGISTRY_URL -echo -echo - - - -echo '**************************Asset 3 **********************' -# Create Submodel data -echo "Create sample data for asset 3..." -curl -X POST -H 'Content-Type: application/json' -s --data "@resources/payloads/IMR18650V1.json" $SERVER_URL/provider_backend/data/${ASSET_ID_3} -echo - -# Create a asset -echo "Create asset 1..." -curl -X POST -H 'Content-Type: application/json' -s --data "@resources/assets/IMR18650V1.json" --header 'X-Api-Key: '${API_KEY} $SERVER_URL/${BPN}/data/assets -echo - -# Create a general policy -echo "Create policy for asset 3..." -curl -X POST -H 'Content-Type: application/json' -s --data "@resources/contractpolicies/IMR18650V1.json" --header 'X-Api-Key: '${API_KEY} $SERVER_URL/${BPN}/data/policydefinitions -echo - -# Create a contract definition -echo "Create contract definition for asset 3..." -curl -X POST -H 'Content-Type: application/json' -s --data "@resources/contractdefinitions/IMR18650V1.json" --header 'X-Api-Key: '${API_KEY} $SERVER_URL/${BPN}/data/contractdefinitions -echo - -# Create a digital twin and register inside CX registry -# To authenticate against CX registry, one needs a valid bearer token which can be issued through postman given the clientId and clientSecret -echo "Create a DT for asset 3 and register it into CX registry..." - -curl -X POST -s --header 'Content-Type: application/json' --header "Authorization: Bearer ${BEARER_TOKEN//[$'\t\r\n ']}" --data "@resources/digitaltwins/IMR18650V1.json" $REGISTRY_URL -echo - -echo 'Provider setup completed...' -echo 'Done' diff --git a/deployment/infrastructure/provider/init-provider_dev.sh b/deployment/infrastructure/provider/init-provider_dev.sh deleted file mode 100644 index 302323f87..000000000 --- a/deployment/infrastructure/provider/init-provider_dev.sh +++ /dev/null @@ -1,141 +0,0 @@ -#!/bin/bash -################################################################################# -# Catena-X - Product Passport Consumer Application -# -# 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. -# -# This program and the accompanying materials are made available under the -# terms of the Apache License, Version 2.0 which is available at -# https://www.apache.org/licenses/LICENSE-2.0. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -# either express or implied. See the -# License for the specific language govern in permissions and limitations -# under the License. -# -# SPDX-License-Identifier: Apache-2.0 -################################################################################# - - -set -o errexit -set -o errtrace -set -o pipefail -set -o nounset - -DIGITAL_TWIN_1='urn:uuid:32aa72de-297a-4405-9148-13e12744028a' -DIGITAL_TWIN_SUBMODEL_ID_1='urn:uuid:699f1245-f57e-4d6b-acdb-ab763665554a' - -DIGITAL_TWIN_2='urn:uuid:1f4a64f0-aba9-498a-917c-4936c24c50cd' -DIGITAL_TWIN_SUBMODEL_ID_2='urn:uuid:49a06ad2-64b7-46c8-9f3b-a718c462ca23' - -DIGITAL_TWIN_3='urn:uuid:365e6fbe-bb34-11ec-8422-0242ac120002' -DIGITAL_TWIN_SUBMODEL_ID_3='urn:uuid:61125dc3-5e6f-4f4b-838d-447432b97918' -BPN='BPNL000000000000' - -SERVER_URL='https://materialpass.dev.demo.catena-x.net' -REGISTRY_URL='https://semantics.dev.demo.catena-x.net/registry/registry/shell-descriptors' - -# put access token without 'Bearer ' prefix -BEARER_TOKEN='' - -API_KEY='' -ASSET_ID_1=${DIGITAL_TWIN_1}-${DIGITAL_TWIN_SUBMODEL_ID_1} -ASSET_ID_2=${DIGITAL_TWIN_2}-${DIGITAL_TWIN_SUBMODEL_ID_2} -ASSET_ID_3=${DIGITAL_TWIN_3}-${DIGITAL_TWIN_SUBMODEL_ID_3} - -echo '**************************Asset 1 **********************' -echo -# Create Submodel data -echo "Create sample data for asset 1..." -curl -X POST -H 'Content-Type: application/json' -s --data "@resources/payloads/X123456789012X12345678901234566_DEV.json" ${SERVER_URL}/provider_backend/data/${ASSET_ID_1} -echo - -# Create a asset -echo "Create asset 1..." -curl -X POST -H 'Content-Type: application/json' -s --data "@resources/assets/X123456789012X12345678901234566_DEV.json" --header 'X-Api-Key: '${API_KEY} ${SERVER_URL}/${BPN}/data/assets -echo - -# Create a general policy -echo "Create policy for asset 1..." -curl -X POST -H 'Content-Type: application/json' -s --data "@resources/contractpolicies/X123456789012X12345678901234566_DEV.json" --header 'X-Api-Key: '${API_KEY} ${SERVER_URL}/${BPN}/data/policydefinitions -echo - -# Create a contract definition -echo "Create contract definition for asset 1..." -curl -X POST -H 'Content-Type: application/json' -s --data "@resources/contractdefinitions/X123456789012X12345678901234566_DEV.json" --header 'X-Api-Key: '${API_KEY} ${SERVER_URL}/${BPN}/data/contractdefinitions -echo - -# Create a digital twin and register inside CX registry -# To authenticate against CX registry, one needs a valid bearer token which can be issued through postman given the clientId and clientSecret -echo "Create a DT for asset 1 and register it into CX registry..." -curl -X POST -s --header 'Content-Type: application/json' --header "Authorization: Bearer ${BEARER_TOKEN//[$'\t\r\n ']}" --data "@resources/digitaltwins/X123456789012X12345678901234566_DEV.json" $REGISTRY_URL -echo -echo - - - -echo '**************************Asset 2 **********************' -echo -# Create Submodel data -echo "Create sample data for asset 2..." -curl -X POST -H 'Content-Type: application/json' -s --data "@resources/payloads/NCR186850B_DEV.json" ${SERVER_URL}/provider_backend/data/${ASSET_ID_2} -echo - -# Create a asset -echo "Create asset 2..." -curl -X POST -H 'Content-Type: application/json' -s --data "@resources/assets/NCR186850B_DEV.json" --header 'X-Api-Key: '${API_KEY} ${SERVER_URL}/${BPN}/data/assets -echo - -# Create a general policy -echo "Create policy for asset 2..." -curl -X POST -H 'Content-Type: application/json' -s --data "@resources/contractpolicies/NCR186850B_DEV.json" --header 'X-Api-Key: '${API_KEY} ${SERVER_URL}/${BPN}/data/policydefinitions - - -# Create a contract definition -echo "Create contract definition for asset 2..." -curl -X POST -H 'Content-Type: application/json' -s --data "@resources/contractdefinitions/NCR186850B_DEV.json" --header 'X-Api-Key: '${API_KEY} ${SERVER_URL}/${BPN}/data/contractdefinitions -echo - -# Create a digital twin and register inside CX registry -# To authenticate against CX registry, one needs a valid bearer token which can be issued through postman given the clientId and clientSecret -echo "Create a DT for asset 2 and register it into CX registry..." -curl -X POST -s --header 'Content-Type: application/json' --header "Authorization: Bearer ${BEARER_TOKEN//[$'\t\r\n ']}" --data "@resources/digitaltwins/NCR186850B_DEV.json" $REGISTRY_URL -echo -echo - - - -echo '**************************Asset 3 **********************' -# Create Submodel data -echo "Create sample data for asset 3..." -curl -X POST -H 'Content-Type: application/json' -s --data "@resources/payloads/IMR18650V1_DEV.json" ${SERVER_URL}/provider_backend/data/${ASSET_ID_3} -echo - -# Create a asset -echo "Create asset 1..." -curl -X POST -H 'Content-Type: application/json' -s --data "@resources/assets/IMR18650V1_DEV.json" --header 'X-Api-Key: '${API_KEY} ${SERVER_URL}/${BPN}/data/assets -echo - -# Create a general policy -echo "Create policy for asset 3..." -curl -X POST -H 'Content-Type: application/json' -s --data "@resources/contractpolicies/IMR18650V1_DEV.json" --header 'X-Api-Key: '${API_KEY} ${SERVER_URL}/${BPN}/data/policydefinitions -echo - -# Create a contract definition -echo "Create contract definition for asset 3..." -curl -X POST -H 'Content-Type: application/json' -s --data "@resources/contractdefinitions/IMR18650V1_DEV.json" --header 'X-Api-Key: '${API_KEY} ${SERVER_URL}/${BPN}/data/contractdefinitions -echo - -# Create a digital twin and register inside CX registry -# To authenticate against CX registry, one needs a valid bearer token which can be issued through postman given the clientId and clientSecret -echo "Create a DT for asset 3 and register it into CX registry..." -curl -X POST -s --header 'Content-Type: application/json' --header "Authorization: Bearer ${BEARER_TOKEN//[$'\t\r\n ']}" --data "@resources/digitaltwins/IMR18650V1_DEV.json" $REGISTRY_URL -echo - -echo 'Provider setup completed...' -echo 'Done' diff --git a/deployment/infrastructure/provider/resources/assets/IMR18650V1.json b/deployment/infrastructure/provider/resources/assets/IMR18650V1.json deleted file mode 100644 index 9511b3c64..000000000 --- a/deployment/infrastructure/provider/resources/assets/IMR18650V1.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "asset": { - "properties": { - "asset:prop:id": "urn:uuid:365e6fbe-bb34-11ec-8422-0242ac120002-urn:uuid:61125dc3-5e6f-4f4b-838d-447432b97918", - "asset:prop:description": "Battery Passport test data" - } - }, - "dataAddress": { - "properties": { - "type": "HttpData", - "baseUrl": "https://materialpass.int.demo.catena-x.net/provider_backend/data/urn:uuid:365e6fbe-bb34-11ec-8422-0242ac120002-urn:uuid:61125dc3-5e6f-4f4b-838d-447432b97918" - } - } -} diff --git a/deployment/infrastructure/provider/resources/assets/IMR18650V1_DEV.json b/deployment/infrastructure/provider/resources/assets/IMR18650V1_DEV.json deleted file mode 100644 index 86a541292..000000000 --- a/deployment/infrastructure/provider/resources/assets/IMR18650V1_DEV.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "asset": { - "properties": { - "asset:prop:id": "urn:uuid:365e6fbe-bb34-11ec-8422-0242ac120002-urn:uuid:61125dc3-5e6f-4f4b-838d-447432b97918", - "asset:prop:description": "Battery Passport test data" - } - }, - "dataAddress": { - "properties": { - "type": "HttpData", - "baseUrl": "https://materialpass.dev.demo.catena-x.net/provider_backend/data/urn:uuid:365e6fbe-bb34-11ec-8422-0242ac120002-urn:uuid:61125dc3-5e6f-4f4b-838d-447432b97918" - } - } -} diff --git a/deployment/infrastructure/provider/resources/assets/NCR186850B.json b/deployment/infrastructure/provider/resources/assets/NCR186850B.json deleted file mode 100644 index 907b490f6..000000000 --- a/deployment/infrastructure/provider/resources/assets/NCR186850B.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "asset": { - "properties": { - "asset:prop:id": "urn:uuid:1f4a64f0-aba9-498a-917c-4936c24c50cd-urn:uuid:49a06ad2-64b7-46c8-9f3b-a718c462ca23", - "asset:prop:description": "Battery Passport test data" - } - }, - "dataAddress": { - "properties": { - "type": "HttpData", - "baseUrl": "https://materialpass.int.demo.catena-x.net/provider_backend/data/urn:uuid:1f4a64f0-aba9-498a-917c-4936c24c50cd-urn:uuid:49a06ad2-64b7-46c8-9f3b-a718c462ca23" - } - } -} - diff --git a/deployment/infrastructure/provider/resources/assets/NCR186850B_DEV.json b/deployment/infrastructure/provider/resources/assets/NCR186850B_DEV.json deleted file mode 100644 index 0728fa38e..000000000 --- a/deployment/infrastructure/provider/resources/assets/NCR186850B_DEV.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "asset": { - "properties": { - "asset:prop:id": "urn:uuid:1f4a64f0-aba9-498a-917c-4936c24c50cd-urn:uuid:49a06ad2-64b7-46c8-9f3b-a718c462ca23", - "asset:prop:description": "Battery Passport test data" - } - }, - "dataAddress": { - "properties": { - "type": "HttpData", - "baseUrl": "https://materialpass.dev.demo.catena-x.net/provider_backend/data/urn:uuid:1f4a64f0-aba9-498a-917c-4936c24c50cd-urn:uuid:49a06ad2-64b7-46c8-9f3b-a718c462ca23" - } - } -} - diff --git a/deployment/infrastructure/provider/resources/assets/X123456789012X12345678901234566.json b/deployment/infrastructure/provider/resources/assets/X123456789012X12345678901234566.json deleted file mode 100644 index 5a530b000..000000000 --- a/deployment/infrastructure/provider/resources/assets/X123456789012X12345678901234566.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "asset": { - "properties": { - "asset:prop:id": "urn:uuid:32aa72de-297a-4405-9148-13e12744028a-urn:uuid:699f1245-f57e-4d6b-acdb-ab763665554a", - "asset:prop:description": "Battery Passport test data" - } - }, - "dataAddress": { - "properties": { - "type": "HttpData", - "baseUrl": "https://materialpass.int.demo.catena-x.net/provider_backend/data/urn:uuid:32aa72de-297a-4405-9148-13e12744028a-urn:uuid:699f1245-f57e-4d6b-acdb-ab763665554a" - } - } -} diff --git a/deployment/infrastructure/provider/resources/assets/X123456789012X12345678901234566_DEV.json b/deployment/infrastructure/provider/resources/assets/X123456789012X12345678901234566_DEV.json deleted file mode 100644 index a07e4a940..000000000 --- a/deployment/infrastructure/provider/resources/assets/X123456789012X12345678901234566_DEV.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "asset": { - "properties": { - "asset:prop:id": "urn:uuid:32aa72de-297a-4405-9148-13e12744028a-urn:uuid:699f1245-f57e-4d6b-acdb-ab763665554a", - "asset:prop:description": "Battery Passport test data" - } - }, - "dataAddress": { - "properties": { - "type": "HttpData", - "baseUrl": "https://materialpass.dev.demo.catena-x.net/provider_backend/data/urn:uuid:32aa72de-297a-4405-9148-13e12744028a-urn:uuid:699f1245-f57e-4d6b-acdb-ab763665554a" - } - } -} diff --git a/deployment/infrastructure/provider/resources/contractdefinitions/IMR18650V1.json b/deployment/infrastructure/provider/resources/contractdefinitions/IMR18650V1.json deleted file mode 100644 index ff190f60e..000000000 --- a/deployment/infrastructure/provider/resources/contractdefinitions/IMR18650V1.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "id": "3", - "criteria": [ - { - "operandLeft": "asset:prop:id", - "operator": "=", - "operandRight": "urn:uuid:365e6fbe-bb34-11ec-8422-0242ac120002-urn:uuid:61125dc3-5e6f-4f4b-838d-447432b97918" - } - ], - "accessPolicyId": "4b480f48-79a0-4851-a56c-6ef71e19ebb3", - "contractPolicyId": "4b480f48-79a0-4851-a56c-6ef71e19ebb3" -} diff --git a/deployment/infrastructure/provider/resources/contractdefinitions/IMR18650V1_DEV.json b/deployment/infrastructure/provider/resources/contractdefinitions/IMR18650V1_DEV.json deleted file mode 100644 index 511457154..000000000 --- a/deployment/infrastructure/provider/resources/contractdefinitions/IMR18650V1_DEV.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "id": "101", - "criteria": [ - { - "operandLeft": "asset:prop:id", - "operator": "=", - "operandRight": "urn:uuid:365e6fbe-bb34-11ec-8422-0242ac120002-urn:uuid:61125dc3-5e6f-4f4b-838d-447432b97918" - } - ], - "accessPolicyId": "4b480f48-79a0-4851-a56c-6ef71e19ebb3", - "contractPolicyId": "4b480f48-79a0-4851-a56c-6ef71e19ebb3" -} diff --git a/deployment/infrastructure/provider/resources/contractdefinitions/NCR186850B.json b/deployment/infrastructure/provider/resources/contractdefinitions/NCR186850B.json deleted file mode 100644 index e6903f862..000000000 --- a/deployment/infrastructure/provider/resources/contractdefinitions/NCR186850B.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "id": "2", - "criteria": [ - { - "operandLeft": "asset:prop:id", - "operator": "=", - "operandRight": "urn:uuid:1f4a64f0-aba9-498a-917c-4936c24c50cd-urn:uuid:49a06ad2-64b7-46c8-9f3b-a718c462ca23" - } - ], - "accessPolicyId": "f873e234-112c-4598-893b-eda0671b7402", - "contractPolicyId": "f873e234-112c-4598-893b-eda0671b7402" -} diff --git a/deployment/infrastructure/provider/resources/contractdefinitions/NCR186850B_DEV.json b/deployment/infrastructure/provider/resources/contractdefinitions/NCR186850B_DEV.json deleted file mode 100644 index b0be0a1ca..000000000 --- a/deployment/infrastructure/provider/resources/contractdefinitions/NCR186850B_DEV.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "id": "102", - "criteria": [ - { - "operandLeft": "asset:prop:id", - "operator": "=", - "operandRight": "urn:uuid:1f4a64f0-aba9-498a-917c-4936c24c50cd-urn:uuid:49a06ad2-64b7-46c8-9f3b-a718c462ca23" - } - ], - "accessPolicyId": "f873e234-112c-4598-893b-eda0671b7402", - "contractPolicyId": "f873e234-112c-4598-893b-eda0671b7402" -} diff --git a/deployment/infrastructure/provider/resources/contractdefinitions/X123456789012X12345678901234566.json b/deployment/infrastructure/provider/resources/contractdefinitions/X123456789012X12345678901234566.json deleted file mode 100644 index f70dda5f4..000000000 --- a/deployment/infrastructure/provider/resources/contractdefinitions/X123456789012X12345678901234566.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "id": "1", - "criteria": [ - { - "operandLeft": "asset:prop:id", - "operator": "=", - "operandRight": "urn:uuid:32aa72de-297a-4405-9148-13e12744028a-urn:uuid:699f1245-f57e-4d6b-acdb-ab763665554a" - } - ], - "accessPolicyId": "ad8d2c57-cf32-409c-96a8-be59675b6ae5", - "contractPolicyId": "ad8d2c57-cf32-409c-96a8-be59675b6ae5" -} diff --git a/deployment/infrastructure/provider/resources/contractdefinitions/X123456789012X12345678901234566_DEV.json b/deployment/infrastructure/provider/resources/contractdefinitions/X123456789012X12345678901234566_DEV.json deleted file mode 100644 index 0b55c7692..000000000 --- a/deployment/infrastructure/provider/resources/contractdefinitions/X123456789012X12345678901234566_DEV.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "id": "300", - "criteria": [ - { - "operandLeft": "asset:prop:id", - "operator": "=", - "operandRight": "urn:uuid:32aa72de-297a-4405-9148-13e12744028a-urn:uuid:699f1245-f57e-4d6b-acdb-ab763665554a" - } - ], - "accessPolicyId": "ad8d2c57-cf32-409c-96a8-be59675b6ae5", - "contractPolicyId": "ad8d2c57-cf32-409c-96a8-be59675b6ae5" -} diff --git a/deployment/infrastructure/provider/resources/contractpolicies/IMR18650V1.json b/deployment/infrastructure/provider/resources/contractpolicies/IMR18650V1.json deleted file mode 100644 index 2fc24d6e6..000000000 --- a/deployment/infrastructure/provider/resources/contractpolicies/IMR18650V1.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "id": "4b480f48-79a0-4851-a56c-6ef71e19ebb3", - "policy": { - "prohibitions": [], - "obligations": [], - "permissions": [ - { - "edctype": "dataspaceconnector:permission", - "action": { - "type": "USE" - }, - "constraints": [] - } - ] - } -} \ No newline at end of file diff --git a/deployment/infrastructure/provider/resources/contractpolicies/IMR18650V1_DEV.json b/deployment/infrastructure/provider/resources/contractpolicies/IMR18650V1_DEV.json deleted file mode 100644 index 304271cf9..000000000 --- a/deployment/infrastructure/provider/resources/contractpolicies/IMR18650V1_DEV.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "id": "4b480f48-79a0-4851-a56c-6ef71e19ebb3", - "policy": { - "prohibitions": [], - "obligations": [], - "permissions": [ - { - "edctype": "dataspaceconnector:permission", - "action": { - "type": "USE" - }, - "constraints": [] - } - ] - } -} diff --git a/deployment/infrastructure/provider/resources/contractpolicies/NCR186850B.json b/deployment/infrastructure/provider/resources/contractpolicies/NCR186850B.json deleted file mode 100644 index a615663eb..000000000 --- a/deployment/infrastructure/provider/resources/contractpolicies/NCR186850B.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "id": "f873e234-112c-4598-893b-eda0671b7402", - "policy": { - "prohibitions": [], - "obligations": [], - "permissions": [ - { - "edctype": "dataspaceconnector:permission", - "action": { - "type": "USE" - }, - "constraints": [] - } - ] - } -} \ No newline at end of file diff --git a/deployment/infrastructure/provider/resources/contractpolicies/NCR186850B_DEV.json b/deployment/infrastructure/provider/resources/contractpolicies/NCR186850B_DEV.json deleted file mode 100644 index 5c7c22807..000000000 --- a/deployment/infrastructure/provider/resources/contractpolicies/NCR186850B_DEV.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "id": "f873e234-112c-4598-893b-eda0671b7402", - "policy": { - "prohibitions": [], - "obligations": [], - "permissions": [ - { - "edctype": "dataspaceconnector:permission", - "action": { - "type": "USE" - }, - "constraints": [] - } - ] - } -} diff --git a/deployment/infrastructure/provider/resources/contractpolicies/X123456789012X12345678901234566.json b/deployment/infrastructure/provider/resources/contractpolicies/X123456789012X12345678901234566.json deleted file mode 100644 index a8bcf57b1..000000000 --- a/deployment/infrastructure/provider/resources/contractpolicies/X123456789012X12345678901234566.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "id": "ad8d2c57-cf32-409c-96a8-be59675b6ae5", - "policy": { - "prohibitions": [], - "obligations": [], - "permissions": [ - { - "edctype": "dataspaceconnector:permission", - "action": { - "type": "USE" - }, - "constraints": [] - } - ] - } -} \ No newline at end of file diff --git a/deployment/infrastructure/provider/resources/contractpolicies/X123456789012X12345678901234566_DEV.json b/deployment/infrastructure/provider/resources/contractpolicies/X123456789012X12345678901234566_DEV.json deleted file mode 100644 index 4cfc0181c..000000000 --- a/deployment/infrastructure/provider/resources/contractpolicies/X123456789012X12345678901234566_DEV.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "id": "ad8d2c57-cf32-409c-96a8-be59675b6ae5", - "policy": { - "prohibitions": [], - "obligations": [], - "permissions": [ - { - "edctype": "dataspaceconnector:permission", - "action": { - "type": "USE" - }, - "constraints": [] - } - ] - } -} diff --git a/deployment/infrastructure/provider/resources/digitaltwins/IMR18650V1.json b/deployment/infrastructure/provider/resources/digitaltwins/IMR18650V1.json deleted file mode 100644 index e4f357ec6..000000000 --- a/deployment/infrastructure/provider/resources/digitaltwins/IMR18650V1.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "description": [], - "globalAssetId": { - "value": [ - "urn:uuid:365e6fbe-bb34-11ec-8422-0242ac120002" - ] - }, - "idShort": "Battery_IMR18650V1", - "identification": "urn:uuid:365e6fbe-bb34-11ec-8422-0242ac120002", - "specificAssetIds": [ - { - "key": "partInstanceId", - "value": "IMR18650V1" - } - ], - "submodelDescriptors": [ - { - "description": [ - { - "language": "en", - "text": "Battery Passport Submodel" - } - ], - "idShort": "batteryPass", - "identification": "urn:uuid:61125dc3-5e6f-4f4b-838d-447432b97918", - "semanticId": { - "value": [ - "urn:bamm:io.catenax.battery.battery_pass:3.0.1#BatteryPass" - ] - }, - "endpoints": [ - { - "interface": "EDC", - "protocolInformation": { - "endpointAddress": "https://materialpass.int.demo.catena-x.net/BPNL000000000000/urn:uuid:365e6fbe-bb34-11ec-8422-0242ac120002-urn:uuid:61125dc3-5e6f-4f4b-838d-447432b97918/submodel?content=value&extent=WithBLOBValue", - "endpointProtocol": "IDS/ECLIPSE DATASPACE CONNECTOR", - "endpointProtocolVersion": "0.0.1-SNAPSHOT" - } - } - ] - } - ] -} diff --git a/deployment/infrastructure/provider/resources/digitaltwins/IMR18650V1_DEV.json b/deployment/infrastructure/provider/resources/digitaltwins/IMR18650V1_DEV.json deleted file mode 100644 index 252d595a3..000000000 --- a/deployment/infrastructure/provider/resources/digitaltwins/IMR18650V1_DEV.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "description": [], - "globalAssetId": { - "value": [ - "urn:uuid:365e6fbe-bb34-11ec-8422-0242ac120002" - ] - }, - "idShort": "Battery_IMR18650V1", - "identification": "urn:uuid:365e6fbe-bb34-11ec-8422-0242ac120002", - "specificAssetIds": [ - { - "key": "partInstanceId", - "value": "IMR18650V1" - } - ], - "submodelDescriptors": [ - { - "description": [ - { - "language": "en", - "text": "Battery Passport Submodel" - } - ], - "idShort": "batteryPass", - "identification": "urn:uuid:61125dc3-5e6f-4f4b-838d-447432b97918", - "semanticId": { - "value": [ - "urn:bamm:io.catenax.battery.battery_pass:3.0.1#BatteryPass" - ] - }, - "endpoints": [ - { - "interface": "EDC", - "protocolInformation": { - "endpointAddress": "https://materialpass.dev.demo.catena-x.net/BPNL000000000000/urn:uuid:365e6fbe-bb34-11ec-8422-0242ac120002-urn:uuid:61125dc3-5e6f-4f4b-838d-447432b97918/submodel?content=value&extent=WithBLOBValue", - "endpointProtocol": "IDS/ECLIPSE DATASPACE CONNECTOR", - "endpointProtocolVersion": "0.0.1-SNAPSHOT" - } - } - ] - } - ] -} diff --git a/deployment/infrastructure/provider/resources/digitaltwins/NCR186850B.json b/deployment/infrastructure/provider/resources/digitaltwins/NCR186850B.json deleted file mode 100644 index 90079b3cd..000000000 --- a/deployment/infrastructure/provider/resources/digitaltwins/NCR186850B.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "description": [], - "globalAssetId": { - "value": [ - "urn:uuid:1f4a64f0-aba9-498a-917c-4936c24c50cd" - ] - }, - "idShort": "Battery_NCR186850B", - "identification": "urn:uuid:1f4a64f0-aba9-498a-917c-4936c24c50cd", - "specificAssetIds": [ - { - "key": "partInstanceId", - "value": "NCR186850B" - } - ], - "submodelDescriptors": [ - { - "description": [ - { - "language": "en", - "text": "Battery Passport Submodel" - } - ], - "idShort": "batteryPass", - "identification": "urn:uuid:49a06ad2-64b7-46c8-9f3b-a718c462ca23", - "semanticId": { - "value": [ - "urn:bamm:io.catenax.battery.battery_pass:3.0.1#BatteryPass" - ] - }, - "endpoints": [ - { - "interface": "EDC", - "protocolInformation": { - "endpointAddress": "https://materialpass.int.demo.catena-x.net/BPNL000000000000/urn:uuid:1f4a64f0-aba9-498a-917c-4936c24c50cd-urn:uuid:49a06ad2-64b7-46c8-9f3b-a718c462ca23/submodel?content=value&extent=WithBLOBValue", - "endpointProtocol": "IDS/ECLIPSE DATASPACE CONNECTOR", - "endpointProtocolVersion": "0.0.1-SNAPSHOT" - } - } - ] - } - ] -} diff --git a/deployment/infrastructure/provider/resources/digitaltwins/NCR186850B_DEV.json b/deployment/infrastructure/provider/resources/digitaltwins/NCR186850B_DEV.json deleted file mode 100644 index 574bbe244..000000000 --- a/deployment/infrastructure/provider/resources/digitaltwins/NCR186850B_DEV.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "description": [], - "globalAssetId": { - "value": [ - "urn:uuid:1f4a64f0-aba9-498a-917c-4936c24c50cd" - ] - }, - "idShort": "Battery_NCR186850B", - "identification": "urn:uuid:1f4a64f0-aba9-498a-917c-4936c24c50cd", - "specificAssetIds": [ - { - "key": "partInstanceId", - "value": "NCR186850B" - } - ], - "submodelDescriptors": [ - { - "description": [ - { - "language": "en", - "text": "Battery Passport Submodel" - } - ], - "idShort": "batteryPass", - "identification": "urn:uuid:49a06ad2-64b7-46c8-9f3b-a718c462ca23", - "semanticId": { - "value": [ - "urn:bamm:io.catenax.battery.battery_pass:3.0.1#BatteryPass" - ] - }, - "endpoints": [ - { - "interface": "EDC", - "protocolInformation": { - "endpointAddress": "https://materialpass.dev.demo.catena-x.net/BPNL000000000000/urn:uuid:1f4a64f0-aba9-498a-917c-4936c24c50cd-urn:uuid:49a06ad2-64b7-46c8-9f3b-a718c462ca23/submodel?content=value&extent=WithBLOBValue", - - "endpointProtocol": "IDS/ECLIPSE DATASPACE CONNECTOR", - "endpointProtocolVersion": "0.0.1-SNAPSHOT" - } - } - ] - } - ] -} diff --git a/deployment/infrastructure/provider/resources/digitaltwins/X123456789012X12345678901234566.json b/deployment/infrastructure/provider/resources/digitaltwins/X123456789012X12345678901234566.json deleted file mode 100644 index b3deb5fe2..000000000 --- a/deployment/infrastructure/provider/resources/digitaltwins/X123456789012X12345678901234566.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "description": [], - "globalAssetId": { - "value": [ - "urn:uuid:32aa72de-297a-4405-9148-13e12744028a" - ] - }, - "idShort": "Battery_X123456789012X12345678901234566", - "identification": "urn:uuid:32aa72de-297a-4405-9148-13e12744028a", - "specificAssetIds": [ - { - "key": "partInstanceId", - "value": "X123456789012X12345678901234566" - } - ], - "submodelDescriptors": [ - { - "description": [ - { - "language": "en", - "text": "Battery Passport Submodel" - } - ], - "idShort": "batteryPass", - "identification": "urn:uuid:699f1245-f57e-4d6b-acdb-ab763665554a", - "semanticId": { - "value": [ - "urn:bamm:io.catenax.battery.battery_pass:3.0.1#BatteryPass" - ] - }, - "endpoints": [ - { - "interface": "EDC", - "protocolInformation": { - "endpointAddress": "https://materialpass.int.demo.catena-x.net/BPNL000000000000/urn:uuid:32aa72de-297a-4405-9148-13e12744028a-urn:uuid:699f1245-f57e-4d6b-acdb-ab763665554a/submodel?content=value&extent=WithBLOBValue", - "endpointProtocol": "IDS/ECLIPSE DATASPACE CONNECTOR", - "endpointProtocolVersion": "0.0.1-SNAPSHOT" - } - } - ] - } - ] -} diff --git a/deployment/infrastructure/provider/resources/digitaltwins/X123456789012X12345678901234566_DEV.json b/deployment/infrastructure/provider/resources/digitaltwins/X123456789012X12345678901234566_DEV.json deleted file mode 100644 index efd8106e2..000000000 --- a/deployment/infrastructure/provider/resources/digitaltwins/X123456789012X12345678901234566_DEV.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "description": [], - "globalAssetId": { - "value": [ - "urn:uuid:32aa72de-297a-4405-9148-13e12744028a" - ] - }, - "idShort": "Battery_X123456789012X12345678901234566", - "identification": "urn:uuid:32aa72de-297a-4405-9148-13e12744028a", - "specificAssetIds": [ - { - "key": "partInstanceId", - "value": "X123456789012X12345678901234566" - } - ], - "submodelDescriptors": [ - { - "description": [ - { - "language": "en", - "text": "Battery Passport Submodel" - } - ], - "idShort": "batteryPass", - "identification": "urn:uuid:699f1245-f57e-4d6b-acdb-ab763665554a", - "semanticId": { - "value": [ - "urn:bamm:io.catenax.battery.battery_pass:3.0.1#BatteryPass" - ] - }, - "endpoints": [ - { - "interface": "EDC", - "protocolInformation": { - "endpointAddress": "https://materialpass.dev.demo.catena-x.net/BPNL000000000000/urn:uuid:32aa72de-297a-4405-9148-13e12744028a-urn:uuid:699f1245-f57e-4d6b-acdb-ab763665554a/submodel?content=value&extent=WithBLOBValue", - "endpointProtocol": "IDS/ECLIPSE DATASPACE CONNECTOR", - "endpointProtocolVersion": "0.0.1-SNAPSHOT" - } - } - ] - } - ] -} diff --git a/deployment/infrastructure/provider/resources/payloads/IMR18650V1.json b/deployment/infrastructure/provider/resources/payloads/IMR18650V1.json deleted file mode 100644 index 91d38f4bd..000000000 --- a/deployment/infrastructure/provider/resources/payloads/IMR18650V1.json +++ /dev/null @@ -1,248 +0,0 @@ -{ - "electrochemicalProperties" : { - "ratedCapacity" : 94, - "batteryEnergy" : { - "energyRoundtripEfficiencyChange" : 48.2, - "maximumAllowedBatteryEnergy" : 85000, - "energyRoundtripEfficiency" : 25 - }, - "ratioMaximumAllowedBatteryPowerAndMaximumAllowedBatteryEnergy" : 0.588, - "batteryVoltage" : { - "nominalVoltage" : 3.7, - "maxVoltage" : 4.2, - "minVoltage" : 2.5 - }, - "internalResistance" : { - "cellInternalResistance" : 0.36, - "packInternalResistanceIncrease" : 1, - "packInternalResistance" : 100 - }, - "capacityThresholdExhaustion" : 23, - "batteryPower" : { - "powerFade" : 23, - "originalPowerCapability" : -1.7976931348623157E308, - "originalPowerCapabilityLimits" : -1.7976931348623157E308, - "maximumAllowedBatteryPower" : -1.7976931348623157E308, - "powerCapabilityAt20Charge" : -1.7976931348623157E308, - "powerCapabilityAt80Charge" : -1.7976931348623157E308 - }, - "capacityFade" : 1.55 - }, - "document" : { - "responsibleSourcing" : [ { - "title" : "2021 Responsible Sourcing document", - "fileLocation" : null - } ], - "packagingInstructions" : [ { - "title" : "Packing Instruction v.2.0", - "fileLocation" : null - } ], - "transportationInstructions" : [ { - "title" : "Transport manual", - "fileLocation" : null - } ], - "vehicleDismantlingProcedure" : [ { - "title" : "Car dismantling manual", - "fileLocation" : "http://www.ietf.org/rfc/rfc2396.txt" - } ], - "testReportsResults" : [ { - "title" : "Battery Test Reports", - "fileLocation" : "http://www.Batterytestreports.de" - } ], - "batteryDismantlingProcedure" : [ { - "title" : "Dismantling Manual", - "fileLocation" : "http://www.dissmantlingmanual.org" - } ], - "safetyMeasures" : [ { - "title" : "Safety Instruction", - "fileLocation" : "http://www.safetyinstructions.txt" - } ], - "declarationOfConformity" : [ { - "title" : "Declaration of Conformity No. 3", - "fileLocation" : null - } ] - }, - "datePlacedOnMarket" : "27.04.2022", - "cellChemistry" : { - "electrolyteComposition" : [ { - "materialPercentageMassFraction" : null, - "materialWeight" : null, - "materialName" : "dimethyl carbonate (DCM)" - } ], - "anodeCompositionOther" : [ { - "materialPercentageMassFraction" : null, - "materialWeight" : null, - "materialName" : "Carboxymethyl cellulose" - } ], - "recyclateContentActiveMaterials" : [ { - "materialPercentageMassFraction" : 6, - "materialWeight" : null, - "materialName" : "Ni/2021/PlantE" - }, { - "materialPercentageMassFraction" : 4, - "materialWeight" : null, - "materialName" : "Li/2021/PlantE" - }, { - "materialPercentageMassFraction" : 0, - "materialWeight" : null, - "materialName" : "Pb(battery model does not contain Pb)" - }, { - "materialPercentageMassFraction" : 0, - "materialWeight" : null, - "materialName" : "Co(battery model does not contain Pb)" - } ], - "anodeActiveMaterials" : [ { - "materialPercentageMassFraction" : null, - "materialWeight" : null, - "materialName" : "Graphite" - } ], - "cathodeActiveMaterials" : [ { - "materialPercentageMassFraction" : null, - "materialWeight" : null, - "materialName" : "LiMn2O4 Lithium Manganese Oxide" - } ], - "cathodeCompositionOther" : [ { - "materialPercentageMassFraction" : null, - "materialWeight" : null, - "materialName" : "binder:PVDF" - } ] - }, - "physicalDimensions" : { - "length" : 2000, - "width" : 1000, - "weight" : 3500, - "diameter" : null, - "height" : 200 - }, - "temperatureRangeIdleState" : { - "temperatureRangeIdleStateUpperLimit" : 50, - "temperatureRangeIdleStateLowerLimit" : -20 - }, - "batteryCycleLife" : { - "cycleLifeTestCRate" : 2, - "cycleLifeTestDepthOfDischarge" : 1.8, - "expectedLifetime" : 2500 - }, - "manufacturer" : { - "name" : "CompanyE", - "contact" : { - "faxNumber" : "+49 89 0987654324", - "website" : "https://www.CompanyE.com", - "phoneNumber" : "+49 89 1234567893", - "email" : "companyE@company.com" - }, - "address" : { - "locality" : { - "value" : "CityE", - "technicalKey" : "BLOCK" - }, - "country" : { - "shortName" : "Germany" - }, - "postCode" : { - "value" : "65-250E", - "technicalKey" : "CEDEX" - }, - "thoroughfare" : { - "value" : "StreetE", - "number" : "1", - "technicalKey" : "STREET" - }, - "premise" : { - "value" : null, - "technicalKey" : "BUILDING" - }, - "postalDeliveryPoint" : { - "value" : null, - "technicalKey" : "INTERURBAN_DELIVERY_POINT" - } - } - }, - "warrantyPeriod" : "96", - "composition" : { - "compositionOfBattery" : [ { - "materialPercentageMassFraction" : null, - "materialWeight" : null, - "materialName" : "Separator: PE" - } ], - "criticalRawMaterials" : "Lithium, Natural graphite", - "components" : { - "componentsPartNumber" : "Voltage cables", - "componentsSupplier" : [ { - "componentsSupplierName" : "AB Corporation", - "address" : { - "locality" : { - "value" : "CityF", - "technicalKey" : "BLOCK" - }, - "country" : { - "shortName" : "Germany" - }, - "postCode" : { - "value" : "65-250F", - "technicalKey" : "CEDEX" - }, - "thoroughfare" : { - "value" : "StreetF", - "number" : "1", - "technicalKey" : "STREET" - }, - "premise" : { - "value" : "PlantF", - "technicalKey" : "BUILDING" - }, - "postalDeliveryPoint" : { - "value" : null, - "technicalKey" : "INTERURBAN_DELIVERY_POINT" - } - }, - "contact" : { - "faxNumber" : "+49 89 0987654324", - "website" : "https://www.companyF.com", - "phoneNumber" : "+49 89 1234567893", - "email" : "companyF@companyF.com" - } - } ] - } - }, - "manufacturing" : { - "dateOfManufacturing" : "2022-01-24", - "address" : { - "locality" : { - "value" : "CityE", - "technicalKey" : "BLOCK" - }, - "country" : { - "shortName" : "Germany" - }, - "postCode" : { - "value" : "65-250E", - "technicalKey" : "CEDEX" - }, - "thoroughfare" : { - "value" : "StreetE", - "number" : "1", - "technicalKey" : "STREET" - }, - "premise" : { - "value" : "PlantE", - "technicalKey" : "BUILDING" - }, - "postalDeliveryPoint" : { - "value" : "GateE", - "technicalKey" : "INTERURBAN_DELIVERY_POINT" - } - } - }, - "batteryIdentification" : { - "batteryType" : "Lithium-Manganese-Oxide (LMO)", - "batteryIDDMCCode" : "IMR18650V1", - "batteryModel" : "Pi4 Orionis" - }, - "stateOfBattery" : { - "stateOfHealth" : 20, - "statusBattery" : "first life", - "stateOfCharge" : 50 - }, - "cO2FootprintTotal" : 210 - } diff --git a/deployment/infrastructure/provider/resources/payloads/IMR18650V1_DEV.json b/deployment/infrastructure/provider/resources/payloads/IMR18650V1_DEV.json deleted file mode 100644 index 91d38f4bd..000000000 --- a/deployment/infrastructure/provider/resources/payloads/IMR18650V1_DEV.json +++ /dev/null @@ -1,248 +0,0 @@ -{ - "electrochemicalProperties" : { - "ratedCapacity" : 94, - "batteryEnergy" : { - "energyRoundtripEfficiencyChange" : 48.2, - "maximumAllowedBatteryEnergy" : 85000, - "energyRoundtripEfficiency" : 25 - }, - "ratioMaximumAllowedBatteryPowerAndMaximumAllowedBatteryEnergy" : 0.588, - "batteryVoltage" : { - "nominalVoltage" : 3.7, - "maxVoltage" : 4.2, - "minVoltage" : 2.5 - }, - "internalResistance" : { - "cellInternalResistance" : 0.36, - "packInternalResistanceIncrease" : 1, - "packInternalResistance" : 100 - }, - "capacityThresholdExhaustion" : 23, - "batteryPower" : { - "powerFade" : 23, - "originalPowerCapability" : -1.7976931348623157E308, - "originalPowerCapabilityLimits" : -1.7976931348623157E308, - "maximumAllowedBatteryPower" : -1.7976931348623157E308, - "powerCapabilityAt20Charge" : -1.7976931348623157E308, - "powerCapabilityAt80Charge" : -1.7976931348623157E308 - }, - "capacityFade" : 1.55 - }, - "document" : { - "responsibleSourcing" : [ { - "title" : "2021 Responsible Sourcing document", - "fileLocation" : null - } ], - "packagingInstructions" : [ { - "title" : "Packing Instruction v.2.0", - "fileLocation" : null - } ], - "transportationInstructions" : [ { - "title" : "Transport manual", - "fileLocation" : null - } ], - "vehicleDismantlingProcedure" : [ { - "title" : "Car dismantling manual", - "fileLocation" : "http://www.ietf.org/rfc/rfc2396.txt" - } ], - "testReportsResults" : [ { - "title" : "Battery Test Reports", - "fileLocation" : "http://www.Batterytestreports.de" - } ], - "batteryDismantlingProcedure" : [ { - "title" : "Dismantling Manual", - "fileLocation" : "http://www.dissmantlingmanual.org" - } ], - "safetyMeasures" : [ { - "title" : "Safety Instruction", - "fileLocation" : "http://www.safetyinstructions.txt" - } ], - "declarationOfConformity" : [ { - "title" : "Declaration of Conformity No. 3", - "fileLocation" : null - } ] - }, - "datePlacedOnMarket" : "27.04.2022", - "cellChemistry" : { - "electrolyteComposition" : [ { - "materialPercentageMassFraction" : null, - "materialWeight" : null, - "materialName" : "dimethyl carbonate (DCM)" - } ], - "anodeCompositionOther" : [ { - "materialPercentageMassFraction" : null, - "materialWeight" : null, - "materialName" : "Carboxymethyl cellulose" - } ], - "recyclateContentActiveMaterials" : [ { - "materialPercentageMassFraction" : 6, - "materialWeight" : null, - "materialName" : "Ni/2021/PlantE" - }, { - "materialPercentageMassFraction" : 4, - "materialWeight" : null, - "materialName" : "Li/2021/PlantE" - }, { - "materialPercentageMassFraction" : 0, - "materialWeight" : null, - "materialName" : "Pb(battery model does not contain Pb)" - }, { - "materialPercentageMassFraction" : 0, - "materialWeight" : null, - "materialName" : "Co(battery model does not contain Pb)" - } ], - "anodeActiveMaterials" : [ { - "materialPercentageMassFraction" : null, - "materialWeight" : null, - "materialName" : "Graphite" - } ], - "cathodeActiveMaterials" : [ { - "materialPercentageMassFraction" : null, - "materialWeight" : null, - "materialName" : "LiMn2O4 Lithium Manganese Oxide" - } ], - "cathodeCompositionOther" : [ { - "materialPercentageMassFraction" : null, - "materialWeight" : null, - "materialName" : "binder:PVDF" - } ] - }, - "physicalDimensions" : { - "length" : 2000, - "width" : 1000, - "weight" : 3500, - "diameter" : null, - "height" : 200 - }, - "temperatureRangeIdleState" : { - "temperatureRangeIdleStateUpperLimit" : 50, - "temperatureRangeIdleStateLowerLimit" : -20 - }, - "batteryCycleLife" : { - "cycleLifeTestCRate" : 2, - "cycleLifeTestDepthOfDischarge" : 1.8, - "expectedLifetime" : 2500 - }, - "manufacturer" : { - "name" : "CompanyE", - "contact" : { - "faxNumber" : "+49 89 0987654324", - "website" : "https://www.CompanyE.com", - "phoneNumber" : "+49 89 1234567893", - "email" : "companyE@company.com" - }, - "address" : { - "locality" : { - "value" : "CityE", - "technicalKey" : "BLOCK" - }, - "country" : { - "shortName" : "Germany" - }, - "postCode" : { - "value" : "65-250E", - "technicalKey" : "CEDEX" - }, - "thoroughfare" : { - "value" : "StreetE", - "number" : "1", - "technicalKey" : "STREET" - }, - "premise" : { - "value" : null, - "technicalKey" : "BUILDING" - }, - "postalDeliveryPoint" : { - "value" : null, - "technicalKey" : "INTERURBAN_DELIVERY_POINT" - } - } - }, - "warrantyPeriod" : "96", - "composition" : { - "compositionOfBattery" : [ { - "materialPercentageMassFraction" : null, - "materialWeight" : null, - "materialName" : "Separator: PE" - } ], - "criticalRawMaterials" : "Lithium, Natural graphite", - "components" : { - "componentsPartNumber" : "Voltage cables", - "componentsSupplier" : [ { - "componentsSupplierName" : "AB Corporation", - "address" : { - "locality" : { - "value" : "CityF", - "technicalKey" : "BLOCK" - }, - "country" : { - "shortName" : "Germany" - }, - "postCode" : { - "value" : "65-250F", - "technicalKey" : "CEDEX" - }, - "thoroughfare" : { - "value" : "StreetF", - "number" : "1", - "technicalKey" : "STREET" - }, - "premise" : { - "value" : "PlantF", - "technicalKey" : "BUILDING" - }, - "postalDeliveryPoint" : { - "value" : null, - "technicalKey" : "INTERURBAN_DELIVERY_POINT" - } - }, - "contact" : { - "faxNumber" : "+49 89 0987654324", - "website" : "https://www.companyF.com", - "phoneNumber" : "+49 89 1234567893", - "email" : "companyF@companyF.com" - } - } ] - } - }, - "manufacturing" : { - "dateOfManufacturing" : "2022-01-24", - "address" : { - "locality" : { - "value" : "CityE", - "technicalKey" : "BLOCK" - }, - "country" : { - "shortName" : "Germany" - }, - "postCode" : { - "value" : "65-250E", - "technicalKey" : "CEDEX" - }, - "thoroughfare" : { - "value" : "StreetE", - "number" : "1", - "technicalKey" : "STREET" - }, - "premise" : { - "value" : "PlantE", - "technicalKey" : "BUILDING" - }, - "postalDeliveryPoint" : { - "value" : "GateE", - "technicalKey" : "INTERURBAN_DELIVERY_POINT" - } - } - }, - "batteryIdentification" : { - "batteryType" : "Lithium-Manganese-Oxide (LMO)", - "batteryIDDMCCode" : "IMR18650V1", - "batteryModel" : "Pi4 Orionis" - }, - "stateOfBattery" : { - "stateOfHealth" : 20, - "statusBattery" : "first life", - "stateOfCharge" : 50 - }, - "cO2FootprintTotal" : 210 - } diff --git a/deployment/infrastructure/provider/resources/payloads/NCR186850B.json b/deployment/infrastructure/provider/resources/payloads/NCR186850B.json deleted file mode 100644 index 70dc443d8..000000000 --- a/deployment/infrastructure/provider/resources/payloads/NCR186850B.json +++ /dev/null @@ -1,283 +0,0 @@ -{ - "electrochemicalProperties": { - "ratedCapacity": 56, - "batteryEnergy": { - "energyRoundtripEfficiencyChange": 45, - "maximumAllowedBatteryEnergy": 75000.0, - "energyRoundtripEfficiency": 80 - }, - "ratioMaximumAllowedBatteryPowerAndMaximumAllowedBatteryEnergy": 0.666, - "batteryVoltage": { - "nominalVoltage": 3.6, - "maxVoltage": 4.2, - "minVoltage": 2.5 - }, - "internalResistance": { - "cellInternalResistance": 3.0, - "packInternalResistanceIncrease": 2, - "packInternalResistance": 80 - }, - "capacityThresholdExhaustion": 23, - "batteryPower": { - "powerFade": 23, - "originalPowerCapability": -1.7976931348623157E308, - "originalPowerCapabilityLimits": -1.7976931348623157E308, - "maximumAllowedBatteryPower": -1.7976931348623157E308, - "powerCapabilityAt20Charge": -1.7976931348623157E308, - "powerCapabilityAt80Charge": -1.7976931348623157E308 - }, - "capacityFade": 2.0 - }, - "document": { - "responsibleSourcing": [ - { - "title": "Sustainability Report 2021", - "fileLocation": "telnet://192.0.2.16:80/" - } - ], - "packagingInstructions": [ - { - "title": "Packaging and transport Instruction", - "fileLocation": "telnet://192.0.2.16:80/" - } - ], - "transportationInstructions": [ - { - "title": "Packaging and transport Instruction", - "fileLocation": "ftp://ftp.is.co.za/rfc/rfc1808.txt" - } - ], - "vehicleDismantlingProcedure": [ - { - "title": "Packaging and transport Instruction", - "fileLocation": "http://www.ietf.org/rfc/rfc2396.txt" - } - ], - "testReportsResults": [ - { - "title": "Certificates of Testing battery", - "fileLocation": "" - } - ], - "batteryDismantlingProcedure": [ - { - "title": "Certificates of Testing battery", - "fileLocation": "http://www.wikipedia.org" - } - ], - "safetyMeasures": [ - { - "title": "Battery user safety precautions", - "fileLocation": "ftp://ftp.is.co.za/rfc/rfc1808.txt" - } - ], - "declarationOfConformity": [ - { - "title": "Declaration of Conformity No. 2", - "fileLocation": "" - } - ] - }, - "datePlacedOnMarket": "27.03.2022", - "cellChemistry": { - "electrolyteComposition": [ - { - "materialPercentageMassFraction": null, - "materialWeight": null, - "materialName": "LiPF6" - } - ], - "anodeCompositionOther": [ - { - "materialPercentageMassFraction": null, - "materialWeight": null, - "materialName": "Styren butadien" - } - ], - "recyclateContentActiveMaterials": [ - { - "materialPercentageMassFraction": 4, - "materialWeight": null, - "materialName": "Ni/2022/PlantC" - }, - { - "materialPercentageMassFraction": 5, - "materialWeight": null, - "materialName": "Li/2021/PlantC" - }, - { - "materialPercentageMassFraction": 0, - "materialWeight": null, - "materialName": "Pb(battery model does not contain Pb)" - }, - { - "materialPercentageMassFraction": 15, - "materialWeight": null, - "materialName": "Co/2021/PlantC" - } - ], - "anodeActiveMaterials": [ - { - "materialPercentageMassFraction": null, - "materialWeight": null, - "materialName": "SiO2-C" - } - ], - "cathodeActiveMaterials": [ - { - "materialPercentageMassFraction": null, - "materialWeight": null, - "materialName": "NCA (Lithium nickel cobalt aluminum oxide)" - } - ], - "cathodeCompositionOther": [ - { - "materialPercentageMassFraction": null, - "materialWeight": null, - "materialName": "carbon black" - } - ] - }, - "physicalDimensions": { - "length": 1800, - "width": 1000, - "weight": 2000, - "diameter": null, - "height": 150 - }, - "temperatureRangeIdleState": { - "temperatureRangeIdleStateUpperLimit": 40, - "temperatureRangeIdleStateLowerLimit": -20 - }, - "batteryCycleLife": { - "cycleLifeTestCRate": 2, - "cycleLifeTestDepthOfDischarge": 1.5, - "expectedLifetime": 3000 - }, - "manufacturer": { - "name": "Company C", - "contact": { - "faxNumber": "+49 89 0987654323", - "website": "http://www.CompanyC.com", - "phoneNumber": "+49 89 1234567892", - "email": "companyC@company.com" - }, - "address": { - "locality": { - "value": "CityC", - "technicalKey": "BLOCK" - }, - "country": { - "shortName": "Germany" - }, - "postCode": { - "value": "65-250A", - "technicalKey": "CEDEX" - }, - "thoroughfare": { - "value": "StreetA", - "number": "1", - "technicalKey": "STREET" - }, - "premise": { - "value": "", - "technicalKey": "CEDEX" - }, - "postalDeliveryPoint": { - "value": "Tor 1", - "technicalKey": "INTERURBAN_DELIVERY_POINT" - } - } - }, - "warrantyPeriod": "120", - "composition": { - "compositionOfBattery": [ - { - "materialPercentageMassFraction": null, - "materialWeight": null, - "materialName": "Co -hazardous, Current collector: Aluminum, LiPF6 - ( conducting lithium salt - toxic, in combination with moisture nad elevated temp. Decompose to HF) . Casing: iron, aluminum laminated plastic" - } - ], - "criticalRawMaterials": "Lithium, Cobalt, Natural graphite", - "components": { - "componentsPartNumber": "Casing Tray: Model C", - "componentsSupplier": [ - { - "componentsSupplierName": "XY Corporation", - "address": { - "locality": { - "value": "CityD", - "technicalKey": "BLOCK" - }, - "country": { - "shortName": "Germany" - }, - "postCode": { - "value": "65-250B", - "technicalKey": "CEDEX" - }, - "thoroughfare": { - "value": "StreetD", - "number": "1", - "technicalKey": "STREET" - }, - "premise": { - "value": "PlantD", - "technicalKey": "BUILDING" - }, - "postalDeliveryPoint": { - "value": "GateD", - "technicalKey": "INTERURBAN_DELIVERY_POINT" - } - }, - "contact": { - "faxNumber": "+49 89 0987654322", - "website": "https://www.companyD.com", - "phoneNumber": "+49 89 1234567890", - "email": "companyD@company.com" - } - } - ] - } - }, - "manufacturing": { - "dateOfManufacturing": "2022-01-24", - "address": { - "locality": { - "value": "CityC", - "technicalKey": "BLOCK" - }, - "country": { - "shortName": "Germany" - }, - "postCode": { - "value": "65-250A", - "technicalKey": "CEDEX" - }, - "thoroughfare": { - "value": "StreetC", - "number": "1", - "technicalKey": "STREET" - }, - "premise": { - "value": "PlantC", - "technicalKey": "BUILDING" - }, - "postalDeliveryPoint": { - "value": "GateC", - "technicalKey": "INTERURBAN_DELIVERY_POINT" - } - } - }, - "batteryIdentification": { - "batteryType": "NCA", - "batteryIDDMCCode": "NCR186850B", - "batteryModel": "Li-ion S-model" - }, - "stateOfBattery": { - "stateOfHealth": 50, - "statusBattery": "first life/ waste/ repaired/ repurposed/ recycled", - "stateOfCharge": 33 - }, - "cO2FootprintTotal": 124.0 -} diff --git a/deployment/infrastructure/provider/resources/payloads/NCR186850B_DEV.json b/deployment/infrastructure/provider/resources/payloads/NCR186850B_DEV.json deleted file mode 100644 index 70dc443d8..000000000 --- a/deployment/infrastructure/provider/resources/payloads/NCR186850B_DEV.json +++ /dev/null @@ -1,283 +0,0 @@ -{ - "electrochemicalProperties": { - "ratedCapacity": 56, - "batteryEnergy": { - "energyRoundtripEfficiencyChange": 45, - "maximumAllowedBatteryEnergy": 75000.0, - "energyRoundtripEfficiency": 80 - }, - "ratioMaximumAllowedBatteryPowerAndMaximumAllowedBatteryEnergy": 0.666, - "batteryVoltage": { - "nominalVoltage": 3.6, - "maxVoltage": 4.2, - "minVoltage": 2.5 - }, - "internalResistance": { - "cellInternalResistance": 3.0, - "packInternalResistanceIncrease": 2, - "packInternalResistance": 80 - }, - "capacityThresholdExhaustion": 23, - "batteryPower": { - "powerFade": 23, - "originalPowerCapability": -1.7976931348623157E308, - "originalPowerCapabilityLimits": -1.7976931348623157E308, - "maximumAllowedBatteryPower": -1.7976931348623157E308, - "powerCapabilityAt20Charge": -1.7976931348623157E308, - "powerCapabilityAt80Charge": -1.7976931348623157E308 - }, - "capacityFade": 2.0 - }, - "document": { - "responsibleSourcing": [ - { - "title": "Sustainability Report 2021", - "fileLocation": "telnet://192.0.2.16:80/" - } - ], - "packagingInstructions": [ - { - "title": "Packaging and transport Instruction", - "fileLocation": "telnet://192.0.2.16:80/" - } - ], - "transportationInstructions": [ - { - "title": "Packaging and transport Instruction", - "fileLocation": "ftp://ftp.is.co.za/rfc/rfc1808.txt" - } - ], - "vehicleDismantlingProcedure": [ - { - "title": "Packaging and transport Instruction", - "fileLocation": "http://www.ietf.org/rfc/rfc2396.txt" - } - ], - "testReportsResults": [ - { - "title": "Certificates of Testing battery", - "fileLocation": "" - } - ], - "batteryDismantlingProcedure": [ - { - "title": "Certificates of Testing battery", - "fileLocation": "http://www.wikipedia.org" - } - ], - "safetyMeasures": [ - { - "title": "Battery user safety precautions", - "fileLocation": "ftp://ftp.is.co.za/rfc/rfc1808.txt" - } - ], - "declarationOfConformity": [ - { - "title": "Declaration of Conformity No. 2", - "fileLocation": "" - } - ] - }, - "datePlacedOnMarket": "27.03.2022", - "cellChemistry": { - "electrolyteComposition": [ - { - "materialPercentageMassFraction": null, - "materialWeight": null, - "materialName": "LiPF6" - } - ], - "anodeCompositionOther": [ - { - "materialPercentageMassFraction": null, - "materialWeight": null, - "materialName": "Styren butadien" - } - ], - "recyclateContentActiveMaterials": [ - { - "materialPercentageMassFraction": 4, - "materialWeight": null, - "materialName": "Ni/2022/PlantC" - }, - { - "materialPercentageMassFraction": 5, - "materialWeight": null, - "materialName": "Li/2021/PlantC" - }, - { - "materialPercentageMassFraction": 0, - "materialWeight": null, - "materialName": "Pb(battery model does not contain Pb)" - }, - { - "materialPercentageMassFraction": 15, - "materialWeight": null, - "materialName": "Co/2021/PlantC" - } - ], - "anodeActiveMaterials": [ - { - "materialPercentageMassFraction": null, - "materialWeight": null, - "materialName": "SiO2-C" - } - ], - "cathodeActiveMaterials": [ - { - "materialPercentageMassFraction": null, - "materialWeight": null, - "materialName": "NCA (Lithium nickel cobalt aluminum oxide)" - } - ], - "cathodeCompositionOther": [ - { - "materialPercentageMassFraction": null, - "materialWeight": null, - "materialName": "carbon black" - } - ] - }, - "physicalDimensions": { - "length": 1800, - "width": 1000, - "weight": 2000, - "diameter": null, - "height": 150 - }, - "temperatureRangeIdleState": { - "temperatureRangeIdleStateUpperLimit": 40, - "temperatureRangeIdleStateLowerLimit": -20 - }, - "batteryCycleLife": { - "cycleLifeTestCRate": 2, - "cycleLifeTestDepthOfDischarge": 1.5, - "expectedLifetime": 3000 - }, - "manufacturer": { - "name": "Company C", - "contact": { - "faxNumber": "+49 89 0987654323", - "website": "http://www.CompanyC.com", - "phoneNumber": "+49 89 1234567892", - "email": "companyC@company.com" - }, - "address": { - "locality": { - "value": "CityC", - "technicalKey": "BLOCK" - }, - "country": { - "shortName": "Germany" - }, - "postCode": { - "value": "65-250A", - "technicalKey": "CEDEX" - }, - "thoroughfare": { - "value": "StreetA", - "number": "1", - "technicalKey": "STREET" - }, - "premise": { - "value": "", - "technicalKey": "CEDEX" - }, - "postalDeliveryPoint": { - "value": "Tor 1", - "technicalKey": "INTERURBAN_DELIVERY_POINT" - } - } - }, - "warrantyPeriod": "120", - "composition": { - "compositionOfBattery": [ - { - "materialPercentageMassFraction": null, - "materialWeight": null, - "materialName": "Co -hazardous, Current collector: Aluminum, LiPF6 - ( conducting lithium salt - toxic, in combination with moisture nad elevated temp. Decompose to HF) . Casing: iron, aluminum laminated plastic" - } - ], - "criticalRawMaterials": "Lithium, Cobalt, Natural graphite", - "components": { - "componentsPartNumber": "Casing Tray: Model C", - "componentsSupplier": [ - { - "componentsSupplierName": "XY Corporation", - "address": { - "locality": { - "value": "CityD", - "technicalKey": "BLOCK" - }, - "country": { - "shortName": "Germany" - }, - "postCode": { - "value": "65-250B", - "technicalKey": "CEDEX" - }, - "thoroughfare": { - "value": "StreetD", - "number": "1", - "technicalKey": "STREET" - }, - "premise": { - "value": "PlantD", - "technicalKey": "BUILDING" - }, - "postalDeliveryPoint": { - "value": "GateD", - "technicalKey": "INTERURBAN_DELIVERY_POINT" - } - }, - "contact": { - "faxNumber": "+49 89 0987654322", - "website": "https://www.companyD.com", - "phoneNumber": "+49 89 1234567890", - "email": "companyD@company.com" - } - } - ] - } - }, - "manufacturing": { - "dateOfManufacturing": "2022-01-24", - "address": { - "locality": { - "value": "CityC", - "technicalKey": "BLOCK" - }, - "country": { - "shortName": "Germany" - }, - "postCode": { - "value": "65-250A", - "technicalKey": "CEDEX" - }, - "thoroughfare": { - "value": "StreetC", - "number": "1", - "technicalKey": "STREET" - }, - "premise": { - "value": "PlantC", - "technicalKey": "BUILDING" - }, - "postalDeliveryPoint": { - "value": "GateC", - "technicalKey": "INTERURBAN_DELIVERY_POINT" - } - } - }, - "batteryIdentification": { - "batteryType": "NCA", - "batteryIDDMCCode": "NCR186850B", - "batteryModel": "Li-ion S-model" - }, - "stateOfBattery": { - "stateOfHealth": 50, - "statusBattery": "first life/ waste/ repaired/ repurposed/ recycled", - "stateOfCharge": 33 - }, - "cO2FootprintTotal": 124.0 -} diff --git a/deployment/infrastructure/provider/resources/payloads/X123456789012X12345678901234566.json b/deployment/infrastructure/provider/resources/payloads/X123456789012X12345678901234566.json deleted file mode 100644 index 049c7c1d6..000000000 --- a/deployment/infrastructure/provider/resources/payloads/X123456789012X12345678901234566.json +++ /dev/null @@ -1,344 +0,0 @@ -{ - "electrochemicalProperties": { - "ratedCapacity": 120, - "batteryEnergy": { - "energyRoundtripEfficiencyChange": 67, - "maximumAllowedBatteryEnergy": 90000, - "energyRoundtripEfficiency": 56 - }, - "ratioMaximumAllowedBatteryPowerAndMaximumAllowedBatteryEnergy": 0.611, - "batteryVoltage": { - "nominalVoltage": 4.3, - "maxVoltage": 6, - "minVoltage": 2.04 - }, - "internalResistance": { - "cellInternalResistance": 45, - "packInternalResistanceIncrease": 23, - "packInternalResistance": 67 - }, - "capacityThresholdExhaustion": 23, - "batteryPower": { - "powerFade": 23, - "originalPowerCapability": 305, - "originalPowerCapabilityLimits": 12, - "maximumAllowedBatteryPower": 308, - "powerCapabilityAt20Charge": -308, - "powerCapabilityAt80Charge": 8 - }, - "capacityFade": 34 - }, - "document": { - "responsibleSourcing": [ - { - "title": "LlN", - "fileLocation": "telnet://192.0.2.16:80/" - }, - { - "title": "LlN 2222", - "fileLocation": "telnet://192.0.2.16:80/" - }, - { - "title": "LlN 2222", - "fileLocation": "telnet://192.0.2.16:80/" - }, - { - "title": "LlN 2222", - "fileLocation": "telnet://192.0.2.16:80/" - }, - { - "title": "LlN 2222", - "fileLocation": "telnet://192.0.2.16:80/" - }, - { - "title": "LlN 2222", - "fileLocation": "telnet://192.0.2.16:80/" - }, - { - "title": "LlN 2222", - "fileLocation": "telnet://192.0.2.16:80/" - } - ], - "packagingInstructions": [ - { - "title": "eOMtThyhVNLWUZNRcBaQKxI", - "fileLocation": "telnet://192.0.2.16:80/" - } - ], - "transportationInstructions": [ - { - "title": "yedUsFwdkelQbxeTeQOvaScfqIOOmaa", - "fileLocation": "ftp://ftp.is.co.za/rfc/rfc1808.txt" - } - ], - "vehicleDismantlingProcedure": [ - { - "title": "JxkyvRnL", - "fileLocation": "http://www.ietf.org/rfc/rfc2396.txt" - } - ], - "testReportsResults": [ - { - "title": "UMaAIKKIkknjWEXJUfPxxQHeWKEJ", - "fileLocation": "telnet://192.0.2.16:80/" - } - ], - "batteryDismantlingProcedure": [ - { - "title": "RYtGKbgicZaHCBRQDSx", - "fileLocation": "http://www.wikipedia.org" - } - ], - "safetyMeasures": [ - { - "title": "VLhpfQGTMDYpsBZxvfBoeygjb", - "fileLocation": "ftp://ftp.is.co.za/rfc/rfc1808.txt" - } - ], - "declarationOfConformity": [ - { - "title": "dpHYZGhtgdntugzvvKAXLhM", - "fileLocation": "http://www.wikipedia.org" - } - ] - }, - "datePlacedOnMarket": "2023-03-08", - "cellChemistry": { - "electrolyteComposition": [ - { - "materialPercentageMassFraction": 4, - "materialName": "Ni", - "materialWeight": 2.5 - } - ], - "anodeCompositionOther": [ - { - "materialPercentageMassFraction": 15, - "materialName": "Co", - "materialWeight": 2.5 - } - ], - "recyclateContentActiveMaterials": [ - { - "materialPercentageMassFraction": 5, - "materialName": "Li", - "materialWeight": 2.5 - } - ], - "anodeActiveMaterials": [ - { - "materialPercentageMassFraction": 5, - "materialName": "Graphite", - "materialWeight": 2.5 - } - ], - "cathodeActiveMaterials": [ - { - "materialPercentageMassFraction": 14, - "materialName": "Ni", - "materialWeight": 2.5 - }, - { - "materialPercentageMassFraction": 9, - "materialName": "Co", - "materialWeight": 2.5 - }, - { - "materialPercentageMassFraction": 19, - "materialName": "Li", - "materialWeight": 2.5 - }, - { - "materialPercentageMassFraction": 0, - "materialName": "Pb", - "materialWeight": 2.5 - } - ], - "cathodeCompositionOther": [ - { - "materialPercentageMassFraction": 19, - "materialName": "Pb", - "materialWeight": 2.5 - } - ] - }, - "physicalDimensions": { - "length": 20000, - "width": 1000, - "weight": 1007, - "diameter": 3, - "height": 1 - }, - "temperatureRangeIdleState": { - "temperatureRangeIdleStateUpperLimit": 67, - "temperatureRangeIdleStateLowerLimit": -22 - }, - "batteryCycleLife": { - "cycleLifeTestCRate": 45, - "cycleLifeTestDepthOfDischarge": 2, - "expectedLifetime": 1200 - }, - "manufacturer": { - "name": "Company A", - "contact": { - "faxNumber": "+49 89 0987654321", - "website": "https://www.samsung.com", - "phoneNumber": "+49 89 1234567890", - "email": "test.mail@example.com" - }, - "address": { - "locality": { - "value": "Mannheim", - "technicalKey": "BLOCK" - }, - "country": { - "shortName": "TG-Y" - }, - "postCode": { - "value": "68161\\12", - "technicalKey": "CEDEX" - }, - "thoroughfare": { - "value": "Bernstraße", - "number": "45", - "technicalKey": "STREET" - }, - "premise": { - "value": "Werk 1", - "technicalKey": "BUILDING" - }, - "postalDeliveryPoint": { - "value": "Tor 1", - "technicalKey": "INTERURBAN_DELIVERY_POINT" - } - } - }, - "warrantyPeriod": 60, - "composition": { - "compositionOfBattery": [ - { - "materialPercentageMassFraction": 19, - "materialName": "Graphite", - "materialWeight": 2.5 - }, - { - "materialPercentageMassFraction": 19, - "materialName": "Graphite", - "materialWeight": 2.5 - }, - { - "materialPercentageMassFraction": 19, - "materialName": "Graphite", - "materialWeight": 2.5 - }, - { - "materialPercentageMassFraction": 19, - "materialName": "Graphite", - "materialWeight": 2.5 - }, - { - "materialPercentageMassFraction": 19, - "materialName": "Graphite", - "materialWeight": 2.5 - }, - { - "materialPercentageMassFraction": 19, - "materialName": "Graphite", - "materialWeight": 2.5 - }, - { - "materialPercentageMassFraction": 19, - "materialName": "Graphite", - "materialWeight": 2.5 - }, - { - "materialPercentageMassFraction": 19, - "materialName": "Graphite", - "materialWeight": 2.5 - } - ], - "criticalRawMaterials": "Lithium, Cobalt, Natural graphite", - "components": { - "componentsPartNumber": [ - "Case xxxxxxx/xx; Controller xxxxxxx/xx" - ], - "componentsSupplier": [ - { - "componentsSupplierName": "XY Corporation", - "address": { - "locality": { - "value": "Mannheim", - "technicalKey": "BLOCK" - }, - "country": { - "shortName": "" - }, - "postCode": { - "value": "68161\\12", - "technicalKey": "CEDEX" - }, - "thoroughfare": { - "value": "Bernstraße", - "number": "45", - "technicalKey": "STREET" - }, - "premise": { - "value": "Werk 1", - "technicalKey": "BUILDING" - }, - "postalDeliveryPoint": { - "value": "Tor 1", - "technicalKey": "INTERURBAN_DELIVERY_POINT" - } - }, - "contact": { - "faxNumber": "+49 89 0987654321", - "website": "https://www.samsung.com", - "phoneNumber": "+49 89 1234567890", - "email": "test.mail@example.com" - } - } - ] - } - }, - "manufacturing": { - "dateOfManufacturing": "2023-03-07", - "address": { - "locality": { - "value": "Mannheim", - "technicalKey": "BLOCK" - }, - "country": { - "shortName": "" - }, - "postCode": { - "value": "68161\\12", - "technicalKey": "CEDEX" - }, - "thoroughfare": { - "value": "Bernstraße", - "number": "45", - "technicalKey": "STREET" - }, - "premise": { - "value": "Werk 1", - "technicalKey": "BUILDING" - }, - "postalDeliveryPoint": { - "value": "Tor 1", - "technicalKey": "INTERURBAN_DELIVERY_POINT" - } - } - }, - "batteryIdentification": { - "batteryType": "Li-Ion", - "batteryIDDMCCode": "X123456789012X12345678901234566", - "batteryModel": "SB 28" - }, - "stateOfBattery": { - "stateOfHealth": 12, - "statusBattery": "first life", - "stateOfCharge": 23 - }, - "cO2FootprintTotal": "110" - } diff --git a/deployment/infrastructure/provider/resources/payloads/X123456789012X12345678901234566_DEV.json b/deployment/infrastructure/provider/resources/payloads/X123456789012X12345678901234566_DEV.json deleted file mode 100644 index 049c7c1d6..000000000 --- a/deployment/infrastructure/provider/resources/payloads/X123456789012X12345678901234566_DEV.json +++ /dev/null @@ -1,344 +0,0 @@ -{ - "electrochemicalProperties": { - "ratedCapacity": 120, - "batteryEnergy": { - "energyRoundtripEfficiencyChange": 67, - "maximumAllowedBatteryEnergy": 90000, - "energyRoundtripEfficiency": 56 - }, - "ratioMaximumAllowedBatteryPowerAndMaximumAllowedBatteryEnergy": 0.611, - "batteryVoltage": { - "nominalVoltage": 4.3, - "maxVoltage": 6, - "minVoltage": 2.04 - }, - "internalResistance": { - "cellInternalResistance": 45, - "packInternalResistanceIncrease": 23, - "packInternalResistance": 67 - }, - "capacityThresholdExhaustion": 23, - "batteryPower": { - "powerFade": 23, - "originalPowerCapability": 305, - "originalPowerCapabilityLimits": 12, - "maximumAllowedBatteryPower": 308, - "powerCapabilityAt20Charge": -308, - "powerCapabilityAt80Charge": 8 - }, - "capacityFade": 34 - }, - "document": { - "responsibleSourcing": [ - { - "title": "LlN", - "fileLocation": "telnet://192.0.2.16:80/" - }, - { - "title": "LlN 2222", - "fileLocation": "telnet://192.0.2.16:80/" - }, - { - "title": "LlN 2222", - "fileLocation": "telnet://192.0.2.16:80/" - }, - { - "title": "LlN 2222", - "fileLocation": "telnet://192.0.2.16:80/" - }, - { - "title": "LlN 2222", - "fileLocation": "telnet://192.0.2.16:80/" - }, - { - "title": "LlN 2222", - "fileLocation": "telnet://192.0.2.16:80/" - }, - { - "title": "LlN 2222", - "fileLocation": "telnet://192.0.2.16:80/" - } - ], - "packagingInstructions": [ - { - "title": "eOMtThyhVNLWUZNRcBaQKxI", - "fileLocation": "telnet://192.0.2.16:80/" - } - ], - "transportationInstructions": [ - { - "title": "yedUsFwdkelQbxeTeQOvaScfqIOOmaa", - "fileLocation": "ftp://ftp.is.co.za/rfc/rfc1808.txt" - } - ], - "vehicleDismantlingProcedure": [ - { - "title": "JxkyvRnL", - "fileLocation": "http://www.ietf.org/rfc/rfc2396.txt" - } - ], - "testReportsResults": [ - { - "title": "UMaAIKKIkknjWEXJUfPxxQHeWKEJ", - "fileLocation": "telnet://192.0.2.16:80/" - } - ], - "batteryDismantlingProcedure": [ - { - "title": "RYtGKbgicZaHCBRQDSx", - "fileLocation": "http://www.wikipedia.org" - } - ], - "safetyMeasures": [ - { - "title": "VLhpfQGTMDYpsBZxvfBoeygjb", - "fileLocation": "ftp://ftp.is.co.za/rfc/rfc1808.txt" - } - ], - "declarationOfConformity": [ - { - "title": "dpHYZGhtgdntugzvvKAXLhM", - "fileLocation": "http://www.wikipedia.org" - } - ] - }, - "datePlacedOnMarket": "2023-03-08", - "cellChemistry": { - "electrolyteComposition": [ - { - "materialPercentageMassFraction": 4, - "materialName": "Ni", - "materialWeight": 2.5 - } - ], - "anodeCompositionOther": [ - { - "materialPercentageMassFraction": 15, - "materialName": "Co", - "materialWeight": 2.5 - } - ], - "recyclateContentActiveMaterials": [ - { - "materialPercentageMassFraction": 5, - "materialName": "Li", - "materialWeight": 2.5 - } - ], - "anodeActiveMaterials": [ - { - "materialPercentageMassFraction": 5, - "materialName": "Graphite", - "materialWeight": 2.5 - } - ], - "cathodeActiveMaterials": [ - { - "materialPercentageMassFraction": 14, - "materialName": "Ni", - "materialWeight": 2.5 - }, - { - "materialPercentageMassFraction": 9, - "materialName": "Co", - "materialWeight": 2.5 - }, - { - "materialPercentageMassFraction": 19, - "materialName": "Li", - "materialWeight": 2.5 - }, - { - "materialPercentageMassFraction": 0, - "materialName": "Pb", - "materialWeight": 2.5 - } - ], - "cathodeCompositionOther": [ - { - "materialPercentageMassFraction": 19, - "materialName": "Pb", - "materialWeight": 2.5 - } - ] - }, - "physicalDimensions": { - "length": 20000, - "width": 1000, - "weight": 1007, - "diameter": 3, - "height": 1 - }, - "temperatureRangeIdleState": { - "temperatureRangeIdleStateUpperLimit": 67, - "temperatureRangeIdleStateLowerLimit": -22 - }, - "batteryCycleLife": { - "cycleLifeTestCRate": 45, - "cycleLifeTestDepthOfDischarge": 2, - "expectedLifetime": 1200 - }, - "manufacturer": { - "name": "Company A", - "contact": { - "faxNumber": "+49 89 0987654321", - "website": "https://www.samsung.com", - "phoneNumber": "+49 89 1234567890", - "email": "test.mail@example.com" - }, - "address": { - "locality": { - "value": "Mannheim", - "technicalKey": "BLOCK" - }, - "country": { - "shortName": "TG-Y" - }, - "postCode": { - "value": "68161\\12", - "technicalKey": "CEDEX" - }, - "thoroughfare": { - "value": "Bernstraße", - "number": "45", - "technicalKey": "STREET" - }, - "premise": { - "value": "Werk 1", - "technicalKey": "BUILDING" - }, - "postalDeliveryPoint": { - "value": "Tor 1", - "technicalKey": "INTERURBAN_DELIVERY_POINT" - } - } - }, - "warrantyPeriod": 60, - "composition": { - "compositionOfBattery": [ - { - "materialPercentageMassFraction": 19, - "materialName": "Graphite", - "materialWeight": 2.5 - }, - { - "materialPercentageMassFraction": 19, - "materialName": "Graphite", - "materialWeight": 2.5 - }, - { - "materialPercentageMassFraction": 19, - "materialName": "Graphite", - "materialWeight": 2.5 - }, - { - "materialPercentageMassFraction": 19, - "materialName": "Graphite", - "materialWeight": 2.5 - }, - { - "materialPercentageMassFraction": 19, - "materialName": "Graphite", - "materialWeight": 2.5 - }, - { - "materialPercentageMassFraction": 19, - "materialName": "Graphite", - "materialWeight": 2.5 - }, - { - "materialPercentageMassFraction": 19, - "materialName": "Graphite", - "materialWeight": 2.5 - }, - { - "materialPercentageMassFraction": 19, - "materialName": "Graphite", - "materialWeight": 2.5 - } - ], - "criticalRawMaterials": "Lithium, Cobalt, Natural graphite", - "components": { - "componentsPartNumber": [ - "Case xxxxxxx/xx; Controller xxxxxxx/xx" - ], - "componentsSupplier": [ - { - "componentsSupplierName": "XY Corporation", - "address": { - "locality": { - "value": "Mannheim", - "technicalKey": "BLOCK" - }, - "country": { - "shortName": "" - }, - "postCode": { - "value": "68161\\12", - "technicalKey": "CEDEX" - }, - "thoroughfare": { - "value": "Bernstraße", - "number": "45", - "technicalKey": "STREET" - }, - "premise": { - "value": "Werk 1", - "technicalKey": "BUILDING" - }, - "postalDeliveryPoint": { - "value": "Tor 1", - "technicalKey": "INTERURBAN_DELIVERY_POINT" - } - }, - "contact": { - "faxNumber": "+49 89 0987654321", - "website": "https://www.samsung.com", - "phoneNumber": "+49 89 1234567890", - "email": "test.mail@example.com" - } - } - ] - } - }, - "manufacturing": { - "dateOfManufacturing": "2023-03-07", - "address": { - "locality": { - "value": "Mannheim", - "technicalKey": "BLOCK" - }, - "country": { - "shortName": "" - }, - "postCode": { - "value": "68161\\12", - "technicalKey": "CEDEX" - }, - "thoroughfare": { - "value": "Bernstraße", - "number": "45", - "technicalKey": "STREET" - }, - "premise": { - "value": "Werk 1", - "technicalKey": "BUILDING" - }, - "postalDeliveryPoint": { - "value": "Tor 1", - "technicalKey": "INTERURBAN_DELIVERY_POINT" - } - } - }, - "batteryIdentification": { - "batteryType": "Li-Ion", - "batteryIDDMCCode": "X123456789012X12345678901234566", - "batteryModel": "SB 28" - }, - "stateOfBattery": { - "stateOfHealth": 12, - "statusBattery": "first life", - "stateOfCharge": 23 - }, - "cO2FootprintTotal": "110" - } diff --git a/postman/v3.0.1/Battery-Pass_BETA.postman_collection.json b/postman/v3.0.1/Battery-Pass_BETA.postman_collection.json deleted file mode 100644 index 218927d1b..000000000 --- a/postman/v3.0.1/Battery-Pass_BETA.postman_collection.json +++ /dev/null @@ -1,1080 +0,0 @@ -{ - "info": { - "_postman_id": "2a70e5bf-1c5d-4fe1-94ed-e7a7d5416852", - "name": "Battery-Pass_BETA", - "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" - }, - "item": [ - { - "name": "Provider", - "item": [ - { - "name": "1. Create sample data", - "protocolProfileBehavior": { - "disabledSystemHeaders": {} - }, - "request": { - "auth": { - "type": "noauth" - }, - "method": "POST", - "header": [ - { - "key": "Accept", - "value": "application/octet-stream", - "type": "default", - "disabled": true - } - ], - "body": { - "mode": "raw", - "raw": "{\r\n \"electrochemicalProperties\": {\r\n \"ratedCapacity\": 200,\r\n \"batteryEnergy\": {\r\n \"energyRoundtripEfficiencyChange\": 80,\r\n \"maximumAllowedBatteryEnergy\": 60000.0,\r\n \"energyRoundtripEfficiency\": 48\r\n },\r\n \"ratioMaximumAllowedBatteryPowerAndMaximumAllowedBatteryEnergy\": 0.833,\r\n \"batteryVoltage\": {\r\n \"nominalVoltage\": 3.6,\r\n \"maxVoltage\": 4.2,\r\n \"minVoltage\": 2.5\r\n },\r\n \"internalResistance\": {\r\n \"cellInternalResistance\": 0.3,\r\n \"packInternalResistanceIncrease\": 0.21,\r\n \"packInternalResistance\": 53\r\n },\r\n \"capacityThresholdExhaustion\": 20,\r\n \"batteryPower\": {\r\n \"originalPowerCapability\": 150,\r\n \"powerFade\": 12.1,\r\n \"originalPowerCapabilityLimits\": 734.8,\r\n \"maximumAllowedBatteryPower\": 100000,\r\n \"powerCapabilityAt20Charge\": 500000,\r\n \"originalPower\": 40000,\r\n \"powerCapabilityAt80Charge\": 120000\r\n },\r\n \"capacityFade\": 1.5\r\n },\r\n \"document\": {\r\n \"responsibleSourcing\": [\r\n {\r\n \"title\": \"Responsible Sourcing Report 2021\",\r\n \"fileLocation\": \"telnet://192.0.2.16:80/\"\r\n }\r\n ],\r\n \"packagingInstructions\": [\r\n {\r\n \"title\": \"Packing Instruction for Lithium cells and batteries\",\r\n \"fileLocation\": \"telnet://192.0.2.16:80/\"\r\n }\r\n ],\r\n \"transportationInstructions\": [\r\n {\r\n \"title\": \"Shipping guidelines\",\r\n \"fileLocation\": \"ftp://ftp.is.co.za/rfc/rfc1808.txt\"\r\n }\r\n ],\r\n \"vehicleDismantlingProcedure\": [\r\n {\r\n \"title\": \"Dissmantling procedure of battery from the car\",\r\n \"fileLocation\": \"http://www.ietf.org/rfc/rfc2396.txt\"\r\n }\r\n ],\r\n \"testReportsResults\": [\r\n {\r\n \"title\": \"Laboratory Test Results for Battery ID no: X123456789012X12345678901234566\",\r\n \"fileLocation\": \"\"\r\n }\r\n ],\r\n \"batteryDismantlingProcedure\": [\r\n {\r\n \"title\": \"Dismantling Procedure for Battery Model: Li-Ion X-series\",\r\n \"fileLocation\": \"http://www.wikipedia.org\"\r\n }\r\n ],\r\n \"safetyMeasures\": [\r\n {\r\n \"title\": \"Lithium battery safety document\",\r\n \"fileLocation\": \"ftp://ftp.is.co.za/rfc/rfc1808.txt\"\r\n }\r\n ],\r\n \"declarationOfConformity\": [\r\n {\r\n \"title\": \"Declaration of Conformity No. 1\",\r\n \"fileLocation\": \"\"\r\n }\r\n ]\r\n },\r\n \"datePlacedOnMarket\": \"27.02.2022\",\r\n \"cellChemistry\": {\r\n \"electrolyteComposition\": [\r\n {\r\n \"matierialPercentageMassFraction\": null,\r\n \"matierialWeight\": null,\r\n \"materialName\": \"Ethylene Carbonate\"\r\n }\r\n ],\r\n \"anodeCompositionOther\": [\r\n {\r\n \"matierialPercentageMassFraction\": null,\r\n \"matierialWeight\": null,\r\n \"materialName\": \"Polyacrylic acid\"\r\n }\r\n ],\r\n \"recyclateContentActiveMaterials\": [\r\n {\r\n \"matierialPercentageMassFraction\": 4,\r\n \"matierialWeight\": null,\r\n \"materialName\": \"Ni/2021/PlantA\"\r\n },\r\n {\r\n \"matierialPercentageMassFraction\": 4,\r\n \"matierialWeight\": null,\r\n \"materialName\": \"Li/2021/PlantA\"\r\n },\r\n {\r\n \"matierialPercentageMassFraction\": 0,\r\n \"matierialWeight\": null,\r\n \"materialName\": \"Pb(battery model does not contain Pb)\"\r\n },\r\n {\r\n \"matierialPercentageMassFraction\": 12,\r\n \"matierialWeight\": null,\r\n \"materialName\": \"Co/2021/PlantA\"\r\n }\r\n ],\r\n \"anodeActiveMaterials\": [\r\n {\r\n \"matierialPercentageMassFraction\": null,\r\n \"matierialWeight\": null,\r\n \"materialName\": \"Graphite\"\r\n }\r\n ],\r\n \"cathodeActiveMaterials\": [\r\n {\r\n \"matierialPercentageMassFraction\": null,\r\n \"matierialWeight\": null,\r\n \"materialName\": \"(NCM)Lithium nickel cobalt manganese oxide\"\r\n }\r\n ],\r\n \"cathodeCompositionOther\": [\r\n {\r\n \"matierialPercentageMassFraction\": null,\r\n \"matierialWeight\": null,\r\n \"materialName\": \"carbon black, PVDR\"\r\n }\r\n ]\r\n },\r\n \"physicalDimensions\": {\r\n \"length\": 1500,\r\n \"width\": 1000,\r\n \"weight\": 1500,\r\n \"diameter\": null,\r\n \"height\": 50\r\n },\r\n \"temperatureRangeIdleState\": {\r\n \"temperatureRangeIdleStateUpperLimit\": 50,\r\n \"temperatureRangeIdleStateLowerLimit\": -20\r\n },\r\n \"batteryCycleLife\": {\r\n \"cycleLifeTestCRate\": 90,\r\n \"cycleLifeTestDepthOfDischarge\": 67,\r\n \"expectedLifetime\": 2800\r\n },\r\n \"manufacturer\": {\r\n \"name\": \"CompanyA\",\r\n \"contact\": {\r\n \"faxNumber\": \"+49 89 0987654322\",\r\n \"website\": \"http://www.CompanyA.com\",\r\n \"phoneNumber\": \"+49 89 1234567891\",\r\n \"email\": \"companyA@company.com\"\r\n },\r\n \"address\": {\r\n \"locality\": {\r\n \"value\": \"CityA\",\r\n \"technicalKey\": \"BLOCK\"\r\n },\r\n \"country\": {\r\n \"shortName\": \"Germany\"\r\n },\r\n \"postCode\": {\r\n \"value\": \"65-250A\",\r\n \"technicalKey\": \"CEDEX\"\r\n },\r\n \"thoroughfare\": {\r\n \"value\": \"StreetA\",\r\n \"number\": \"1\",\r\n \"technicalKey\": \"STREET\"\r\n },\r\n \"premise\": {\r\n \"value\": \"\",\r\n \"technicalKey\": \"CEDEX\"\r\n },\r\n \"postalDeliveryPoint\": {\r\n \"value\": \"Tor 1\",\r\n \"technicalKey\": \"INTERURBAN_DELIVERY_POINT\"\r\n }\r\n }\r\n },\r\n \"warrantyPeriod\": 96,\r\n \"composition\": {\r\n \"compositionOfBattery\": [\r\n {\r\n \"matierialPercentageMassFraction\": null,\r\n \"matierialWeight\": null,\r\n \"materialName\": \"current collector: Cupper, Separator: PP, Casing: Aluminium\"\r\n }\r\n ],\r\n \"criticalRawMaterials\": \"Lithium, Bauxite, Natural graphite\",\r\n \"components\": {\r\n \"componentsPartNumber\": \"Battery Management Unit Model: 75345\",\r\n \"componentsSupplier\": [\r\n {\r\n \"address\": {\r\n \"locality\": {\r\n \"value\": \"CityB\",\r\n \"technicalKey\": \"BLOCK\"\r\n },\r\n \"country\": {\r\n \"shortName\": \"Germany\"\r\n },\r\n \"postCode\": {\r\n \"value\": \"65-250B\",\r\n \"technicalKey\": \"CEDEX\"\r\n },\r\n \"thoroughfare\": {\r\n \"value\": \"StreetB\",\r\n \"number\": \"1\",\r\n \"technicalKey\": \"STREET\"\r\n },\r\n \"premise\": {\r\n \"value\": \"PlantB\",\r\n \"technicalKey\": \"BUILDING\"\r\n },\r\n \"postalDeliveryPoint\": {\r\n \"value\": \"GateB\",\r\n \"technicalKey\": \"INTERURBAN_DELIVERY_POINT\"\r\n }\r\n },\r\n \"contact\": {\r\n \"faxNumber\": \"+49 89 0987654322\",\r\n \"website\": \"https://www.companyB.com\",\r\n \"phoneNumber\": \"+49 89 1234567890\",\r\n \"email\": \"companyB@company.com\"\r\n }\r\n }\r\n ]\r\n }\r\n },\r\n \"manufacturing\": {\r\n \"dateOfManufacturing\": \"2022-01-24\",\r\n \"address\": {\r\n \"locality\": {\r\n \"value\": \"CityA\",\r\n \"technicalKey\": \"BLOCK\"\r\n },\r\n \"country\": {\r\n \"shortName\": \"Germany\"\r\n },\r\n \"postCode\": {\r\n \"value\": \"65-250A\",\r\n \"technicalKey\": \"CEDEX\"\r\n },\r\n \"thoroughfare\": {\r\n \"value\": \"StreetA\",\r\n \"number\": \"1\",\r\n \"technicalKey\": \"STREET\"\r\n },\r\n \"premise\": {\r\n \"value\": \"PlantA\",\r\n \"technicalKey\": \"BUILDING\"\r\n },\r\n \"postalDeliveryPoint\": {\r\n \"value\": \"GateA\",\r\n \"technicalKey\": \"INTERURBAN_DELIVERY_POINT\"\r\n }\r\n }\r\n },\r\n \"batteryIdentification\": {\r\n \"batteryType\": \"LiNMC\",\r\n \"batteryIDDMCCode\": \"X123456789012X12345678901234566\",\r\n \"batteryModel\": \"Li-Ion X-series\"\r\n },\r\n \"stateOfBattery\": {\r\n \"stateOfHealth\": 100,\r\n \"statusBattery\": \"first life\",\r\n \"stateOfCharge\": 99\r\n },\r\n \"cO2FootprintTotal\": 3120\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{BETAServer}}/provider_backend/data/{{digitalTwinId}}-{{digitalTwinSubmodelId}}", - "host": [ - "{{BETAServer}}" - ], - "path": [ - "provider_backend", - "data", - "{{digitalTwinId}}-{{digitalTwinSubmodelId}}" - ] - } - }, - "response": [] - }, - { - "name": "1.1 Get sample data", - "protocolProfileBehavior": { - "disabledSystemHeaders": {} - }, - "request": { - "auth": { - "type": "noauth" - }, - "method": "GET", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "type": "default" - }, - { - "key": "Accept", - "value": "application/octet-stream", - "type": "default" - } - ], - "url": { - "raw": "{{BETAServer}}/provider_backend/data/{{digitalTwinId}}-{{digitalTwinSubmodelId}}", - "host": [ - "{{BETAServer}}" - ], - "path": [ - "provider_backend", - "data", - "{{digitalTwinId}}-{{digitalTwinSubmodelId}}" - ] - } - }, - "response": [] - }, - { - "name": "2. Register assets", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "apikey", - "apikey": [ - { - "key": "value", - "value": "{{APIKey}}", - "type": "string" - }, - { - "key": "key", - "value": "X-Api-Key", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "type": "default" - } - ], - "body": { - "mode": "raw", - "raw": "{\r\n \"asset\": {\r\n \"properties\": {\r\n \"asset:prop:id\": \"{{assetId}}\",\r\n \"asset:prop:description\": \"Battery Passport test data\"\r\n }\r\n },\r\n \"dataAddress\": {\r\n \"properties\": {\r\n \"type\": \"HttpData\",\r\n \"baseUrl\": \"{{BETAServer}}/provider_backend/data/{{digitalTwinId}}-{{digitalTwinSubmodelId}}\"\r\n }\r\n }\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{BETAServer}}/BPNL000000000000/data/assets", - "host": [ - "{{BETAServer}}" - ], - "path": [ - "BPNL000000000000", - "data", - "assets" - ] - } - }, - "response": [] - }, - { - "name": "2.1 Get assets", - "request": { - "auth": { - "type": "apikey", - "apikey": [ - { - "key": "value", - "value": "{{APIKey}}", - "type": "string" - }, - { - "key": "key", - "value": "X-Api-Key", - "type": "string" - } - ] - }, - "method": "GET", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "type": "default" - } - ], - "url": { - "raw": "{{BETAServer}}/BPNL000000000000/data/assets", - "host": [ - "{{BETAServer}}" - ], - "path": [ - "BPNL000000000000", - "data", - "assets" - ] - } - }, - "response": [] - }, - { - "name": "3. Register policy", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "apikey", - "apikey": [ - { - "key": "value", - "value": "{{APIKey}}", - "type": "string" - }, - { - "key": "key", - "value": "X-Api-Key", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "type": "default" - } - ], - "body": { - "mode": "raw", - "raw": "{\r\n \"id\": \"{{policyId}}\",\r\n \"policy\": {\r\n \"prohibitions\": [],\r\n \"obligations\": [],\r\n \"permissions\": [\r\n {\r\n \"edctype\": \"dataspaceconnector:permission\",\r\n \"action\": {\r\n \"type\": \"USE\"\r\n },\r\n \"constraints\": []\r\n }\r\n ]\r\n }\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{BETAServer}}/BPNL000000000000/data/policydefinitions", - "host": [ - "{{BETAServer}}" - ], - "path": [ - "BPNL000000000000", - "data", - "policydefinitions" - ] - } - }, - "response": [] - }, - { - "name": "3.1 Get policy", - "request": { - "auth": { - "type": "apikey", - "apikey": [ - { - "key": "value", - "value": "{{APIKey}}", - "type": "string" - }, - { - "key": "key", - "value": "X-Api-Key", - "type": "string" - } - ] - }, - "method": "GET", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "type": "default" - } - ], - "url": { - "raw": "{{BETAServer}}/BPNL000000000000/data/policydefinitions", - "host": [ - "{{BETAServer}}" - ], - "path": [ - "BPNL000000000000", - "data", - "policydefinitions" - ] - } - }, - "response": [] - }, - { - "name": "4. Register contract definitions", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "apikey", - "apikey": [ - { - "key": "value", - "value": "{{APIKey}}", - "type": "string" - }, - { - "key": "key", - "value": "X-Api-Key", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "type": "default" - } - ], - "body": { - "mode": "raw", - "raw": "{\r\n \"id\": \"{{contractDefinitionId}}\",\r\n \"criteria\": [\r\n {\r\n \"operandLeft\": \"asset:prop:id\",\r\n \"operator\": \"=\",\r\n \"operandRight\": \"{{assetId}}\"\r\n }\r\n ],\r\n \"accessPolicyId\": \"{{policyId}}\",\r\n \"contractPolicyId\": \"{{policyId}}\"\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{BETAServer}}/BPNL000000000000/data/contractdefinitions", - "host": [ - "{{BETAServer}}" - ], - "path": [ - "BPNL000000000000", - "data", - "contractdefinitions" - ] - } - }, - "response": [] - }, - { - "name": "4.1 Get contract definitions", - "request": { - "auth": { - "type": "apikey", - "apikey": [ - { - "key": "value", - "value": "{{APIKey}}", - "type": "string" - }, - { - "key": "key", - "value": "X-Api-Key", - "type": "string" - } - ] - }, - "method": "GET", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "type": "default" - } - ], - "url": { - "raw": "{{BETAServer}}/BPNL000000000000/data/contractdefinitions", - "host": [ - "{{BETAServer}}" - ], - "path": [ - "BPNL000000000000", - "data", - "contractdefinitions" - ] - } - }, - "response": [] - }, - { - "name": "5. Register Digital Twin to registry", - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "type": "default" - } - ], - "body": { - "mode": "raw", - "raw": "{\r\n \"description\": [],\r\n \"globalAssetId\": {\r\n \"value\": [\r\n \"urn:uuid:32aa72de-297a-4405-9148-13e12744028a\"\r\n ]\r\n },\r\n \"idShort\": \"Battery_X123456789012X12345678901234566\",\r\n \"identification\": \"urn:uuid:32aa72de-297a-4405-9148-13e12744028a\",\r\n \"specificAssetIds\": [\r\n {\r\n \"key\": \"partInstanceId\",\r\n \"value\": \"X123456789012X12345678901234566\"\r\n }\r\n ],\r\n \"submodelDescriptors\": [\r\n {\r\n \"description\": [\r\n {\r\n \"language\": \"en\",\r\n \"text\": \"Battery Passport Submodel\"\r\n }\r\n ],\r\n \"idShort\": \"batteryPass\",\r\n \"identification\": \"urn:uuid:699f1245-f57e-4d6b-acdb-ab763665554a\",\r\n \"semanticId\": {\r\n \"value\": [\r\n \"urn:bamm:io.catenax.battery.battery_pass:3.0.1#BatteryPass\"\r\n ]\r\n },\r\n \"endpoints\": [\r\n {\r\n \"interface\": \"EDC\",\r\n \"protocolInformation\": {\r\n \"endpointAddress\": \"{{BETAServer}}/BPNL000000000000/urn:uuid:32aa72de-297a-4405-9148-13e12744028a-urn:uuid:699f1245-f57e-4d6b-acdb-ab763665554a/submodel?content=value&extent=WithBLOBValue\",\r\n \"endpointProtocol\": \"IDS/ECLIPSE DATASPACE CONNECTOR\",\r\n \"endpointProtocolVersion\": \"0.0.1-SNAPSHOT\"\r\n }\r\n }\r\n ]\r\n }\r\n ]\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{registryUrl}}/registry/registry/shell-descriptors", - "host": [ - "{{registryUrl}}" - ], - "path": [ - "registry", - "registry", - "shell-descriptors" - ] - } - }, - "response": [] - }, - { - "name": "5.1 Get Digital Twin by Id from registry", - "request": { - "method": "GET", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "type": "default" - } - ], - "url": { - "raw": "{{registryUrl}}/registry/registry/shell-descriptors?pageSize=100", - "host": [ - "{{registryUrl}}" - ], - "path": [ - "registry", - "registry", - "shell-descriptors" - ], - "query": [ - { - "key": "pageSize", - "value": "100" - } - ] - } - }, - "response": [] - } - ] - }, - { - "name": "Consumer", - "item": [ - { - "name": "CX Registry", - "item": [ - { - "name": "1. /lookup/shells - Query Digital Twin", - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "{{registryUrl}}/registry/lookup/shells?assetIds=[\"{\\\"key\\\": \\\"partInstanceId\\\", \\\"value\\\": \\\"X123456789012X12345678901234566\\\"}\"]", - "host": [ - "{{registryUrl}}" - ], - "path": [ - "registry", - "lookup", - "shells" - ], - "query": [ - { - "key": "assetIds", - "value": "[\"{\\\"key\\\": \\\"partInstanceId\\\", \\\"value\\\": \\\"X123456789012X12345678901234566\\\"}\"]" - } - ] - } - }, - "response": [] - }, - { - "name": "1. /lookup/shells - Delete DT", - "request": { - "method": "DELETE", - "header": [], - "url": { - "raw": "{{registryUrl}}/registry/registry/shell-descriptors/urn:uuid:51b1cd81-d03b-441d-a7c2-41ef9d789199", - "host": [ - "{{registryUrl}}" - ], - "path": [ - "registry", - "registry", - "shell-descriptors", - "urn:uuid:51b1cd81-d03b-441d-a7c2-41ef9d789199" - ] - } - }, - "response": [] - }, - { - "name": "2. /registry/shell-descriptors/{id} - Get Digital Twin By Id", - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "{{registryUrl}}/registry/registry/shell-descriptors/{{digitalTwinId}}", - "host": [ - "{{registryUrl}}" - ], - "path": [ - "registry", - "registry", - "shell-descriptors", - "{{digitalTwinId}}" - ] - } - }, - "response": [] - }, - { - "name": "3. Get specific submodel descripter", - "protocolProfileBehavior": { - "disableBodyPruning": true - }, - "request": { - "method": "GET", - "header": [], - "body": { - "mode": "raw", - "raw": "", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{registryUrl}}/registry/registry/shell-descriptors/{{digitalTwinId}}/submodel-descriptors/{{digitalTwinSubmodelId}}", - "host": [ - "{{registryUrl}}" - ], - "path": [ - "registry", - "registry", - "shell-descriptors", - "{{digitalTwinId}}", - "submodel-descriptors", - "{{digitalTwinSubmodelId}}" - ], - "query": [ - { - "key": "", - "value": "", - "disabled": true - } - ] - } - }, - "response": [] - } - ] - }, - { - "name": "Data transfer", - "item": [ - { - "name": "1. Get contract offer catalog", - "protocolProfileBehavior": { - "disabledSystemHeaders": {} - }, - "request": { - "auth": { - "type": "apikey", - "apikey": [ - { - "key": "value", - "value": "{{APIKey}}", - "type": "string" - }, - { - "key": "key", - "value": "X-Api-Key", - "type": "string" - } - ] - }, - "method": "GET", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "type": "default" - } - ], - "url": { - "raw": "{{BETAServer}}/consumer/data/catalog?providerUrl=https://materialpass.beta.demo.catena-x.net/BPNL000000000000/api/v1/ids/data", - "host": [ - "{{BETAServer}}" - ], - "path": [ - "consumer", - "data", - "catalog" - ], - "query": [ - { - "key": "providerUrl", - "value": "https://materialpass.beta.demo.catena-x.net/BPNL000000000000/api/v1/ids/data" - } - ] - } - }, - "response": [] - }, - { - "name": "2. Negotiate Contract", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "const jsonResponse = pm.response.json();\r", - "pm.collectionVariables.set(\"negotiationId\", jsonResponse.id);" - ], - "type": "text/javascript" - } - }, - { - "listen": "prerequest", - "script": { - "exec": [ - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "apikey", - "apikey": [ - { - "key": "value", - "value": "{{APIKey}}", - "type": "string" - }, - { - "key": "key", - "value": "X-Api-Key", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "type": "default" - } - ], - "body": { - "mode": "raw", - "raw": "{\r\n \"connectorId\": \"foo\",\r\n \"connectorAddress\": \"{{BETAServer}}/BPNL000000000000/api/v1/ids/data\",\r\n \"offer\": {\r\n \"offerId\": \"300:66bd0148-78ab-4247-b09e-68fc1b98bcb5\",\r\n \"assetId\": \"{{assetId}}\",\r\n \"policy\": {\r\n \"uid\": null,\r\n \"prohibitions\": [],\r\n \"obligations\": [],\r\n \"permissions\": [\r\n {\r\n \"edctype\": \"dataspaceconnector:permission\",\r\n \"action\": {\r\n \"type\": \"USE\"\r\n },\r\n \"target\": \"{{assetId}}\",\r\n \"constraints\": []\r\n }\r\n ]\r\n }\r\n }\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{BETAServer}}/consumer/data/contractnegotiations", - "host": [ - "{{BETAServer}}" - ], - "path": [ - "consumer", - "data", - "contractnegotiations" - ] - } - }, - "response": [] - }, - { - "name": "2.1 Get Negotiations", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "const jsonResponse = pm.response.json();\r", - "pm.collectionVariables.set(\"contractAgreementId\", jsonResponse.contractAgreementId);" - ], - "type": "text/javascript" - } - }, - { - "listen": "prerequest", - "script": { - "exec": [ - "" - ], - "type": "text/javascript" - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - }, - "request": { - "auth": { - "type": "apikey", - "apikey": [ - { - "key": "value", - "value": "{{APIKey}}", - "type": "string" - }, - { - "key": "key", - "value": "X-Api-Key", - "type": "string" - } - ] - }, - "method": "GET", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "type": "default" - } - ], - "body": { - "mode": "raw", - "raw": "", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{BETAServer}}/consumer/data/contractnegotiations/{{negotiationId}}", - "host": [ - "{{BETAServer}}" - ], - "path": [ - "consumer", - "data", - "contractnegotiations", - "{{negotiationId}}" - ] - } - }, - "response": [] - }, - { - "name": "3. Transfer data", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "const jsonResponse = pm.response.json();\r", - "pm.collectionVariables.set(\"transferId\", jsonResponse.id);" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "apikey", - "apikey": [ - { - "key": "value", - "value": "{{APIKey}}", - "type": "string" - }, - { - "key": "key", - "value": "X-Api-Key", - "type": "string" - } - ] - }, - "method": "POST", - "header": [], - "body": { - "mode": "raw", - "raw": "{\r\n \"id\": \"{{transferProcessId}}\",\r\n \"connectorId\": \"foo\",\r\n \"connectorAddress\": \"{{BETAServer}}/BPNL000000000000/api/v1/ids/data\",\r\n \"contractId\": \"{{contractAgreementId}}\",\r\n \"assetId\": \"{{assetId}}\",\r\n \"managedResources\": \"false\",\r\n \"dataDestination\": {\r\n \"type\": \"HttpProxy\"\r\n }\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{BETAServer}}/consumer/data/transferprocess", - "host": [ - "{{BETAServer}}" - ], - "path": [ - "consumer", - "data", - "transferprocess" - ] - } - }, - "response": [] - }, - { - "name": "3.1 Verify data transfer", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "apikey", - "apikey": [ - { - "key": "value", - "value": "{{APIKey}}", - "type": "string" - }, - { - "key": "key", - "value": "X-Api-Key", - "type": "string" - } - ] - }, - "method": "GET", - "header": [], - "url": { - "raw": "{{BETAServer}}/consumer/data/transferprocess/{{transferId}}", - "host": [ - "{{BETAServer}}" - ], - "path": [ - "consumer", - "data", - "transferprocess", - "{{transferId}}" - ] - } - }, - "response": [] - }, - { - "name": "4. Get data from backend", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "// generate unique transfer process Id for every call\r", - "var transferProcessId = pm.collectionVariables.get(\"transferProcessId\");\r", - "console.info(\"Transfer Process Id: \"+ pm.collectionVariables.get(\"transferProcessId\"))" - ], - "type": "text/javascript" - } - } - ], - "protocolProfileBehavior": { - "disabledSystemHeaders": {} - }, - "request": { - "auth": { - "type": "noauth" - }, - "method": "GET", - "header": [ - { - "key": "Accept", - "value": "application/octet-stream", - "type": "default" - } - ], - "url": { - "raw": "{{BETAServer}}/consumer_backend/{{transferProcessId}}", - "host": [ - "{{BETAServer}}" - ], - "path": [ - "consumer_backend", - "{{transferProcessId}}" - ] - } - }, - "response": [] - } - ] - } - ] - } - ], - "auth": { - "type": "oauth2", - "oauth2": [ - { - "key": "accessTokenUrl", - "value": "https://centralidp.beta.demo.catena-x.net/auth/realms/CX-Central/protocol/openid-connect/token", - "type": "string" - }, - { - "key": "grant_type", - "value": "client_credentials", - "type": "string" - }, - { - "key": "useBrowser", - "value": false, - "type": "boolean" - }, - { - "key": "redirect_uri", - "value": "http://localhost:8080", - "type": "string" - }, - { - "key": "clientSecret", - "value": "{{clientSecret}}", - "type": "string" - }, - { - "key": "clientId", - "value": "{{clientId}}", - "type": "string" - }, - { - "key": "scope", - "value": "openid profile email", - "type": "string" - }, - { - "key": "challengeAlgorithm", - "value": "S256", - "type": "string" - }, - { - "key": "authUrl", - "value": "https://centralidp.demo.catena-x.net/auth/realms/CX-Central/protocol/openid-connect/auth", - "type": "string" - }, - { - "key": "addTokenTo", - "value": "header", - "type": "string" - }, - { - "key": "client_authentication", - "value": "header", - "type": "string" - } - ] - }, - "event": [ - { - "listen": "prerequest", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } - }, - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } - } - ], - "variable": [ - { - "key": "digitalTwinId", - "value": "urn:uuid:32aa72de-297a-4405-9148-13e12744028a", - "type": "default" - }, - { - "key": "digitalTwinSubmodelId", - "value": "urn:uuid:699f1245-f57e-4d6b-acdb-ab763665554a", - "type": "default" - }, - { - "key": "edcPolicyId", - "value": "ad8d2c57-cf32-409c-96a8-be59675b6ae5", - "type": "default" - }, - { - "key": "registryUrl", - "value": "https://semantics.beta.demo.catena-x.net", - "type": "default" - }, - { - "key": "clientId", - "value": "", - "type": "default" - }, - { - "key": "clientSecret", - "value": "", - "type": "default" - }, - { - "key": "APIKey", - "value": "", - "type": "default" - }, - { - "key": "INTServer", - "value": "", - "type": "default" - }, - { - "key": "BETAServer", - "value": "" - }, - { - "key": "negotiationId", - "value": "", - "type": "default" - }, - { - "key": "transferId", - "value": "", - "type": "default" - }, - { - "key": "contractAgreementId", - "value": "", - "type": "default" - }, - { - "key": "transferProcessId", - "value": "", - "type": "default" - }, - { - "key": "assetId", - "value": "urn:uuid:32aa72de-297a-4405-9148-13e12744028a-urn:uuid:699f1245-f57e-4d6b-acdb-ab763665554a", - "type": "default" - }, - { - "key": "policyId", - "value": "ad8d2c57-cf32-409c-96a8-be59675b6ae5", - "type": "default" - }, - { - "key": "contractDefinitionId", - "value": "300", - "type": "default" - }, - { - "key": "partInstanceId", - "value": "X123456789012X12345678901234566", - "type": "default" - } - ] -} \ No newline at end of file diff --git a/postman/v3.0.1/Battery-Pass_DEV.postman_collection.json b/postman/v3.0.1/Battery-Pass_DEV.postman_collection.json deleted file mode 100644 index e9110396a..000000000 --- a/postman/v3.0.1/Battery-Pass_DEV.postman_collection.json +++ /dev/null @@ -1,1124 +0,0 @@ -{ - "info": { - "_postman_id": "6f31deff-c300-4abd-88d9-1c042952e996", - "name": "Battery-Pass_DEV", - "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" - }, - "item": [ - { - "name": "Provider", - "item": [ - { - "name": "1. Create sample data", - "protocolProfileBehavior": { - "disabledSystemHeaders": {} - }, - "request": { - "auth": { - "type": "noauth" - }, - "method": "POST", - "header": [ - { - "key": "Accept", - "value": "application/octet-stream", - "type": "default", - "disabled": true - } - ], - "body": { - "mode": "raw", - "raw": "{\r\n \"electrochemicalProperties\": {\r\n \"ratedCapacity\": 200,\r\n \"batteryEnergy\": {\r\n \"energyRoundtripEfficiencyChange\": 80,\r\n \"maximumAllowedBatteryEnergy\": 60000.0,\r\n \"energyRoundtripEfficiency\": 48\r\n },\r\n \"ratioMaximumAllowedBatteryPowerAndMaximumAllowedBatteryEnergy\": 0.833,\r\n \"batteryVoltage\": {\r\n \"nominalVoltage\": 3.6,\r\n \"maxVoltage\": 4.2,\r\n \"minVoltage\": 2.5\r\n },\r\n \"internalResistance\": {\r\n \"cellInternalResistance\": 0.3,\r\n \"packInternalResistanceIncrease\": 0.21,\r\n \"packInternalResistance\": 53\r\n },\r\n \"capacityThresholdExhaustion\": 20,\r\n \"batteryPower\": {\r\n \"originalPowerCapability\": 150,\r\n \"powerFade\": 12.1,\r\n \"originalPowerCapabilityLimits\": 734.8,\r\n \"maximumAllowedBatteryPower\": 100000,\r\n \"powerCapabilityAt20Charge\": 500000,\r\n \"originalPower\": 40000,\r\n \"powerCapabilityAt80Charge\": 120000\r\n },\r\n \"capacityFade\": 1.5\r\n },\r\n \"document\": {\r\n \"responsibleSourcing\": [\r\n {\r\n \"title\": \"Responsible Sourcing Report 2021\",\r\n \"fileLocation\": \"telnet://192.0.2.16:80/\"\r\n }\r\n ],\r\n \"packagingInstructions\": [\r\n {\r\n \"title\": \"Packing Instruction for Lithium cells and batteries\",\r\n \"fileLocation\": \"telnet://192.0.2.16:80/\"\r\n }\r\n ],\r\n \"transportationInstructions\": [\r\n {\r\n \"title\": \"Shipping guidelines\",\r\n \"fileLocation\": \"ftp://ftp.is.co.za/rfc/rfc1808.txt\"\r\n }\r\n ],\r\n \"vehicleDismantlingProcedure\": [\r\n {\r\n \"title\": \"Dissmantling procedure of battery from the car\",\r\n \"fileLocation\": \"http://www.ietf.org/rfc/rfc2396.txt\"\r\n }\r\n ],\r\n \"testReportsResults\": [\r\n {\r\n \"title\": \"Laboratory Test Results for Battery ID no: X123456789012X12345678901234566\",\r\n \"fileLocation\": \"\"\r\n }\r\n ],\r\n \"batteryDismantlingProcedure\": [\r\n {\r\n \"title\": \"Dismantling Procedure for Battery Model: Li-Ion X-series\",\r\n \"fileLocation\": \"http://www.wikipedia.org\"\r\n }\r\n ],\r\n \"safetyMeasures\": [\r\n {\r\n \"title\": \"Lithium battery safety document\",\r\n \"fileLocation\": \"ftp://ftp.is.co.za/rfc/rfc1808.txt\"\r\n }\r\n ],\r\n \"declarationOfConformity\": [\r\n {\r\n \"title\": \"Declaration of Conformity No. 1\",\r\n \"fileLocation\": \"\"\r\n }\r\n ]\r\n },\r\n \"datePlacedOnMarket\": \"27.02.2022\",\r\n \"cellChemistry\": {\r\n \"electrolyteComposition\": [\r\n {\r\n \"matierialPercentageMassFraction\": null,\r\n \"matierialWeight\": null,\r\n \"materialName\": \"Ethylene Carbonate\"\r\n }\r\n ],\r\n \"anodeCompositionOther\": [\r\n {\r\n \"matierialPercentageMassFraction\": null,\r\n \"matierialWeight\": null,\r\n \"materialName\": \"Polyacrylic acid\"\r\n }\r\n ],\r\n \"recyclateContentActiveMaterials\": [\r\n {\r\n \"matierialPercentageMassFraction\": 4,\r\n \"matierialWeight\": null,\r\n \"materialName\": \"Ni/2021/PlantA\"\r\n },\r\n {\r\n \"matierialPercentageMassFraction\": 4,\r\n \"matierialWeight\": null,\r\n \"materialName\": \"Li/2021/PlantA\"\r\n },\r\n {\r\n \"matierialPercentageMassFraction\": 0,\r\n \"matierialWeight\": null,\r\n \"materialName\": \"Pb(battery model does not contain Pb)\"\r\n },\r\n {\r\n \"matierialPercentageMassFraction\": 12,\r\n \"matierialWeight\": null,\r\n \"materialName\": \"Co/2021/PlantA\"\r\n }\r\n ],\r\n \"anodeActiveMaterials\": [\r\n {\r\n \"matierialPercentageMassFraction\": null,\r\n \"matierialWeight\": null,\r\n \"materialName\": \"Graphite\"\r\n }\r\n ],\r\n \"cathodeActiveMaterials\": [\r\n {\r\n \"matierialPercentageMassFraction\": null,\r\n \"matierialWeight\": null,\r\n \"materialName\": \"(NCM)Lithium nickel cobalt manganese oxide\"\r\n }\r\n ],\r\n \"cathodeCompositionOther\": [\r\n {\r\n \"matierialPercentageMassFraction\": null,\r\n \"matierialWeight\": null,\r\n \"materialName\": \"carbon black, PVDR\"\r\n }\r\n ]\r\n },\r\n \"physicalDimensions\": {\r\n \"length\": 1500,\r\n \"width\": 1000,\r\n \"weight\": 1500,\r\n \"diameter\": null,\r\n \"height\": 50\r\n },\r\n \"temperatureRangeIdleState\": {\r\n \"temperatureRangeIdleStateUpperLimit\": 50,\r\n \"temperatureRangeIdleStateLowerLimit\": -20\r\n },\r\n \"batteryCycleLife\": {\r\n \"cycleLifeTestCRate\": 90,\r\n \"cycleLifeTestDepthOfDischarge\": 67,\r\n \"expectedLifetime\": 2800\r\n },\r\n \"manufacturer\": {\r\n \"name\": \"CompanyA\",\r\n \"contact\": {\r\n \"faxNumber\": \"+49 89 0987654322\",\r\n \"website\": \"http://www.CompanyA.com\",\r\n \"phoneNumber\": \"+49 89 1234567891\",\r\n \"email\": \"companyA@company.com\"\r\n },\r\n \"address\": {\r\n \"locality\": {\r\n \"value\": \"CityA\",\r\n \"technicalKey\": \"BLOCK\"\r\n },\r\n \"country\": {\r\n \"shortName\": \"Germany\"\r\n },\r\n \"postCode\": {\r\n \"value\": \"65-250A\",\r\n \"technicalKey\": \"CEDEX\"\r\n },\r\n \"thoroughfare\": {\r\n \"value\": \"StreetA\",\r\n \"number\": \"1\",\r\n \"technicalKey\": \"STREET\"\r\n },\r\n \"premise\": {\r\n \"value\": \"\",\r\n \"technicalKey\": \"CEDEX\"\r\n },\r\n \"postalDeliveryPoint\": {\r\n \"value\": \"Tor 1\",\r\n \"technicalKey\": \"INTERURBAN_DELIVERY_POINT\"\r\n }\r\n }\r\n },\r\n \"warrantyPeriod\": 96,\r\n \"composition\": {\r\n \"compositionOfBattery\": [\r\n {\r\n \"matierialPercentageMassFraction\": null,\r\n \"matierialWeight\": null,\r\n \"materialName\": \"current collector: Cupper, Separator: PP, Casing: Aluminium\"\r\n }\r\n ],\r\n \"criticalRawMaterials\": \"Lithium, Bauxite, Natural graphite\",\r\n \"components\": {\r\n \"componentsPartNumber\": \"Battery Management Unit Model: 75345\",\r\n \"componentsSupplier\": [\r\n {\r\n \"address\": {\r\n \"locality\": {\r\n \"value\": \"CityB\",\r\n \"technicalKey\": \"BLOCK\"\r\n },\r\n \"country\": {\r\n \"shortName\": \"Germany\"\r\n },\r\n \"postCode\": {\r\n \"value\": \"65-250B\",\r\n \"technicalKey\": \"CEDEX\"\r\n },\r\n \"thoroughfare\": {\r\n \"value\": \"StreetB\",\r\n \"number\": \"1\",\r\n \"technicalKey\": \"STREET\"\r\n },\r\n \"premise\": {\r\n \"value\": \"PlantB\",\r\n \"technicalKey\": \"BUILDING\"\r\n },\r\n \"postalDeliveryPoint\": {\r\n \"value\": \"GateB\",\r\n \"technicalKey\": \"INTERURBAN_DELIVERY_POINT\"\r\n }\r\n },\r\n \"contact\": {\r\n \"faxNumber\": \"+49 89 0987654322\",\r\n \"website\": \"https://www.companyB.com\",\r\n \"phoneNumber\": \"+49 89 1234567890\",\r\n \"email\": \"companyB@company.com\"\r\n }\r\n }\r\n ]\r\n }\r\n },\r\n \"manufacturing\": {\r\n \"dateOfManufacturing\": \"2022-01-24\",\r\n \"address\": {\r\n \"locality\": {\r\n \"value\": \"CityA\",\r\n \"technicalKey\": \"BLOCK\"\r\n },\r\n \"country\": {\r\n \"shortName\": \"Germany\"\r\n },\r\n \"postCode\": {\r\n \"value\": \"65-250A\",\r\n \"technicalKey\": \"CEDEX\"\r\n },\r\n \"thoroughfare\": {\r\n \"value\": \"StreetA\",\r\n \"number\": \"1\",\r\n \"technicalKey\": \"STREET\"\r\n },\r\n \"premise\": {\r\n \"value\": \"PlantA\",\r\n \"technicalKey\": \"BUILDING\"\r\n },\r\n \"postalDeliveryPoint\": {\r\n \"value\": \"GateA\",\r\n \"technicalKey\": \"INTERURBAN_DELIVERY_POINT\"\r\n }\r\n }\r\n },\r\n \"batteryIdentification\": {\r\n \"batteryType\": \"LiNMC\",\r\n \"batteryIDDMCCode\": \"X123456789012X12345678901234566\",\r\n \"batteryModel\": \"Li-Ion X-series\"\r\n },\r\n \"stateOfBattery\": {\r\n \"stateOfHealth\": 100,\r\n \"statusBattery\": \"first life\",\r\n \"stateOfCharge\": 99\r\n },\r\n \"cO2FootprintTotal\": 3120\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{DEVServer}}/provider_backend/data/{{digitalTwinId}}-{{digitalTwinSubmodelId}}", - "host": [ - "{{DEVServer}}" - ], - "path": [ - "provider_backend", - "data", - "{{digitalTwinId}}-{{digitalTwinSubmodelId}}" - ] - } - }, - "response": [] - }, - { - "name": "1.1 Get sample data", - "protocolProfileBehavior": { - "disabledSystemHeaders": {} - }, - "request": { - "auth": { - "type": "noauth" - }, - "method": "GET", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "type": "default" - }, - { - "key": "Accept", - "value": "application/octet-stream", - "type": "default" - } - ], - "url": { - "raw": "{{DEVServer}}/provider_backend/data/{{digitalTwinId}}-{{digitalTwinSubmodelId}}", - "host": [ - "{{DEVServer}}" - ], - "path": [ - "provider_backend", - "data", - "{{digitalTwinId}}-{{digitalTwinSubmodelId}}" - ] - } - }, - "response": [] - }, - { - "name": "2. Register assets", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "apikey", - "apikey": [ - { - "key": "value", - "value": "{{APIKey}}", - "type": "string" - }, - { - "key": "key", - "value": "X-Api-Key", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "type": "default" - } - ], - "body": { - "mode": "raw", - "raw": "{\r\n \"asset\": {\r\n \"properties\": {\r\n \"asset:prop:id\": \"{{assetId}}\",\r\n \"asset:prop:description\": \"Battery Passport test data\"\r\n }\r\n },\r\n \"dataAddress\": {\r\n \"properties\": {\r\n \"type\": \"HttpData\",\r\n \"baseUrl\": \"{{DEVServer}}/provider_backend/data/{{digitalTwinId}}-{{digitalTwinSubmodelId}}\"\r\n }\r\n }\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{DEVServer}}/BPNL000000000000/data/assets", - "host": [ - "{{DEVServer}}" - ], - "path": [ - "BPNL000000000000", - "data", - "assets" - ] - } - }, - "response": [] - }, - { - "name": "2.1 Get assets", - "request": { - "auth": { - "type": "apikey", - "apikey": [ - { - "key": "value", - "value": "{{APIKey}}", - "type": "string" - }, - { - "key": "key", - "value": "X-Api-Key", - "type": "string" - } - ] - }, - "method": "GET", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "type": "default" - } - ], - "url": { - "raw": "{{DEVServer}}/BPNL000000000000/data/assets", - "host": [ - "{{DEVServer}}" - ], - "path": [ - "BPNL000000000000", - "data", - "assets" - ] - } - }, - "response": [] - }, - { - "name": "3. Register policy", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "apikey", - "apikey": [ - { - "key": "value", - "value": "{{APIKey}}", - "type": "string" - }, - { - "key": "key", - "value": "X-Api-Key", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "type": "default" - } - ], - "body": { - "mode": "raw", - "raw": "{\r\n \"id\": \"{{policyId}}\",\r\n \"policy\": {\r\n \"prohibitions\": [],\r\n \"obligations\": [],\r\n \"permissions\": [\r\n {\r\n \"edctype\": \"dataspaceconnector:permission\",\r\n \"action\": {\r\n \"type\": \"USE\"\r\n },\r\n \"constraints\": []\r\n }\r\n ]\r\n }\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{DEVServer}}/BPNL000000000000/data/policydefinitions", - "host": [ - "{{DEVServer}}" - ], - "path": [ - "BPNL000000000000", - "data", - "policydefinitions" - ] - } - }, - "response": [] - }, - { - "name": "3.1 Get policy", - "request": { - "auth": { - "type": "apikey", - "apikey": [ - { - "key": "value", - "value": "{{APIKey}}", - "type": "string" - }, - { - "key": "key", - "value": "X-Api-Key", - "type": "string" - } - ] - }, - "method": "GET", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "type": "default" - } - ], - "url": { - "raw": "{{DEVServer}}/BPNL000000000000/data/policydefinitions", - "host": [ - "{{DEVServer}}" - ], - "path": [ - "BPNL000000000000", - "data", - "policydefinitions" - ] - } - }, - "response": [] - }, - { - "name": "4. Register contract definitions", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "apikey", - "apikey": [ - { - "key": "value", - "value": "{{APIKey}}", - "type": "string" - }, - { - "key": "key", - "value": "X-Api-Key", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "type": "default" - } - ], - "body": { - "mode": "raw", - "raw": "{\r\n \"id\": \"{{contractDefinitionId}}\",\r\n \"criteria\": [\r\n {\r\n \"operandLeft\": \"asset:prop:id\",\r\n \"operator\": \"=\",\r\n \"operandRight\": \"{{assetId}}\"\r\n }\r\n ],\r\n \"accessPolicyId\": \"{{policyId}}\",\r\n \"contractPolicyId\": \"{{policyId}}\"\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{DEVServer}}/BPNL000000000000/data/contractdefinitions", - "host": [ - "{{DEVServer}}" - ], - "path": [ - "BPNL000000000000", - "data", - "contractdefinitions" - ] - } - }, - "response": [] - }, - { - "name": "4.1 Get contract definitions", - "request": { - "auth": { - "type": "apikey", - "apikey": [ - { - "key": "value", - "value": "{{APIKey}}", - "type": "string" - }, - { - "key": "key", - "value": "X-Api-Key", - "type": "string" - } - ] - }, - "method": "GET", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "type": "default" - } - ], - "url": { - "raw": "{{DEVServer}}/BPNL000000000000/data/contractdefinitions", - "host": [ - "{{DEVServer}}" - ], - "path": [ - "BPNL000000000000", - "data", - "contractdefinitions" - ] - } - }, - "response": [] - }, - { - "name": "5. Register Digital Twin to registry", - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "type": "default" - } - ], - "body": { - "mode": "raw", - "raw": "{\r\n \"description\": [],\r\n \"globalAssetId\": {\r\n \"value\": [\r\n \"urn:uuid:32aa72de-297a-4405-9148-13e12744028a\"\r\n ]\r\n },\r\n \"idShort\": \"Battery_X123456789012X12345678901234566\",\r\n \"identification\": \"urn:uuid:32aa72de-297a-4405-9148-13e12744028a\",\r\n \"specificAssetIds\": [\r\n {\r\n \"key\": \"partInstanceId\",\r\n \"value\": \"X123456789012X12345678901234566\"\r\n }\r\n ],\r\n \"submodelDescriptors\": [\r\n {\r\n \"description\": [\r\n {\r\n \"language\": \"en\",\r\n \"text\": \"Battery Passport Submodel\"\r\n }\r\n ],\r\n \"idShort\": \"batteryPass\",\r\n \"identification\": \"urn:uuid:699f1245-f57e-4d6b-acdb-ab763665554a\",\r\n \"semanticId\": {\r\n \"value\": [\r\n \"urn:bamm:io.catenax.battery.battery_pass:3.0.1#BatteryPass\"\r\n ]\r\n },\r\n \"endpoints\": [\r\n {\r\n \"interface\": \"EDC\",\r\n \"protocolInformation\": {\r\n \"endpointAddress\": \"{{DEVServer}}/BPNL000000000000/urn:uuid:32aa72de-297a-4405-9148-13e12744028a-urn:uuid:699f1245-f57e-4d6b-acdb-ab763665554a/submodel?content=value&extent=WithBLOBValue\",\r\n \"endpointProtocol\": \"IDS/ECLIPSE DATASPACE CONNECTOR\",\r\n \"endpointProtocolVersion\": \"0.0.1-SNAPSHOT\"\r\n }\r\n }\r\n ]\r\n }\r\n ]\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{registryUrl}}/registry/registry/shell-descriptors", - "host": [ - "{{registryUrl}}" - ], - "path": [ - "registry", - "registry", - "shell-descriptors" - ] - } - }, - "response": [] - }, - { - "name": "5.1 Get Digital Twin by Id from registry", - "request": { - "method": "GET", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "type": "default" - } - ], - "url": { - "raw": "{{registryUrl}}/registry/registry/shell-descriptors?pageSize=100", - "host": [ - "{{registryUrl}}" - ], - "path": [ - "registry", - "registry", - "shell-descriptors" - ], - "query": [ - { - "key": "pageSize", - "value": "100" - } - ] - } - }, - "response": [] - } - ] - }, - { - "name": "Consumer", - "item": [ - { - "name": "CX Registry", - "item": [ - { - "name": "1. /lookup/shells - Query Digital Twin", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "const jsonResponse = pm.response.json();\r", - "pm.collectionVariables.set(\"digitalTwinId\", jsonResponse[0]);" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "{{registryUrl}}/registry/lookup/shells?assetIds=[\"{\\\"key\\\": \\\"partInstanceId\\\", \\\"value\\\": \\\"X123456789012X12345678901234566\\\"}\"]", - "host": [ - "{{registryUrl}}" - ], - "path": [ - "registry", - "lookup", - "shells" - ], - "query": [ - { - "key": "assetIds", - "value": "[\"{\\\"key\\\": \\\"partInstanceId\\\", \\\"value\\\": \\\"X123456789012X12345678901234566\\\"}\"]" - } - ] - } - }, - "response": [] - }, - { - "name": "1. /lookup/shells - Delete DT", - "request": { - "method": "DELETE", - "header": [], - "url": { - "raw": "{{registryUrl}}/registry/registry/shell-descriptors/urn:uuid:1e4b62e8-dc0d-4327-9ece-fd333cea06d8", - "host": [ - "{{registryUrl}}" - ], - "path": [ - "registry", - "registry", - "shell-descriptors", - "urn:uuid:1e4b62e8-dc0d-4327-9ece-fd333cea06d8" - ] - } - }, - "response": [] - }, - { - "name": "2. /registry/shell-descriptors/{id} - Get Digital Twin By Id", - "protocolProfileBehavior": { - "disableBodyPruning": true - }, - "request": { - "method": "GET", - "header": [], - "body": { - "mode": "raw", - "raw": "{\r\n \"description\": [],\r\n \"globalAssetId\": {\r\n \"value\": [\r\n \"urn:uuid:51b1cd81-d03b-441d-a7c2-41ef9d789199\"\r\n ]\r\n },\r\n \"idShort\": \"Battery_IMR18650V1\",\r\n \"identification\": \"urn:uuid:51b1cd81-d03b-441d-a7c2-41ef9d789199\",\r\n \"specificAssetIds\": [\r\n {\r\n \"key\": \"partInstanceId\",\r\n \"value\": \"IMR18650V1\"\r\n }\r\n ],\r\n \"submodelDescriptors\": [\r\n {\r\n \"description\": [\r\n {\r\n \"language\": \"en\",\r\n \"text\": \"Battery Passport Submodel\"\r\n }\r\n ],\r\n \"idShort\": \"batteryPass\",\r\n \"identification\": \"urn:uuid:10d094e0-aecc-4e84-b937-a1d606112cdd\",\r\n \"semanticId\": {\r\n \"value\": [\r\n \"urn:bamm:io.catenax.battery.battery_pass:3.0.1#BatteryPass\"\r\n ]\r\n },\r\n \"endpoints\": [\r\n {\r\n \"interface\": \"EDC\",\r\n \"protocolInformation\": {\r\n \"endpointAddress\": \"https://materialpass.dev.demo.catena-x.net/provider/api/v1/ids/data\",\r\n \"endpointProtocol\": \"IDS/ECLIPSE DATASPACE CONNECTOR\",\r\n \"endpointProtocolVersion\": \"0.0.1-SNAPSHOT\"\r\n }\r\n }\r\n ]\r\n }\r\n ]\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{registryUrl}}/registry/registry/shell-descriptors/{{digitalTwinId}}", - "host": [ - "{{registryUrl}}" - ], - "path": [ - "registry", - "registry", - "shell-descriptors", - "{{digitalTwinId}}" - ] - } - }, - "response": [] - }, - { - "name": "3. Get specific submodel descripter", - "protocolProfileBehavior": { - "disableBodyPruning": true - }, - "request": { - "method": "GET", - "header": [], - "body": { - "mode": "raw", - "raw": "", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{registryUrl}}/registry/registry/shell-descriptors/{{digitalTwinId}}/submodel-descriptors/{{digitalTwinSubmodelId}}", - "host": [ - "{{registryUrl}}" - ], - "path": [ - "registry", - "registry", - "shell-descriptors", - "{{digitalTwinId}}", - "submodel-descriptors", - "{{digitalTwinSubmodelId}}" - ], - "query": [ - { - "key": "", - "value": "", - "disabled": true - } - ] - } - }, - "response": [] - } - ] - }, - { - "name": "Data transfer", - "item": [ - { - "name": "1. Get contract offer catalog", - "protocolProfileBehavior": { - "disableBodyPruning": true, - "disabledSystemHeaders": {} - }, - "request": { - "auth": { - "type": "apikey", - "apikey": [ - { - "key": "value", - "value": "{{APIKey}}", - "type": "string" - }, - { - "key": "key", - "value": "X-Api-Key", - "type": "string" - } - ] - }, - "method": "GET", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "type": "default" - } - ], - "body": { - "mode": "formdata", - "formdata": [], - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{DEVServer}}/consumer/data/catalog?providerUrl=https://materialpass.dev.demo.catena-x.net/BPNL000000000000/api/v1/ids/data", - "host": [ - "{{DEVServer}}" - ], - "path": [ - "consumer", - "data", - "catalog" - ], - "query": [ - { - "key": "providerUrl", - "value": "https://materialpass.dev.demo.catena-x.net/BPNL000000000000/api/v1/ids/data" - } - ] - } - }, - "response": [] - }, - { - "name": "2. Negotiate Contract", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "const jsonResponse = pm.response.json();\r", - "pm.collectionVariables.set(\"negotiationId\", jsonResponse.id);" - ], - "type": "text/javascript" - } - }, - { - "listen": "prerequest", - "script": { - "exec": [ - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "apikey", - "apikey": [ - { - "key": "value", - "value": "{{APIKey}}", - "type": "string" - }, - { - "key": "key", - "value": "X-Api-Key", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "type": "default" - } - ], - "body": { - "mode": "raw", - "raw": "{\r\n \"connectorId\": \"foo\",\r\n \"connectorAddress\": \"{{DEVServer}}/BPNL000000000000/api/v1/ids/data\",\r\n \"offer\": {\r\n \"offerId\": \"300:fe0ed727-617b-4c24-93b3-31ef29d69ff2\",\r\n \"assetId\": \"{{assetId}}\",\r\n \"policy\": {\r\n \"uid\": null,\r\n \"prohibitions\": [],\r\n \"obligations\": [],\r\n \"permissions\": [\r\n {\r\n \"edctype\": \"dataspaceconnector:permission\",\r\n \"action\": {\r\n \"type\": \"USE\"\r\n },\r\n \"target\": \"{{assetId}}\",\r\n \"constraints\": []\r\n }\r\n ]\r\n }\r\n }\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{DEVServer}}/consumer/data/contractnegotiations", - "host": [ - "{{DEVServer}}" - ], - "path": [ - "consumer", - "data", - "contractnegotiations" - ] - } - }, - "response": [] - }, - { - "name": "2.1 Get Negotiations", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "const jsonResponse = pm.response.json();\r", - "pm.collectionVariables.set(\"contractAgreementId\", jsonResponse.contractAgreementId);" - ], - "type": "text/javascript" - } - }, - { - "listen": "prerequest", - "script": { - "exec": [ - "" - ], - "type": "text/javascript" - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - }, - "request": { - "auth": { - "type": "apikey", - "apikey": [ - { - "key": "value", - "value": "{{APIKey}}", - "type": "string" - }, - { - "key": "key", - "value": "X-Api-Key", - "type": "string" - } - ] - }, - "method": "GET", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "type": "default" - } - ], - "body": { - "mode": "raw", - "raw": "", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{DEVServer}}/consumer/data/contractnegotiations/{{negotiationId}}", - "host": [ - "{{DEVServer}}" - ], - "path": [ - "consumer", - "data", - "contractnegotiations", - "{{negotiationId}}" - ] - } - }, - "response": [] - }, - { - "name": "3. Transfer data", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "const jsonResponse = pm.response.json();\r", - "pm.collectionVariables.set(\"transferId\", jsonResponse.id);" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "apikey", - "apikey": [ - { - "key": "value", - "value": "{{APIKey}}", - "type": "string" - }, - { - "key": "key", - "value": "X-Api-Key", - "type": "string" - } - ] - }, - "method": "POST", - "header": [], - "body": { - "mode": "raw", - "raw": "{\r\n \"id\": \"{{transferProcessId}}\",\r\n \"connectorId\": \"foo\",\r\n \"connectorAddress\": \"{{DEVServer}}/BPNL000000000000/api/v1/ids/data\",\r\n \"contractId\": \"{{contractAgreementId}}\",\r\n \"assetId\": \"{{assetId}}\",\r\n \"managedResources\": \"false\",\r\n \"dataDestination\": {\r\n \"type\": \"HttpProxy\"\r\n }\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{DEVServer}}/consumer/data/transferprocess", - "host": [ - "{{DEVServer}}" - ], - "path": [ - "consumer", - "data", - "transferprocess" - ] - } - }, - "response": [] - }, - { - "name": "3.1 Verify data transfer", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "apikey", - "apikey": [ - { - "key": "value", - "value": "{{APIKey}}", - "type": "string" - }, - { - "key": "key", - "value": "X-Api-Key", - "type": "string" - } - ] - }, - "method": "GET", - "header": [], - "url": { - "raw": "{{DEVServer}}/consumer/data/transferprocess/{{transferId}}", - "host": [ - "{{DEVServer}}" - ], - "path": [ - "consumer", - "data", - "transferprocess", - "{{transferId}}" - ] - } - }, - "response": [] - }, - { - "name": "4. Get data from backend", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "// generate unique transfer process Id for every call\r", - "var transferProcessId = pm.collectionVariables.get(\"transferProcessId\");\r", - "console.info(\"Transfer Process Id: \"+ pm.collectionVariables.get(\"transferProcessId\"))" - ], - "type": "text/javascript" - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true, - "disabledSystemHeaders": {} - }, - "request": { - "auth": { - "type": "noauth" - }, - "method": "GET", - "header": [ - { - "key": "Accept", - "value": "application/octet-stream", - "type": "default" - } - ], - "body": { - "mode": "raw", - "raw": "", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{DEVServer}}/consumer_backend/{{transferProcessId}}", - "host": [ - "{{DEVServer}}" - ], - "path": [ - "consumer_backend", - "{{transferProcessId}}" - ] - } - }, - "response": [] - } - ] - } - ] - } - ], - "auth": { - "type": "oauth2", - "oauth2": [ - { - "key": "accessTokenUrl", - "value": "https://centralidp.dev.demo.catena-x.net/auth/realms/CX-Central/protocol/openid-connect/token", - "type": "string" - }, - { - "key": "grant_type", - "value": "client_credentials", - "type": "string" - }, - { - "key": "useBrowser", - "value": false, - "type": "boolean" - }, - { - "key": "redirect_uri", - "value": "http://localhost:8080", - "type": "string" - }, - { - "key": "clientSecret", - "value": "{{clientSecret}}", - "type": "string" - }, - { - "key": "clientId", - "value": "{{clientId}}", - "type": "string" - }, - { - "key": "scope", - "value": "openid profile email", - "type": "string" - }, - { - "key": "challengeAlgorithm", - "value": "S256", - "type": "string" - }, - { - "key": "authUrl", - "value": "https://centralidp.demo.catena-x.net/auth/realms/CX-Central/protocol/openid-connect/auth", - "type": "string" - }, - { - "key": "addTokenTo", - "value": "header", - "type": "string" - }, - { - "key": "client_authentication", - "value": "header", - "type": "string" - } - ] - }, - "event": [ - { - "listen": "prerequest", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } - }, - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } - } - ], - "variable": [ - { - "key": "digitalTwinId", - "value": "urn:uuid:32aa72de-297a-4405-9148-13e12744028a", - "type": "default" - }, - { - "key": "digitalTwinSubmodelId", - "value": "urn:uuid:699f1245-f57e-4d6b-acdb-ab763665554a", - "type": "default" - }, - { - "key": "edcPolicyId", - "value": "ad8d2c57-cf32-409c-96a8-be59675b6ae5", - "type": "default" - }, - { - "key": "registryUrl", - "value": "https://semantics.dev.demo.catena-x.net", - "type": "default" - }, - { - "key": "clientId", - "value": "", - "type": "default" - }, - { - "key": "clientSecret", - "value": "", - "type": "default" - }, - { - "key": "APIKey", - "value": "", - "type": "default" - }, - { - "key": "INTServer", - "value": "", - "type": "default" - }, - { - "key": "DEVServer", - "value": "" - }, - { - "key": "negotiationId", - "value": "", - "type": "default" - }, - { - "key": "transferId", - "value": "", - "type": "default" - }, - { - "key": "contractAgreementId", - "value": "", - "type": "default" - }, - { - "key": "transferProcessId", - "value": "", - "type": "default" - }, - { - "key": "assetId", - "value": "urn:uuid:32aa72de-297a-4405-9148-13e12744028a-urn:uuid:699f1245-f57e-4d6b-acdb-ab763665554a", - "type": "default" - }, - { - "key": "policyId", - "value": "ad8d2c57-cf32-409c-96a8-be59675b6ae5", - "type": "default" - }, - { - "key": "contractDefinitionId", - "value": "300", - "type": "default" - }, - { - "key": "partInstanceId", - "value": "X123456789012X12345678901234566", - "type": "default" - } - ] -} \ No newline at end of file diff --git a/postman/v3.0.1/Battery-Pass_INT.postman_collection.json b/postman/v3.0.1/Battery-Pass_INT.postman_collection.json deleted file mode 100644 index 00aaacd2d..000000000 --- a/postman/v3.0.1/Battery-Pass_INT.postman_collection.json +++ /dev/null @@ -1,1085 +0,0 @@ -{ - "info": { - "_postman_id": "0566ca7f-470c-4f28-a76d-70b1b68aee26", - "name": "Battery-Pass_INT", - "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" - }, - "item": [ - { - "name": "Provider", - "item": [ - { - "name": "1. Create sample data", - "protocolProfileBehavior": { - "disabledSystemHeaders": {} - }, - "request": { - "auth": { - "type": "noauth" - }, - "method": "POST", - "header": [ - { - "key": "Accept", - "value": "application/octet-stream", - "type": "default", - "disabled": true - } - ], - "body": { - "mode": "raw", - "raw": "{\r\n \"electrochemicalProperties\": {\r\n \"ratedCapacity\": 200,\r\n \"batteryEnergy\": {\r\n \"energyRoundtripEfficiencyChange\": 80,\r\n \"maximumAllowedBatteryEnergy\": 60000.0,\r\n \"energyRoundtripEfficiency\": 48\r\n },\r\n \"ratioMaximumAllowedBatteryPowerAndMaximumAllowedBatteryEnergy\": 0.833,\r\n \"batteryVoltage\": {\r\n \"nominalVoltage\": 3.6,\r\n \"maxVoltage\": 4.2,\r\n \"minVoltage\": 2.5\r\n },\r\n \"internalResistance\": {\r\n \"cellInternalResistance\": 0.3,\r\n \"packInternalResistanceIncrease\": 0.21,\r\n \"packInternalResistance\": 53\r\n },\r\n \"capacityThresholdExhaustion\": 20,\r\n \"batteryPower\": {\r\n \"originalPowerCapability\": 150,\r\n \"powerFade\": 12.1,\r\n \"originalPowerCapabilityLimits\": 734.8,\r\n \"maximumAllowedBatteryPower\": 100000,\r\n \"powerCapabilityAt20Charge\": 500000,\r\n \"originalPower\": 40000,\r\n \"powerCapabilityAt80Charge\": 120000\r\n },\r\n \"capacityFade\": 1.5\r\n },\r\n \"document\": {\r\n \"responsibleSourcing\": [\r\n {\r\n \"title\": \"Responsible Sourcing Report 2021\",\r\n \"fileLocation\": \"telnet://192.0.2.16:80/\"\r\n }\r\n ],\r\n \"packagingInstructions\": [\r\n {\r\n \"title\": \"Packing Instruction for Lithium cells and batteries\",\r\n \"fileLocation\": \"telnet://192.0.2.16:80/\"\r\n }\r\n ],\r\n \"transportationInstructions\": [\r\n {\r\n \"title\": \"Shipping guidelines\",\r\n \"fileLocation\": \"ftp://ftp.is.co.za/rfc/rfc1808.txt\"\r\n }\r\n ],\r\n \"vehicleDismantlingProcedure\": [\r\n {\r\n \"title\": \"Dissmantling procedure of battery from the car\",\r\n \"fileLocation\": \"http://www.ietf.org/rfc/rfc2396.txt\"\r\n }\r\n ],\r\n \"testReportsResults\": [\r\n {\r\n \"title\": \"Laboratory Test Results for Battery ID no: X123456789012X12345678901234566\",\r\n \"fileLocation\": \"\"\r\n }\r\n ],\r\n \"batteryDismantlingProcedure\": [\r\n {\r\n \"title\": \"Dismantling Procedure for Battery Model: Li-Ion X-series\",\r\n \"fileLocation\": \"http://www.wikipedia.org\"\r\n }\r\n ],\r\n \"safetyMeasures\": [\r\n {\r\n \"title\": \"Lithium battery safety document\",\r\n \"fileLocation\": \"ftp://ftp.is.co.za/rfc/rfc1808.txt\"\r\n }\r\n ],\r\n \"declarationOfConformity\": [\r\n {\r\n \"title\": \"Declaration of Conformity No. 1\",\r\n \"fileLocation\": \"\"\r\n }\r\n ]\r\n },\r\n \"datePlacedOnMarket\": \"27.02.2022\",\r\n \"cellChemistry\": {\r\n \"electrolyteComposition\": [\r\n {\r\n \"matierialPercentageMassFraction\": null,\r\n \"matierialWeight\": null,\r\n \"materialName\": \"Ethylene Carbonate\"\r\n }\r\n ],\r\n \"anodeCompositionOther\": [\r\n {\r\n \"matierialPercentageMassFraction\": null,\r\n \"matierialWeight\": null,\r\n \"materialName\": \"Polyacrylic acid\"\r\n }\r\n ],\r\n \"recyclateContentActiveMaterials\": [\r\n {\r\n \"matierialPercentageMassFraction\": 4,\r\n \"matierialWeight\": null,\r\n \"materialName\": \"Ni/2021/PlantA\"\r\n },\r\n {\r\n \"matierialPercentageMassFraction\": 4,\r\n \"matierialWeight\": null,\r\n \"materialName\": \"Li/2021/PlantA\"\r\n },\r\n {\r\n \"matierialPercentageMassFraction\": 0,\r\n \"matierialWeight\": null,\r\n \"materialName\": \"Pb(battery model does not contain Pb)\"\r\n },\r\n {\r\n \"matierialPercentageMassFraction\": 12,\r\n \"matierialWeight\": null,\r\n \"materialName\": \"Co/2021/PlantA\"\r\n }\r\n ],\r\n \"anodeActiveMaterials\": [\r\n {\r\n \"matierialPercentageMassFraction\": null,\r\n \"matierialWeight\": null,\r\n \"materialName\": \"Graphite\"\r\n }\r\n ],\r\n \"cathodeActiveMaterials\": [\r\n {\r\n \"matierialPercentageMassFraction\": null,\r\n \"matierialWeight\": null,\r\n \"materialName\": \"(NCM)Lithium nickel cobalt manganese oxide\"\r\n }\r\n ],\r\n \"cathodeCompositionOther\": [\r\n {\r\n \"matierialPercentageMassFraction\": null,\r\n \"matierialWeight\": null,\r\n \"materialName\": \"carbon black, PVDR\"\r\n }\r\n ]\r\n },\r\n \"physicalDimensions\": {\r\n \"length\": 1500,\r\n \"width\": 1000,\r\n \"weight\": 1500,\r\n \"diameter\": null,\r\n \"height\": 50\r\n },\r\n \"temperatureRangeIdleState\": {\r\n \"temperatureRangeIdleStateUpperLimit\": 50,\r\n \"temperatureRangeIdleStateLowerLimit\": -20\r\n },\r\n \"batteryCycleLife\": {\r\n \"cycleLifeTestCRate\": 90,\r\n \"cycleLifeTestDepthOfDischarge\": 67,\r\n \"expectedLifetime\": 2800\r\n },\r\n \"manufacturer\": {\r\n \"name\": \"CompanyA\",\r\n \"contact\": {\r\n \"faxNumber\": \"+49 89 0987654322\",\r\n \"website\": \"http://www.CompanyA.com\",\r\n \"phoneNumber\": \"+49 89 1234567891\",\r\n \"email\": \"companyA@company.com\"\r\n },\r\n \"address\": {\r\n \"locality\": {\r\n \"value\": \"CityA\",\r\n \"technicalKey\": \"BLOCK\"\r\n },\r\n \"country\": {\r\n \"shortName\": \"Germany\"\r\n },\r\n \"postCode\": {\r\n \"value\": \"65-250A\",\r\n \"technicalKey\": \"CEDEX\"\r\n },\r\n \"thoroughfare\": {\r\n \"value\": \"StreetA\",\r\n \"number\": \"1\",\r\n \"technicalKey\": \"STREET\"\r\n },\r\n \"premise\": {\r\n \"value\": \"\",\r\n \"technicalKey\": \"CEDEX\"\r\n },\r\n \"postalDeliveryPoint\": {\r\n \"value\": \"Tor 1\",\r\n \"technicalKey\": \"INTERURBAN_DELIVERY_POINT\"\r\n }\r\n }\r\n },\r\n \"warrantyPeriod\": 96,\r\n \"composition\": {\r\n \"compositionOfBattery\": [\r\n {\r\n \"matierialPercentageMassFraction\": null,\r\n \"matierialWeight\": null,\r\n \"materialName\": \"current collector: Cupper, Separator: PP, Casing: Aluminium\"\r\n }\r\n ],\r\n \"criticalRawMaterials\": \"Lithium, Bauxite, Natural graphite\",\r\n \"components\": {\r\n \"componentsPartNumber\": \"Battery Management Unit Model: 75345\",\r\n \"componentsSupplier\": [\r\n {\r\n \"address\": {\r\n \"locality\": {\r\n \"value\": \"CityB\",\r\n \"technicalKey\": \"BLOCK\"\r\n },\r\n \"country\": {\r\n \"shortName\": \"Germany\"\r\n },\r\n \"postCode\": {\r\n \"value\": \"65-250B\",\r\n \"technicalKey\": \"CEDEX\"\r\n },\r\n \"thoroughfare\": {\r\n \"value\": \"StreetB\",\r\n \"number\": \"1\",\r\n \"technicalKey\": \"STREET\"\r\n },\r\n \"premise\": {\r\n \"value\": \"PlantB\",\r\n \"technicalKey\": \"BUILDING\"\r\n },\r\n \"postalDeliveryPoint\": {\r\n \"value\": \"GateB\",\r\n \"technicalKey\": \"INTERURBAN_DELIVERY_POINT\"\r\n }\r\n },\r\n \"contact\": {\r\n \"faxNumber\": \"+49 89 0987654322\",\r\n \"website\": \"https://www.companyB.com\",\r\n \"phoneNumber\": \"+49 89 1234567890\",\r\n \"email\": \"companyB@company.com\"\r\n }\r\n }\r\n ]\r\n }\r\n },\r\n \"manufacturing\": {\r\n \"dateOfManufacturing\": \"2022-01-24\",\r\n \"address\": {\r\n \"locality\": {\r\n \"value\": \"CityA\",\r\n \"technicalKey\": \"BLOCK\"\r\n },\r\n \"country\": {\r\n \"shortName\": \"Germany\"\r\n },\r\n \"postCode\": {\r\n \"value\": \"65-250A\",\r\n \"technicalKey\": \"CEDEX\"\r\n },\r\n \"thoroughfare\": {\r\n \"value\": \"StreetA\",\r\n \"number\": \"1\",\r\n \"technicalKey\": \"STREET\"\r\n },\r\n \"premise\": {\r\n \"value\": \"PlantA\",\r\n \"technicalKey\": \"BUILDING\"\r\n },\r\n \"postalDeliveryPoint\": {\r\n \"value\": \"GateA\",\r\n \"technicalKey\": \"INTERURBAN_DELIVERY_POINT\"\r\n }\r\n }\r\n },\r\n \"batteryIdentification\": {\r\n \"batteryType\": \"LiNMC\",\r\n \"batteryIDDMCCode\": \"X123456789012X12345678901234566\",\r\n \"batteryModel\": \"Li-Ion X-series\"\r\n },\r\n \"stateOfBattery\": {\r\n \"stateOfHealth\": 100,\r\n \"statusBattery\": \"first life\",\r\n \"stateOfCharge\": 99\r\n },\r\n \"cO2FootprintTotal\": 3120\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{INTServer}}/provider_backend/data/{{digitalTwinId}}-{{digitalTwinSubmodelId}}", - "host": [ - "{{INTServer}}" - ], - "path": [ - "provider_backend", - "data", - "{{digitalTwinId}}-{{digitalTwinSubmodelId}}" - ] - } - }, - "response": [] - }, - { - "name": "1.1 Get sample data", - "protocolProfileBehavior": { - "disabledSystemHeaders": {} - }, - "request": { - "auth": { - "type": "noauth" - }, - "method": "GET", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "type": "default" - }, - { - "key": "Accept", - "value": "application/octet-stream", - "type": "default" - } - ], - "url": { - "raw": "{{INTServer}}/provider_backend/data/{{digitalTwinId}}-{{digitalTwinSubmodelId}}", - "host": [ - "{{INTServer}}" - ], - "path": [ - "provider_backend", - "data", - "{{digitalTwinId}}-{{digitalTwinSubmodelId}}" - ] - } - }, - "response": [] - }, - { - "name": "2. Register assets", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "apikey", - "apikey": [ - { - "key": "value", - "value": "{{APIKey}}", - "type": "string" - }, - { - "key": "key", - "value": "X-Api-Key", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "type": "default" - } - ], - "body": { - "mode": "raw", - "raw": "{\r\n \"asset\": {\r\n \"properties\": {\r\n \"asset:prop:id\": \"{{assetId}}\",\r\n \"asset:prop:description\": \"Battery Passport test data\"\r\n }\r\n },\r\n \"dataAddress\": {\r\n \"properties\": {\r\n \"type\": \"HttpData\",\r\n \"baseUrl\": \"{{INTServer}}/provider_backend/data/{{digitalTwinId}}-{{digitalTwinSubmodelId}}\"\r\n }\r\n }\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{INTServer}}/BPNL000000000000/data/assets", - "host": [ - "{{INTServer}}" - ], - "path": [ - "BPNL000000000000", - "data", - "assets" - ] - } - }, - "response": [] - }, - { - "name": "2.1 Get assets", - "request": { - "auth": { - "type": "apikey", - "apikey": [ - { - "key": "value", - "value": "{{APIKey}}", - "type": "string" - }, - { - "key": "key", - "value": "X-Api-Key", - "type": "string" - } - ] - }, - "method": "GET", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "type": "default" - } - ], - "url": { - "raw": "{{INTServer}}/BPNL000000000000/data/assets", - "host": [ - "{{INTServer}}" - ], - "path": [ - "BPNL000000000000", - "data", - "assets" - ] - } - }, - "response": [] - }, - { - "name": "3. Register policy", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "apikey", - "apikey": [ - { - "key": "value", - "value": "{{APIKey}}", - "type": "string" - }, - { - "key": "key", - "value": "X-Api-Key", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "type": "default" - } - ], - "body": { - "mode": "raw", - "raw": "{\r\n \"id\": \"{{policyId}}\",\r\n \"policy\": {\r\n \"prohibitions\": [],\r\n \"obligations\": [],\r\n \"permissions\": [\r\n {\r\n \"edctype\": \"dataspaceconnector:permission\",\r\n \"action\": {\r\n \"type\": \"USE\"\r\n },\r\n \"constraints\": []\r\n }\r\n ]\r\n }\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{INTServer}}/BPNL000000000000/data/policydefinitions", - "host": [ - "{{INTServer}}" - ], - "path": [ - "BPNL000000000000", - "data", - "policydefinitions" - ] - } - }, - "response": [] - }, - { - "name": "3.1 Get policy", - "request": { - "auth": { - "type": "apikey", - "apikey": [ - { - "key": "value", - "value": "{{APIKey}}", - "type": "string" - }, - { - "key": "key", - "value": "X-Api-Key", - "type": "string" - } - ] - }, - "method": "GET", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "type": "default" - } - ], - "url": { - "raw": "{{INTServer}}/BPNL000000000000/data/policydefinitions", - "host": [ - "{{INTServer}}" - ], - "path": [ - "BPNL000000000000", - "data", - "policydefinitions" - ] - } - }, - "response": [] - }, - { - "name": "4. Register contract definitions", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "apikey", - "apikey": [ - { - "key": "value", - "value": "{{APIKey}}", - "type": "string" - }, - { - "key": "key", - "value": "X-Api-Key", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "type": "default" - } - ], - "body": { - "mode": "raw", - "raw": "{\r\n \"id\": \"{{contractDefinitionId}}\",\r\n \"criteria\": [\r\n {\r\n \"operandLeft\": \"asset:prop:id\",\r\n \"operator\": \"=\",\r\n \"operandRight\": \"{{assetId}}\"\r\n }\r\n ],\r\n \"accessPolicyId\": \"{{policyId}}\",\r\n \"contractPolicyId\": \"{{policyId}}\"\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{INTServer}}/BPNL000000000000/data/contractdefinitions", - "host": [ - "{{INTServer}}" - ], - "path": [ - "BPNL000000000000", - "data", - "contractdefinitions" - ] - } - }, - "response": [] - }, - { - "name": "4.1 Get contract definitions", - "request": { - "auth": { - "type": "apikey", - "apikey": [ - { - "key": "value", - "value": "{{APIKey}}", - "type": "string" - }, - { - "key": "key", - "value": "X-Api-Key", - "type": "string" - } - ] - }, - "method": "GET", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "type": "default" - } - ], - "url": { - "raw": "{{INTServer}}/BPNL000000000000/data/contractdefinitions", - "host": [ - "{{INTServer}}" - ], - "path": [ - "BPNL000000000000", - "data", - "contractdefinitions" - ] - } - }, - "response": [] - }, - { - "name": "5. Register Digital Twin to registry", - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "type": "default" - } - ], - "body": { - "mode": "raw", - "raw": "{\r\n \"description\": [],\r\n \"globalAssetId\": {\r\n \"value\": [\r\n \"urn:uuid:32aa72de-297a-4405-9148-13e12744028a\"\r\n ]\r\n },\r\n \"idShort\": \"Battery_X123456789012X12345678901234566\",\r\n \"identification\": \"urn:uuid:32aa72de-297a-4405-9148-13e12744028a\",\r\n \"specificAssetIds\": [\r\n {\r\n \"key\": \"partInstanceId\",\r\n \"value\": \"X123456789012X12345678901234566\"\r\n }\r\n ],\r\n \"submodelDescriptors\": [\r\n {\r\n \"description\": [\r\n {\r\n \"language\": \"en\",\r\n \"text\": \"Battery Passport Submodel\"\r\n }\r\n ],\r\n \"idShort\": \"batteryPass\",\r\n \"identification\": \"urn:uuid:699f1245-f57e-4d6b-acdb-ab763665554a\",\r\n \"semanticId\": {\r\n \"value\": [\r\n \"urn:bamm:io.catenax.battery.battery_pass:3.0.1#BatteryPass\"\r\n ]\r\n },\r\n \"endpoints\": [\r\n {\r\n \"interface\": \"EDC\",\r\n \"protocolInformation\": {\r\n \"endpointAddress\": \"{{INTServer}}/BPNL000000000000/urn:uuid:32aa72de-297a-4405-9148-13e12744028a-urn:uuid:699f1245-f57e-4d6b-acdb-ab763665554a/submodel?content=value&extent=WithBLOBValue\",\r\n \"endpointProtocol\": \"IDS/ECLIPSE DATASPACE CONNECTOR\",\r\n \"endpointProtocolVersion\": \"0.0.1-SNAPSHOT\"\r\n }\r\n }\r\n ]\r\n }\r\n ]\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{registryUrl}}/registry/registry/shell-descriptors", - "host": [ - "{{registryUrl}}" - ], - "path": [ - "registry", - "registry", - "shell-descriptors" - ] - } - }, - "response": [] - }, - { - "name": "5.1 Get Digital Twin by Id from registry", - "request": { - "method": "GET", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "type": "default" - } - ], - "url": { - "raw": "{{registryUrl}}/registry/registry/shell-descriptors/urn:uuid:8593cc81-073e-498e-8026-b92dbbe41de7", - "host": [ - "{{registryUrl}}" - ], - "path": [ - "registry", - "registry", - "shell-descriptors", - "urn:uuid:8593cc81-073e-498e-8026-b92dbbe41de7" - ] - } - }, - "response": [] - } - ] - }, - { - "name": "Consumer", - "item": [ - { - "name": "CX Registry", - "item": [ - { - "name": "1. /lookup/shells - Query Digital Twin", - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "{{registryUrl}}/registry/lookup/shells?assetIds=[\"{\\\"key\\\": \\\"partInstanceId\\\", \\\"value\\\": \\\"X123456789012X12345678901234566\\\"}\"]", - "host": [ - "{{registryUrl}}" - ], - "path": [ - "registry", - "lookup", - "shells" - ], - "query": [ - { - "key": "assetIds", - "value": "[\"{\\\"key\\\": \\\"partInstanceId\\\", \\\"value\\\": \\\"X123456789012X12345678901234566\\\"}\"]" - } - ] - } - }, - "response": [] - }, - { - "name": "1. /lookup/shells - Delete DT", - "request": { - "method": "DELETE", - "header": [], - "url": { - "raw": "{{registryUrl}}/registry/registry/shell-descriptors/urn:uuid:51b1cd81-d03b-441d-a7c2-41ef9d789199", - "host": [ - "{{registryUrl}}" - ], - "path": [ - "registry", - "registry", - "shell-descriptors", - "urn:uuid:51b1cd81-d03b-441d-a7c2-41ef9d789199" - ] - } - }, - "response": [] - }, - { - "name": "2. /registry/shell-descriptors/{id} - Get Digital Twin By Id", - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "{{registryUrl}}/registry/registry/shell-descriptors/{{digitalTwinId}}", - "host": [ - "{{registryUrl}}" - ], - "path": [ - "registry", - "registry", - "shell-descriptors", - "{{digitalTwinId}}" - ] - } - }, - "response": [] - }, - { - "name": "3. Get specific submodel descripter", - "protocolProfileBehavior": { - "disableBodyPruning": true - }, - "request": { - "method": "GET", - "header": [], - "body": { - "mode": "raw", - "raw": "", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{registryUrl}}/registry/registry/shell-descriptors/{{digitalTwinId}}/submodel-descriptors/{{digitalTwinSubmodelId}}", - "host": [ - "{{registryUrl}}" - ], - "path": [ - "registry", - "registry", - "shell-descriptors", - "{{digitalTwinId}}", - "submodel-descriptors", - "{{digitalTwinSubmodelId}}" - ], - "query": [ - { - "key": "", - "value": "", - "disabled": true - } - ] - } - }, - "response": [] - } - ] - }, - { - "name": "Data transfer", - "item": [ - { - "name": "1. Get contract offer catalog", - "protocolProfileBehavior": { - "disabledSystemHeaders": {} - }, - "request": { - "auth": { - "type": "apikey", - "apikey": [ - { - "key": "value", - "value": "{{APIKey}}", - "type": "string" - }, - { - "key": "key", - "value": "X-Api-Key", - "type": "string" - } - ] - }, - "method": "GET", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "type": "default" - } - ], - "url": { - "raw": "{{INTServer}}/consumer/data/catalog?providerUrl=https://materialpass.int.demo.catena-x.net/BPNL000000000000/api/v1/ids/data", - "host": [ - "{{INTServer}}" - ], - "path": [ - "consumer", - "data", - "catalog" - ], - "query": [ - { - "key": "providerUrl", - "value": "https://materialpass.int.demo.catena-x.net/BPNL000000000000/api/v1/ids/data" - } - ] - } - }, - "response": [] - }, - { - "name": "2. Negotiate Contract", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "const jsonResponse = pm.response.json();\r", - "pm.collectionVariables.set(\"negotiationId\", jsonResponse.id);" - ], - "type": "text/javascript" - } - }, - { - "listen": "prerequest", - "script": { - "exec": [ - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "apikey", - "apikey": [ - { - "key": "value", - "value": "{{APIKey}}", - "type": "string" - }, - { - "key": "key", - "value": "X-Api-Key", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "type": "default" - } - ], - "body": { - "mode": "raw", - "raw": "{\r\n \"connectorId\": \"foo\",\r\n \"connectorAddress\": \"{{INTServer}}/BPNL000000000000/api/v1/ids/data\",\r\n \"offer\": {\r\n \"offerId\": \"300:fe0ed727-617b-4c24-93b3-31ef29d69ff2\",\r\n \"assetId\": \"{{assetId}}\",\r\n \"policy\": {\r\n \"uid\": null,\r\n \"prohibitions\": [],\r\n \"obligations\": [],\r\n \"permissions\": [\r\n {\r\n \"edctype\": \"dataspaceconnector:permission\",\r\n \"action\": {\r\n \"type\": \"USE\"\r\n },\r\n \"target\": \"{{assetId}}\",\r\n \"constraints\": []\r\n }\r\n ]\r\n }\r\n }\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{INTServer}}/consumer/data/contractnegotiations", - "host": [ - "{{INTServer}}" - ], - "path": [ - "consumer", - "data", - "contractnegotiations" - ] - } - }, - "response": [] - }, - { - "name": "2.1 Get Negotiations", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "const jsonResponse = pm.response.json();\r", - "pm.collectionVariables.set(\"contractAgreementId\", jsonResponse.contractAgreementId);" - ], - "type": "text/javascript" - } - }, - { - "listen": "prerequest", - "script": { - "exec": [ - "" - ], - "type": "text/javascript" - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - }, - "request": { - "auth": { - "type": "apikey", - "apikey": [ - { - "key": "value", - "value": "{{APIKey}}", - "type": "string" - }, - { - "key": "key", - "value": "X-Api-Key", - "type": "string" - } - ] - }, - "method": "GET", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "type": "default" - } - ], - "body": { - "mode": "raw", - "raw": "", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{INTServer}}/consumer/data/contractnegotiations/{{negotiationId}}", - "host": [ - "{{INTServer}}" - ], - "path": [ - "consumer", - "data", - "contractnegotiations", - "{{negotiationId}}" - ] - } - }, - "response": [] - }, - { - "name": "3. Transfer data", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "const jsonResponse = pm.response.json();\r", - "pm.collectionVariables.set(\"transferId\", jsonResponse.id);" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "apikey", - "apikey": [ - { - "key": "value", - "value": "{{APIKey}}", - "type": "string" - }, - { - "key": "key", - "value": "X-Api-Key", - "type": "string" - } - ] - }, - "method": "POST", - "header": [], - "body": { - "mode": "raw", - "raw": "{\r\n \"id\": \"{{transferProcessId}}\",\r\n \"connectorId\": \"foo\",\r\n \"connectorAddress\": \"{{INTServer}}/BPNL000000000000/api/v1/ids/data\",\r\n \"contractId\": \"{{contractAgreementId}}\",\r\n \"assetId\": \"{{assetId}}\",\r\n \"managedResources\": \"false\",\r\n \"dataDestination\": {\r\n \"type\": \"HttpProxy\"\r\n }\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{INTServer}}/consumer/data/transferprocess", - "host": [ - "{{INTServer}}" - ], - "path": [ - "consumer", - "data", - "transferprocess" - ] - } - }, - "response": [] - }, - { - "name": "3.1 Verify data transfer", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "apikey", - "apikey": [ - { - "key": "value", - "value": "{{APIKey}}", - "type": "string" - }, - { - "key": "key", - "value": "X-Api-Key", - "type": "string" - } - ] - }, - "method": "GET", - "header": [], - "url": { - "raw": "{{INTServer}}/consumer/data/transferprocess/{{transferId}}", - "host": [ - "{{INTServer}}" - ], - "path": [ - "consumer", - "data", - "transferprocess", - "{{transferId}}" - ] - } - }, - "response": [] - }, - { - "name": "4. Get data from backend", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "// generate unique transfer process Id for every call\r", - "var transferProcessId = pm.collectionVariables.get(\"transferProcessId\");\r", - "console.info(\"Transfer Process Id: \"+ pm.collectionVariables.get(\"transferProcessId\"))" - ], - "type": "text/javascript" - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true, - "disabledSystemHeaders": {} - }, - "request": { - "auth": { - "type": "noauth" - }, - "method": "GET", - "header": [ - { - "key": "Accept", - "value": "application/octet-stream", - "type": "default" - } - ], - "body": { - "mode": "raw", - "raw": "", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{INTServer}}/consumer_backend/{{transferProcessId}}", - "host": [ - "{{INTServer}}" - ], - "path": [ - "consumer_backend", - "{{transferProcessId}}" - ] - } - }, - "response": [] - } - ] - } - ] - } - ], - "auth": { - "type": "oauth2", - "oauth2": [ - { - "key": "grant_type", - "value": "client_credentials", - "type": "string" - }, - { - "key": "accessTokenUrl", - "value": "https://centralidp.int.demo.catena-x.net/auth/realms/CX-Central/protocol/openid-connect/token", - "type": "string" - }, - { - "key": "useBrowser", - "value": false, - "type": "boolean" - }, - { - "key": "redirect_uri", - "value": "http://localhost:8080", - "type": "string" - }, - { - "key": "clientSecret", - "value": "{{clientSecret}}", - "type": "string" - }, - { - "key": "clientId", - "value": "{{clientId}}", - "type": "string" - }, - { - "key": "scope", - "value": "openid profile email", - "type": "string" - }, - { - "key": "challengeAlgorithm", - "value": "S256", - "type": "string" - }, - { - "key": "authUrl", - "value": "https://centralidp.demo.catena-x.net/auth/realms/CX-Central/protocol/openid-connect/auth", - "type": "string" - }, - { - "key": "addTokenTo", - "value": "header", - "type": "string" - }, - { - "key": "client_authentication", - "value": "header", - "type": "string" - } - ] - }, - "event": [ - { - "listen": "prerequest", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } - }, - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } - } - ], - "variable": [ - { - "key": "digitalTwinId", - "value": "urn:uuid:32aa72de-297a-4405-9148-13e12744028a", - "type": "default" - }, - { - "key": "digitalTwinSubmodelId", - "value": "urn:uuid:699f1245-f57e-4d6b-acdb-ab763665554a", - "type": "default" - }, - { - "key": "edcPolicyId", - "value": "ad8d2c57-cf32-409c-96a8-be59675b6ae5", - "type": "default" - }, - { - "key": "registryUrl", - "value": "https://semantics.int.demo.catena-x.net", - "type": "default" - }, - { - "key": "clientId", - "value": "", - "type": "default" - }, - { - "key": "clientSecret", - "value": "", - "type": "default" - }, - { - "key": "APIKey", - "value": "", - "type": "default" - }, - { - "key": "INTServer", - "value": "", - "type": "default" - }, - { - "key": "DEVServer", - "value": "" - }, - { - "key": "negotiationId", - "value": "", - "type": "default" - }, - { - "key": "transferId", - "value": "", - "type": "default" - }, - { - "key": "contractAgreementId", - "value": "", - "type": "default" - }, - { - "key": "transferProcessId", - "value": "", - "type": "default" - }, - { - "key": "assetId", - "value": "urn:uuid:32aa72de-297a-4405-9148-13e12744028a-urn:uuid:699f1245-f57e-4d6b-acdb-ab763665554a", - "type": "default" - }, - { - "key": "policyId", - "value": "ad8d2c57-cf32-409c-96a8-be59675b6ae5", - "type": "default" - }, - { - "key": "contractDefinitionId", - "value": "300", - "type": "default" - }, - { - "key": "partInstanceId", - "value": "X123456789012X12345678901234566", - "type": "default" - } - ] -} \ No newline at end of file diff --git a/postman/v3.0.1/Digital-Product-Pass-v1.0.0.postman_collection.json b/postman/v3.0.1/Digital-Product-Pass-v1.0.0.postman_collection.json new file mode 100644 index 000000000..136f8fec7 --- /dev/null +++ b/postman/v3.0.1/Digital-Product-Pass-v1.0.0.postman_collection.json @@ -0,0 +1,1325 @@ +{ + "info": { + "_postman_id": "dab3fede-d5fe-4d0c-b87c-d8a05b3ff40c", + "name": "Digital Product Pass Collection", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", + "_exporter_id": "19902752", + "_collection_link": "https://catena-x-product-material-pass.postman.co/workspace/Team-Workspace~b66fa959-bfa7-4129-8a45-8e9e03ef0cbb/collection/19902752-dab3fede-d5fe-4d0c-b87c-d8a05b3ff40c?action=share&creator=19902752&source=collection_link" + }, + "item": [ + { + "name": "Provider", + "item": [ + { + "name": "1. Create sample data", + "protocolProfileBehavior": { + "disabledSystemHeaders": {} + }, + "request": { + "auth": { + "type": "noauth" + }, + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/octet-stream", + "type": "default", + "disabled": true + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"electrochemicalProperties\" : {\r\n \"ratedCapacity\" : 94,\r\n \"batteryEnergy\" : {\r\n \"energyRoundtripEfficiencyChange\" : 48.2,\r\n \"maximumAllowedBatteryEnergy\" : 85000,\r\n \"energyRoundtripEfficiency\" : 25\r\n },\r\n \"ratioMaximumAllowedBatteryPowerAndMaximumAllowedBatteryEnergy\" : 0.588,\r\n \"batteryVoltage\" : {\r\n \"nominalVoltage\" : 3.7,\r\n \"maxVoltage\" : 4.2,\r\n \"minVoltage\" : 2.5\r\n },\r\n \"internalResistance\" : {\r\n \"cellinternalResistance\" : 0.36,\r\n \"packinternalResistanceIncrease\" : 1,\r\n \"packinternalResistance\" : 100\r\n },\r\n \"capacityThresholdExhaustion\" : 23,\r\n \"batteryPower\" : {\r\n \"powerFade\" : 23,\r\n \"originalPowerCapability\" : -1.7976931348623157E308,\r\n \"originalPowerCapabilityLimits\" : -1.7976931348623157E308,\r\n \"maximumAllowedBatteryPower\" : -1.7976931348623157E308,\r\n \"powerCapabilityAt20Charge\" : -1.7976931348623157E308,\r\n \"powerCapabilityAt80Charge\" : -1.7976931348623157E308\r\n },\r\n \"capacityFade\" : 1.55\r\n },\r\n \"document\" : {\r\n \"responsibleSourcing\" : [ {\r\n \"title\" : \"2021 Responsible Sourcing document\",\r\n \"fileLocation\" : null\r\n } ],\r\n \"packagingInstructions\" : [ {\r\n \"title\" : \"Packing Instruction v.2.0\",\r\n \"fileLocation\" : null\r\n } ],\r\n \"transportationInstructions\" : [ {\r\n \"title\" : \"Transport manual\",\r\n \"fileLocation\" : null\r\n } ],\r\n \"vehicleDismantlingProcedure\" : [ {\r\n \"title\" : \"Car dismantling manual\",\r\n \"fileLocation\" : \"http://www.ietf.org/rfc/rfc2396.txt\"\r\n } ],\r\n \"testReportsResults\" : [ {\r\n \"title\" : \"Battery Test Reports\",\r\n \"fileLocation\" : \"http://www.Batterytestreports.de\"\r\n } ],\r\n \"batteryDismantlingProcedure\" : [ {\r\n \"title\" : \"Dismantling Manual\",\r\n \"fileLocation\" : \"http://www.dissmantlingmanual.org\"\r\n } ],\r\n \"safetyMeasures\" : [ {\r\n \"title\" : \"Safety Instruction\",\r\n \"fileLocation\" : \"http://www.safetyinstructions.txt\"\r\n } ],\r\n \"declarationOfConformity\" : [ {\r\n \"title\" : \"Declaration of Conformity No. 3\",\r\n \"fileLocation\" : null\r\n } ]\r\n },\r\n \"datePlacedOnMarket\" : \"27.04.2022\",\r\n \"cellChemistry\" : {\r\n \"electrolyteComposition\" : [ {\r\n \"materialPercentageMassFraction\" : null,\r\n \"materialWeight\" : null,\r\n \"materialName\" : \"dimethyl carbonate (DCM)\"\r\n } ],\r\n \"anodeCompositionOther\" : [ {\r\n \"materialPercentageMassFraction\" : null,\r\n \"materialWeight\" : null,\r\n \"materialName\" : \"Carboxymethyl cellulose\"\r\n } ],\r\n \"recyclateContentActiveMaterials\" : [ {\r\n \"materialPercentageMassFraction\" : 6,\r\n \"materialWeight\" : null,\r\n \"materialName\" : \"Ni/2021/PlantE\"\r\n }, {\r\n \"materialPercentageMassFraction\" : 4,\r\n \"materialWeight\" : null,\r\n \"materialName\" : \"Li/2021/PlantE\"\r\n }, {\r\n \"materialPercentageMassFraction\" : 0,\r\n \"materialWeight\" : null,\r\n \"materialName\" : \"Pb(battery model does not contain Pb)\"\r\n }, {\r\n \"materialPercentageMassFraction\" : 0,\r\n \"materialWeight\" : null,\r\n \"materialName\" : \"Co(battery model does not contain Pb)\"\r\n } ],\r\n \"anodeActiveMaterials\" : [ {\r\n \"materialPercentageMassFraction\" : null,\r\n \"materialWeight\" : null,\r\n \"materialName\" : \"Graphite\"\r\n } ],\r\n \"cathodeActiveMaterials\" : [ {\r\n \"materialPercentageMassFraction\" : null,\r\n \"materialWeight\" : null,\r\n \"materialName\" : \"LiMn2O4 Lithium Manganese Oxide\"\r\n } ],\r\n \"cathodeCompositionOther\" : [ {\r\n \"materialPercentageMassFraction\" : null,\r\n \"materialWeight\" : null,\r\n \"materialName\" : \"binder:PVDF\"\r\n } ]\r\n },\r\n \"physicalDimensions\" : {\r\n \"length\" : 2000,\r\n \"width\" : 1000,\r\n \"weight\" : 3500,\r\n \"diameter\" : null,\r\n \"height\" : 200\r\n },\r\n \"temperatureRangeIdleState\" : {\r\n \"temperatureRangeIdleStateUpperLimit\" : 50,\r\n \"temperatureRangeIdleStateLowerLimit\" : -20\r\n },\r\n \"batteryCycleLife\" : {\r\n \"cycleLifeTestCRate\" : 2,\r\n \"cycleLifeTestDepthOfDischarge\" : 1.8,\r\n \"expectedLifetime\" : 2500\r\n },\r\n \"manufacturer\" : {\r\n \"name\" : \"CompanyE\",\r\n \"contact\" : {\r\n \"faxNumber\" : \"+49 89 0987654324\",\r\n \"website\" : \"https://www.CompanyE.com\",\r\n \"phoneNumber\" : \"+49 89 1234567893\",\r\n \"email\" : \"companyE@company.com\"\r\n },\r\n \"address\" : {\r\n \"locality\" : {\r\n \"value\" : \"CityE\",\r\n \"technicalKey\" : \"BLOCK\"\r\n },\r\n \"country\" : {\r\n \"shortName\" : \"Germany\"\r\n },\r\n \"postCode\" : {\r\n \"value\" : \"65-250E\",\r\n \"technicalKey\" : \"CEDEX\"\r\n },\r\n \"thoroughfare\" : {\r\n \"value\" : \"StreetE\",\r\n \"number\" : \"1\",\r\n \"technicalKey\" : \"STREET\"\r\n },\r\n \"premise\" : {\r\n \"value\" : null,\r\n \"technicalKey\" : \"BUILDING\"\r\n },\r\n \"postalDeliveryPoint\" : {\r\n \"value\" : null,\r\n \"technicalKey\" : \"intERURBAN_DELIVERY_POint\"\r\n }\r\n }\r\n },\r\n \"warrantyPeriod\" : \"96\",\r\n \"composition\" : {\r\n \"compositionOfBattery\" : [ {\r\n \"materialPercentageMassFraction\" : null,\r\n \"materialWeight\" : null,\r\n \"materialName\" : \"Separator: PE\"\r\n } ],\r\n \"criticalRawMaterials\" : \"Lithium, Natural graphite\",\r\n \"components\" : {\r\n \"componentsPartNumber\" : \"Voltage cables\",\r\n \"componentsSupplier\" : [ {\r\n \"componentsSupplierName\" : \"AB Corporation\",\r\n \"address\" : {\r\n \"locality\" : {\r\n \"value\" : \"CityF\",\r\n \"technicalKey\" : \"BLOCK\"\r\n },\r\n \"country\" : {\r\n \"shortName\" : \"Germany\"\r\n },\r\n \"postCode\" : {\r\n \"value\" : \"65-250F\",\r\n \"technicalKey\" : \"CEDEX\"\r\n },\r\n \"thoroughfare\" : {\r\n \"value\" : \"StreetF\",\r\n \"number\" : \"1\",\r\n \"technicalKey\" : \"STREET\"\r\n },\r\n \"premise\" : {\r\n \"value\" : \"PlantF\",\r\n \"technicalKey\" : \"BUILDING\"\r\n },\r\n \"postalDeliveryPoint\" : {\r\n \"value\" : null,\r\n \"technicalKey\" : \"INTERURBAN_DELIVERY_POINT\"\r\n }\r\n },\r\n \"contact\" : {\r\n \"faxNumber\" : \"+49 89 0987654324\",\r\n \"website\" : \"https://www.companyF.com\",\r\n \"phoneNumber\" : \"+49 89 1234567893\",\r\n \"email\" : \"companyF@companyF.com\"\r\n }\r\n } ]\r\n }\r\n },\r\n \"manufacturing\" : {\r\n \"dateOfManufacturing\" : \"2022-01-24\",\r\n \"address\" : {\r\n \"locality\" : {\r\n \"value\" : \"CityE\",\r\n \"technicalKey\" : \"BLOCK\"\r\n },\r\n \"country\" : {\r\n \"shortName\" : \"Germany\"\r\n },\r\n \"postCode\" : {\r\n \"value\" : \"65-250E\",\r\n \"technicalKey\" : \"CEDEX\"\r\n },\r\n \"thoroughfare\" : {\r\n \"value\" : \"StreetE\",\r\n \"number\" : \"1\",\r\n \"technicalKey\" : \"STREET\"\r\n },\r\n \"premise\" : {\r\n \"value\" : \"PlantE\",\r\n \"technicalKey\" : \"BUILDING\"\r\n },\r\n \"postalDeliveryPoint\" : {\r\n \"value\" : \"GateE\",\r\n \"technicalKey\" : \"INTERURBAN_DELIVERY_POINT\"\r\n }\r\n }\r\n },\r\n \"batteryIdentification\" : {\r\n \"batteryType\" : \"Lithium-Manganese-Oxide (LMO)\",\r\n \"batteryIDDMCCode\" : \"IMR18650V1\",\r\n \"batteryModel\" : \"Pi4 Orionis\"\r\n },\r\n \"stateOfBattery\" : {\r\n \"stateOfHealth\" : 20,\r\n \"statusBattery\" : \"first life\",\r\n \"stateOfCharge\" : 50\r\n },\r\n \"cO2FootprintTotal\" : 210\r\n }\r\n", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{Server}}/provider_backend/data/365e6fbe-bb34-11ec-8422-0242ac120002-61125dc3-5e6f-4f4b-838d-447432b97918", + "host": [ + "{{Server}}" + ], + "path": [ + "provider_backend", + "data", + "365e6fbe-bb34-11ec-8422-0242ac120002-61125dc3-5e6f-4f4b-838d-447432b97918" + ] + } + }, + "response": [] + }, + { + "name": "1.1 Get sample data", + "protocolProfileBehavior": { + "disabledSystemHeaders": {} + }, + "request": { + "auth": { + "type": "noauth" + }, + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "default" + }, + { + "key": "Accept", + "value": "application/octet-stream", + "type": "default" + } + ], + "url": { + "raw": "{{Server}}/provider_backend/data/365e6fbe-bb34-11ec-8422-0242ac120002-61125dc3-5e6f-4f4b-838d-447432b97918", + "host": [ + "{{Server}}" + ], + "path": [ + "provider_backend", + "data", + "365e6fbe-bb34-11ec-8422-0242ac120002-61125dc3-5e6f-4f4b-838d-447432b97918" + ] + } + }, + "response": [] + }, + { + "name": "2. Register assets", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{APIKey}}", + "type": "string" + }, + { + "key": "key", + "value": "X-Api-Key", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "default" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"@context\": {},\r\n \"asset\": {\r\n \"@type\": \"Asset\",\r\n \"@id\": \"365e6fbe-bb34-11ec-8422-0242ac120002-61125dc3-5e6f-4f4b-838d-447432b97918\", \r\n \"properties\": {\r\n \"description\": \"Battery Passport test data\"\r\n }\r\n },\r\n \"dataAddress\": {\r\n \"@type\": \"DataAddress\",\r\n \"type\": \"HttpData\",\r\n \"baseUrl\": \"https://materialpass.dev.demo.catena-x.net/provider_backend/data/365e6fbe-bb34-11ec-8422-0242ac120002-61125dc3-5e6f-4f4b-838d-447432b97918\"\r\n }\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{Server}}/BPNL000000000000/management/v2/assets", + "host": [ + "{{Server}}" + ], + "path": [ + "BPNL000000000000", + "management", + "v2", + "assets" + ] + } + }, + "response": [] + }, + { + "name": "2.1 Get assets", + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{APIKey}}", + "type": "string" + }, + { + "key": "key", + "value": "X-Api-Key", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "default" + } + ], + "url": { + "raw": "{{Server}}/BPNL000000000000/management/v2/assets/request", + "host": [ + "{{Server}}" + ], + "path": [ + "BPNL000000000000", + "management", + "v2", + "assets", + "request" + ] + } + }, + "response": [] + }, + { + "name": "3. Register policy", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{APIKey}}", + "type": "string" + }, + { + "key": "key", + "value": "X-Api-Key", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "default" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"@context\": {\r\n \"odrl\": \"http://www.w3.org/ns/odrl/2/leftOperand\"\r\n },\r\n \"@type\": \"PolicyDefinitionRequestDto\",\r\n \"@id\": \"4b480f48-79a0-4851-a56c-6ef71e19ebb3\",\r\n \"policy\": {\r\n\t\t\"@type\": \"Policy\",\r\n\t\t\"odrl:permission\" : [{\r\n \"odrl:action\": \"USE\",\r\n \"odrl:constraint\": {\r\n \"odrl:constraint\": {\r\n \"@type\": \"LogicalConstradev\",\r\n \"odrl:or\": [\r\n {\r\n \"@type\": \"Contraint\",\r\n \"odrl:leftOperand\": \"BusinessPartnerNumber\",\r\n \"odrl:operator\": \"EQ\",\r\n \"odrl:rightOperand\": \"{{BPNNumber}}\"\r\n }\r\n ]\r\n }\r\n }\r\n }]\r\n }\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{Server}}/BPNL000000000000/management/v2/policydefinitions", + "host": [ + "{{Server}}" + ], + "path": [ + "BPNL000000000000", + "management", + "v2", + "policydefinitions" + ] + } + }, + "response": [] + }, + { + "name": "3.1 Get policy", + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{APIKey}}", + "type": "string" + }, + { + "key": "key", + "value": "X-Api-Key", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "default" + } + ], + "url": { + "raw": "{{Server}}/BPNL000000000000/management/v2/policydefinitions/request", + "host": [ + "{{Server}}" + ], + "path": [ + "BPNL000000000000", + "management", + "v2", + "policydefinitions", + "request" + ] + } + }, + "response": [] + }, + { + "name": "4. Register contract definitions", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{APIKey}}", + "type": "string" + }, + { + "key": "key", + "value": "X-Api-Key", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "default" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"@context\": {},\r\n \"@id\": \"3\",\r\n \"@type\": \"ContractDefinition\",\r\n \"accessPolicyId\": \"4b480f48-79a0-4851-a56c-6ef71e19ebb3\",\r\n \"contractPolicyId\": \"4b480f48-79a0-4851-a56c-6ef71e19ebb3\",\r\n \"assetsSelector\" : {\r\n \"@type\" : \"CriterionDto\",\r\n \"operandLeft\": \"https://w3id.org/edc/v0.0.1/ns/id\",\r\n \"operator\": \"=\",\r\n \"operandRight\": \"365e6fbe-bb34-11ec-8422-0242ac120002-61125dc3-5e6f-4f4b-838d-447432b97918\"\r\n }\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{Server}}/BPNL000000000000/management/v2/contractdefinitions", + "host": [ + "{{Server}}" + ], + "path": [ + "BPNL000000000000", + "management", + "v2", + "contractdefinitions" + ] + } + }, + "response": [] + }, + { + "name": "4.1 Get contract definitions", + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{APIKey}}", + "type": "string" + }, + { + "key": "key", + "value": "X-Api-Key", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "default" + } + ], + "url": { + "raw": "{{Server}}/BPNL000000000000/management/v2/contractdefinitions/request", + "host": [ + "{{Server}}" + ], + "path": [ + "BPNL000000000000", + "management", + "v2", + "contractdefinitions", + "request" + ] + } + }, + "response": [] + }, + { + "name": "5. Register Digital Twin to registry", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJrRHdFTm5KUTktajBiUFpfSnZwYnVKODFfTlYxMDJpMEJhYWJvcUVwSmhJIn0.eyJleHAiOjE2NzQ0ODg0MDUsImlhdCI6MTY3NDQ4ODEwNSwianRpIjoiYTU2YjQyMDctOTQwNi00ZjNjLWIzMjgtMDFhMThhOTJkOGVmIiwiaXNzIjoiaHR0cHM6Ly9jZW50cmFsaWRwLmRldi5kZW1vLmNhdGVuYS14Lm5ldC9hdXRoL3JlYWxtcy9DWC1DZW50cmFsIiwiYXVkIjpbInJlYWxtLW1hbmFnZW1lbnQiLCJ0ZWNobmljYWxfcm9sZXNfbWFuYWdlbWVudCIsIkNsNi1DWC1EQVBTIiwiQ2w0LUNYLURpZ2l0YWxUd2luIiwiYWNjb3VudCIsIkNsMy1DWC1TZW1hbnRpYyIsIkNsMi1DWC1Qb3J0YWwiXSwic3ViIjoiNDMxYmQzOWQtZjA0ZC00Yjk5LWExY2UtZGM5NzJiN2Y2MWIyIiwidHlwIjoiQmVhcmVyIiwiYXpwIjoic2EtY2w2LWN4LTI5IiwiYWNyIjoiMSIsImFsbG93ZWQtb3JpZ2lucyI6WyJodHRwOi8vbG9jYWxob3N0OjgwODAiLCJodHRwczovL21hdGVyaWFscGFzcy5kZXYuZGVtby5jYXRlbmEteC5uZXQiXSwicmVhbG1fYWNjZXNzIjp7InJvbGVzIjpbIm9mZmxpbmVfYWNjZXNzIiwiZGVmYXVsdC1yb2xlcy1jYXRlbmEteCByZWFsbSIsInVtYV9hdXRob3JpemF0aW9uIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnsicmVhbG0tbWFuYWdlbWVudCI6eyJyb2xlcyI6WyJtYW5hZ2UtdXNlcnMiLCJ2aWV3LWNsaWVudHMiLCJxdWVyeS1jbGllbnRzIl19LCJ0ZWNobmljYWxfcm9sZXNfbWFuYWdlbWVudCI6eyJyb2xlcyI6WyJBcHAgVGVjaCBVc2VyIiwiQ29ubmVjdG9yIFVzZXIiXX0sIkNsNi1DWC1EQVBTIjp7InJvbGVzIjpbImNyZWF0ZV9kYXBzX2NsaWVudCJdfSwiQ2w0LUNYLURpZ2l0YWxUd2luIjp7InJvbGVzIjpbImFkZF9kaWdpdGFsX3R3aW4iLCJ2aWV3X2RpZ2l0YWxfdHdpbiIsImRlbGV0ZV9kaWdpdGFsX3R3aW4iLCJ1cGRhdGVfZGlnaXRhbF90d2luIl19LCJhY2NvdW50Ijp7InJvbGVzIjpbIm1hbmFnZS1hY2NvdW50IiwibWFuYWdlLWFjY291bnQtbGlua3MiLCJ2aWV3LXByb2ZpbGUiXX0sIkNsMy1DWC1TZW1hbnRpYyI6eyJyb2xlcyI6WyJ2aWV3X3NlbWFudGljX21vZGVsIl19LCJDbDItQ1gtUG9ydGFsIjp7InJvbGVzIjpbInZpZXdfY29ubmVjdG9ycyJdfX0sInNjb3BlIjoib3BlbmlkIHByb2ZpbGUgZW1haWwiLCJicG4iOiJCUE5MMDAwMDAwMDAwMDAwIiwiY2xpZW50SG9zdCI6IjEwLjI0MC4wLjYiLCJlbWFpbF92ZXJpZmllZCI6ZmFsc2UsImNsaWVudElkIjoic2EtY2w2LWN4LTI5IiwicHJlZmVycmVkX3VzZXJuYW1lIjoic2VydmljZS1hY2NvdW50LXNhLWNsNi1jeC0yOSIsImNsaWVudEFkZHJlc3MiOiIxMC4yNDAuMC42In0.iaiR2Ylq95zWZhOuQxM0UMjn5SKssgyanmD4rMotJFEHoQGGlpA7nPoj7-2aw7wWyKSKKk6y_AEDyDlz_Fu_VghCi5JNDZawr7jGSKi755697DMGphBUck9BoYsC1ZCr4xB0bGmxzEwoHhs-6zj_GSrUNz_yeI5BuYnrPleQPyLHOi4q5Op52xpyzTHL_aHdnobDwuCNeasRHy3wTpe6b3qgIocWm9fsCDqNC-pU2tkrAv1pvVpsyvt5Pa0wP23zNiKqgFuQ45EKjVbcaAh97fOJlwB8aesH-ILnTu6-eH9p6hs89jeKZP_7HxSeXvUwlHBSQGGkpovBvhGzjBkHsQ", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "default" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"description\": [],\r\n \"globalAssetId\": {\r\n \"value\": [\r\n \"365e6fbe-bb34-11ec-8422-0242ac120002\"\r\n ]\r\n },\r\n \"idShort\": \"Battery_IMR18650V1\",\r\n \"identification\": \"365e6fbe-bb34-11ec-8422-0242ac120002\",\r\n \"specificAssetIds\": [\r\n {\r\n \"key\": \"partInstanceId\",\r\n \"value\": \"IMR18650V1\"\r\n }\r\n ],\r\n \"submodelDescriptors\": [\r\n {\r\n \"description\": [\r\n {\r\n \"language\": \"en\",\r\n \"text\": \"Battery Passport Submodel\"\r\n }\r\n ],\r\n \"idShort\": \"batteryPass\",\r\n \"identification\": \"61125dc3-5e6f-4f4b-838d-447432b97918\",\r\n \"semanticId\": {\r\n \"value\": [\r\n \"urn:bamm:io.catenax.battery.battery_pass:3.0.1#BatteryPass\"\r\n ]\r\n },\r\n \"endpoints\": [\r\n {\r\n \"interface\": \"EDC\",\r\n \"protocolInformation\": {\r\n \"endpointAddress\": \"https://materialpass.dev.demo.catena-x.net/BPNL000000000000/365e6fbe-bb34-11ec-8422-0242ac120002-61125dc3-5e6f-4f4b-838d-447432b97918/submodel?content=value&extent=WithBLOBValue\",\r\n \"endpointProtocol\": \"IDS/ECLIPSE DATASPACE CONNECTOR\",\r\n \"endpointProtocolVersion\": \"0.0.1-SNAPSHOT\"\r\n }\r\n }\r\n ]\r\n }\r\n ]\r\n}\r\n", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{registryUrl}}/registry/registry/shell-descriptors", + "host": [ + "{{registryUrl}}" + ], + "path": [ + "registry", + "registry", + "shell-descriptors" + ] + } + }, + "response": [] + }, + { + "name": "5.1 Get Digital Twin by Id from registry", + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "default" + } + ], + "url": { + "raw": "{{registryUrl}}/registry/registry/shell-descriptors/365e6fbe-bb34-11ec-8422-0242ac120002", + "host": [ + "{{registryUrl}}" + ], + "path": [ + "registry", + "registry", + "shell-descriptors", + "365e6fbe-bb34-11ec-8422-0242ac120002" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Consumer", + "item": [ + { + "name": "CX Registry", + "item": [ + { + "name": "1. /lookup/shells - Query Digital Twin", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "https://semantics.dev.demo.catena-x.net/registry/lookup/shells?assetIds={\"key\":\"partInstanceId\",\"value\":\"X123456789012X12345678901234566\"}", + "protocol": "https", + "host": [ + "semantics", + "dev", + "demo", + "catena-x", + "net" + ], + "path": [ + "registry", + "lookup", + "shells" + ], + "query": [ + { + "key": "assetIds", + "value": "{\"key\":\"partInstanceId\",\"value\":\"X123456789012X12345678901234566\"}" + } + ] + } + }, + "response": [] + }, + { + "name": "2. /registry/shell-descriptors/{id} - Get Digital Twin By Id Copy", + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"description\": [\r\n {\r\n \"language\": \"en\",\r\n \"text\": \"demo_catena_test_3.txt\"\r\n }\r\n ],\r\n \"globalAssetId\": {\r\n \"value\": [\r\n \"urn:uuid:1f4a64f0-aba9-498a-917c-4936c24c50cd\"\r\n ]\r\n },\r\n \"idShort\": \"demo_catena_test_1.txt\",\r\n \"identification\": \"urn:uuid:1f4a64f0-aba9-498a-917c-4936c24c50cd\",\r\n \"specificAssetIds\": [\r\n {\r\n \"key\": \"Battery_ID_DMC_Code\",\r\n \"value\": \"NCR186850B\"\r\n }\r\n ],\r\n \"submodelDescriptors\": [\r\n {\r\n \"description\": [\r\n {\r\n \"language\": \"en\",\r\n \"text\": \"Battery Passport Submodel\"\r\n }\r\n ],\r\n \"idShort\": \"MaterialPass\",\r\n \"identification\": \"urn:uuid:49a06ad2-64b7-46c8-9f3b-a718c462ca23\",\r\n \"semanticId\": {\r\n \"value\": [\r\n \"urn_bamm_io.catenax.battery.battery_pass_2.0.0\"\r\n ]\r\n },\r\n \"endpoints\": [\r\n {\r\n \"interface\": \"SUBMODEL.SIEM.0002\",\r\n \"protocolInformation\": {\r\n \"endpointAddress\": \"https://materialpass.dev.demo.catena-x.net/provider/api/v1/ids/data\",\r\n \"endpointProtocol\": \"IDS/ECLIPSE DATASPACE CONNECTOR\",\r\n \"endpointProtocolVersion\": \"0.0.1-SNAPSHOT\"\r\n }\r\n }\r\n ]\r\n }\r\n ]\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{registryUrl}}/registry/registry/shell-descriptors", + "host": [ + "{{registryUrl}}" + ], + "path": [ + "registry", + "registry", + "shell-descriptors" + ] + } + }, + "response": [] + }, + { + "name": "1. /lookup/shells - Delete DT", + "request": { + "method": "DELETE", + "header": [], + "url": { + "raw": "{{registryUrl}}/registry/registry/shell-descriptors/urn:uuid:1e4b62e8-dc0d-4327-9ece-fd333cea06d8", + "host": [ + "{{registryUrl}}" + ], + "path": [ + "registry", + "registry", + "shell-descriptors", + "urn:uuid:1e4b62e8-dc0d-4327-9ece-fd333cea06d8" + ] + } + }, + "response": [] + }, + { + "name": "2. /registry/shell-descriptors/{id} - Get Digital Twin By Id", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{registryUrl}}/registry/registry/shell-descriptors/32aa72de-297a-4405-9148-13e12744028a", + "host": [ + "{{registryUrl}}" + ], + "path": [ + "registry", + "registry", + "shell-descriptors", + "32aa72de-297a-4405-9148-13e12744028a" + ] + } + }, + "response": [] + }, + { + "name": "3. Get specific submodel descripter", + "protocolProfileBehavior": { + "disableBodyPruning": true + }, + "request": { + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{registryUrl}}/registry/registry/shell-descriptors/urn:uuid:1e4b62e8-dc0d-4327-9ece-fd333cea06d8/submodel-descriptors/urn:uuid:db3fed5d-86cb-4d99-9adf-5e1c6267d293", + "host": [ + "{{registryUrl}}" + ], + "path": [ + "registry", + "registry", + "shell-descriptors", + "urn:uuid:1e4b62e8-dc0d-4327-9ece-fd333cea06d8", + "submodel-descriptors", + "urn:uuid:db3fed5d-86cb-4d99-9adf-5e1c6267d293" + ], + "query": [ + { + "key": "", + "value": "", + "disabled": true + } + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Data transfer", + "item": [ + { + "name": "1. Get contract offer catalog", + "protocolProfileBehavior": { + "disabledSystemHeaders": {} + }, + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{APIKey}}", + "type": "string" + }, + { + "key": "key", + "value": "X-Api-Key", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "default" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"@context\": {},\r\n \"protocol\": \"dataspace-protocol-http\",\r\n \"providerUrl\": \"https://materialpass.dev.demo.catena-x.net/BPNL000000000000/api/v1/dsp\",\r\n \"querySpec\": {}\r\n}" + }, + "url": { + "raw": "{{Server}}/consumer/management/v2/catalog/request", + "host": [ + "{{Server}}" + ], + "path": [ + "consumer", + "management", + "v2", + "catalog", + "request" + ] + } + }, + "response": [] + }, + { + "name": "2. Negotiate Contract", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const jsonResponse = pm.response.json();\r", + "pm.collectionVariables.set(\"negotiationId\", jsonResponse.id);" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{APIKey}}", + "type": "string" + }, + { + "key": "key", + "value": "X-Api-Key", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "default" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n\t\"@context\": {\r\n\t\t\"odrl\": \"http://www.w3.org/ns/odrl/2/\"\r\n\t},\r\n\t\"@type\": \"NegotiationInitiateRequestDto\",\r\n\t\"connectorAddress\": \"https://materialpass.dev.demo.catena-x.net/BPNL000000000000/api/v1/dsp\",\r\n\t\"protocol\": \"dataspace-protocol-http\",\r\n\t\"connectorId\": \"BPNL00000000CBA5\",\r\n\t\"offer\": {\r\n\t\t\"offerId\": \"1:32aa72de-297a-4405-9148-13e12744028a-699f1245-f57e-4d6b-acdb-ab763665554a:523756a0-eca7-46d3-99e7-bd2e6a81fab8\",\r\n\t\t\"assetId\": \"32aa72de-297a-4405-9148-13e12744028a-699f1245-f57e-4d6b-acdb-ab763665554a\",\r\n\t\t\"policy\": {\r\n\t\t\t\"@type\": \"odrl:Set\",\r\n\t\t\t\"odrl:permission\": [],\r\n\t\t\t\"odrl:prohibition\": [],\r\n\t\t\t\"odrl:obligation\": [],\r\n\t\t\t\"odrl:target\": \"32aa72de-297a-4405-9148-13e12744028a-699f1245-f57e-4d6b-acdb-ab763665554a\"\r\n\t\t}\r\n\t}\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{Server}}/consumer/management/v2/contractnegotiations", + "host": [ + "{{Server}}" + ], + "path": [ + "consumer", + "management", + "v2", + "contractnegotiations" + ] + } + }, + "response": [] + }, + { + "name": "2.1 Get Negotiations", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const jsonResponse = pm.response.json();\r", + "pm.collectionVariables.set(\"contractAgreementId\", jsonResponse.contractAgreementId);" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "protocolProfileBehavior": { + "disableBodyPruning": true + }, + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{APIKey}}", + "type": "string" + }, + { + "key": "key", + "value": "X-Api-Key", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "default" + } + ], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{Server}}/consumer/management/v2/contractnegotiations/fa94a1cb-7440-41b8-926f-a56894f197c3", + "host": [ + "{{Server}}" + ], + "path": [ + "consumer", + "management", + "v2", + "contractnegotiations", + "fa94a1cb-7440-41b8-926f-a56894f197c3" + ] + } + }, + "response": [] + }, + { + "name": "3. Transfer data", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const jsonResponse = pm.response.json();\r", + "pm.collectionVariables.set(\"transferId\", jsonResponse.id);" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{APIKey}}", + "type": "string" + }, + { + "key": "key", + "value": "X-Api-Key", + "type": "string" + } + ] + }, + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"@context\": {\r\n \"odrl\": \"http://www.w3.org/ns/odrl/2/\"\r\n },\r\n \"assetId\": \"32aa72de-297a-4405-9148-13e12744028a-699f1245-f57e-4d6b-acdb-ab763665554a\",\r\n \"connectorAddress\": \"https://materialpass.dev.demo.catena-x.net/BPNL000000000000/api/v1/dsp\",\r\n \"contractId\": \"1:32aa72de-297a-4405-9148-13e12744028a-699f1245-f57e-4d6b-acdb-ab763665554a:e29e579e-488b-4dd9-b746-c1bcc2eb98d0\",\r\n \"dataDestination\": {\r\n \"properties\": {\r\n \"type\": \"HttpProxy\"\r\n }\r\n },\r\n \"managedResources\": false,\r\n \"privateProperties\": {\r\n \"receiverHttpEndpoint\": \"https://materialpass.dev.demo.catena-x.net/endpoint/{{processid}}\"\r\n },\r\n \"protocol\": \"dataspace-protocol-http\",\r\n \"transferType\": {\r\n \"contentType\": \"application/octet-stream\",\r\n \"isFinite\": true\r\n }\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{Server}}/consumer/management/v2/transferprocesses", + "host": [ + "{{Server}}" + ], + "path": [ + "consumer", + "management", + "v2", + "transferprocesses" + ] + } + }, + "response": [] + }, + { + "name": "3.1 Verify data transfer", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{APIKey}}", + "type": "string" + }, + { + "key": "key", + "value": "X-Api-Key", + "type": "string" + } + ] + }, + "method": "GET", + "header": [], + "url": { + "raw": "{{Server}}/consumer/management/v2/transferprocesses/f3df2fb0-deff-4e85-9fe3-d4b779b493f6", + "host": [ + "{{Server}}" + ], + "path": [ + "consumer", + "management", + "v2", + "transferprocesses", + "f3df2fb0-deff-4e85-9fe3-d4b779b493f6" + ] + } + }, + "response": [] + } + ] + } + ] + }, + { + "name": "Backend", + "item": [ + { + "name": "1. Search Contract", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const jsonResponse = pm.response.json();\r", + "pm.collectionVariables.set(\"token\", jsonResponse.data.token);\r", + "pm.collectionVariables.set(\"processid\", jsonResponse.data.id);\r", + "pm.collectionVariables.set(\"contractid\", jsonResponse.data.contract['@id']);" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"id\": \"IMR18650V1\",\r\n \"version\": \"v3.0.1\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{Server}}/api/contract/search", + "host": [ + "{{Server}}" + ], + "path": [ + "api", + "contract", + "search" + ] + } + }, + "response": [] + }, + { + "name": "2.1 Sign Contract", + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"processId\": \"{{processid}}\",\r\n \"contractId\": \"{{contractid}}\",\r\n \"token\": \"{{token}}\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{Server}}/api/contract/sign", + "host": [ + "{{Server}}" + ], + "path": [ + "api", + "contract", + "sign" + ] + } + }, + "response": [] + }, + { + "name": "2.2 Decline Contract", + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"processId\": \"{{processid}}\",\r\n \"contractId\": \"{{contractid}}\",\r\n \"token\": \"{{token}}\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{Server}}/api/contract/decline", + "host": [ + "{{Server}}" + ], + "path": [ + "api", + "contract", + "decline" + ] + } + }, + "response": [] + }, + { + "name": "3.0 Cancel Negotiation", + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"processId\": \"{{processid}}\",\r\n \"contractId\": \"{{contractid}}\",\r\n \"token\": \"{{token}}\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{Server}}/api/contract/cancel", + "host": [ + "{{Server}}" + ], + "path": [ + "api", + "contract", + "cancel" + ] + } + }, + "response": [] + }, + { + "name": "3.1 Get Status", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{Server}}/api/contract/status/{{processid}}", + "host": [ + "{{Server}}" + ], + "path": [ + "api", + "contract", + "status", + "{{processid}}" + ] + } + }, + "response": [] + }, + { + "name": "4.0 Retrieve Passport", + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"processId\": \"{{processid}}\",\r\n \"contractId\": \"{{contractid}}\",\r\n \"token\": \"{{token}}\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{Server}}/api/passport", + "host": [ + "{{Server}}" + ], + "path": [ + "api", + "passport" + ] + } + }, + "response": [] + } + ], + "auth": { + "type": "oauth2", + "oauth2": [ + { + "key": "accessTokenUrl", + "value": "https://centralidp.dev.demo.catena-x.net/auth/realms/CX-Central/protocol/openid-connect/token", + "type": "string" + }, + { + "key": "authUrl", + "value": "https://centralidp.dev.demo.catena-x.net/auth/realms/CX-Central/protocol/openid-connect/auth", + "type": "string" + }, + { + "key": "redirect_uri", + "value": "http://localhost:8080", + "type": "string" + }, + { + "key": "clientId", + "value": "Cl13-CX-Battery", + "type": "string" + }, + { + "key": "addTokenTo", + "value": "header", + "type": "string" + } + ] + }, + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ] + } + ], + "auth": { + "type": "oauth2", + "oauth2": [ + { + "key": "grant_type", + "value": "client_credentials", + "type": "string" + }, + { + "key": "accessTokenUrl", + "value": "https://centralidp.int.demo.catena-x.net/auth/realms/CX-Central/protocol/openid-connect/token", + "type": "string" + }, + { + "key": "useBrowser", + "value": false, + "type": "boolean" + }, + { + "key": "redirect_uri", + "value": "http://localhost:8080", + "type": "string" + }, + { + "key": "clientSecret", + "value": "{{clientSecret}}", + "type": "string" + }, + { + "key": "clientId", + "value": "{{clientId}}", + "type": "string" + }, + { + "key": "scope", + "value": "openid profile email", + "type": "string" + }, + { + "key": "challengeAlgorithm", + "value": "S256", + "type": "string" + }, + { + "key": "authUrl", + "value": "https://centralidp.demo.catena-x.net/auth/realms/CX-Central/protocol/openid-connect/auth", + "type": "string" + }, + { + "key": "addTokenTo", + "value": "header", + "type": "string" + }, + { + "key": "client_authentication", + "value": "header", + "type": "string" + } + ] + }, + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ], + "variable": [ + { + "key": "digitalTwinId", + "value": "urn:uuid:1e4b62e8-dc0d-4327-9ece-fd333cea06d8", + "type": "default" + }, + { + "key": "digitalTwinSubmodelId", + "value": "urn:uuid:61125dc3-5e6f-4f4b-838d-447432b97918", + "type": "default" + }, + { + "key": "edcPolicyId", + "value": "609e305c-2fbf-4257-8e1d-7fedc27df987", + "type": "default" + }, + { + "key": "providerBpn", + "value": "some-bpn", + "type": "default" + }, + { + "key": "registryUrl", + "value": "https://semantics.dev.demo.catena-x.net", + "type": "default" + }, + { + "key": "clientId", + "value": "", + "type": "default" + }, + { + "key": "clientSecret", + "value": "", + "type": "default" + }, + { + "key": "APIKey", + "value": "", + "type": "default" + }, + { + "key": "negotiationId", + "value": "", + "type": "default" + }, + { + "key": "transferId", + "value": "", + "type": "default" + }, + { + "key": "contractAgreementId", + "value": "", + "type": "default" + }, + { + "key": "transferProcessId", + "value": "", + "type": "default" + }, + { + "key": "assetId", + "value": "", + "type": "default" + }, + { + "key": "policyId", + "value": "", + "type": "default" + }, + { + "key": "contractDefinitionId", + "value": "", + "type": "default" + }, + { + "key": "token", + "value": "" + }, + { + "key": "processid", + "value": "" + }, + { + "key": "contractid", + "value": "" + }, + { + "key": "Server", + "value": "https://materialpass.dev.demo.catena-x.net" + } + ] +} \ No newline at end of file From c69ba57e67a9762b7605325f1ada8ca939d9ca3f Mon Sep 17 00:00:00 2001 From: Mathias Brunkow Moser Date: Mon, 26 Jun 2023 18:31:18 +0200 Subject: [PATCH 22/35] feat: added updated infrastructure related to the new provider --- deployment/infrastructure/delete-provider.sh | 186 +++++++++ deployment/infrastructure/init-provider.sh | 182 ++++++++ .../resources/assets/IMR18650V1.json | 15 + .../resources/assets/NCR186850B.json | 15 + .../X123456789012X12345678901234566.json | 15 + .../Y792927456954B81677903848654570.json | 15 + .../contractdefinitions/IMR18650V1.json | 13 + .../contractdefinitions/NCR186850B.json | 13 + .../X123456789012X12345678901234566.json | 13 + .../Y792927456954B81677903848654570.json | 13 + .../contractpolicies/IMR18650V1.json | 26 ++ .../contractpolicies/NCR186850B.json | 26 ++ .../X123456789012X12345678901234566.json | 26 ++ .../Y792927456954B81677903848654570.json | 28 ++ .../resources/digitaltwins/IMR18650V1.json | 43 ++ .../resources/digitaltwins/NCR186850B.json | 43 ++ .../X123456789012X12345678901234566.json | 43 ++ .../Y792927456954B81677903848654570.json | 43 ++ .../resources/payloads/IMR18650V1.json | 248 +++++++++++ .../resources/payloads/NCR186850B.json | 283 +++++++++++++ .../X123456789012X12345678901234566.json | 344 +++++++++++++++ .../Y792927456954B81677903848654570.json | 390 ++++++++++++++++++ 22 files changed, 2023 insertions(+) create mode 100644 deployment/infrastructure/delete-provider.sh create mode 100644 deployment/infrastructure/init-provider.sh create mode 100644 deployment/infrastructure/resources/assets/IMR18650V1.json create mode 100644 deployment/infrastructure/resources/assets/NCR186850B.json create mode 100644 deployment/infrastructure/resources/assets/X123456789012X12345678901234566.json create mode 100644 deployment/infrastructure/resources/assets/Y792927456954B81677903848654570.json create mode 100644 deployment/infrastructure/resources/contractdefinitions/IMR18650V1.json create mode 100644 deployment/infrastructure/resources/contractdefinitions/NCR186850B.json create mode 100644 deployment/infrastructure/resources/contractdefinitions/X123456789012X12345678901234566.json create mode 100644 deployment/infrastructure/resources/contractdefinitions/Y792927456954B81677903848654570.json create mode 100644 deployment/infrastructure/resources/contractpolicies/IMR18650V1.json create mode 100644 deployment/infrastructure/resources/contractpolicies/NCR186850B.json create mode 100644 deployment/infrastructure/resources/contractpolicies/X123456789012X12345678901234566.json create mode 100644 deployment/infrastructure/resources/contractpolicies/Y792927456954B81677903848654570.json create mode 100644 deployment/infrastructure/resources/digitaltwins/IMR18650V1.json create mode 100644 deployment/infrastructure/resources/digitaltwins/NCR186850B.json create mode 100644 deployment/infrastructure/resources/digitaltwins/X123456789012X12345678901234566.json create mode 100644 deployment/infrastructure/resources/digitaltwins/Y792927456954B81677903848654570.json create mode 100644 deployment/infrastructure/resources/payloads/IMR18650V1.json create mode 100644 deployment/infrastructure/resources/payloads/NCR186850B.json create mode 100644 deployment/infrastructure/resources/payloads/X123456789012X12345678901234566.json create mode 100644 deployment/infrastructure/resources/payloads/Y792927456954B81677903848654570.json diff --git a/deployment/infrastructure/delete-provider.sh b/deployment/infrastructure/delete-provider.sh new file mode 100644 index 000000000..d19ee64c2 --- /dev/null +++ b/deployment/infrastructure/delete-provider.sh @@ -0,0 +1,186 @@ +#!/bin/bash +################################################################################# +# Catena-X - Product Passport Consumer Application +# +# 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. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License, Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +# either express or implied. See the +# License for the specific language govern in permissions and limitations +# under the License. +# +# SPDX-License-Identifier: Apache-2.0 +################################################################################# + + +set -o errexit +set -o errtrace +set -o pipefail +set -o nounset + +DIGITAL_TWIN_1='32aa72de-297a-4405-9148-13e12744028a' +DIGITAL_TWIN_SUBMODEL_ID_1='699f1245-f57e-4d6b-acdb-ab763665554a' + +DIGITAL_TWIN_2='1f4a64f0-aba9-498a-917c-4936c24c50cd' +DIGITAL_TWIN_SUBMODEL_ID_2='49a06ad2-64b7-46c8-9f3b-a718c462ca23' + +DIGITAL_TWIN_3='365e6fbe-bb34-11ec-8422-0242ac120002' +DIGITAL_TWIN_SUBMODEL_ID_3='61125dc3-5e6f-4f4b-838d-447432b97918' + +DIGITAL_TWIN_4='1f0ef836-40b7-4f31-a9bd-cb6a8960779e' +DIGITAL_TWIN_SUBMODEL_ID_4='26bf39c5-68a5-43a1-8db7-d33e116a6f61' + +SERVER_URL='' +REGISTRY_URL='' + + +# put access token without 'Bearer ' prefix +BEARER_TOKEN='' + +API_KEY='' +ASSET_ID_1=${DIGITAL_TWIN_1}-${DIGITAL_TWIN_SUBMODEL_ID_1} +ASSET_ID_2=${DIGITAL_TWIN_2}-${DIGITAL_TWIN_SUBMODEL_ID_2} +ASSET_ID_3=${DIGITAL_TWIN_3}-${DIGITAL_TWIN_SUBMODEL_ID_3} +ASSET_ID_4=${DIGITAL_TWIN_4}-${DIGITAL_TWIN_SUBMODEL_ID_4} + + +echo '**************************Asset 1 **********************' +echo +# Create Submodel data +echo "Create sample data for asset 1..." +curl -X DELETE -H 'Content-Type: application/json' -s --data "@resources/payloads/X123456789012X12345678901234566.json" $SERVER_URL/provider_backend/data/${ASSET_ID_1} +echo + +# Create a contract definition +echo "Create contract definition for asset 1..." +curl -X DELETE -H 'Content-Type: application/json' -s --data "@resources/contractdefinitions/X123456789012X12345678901234566.json" --header 'X-Api-Key: '${API_KEY} $SERVER_URL/management/v2/contractdefinitions/1 +echo + +# Create a asset +echo "Create asset 1..." +curl -X DELETE -H 'Content-Type: application/json' -s --data "@resources/assets/X123456789012X12345678901234566.json" --header 'X-Api-Key: '${API_KEY} $SERVER_URL/management/v2/assets/${ASSET_ID_1} +echo + +# Create a general policy +echo "Create policy for asset 1..." +curl -X DELETE -H 'Content-Type: application/json' -s --data "@resources/contractpolicies/X123456789012X12345678901234566.json" --header 'X-Api-Key: '${API_KEY} $SERVER_URL/management/v2/policydefinitions/ad8d2c57-cf32-409c-96a8-be59675b6ae5 +echo + +# Create a digital twin and register inside CX registry +# To authenticate against CX registry, one needs a valid bearer token which can be issued through postman given the clientId and clientSecret +echo "Create a DT for asset 1 and register it devo CX registry..." + +curl -X DELETE -s --header 'Content-Type: application/json' --header "Authorization: Bearer ${BEARER_TOKEN//[$'\t\r\n ']}" --data "@resources/digitaltwins/X123456789012X12345678901234566.json" $REGISTRY_URL/${DIGITAL_TWIN_1} +echo +echo + + + +echo '**************************Asset 2 **********************' + +echo + +# Create a contract definition +echo "Create contract definition for asset 2..." +curl -X DELETE -H 'Content-Type: application/json' -s --data "@resources/contractdefinitions/NCR186850B.json" --header 'X-Api-Key: '${API_KEY} $SERVER_URL/management/v2/contractdefinitions/2 +echo + + +# Create Submodel data +echo "Create sample data for asset 2..." +curl -X DELETE -H 'Content-Type: application/json' -s --data "@resources/payloads/NCR186850B.json" $SERVER_URL/provider_backend/data/${ASSET_ID_2} +echo + +# Create a asset +echo "Create asset 2..." +curl -X DELETE -H 'Content-Type: application/json' -s --data "@resources/assets/NCR186850B.json" --header 'X-Api-Key: '${API_KEY} $SERVER_URL/management/v2/assets/${ASSET_ID_2} +echo + +# Create a general policy +echo "Create policy for asset 2..." +curl -X DELETE -H 'Content-Type: application/json' -s --data "@resources/contractpolicies/NCR186850B.json" --header 'X-Api-Key: '${API_KEY} $SERVER_URL/management/v2/policydefinitions/f873e234-112c-4598-893b-eda0671b7402 +echo + +# Create a digital twin and register inside CX registry +# To authenticate against CX registry, one needs a valid bearer token which can be issued through postman given the clientId and clientSecret +echo "Create a DT for asset 2 and register it devo CX registry..." + +curl -X DELETE -s --header 'Content-Type: application/json' --header "Authorization: Bearer ${BEARER_TOKEN//[$'\t\r\n ']}" --data "@resources/digitaltwins/NCR186850B.json" $REGISTRY_URL/${DIGITAL_TWIN_2} +echo +echo + + + +echo '**************************Asset 3 **********************' +# Create Submodel data +echo "Create sample data for asset 3..." +curl -X DELETE -H 'Content-Type: application/json' -s --data "@resources/payloads/IMR18650V1.json" $SERVER_URL/provider_backend/data/${ASSET_ID_3} +echo + + +# Create a contract definition +echo "Create contract definition for asset 3..." +curl -X DELETE -H 'Content-Type: application/json' -s --data "@resources/contractdefinitions/IMR18650V1.json" --header 'X-Api-Key: '${API_KEY} $SERVER_URL/management/v2/contractdefinitions/3 +echo + +# Create a asset +echo "Create asset 1..." +curl -X DELETE -H 'Content-Type: application/json' -s --data "@resources/assets/IMR18650V1.json" --header 'X-Api-Key: '${API_KEY} $SERVER_URL/management/v2/assets/${ASSET_ID_3} +echo + +# Create a general policy +echo "Create policy for asset 3..." +curl -X DELETE -H 'Content-Type: application/json' -s --data "@resources/contractpolicies/IMR18650V1.json" --header 'X-Api-Key: '${API_KEY} $SERVER_URL/management/v2/policydefinitions/4b480f48-79a0-4851-a56c-6ef71e19ebb3 +echo + + +# Create a digital twin and register inside CX registry +# To authenticate against CX registry, one needs a valid bearer token which can be issued through postman given the clientId and clientSecret +echo "Create a DT for asset 3 and register it devo CX registry..." + +curl -X DELETE -s --header 'Content-Type: application/json' --header "Authorization: Bearer ${BEARER_TOKEN//[$'\t\r\n ']}" --data "@resources/digitaltwins/IMR18650V1.json" $REGISTRY_URL/${DIGITAL_TWIN_3} +echo + + +echo '**************************Asset 4 **********************' +# Create Submodel data +echo "Create sample data for asset 4..." +curl -X DELETE -H 'Content-Type: application/json' -s --data "@resources/payloads/Y792927456954B81677903848654570.json" $SERVER_URL/provider_backend/data/${ASSET_ID_4} +echo + + +# Create a contract definition +echo "Create contract definition for asset 4..." +curl -X DELETE -H 'Content-Type: application/json' -s --data "@resources/contractdefinitions/Y792927456954B81677903848654570.json" --header 'X-Api-Key: '${API_KEY} $SERVER_URL/management/v2/contractdefinitions/131 +echo + +# Create a asset +echo "Create asset 4..." +curl -X DELETE -H 'Content-Type: application/json' -s --data "@resources/assets/Y792927456954B81677903848654570.json" --header 'X-Api-Key: '${API_KEY} $SERVER_URL/management/v2/assets/${ASSET_ID_4} +echo + +# Create a general policy +echo "Create policy for asset 4..." +curl -X DELETE -H 'Content-Type: application/json' -s --data "@resources/contractpolicies/Y792927456954B81677903848654570.json" --header 'X-Api-Key: '${API_KEY} $SERVER_URL/management/v2/policydefinitions/0a216bb0-934d-4c93-8e92-ca3b4f862e33 +echo + + + +# Create a digital twin and register inside CX registry +# To authenticate against CX registry, one needs a valid bearer token which can be issued through postman given the clientId and clientSecret +echo "Create a DT for asset 4 and register it devo CX registry..." + +curl -X POST -s --header 'Content-Type: application/json' --header "Authorization: Bearer ${BEARER_TOKEN//[$'\t\r\n ']}" --data "@resources/digitaltwins/Y792927456954B81677903848654570.json" $REGISTRY_URL/${DIGITAL_TWIN_4} +echo + +echo 'Provider setup completed...' +echo 'Done' diff --git a/deployment/infrastructure/init-provider.sh b/deployment/infrastructure/init-provider.sh new file mode 100644 index 000000000..c5290f18b --- /dev/null +++ b/deployment/infrastructure/init-provider.sh @@ -0,0 +1,182 @@ +#!/bin/bash +################################################################################# +# Catena-X - Product Passport Consumer Application +# +# 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. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License, Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +# either express or implied. See the +# License for the specific language govern in permissions and limitations +# under the License. +# +# SPDX-License-Identifier: Apache-2.0 +################################################################################# + + +set -o errexit +set -o errtrace +set -o pipefail +set -o nounset + +DIGITAL_TWIN_1='32aa72de-297a-4405-9148-13e12744028a' +DIGITAL_TWIN_SUBMODEL_ID_1='699f1245-f57e-4d6b-acdb-ab763665554a' + +DIGITAL_TWIN_2='1f4a64f0-aba9-498a-917c-4936c24c50cd' +DIGITAL_TWIN_SUBMODEL_ID_2='49a06ad2-64b7-46c8-9f3b-a718c462ca23' + +DIGITAL_TWIN_3='365e6fbe-bb34-11ec-8422-0242ac120002' +DIGITAL_TWIN_SUBMODEL_ID_3='61125dc3-5e6f-4f4b-838d-447432b97918' + +DIGITAL_TWIN_4='1f0ef836-40b7-4f31-a9bd-cb6a8960779e' +DIGITAL_TWIN_SUBMODEL_ID_4='26bf39c5-68a5-43a1-8db7-d33e116a6f61' + +SERVER_URL='' +REGISTRY_URL='' + + +# put access token without 'Bearer ' prefix +BEARER_TOKEN='' + +API_KEY='' + +ASSET_ID_1=${DIGITAL_TWIN_1}-${DIGITAL_TWIN_SUBMODEL_ID_1} +ASSET_ID_2=${DIGITAL_TWIN_2}-${DIGITAL_TWIN_SUBMODEL_ID_2} +ASSET_ID_3=${DIGITAL_TWIN_3}-${DIGITAL_TWIN_SUBMODEL_ID_3} +ASSET_ID_4=${DIGITAL_TWIN_4}-${DIGITAL_TWIN_SUBMODEL_ID_4} + + +echo '**************************Asset 1 **********************' +echo +# Create Submodel data +echo "Create sample data for asset 1..." +curl -X POST -H 'Content-Type: application/json' -s --data "@resources/payloads/X123456789012X12345678901234566.json" $SERVER_URL/provider_backend/data/${ASSET_ID_1} +echo + +# Create a asset +echo "Create asset 1..." +curl -X POST -H 'Content-Type: application/json' -s --data "@resources/assets/X123456789012X12345678901234566.json" --header 'X-Api-Key: '${API_KEY} $SERVER_URL/management/v2/assets +echo + +# Create a general policy +echo "Create policy for asset 1..." +curl -X POST -H 'Content-Type: application/json' -s --data "@resources/contractpolicies/X123456789012X12345678901234566.json" --header 'X-Api-Key: '${API_KEY} $SERVER_URL/management/v2/policydefinitions +echo + +# Create a contract definition +echo "Create contract definition for asset 1..." +curl -X POST -H 'Content-Type: application/json' -s --data "@resources/contractdefinitions/X123456789012X12345678901234566.json" --header 'X-Api-Key: '${API_KEY} $SERVER_URL/management/v2/contractdefinitions +echo + +# Create a digital twin and register inside CX registry +# To authenticate against CX registry, one needs a valid bearer token which can be issued through postman given the clientId and clientSecret +echo "Create a DT for asset 1 and register it devo CX registry..." + +curl -X POST -s --header 'Content-Type: application/json' --header "Authorization: Bearer ${BEARER_TOKEN//[$'\t\r\n ']}" --data "@resources/digitaltwins/X123456789012X12345678901234566.json" $REGISTRY_URL +echo +echo + + + +echo '**************************Asset 2 **********************' + +echo +# Create Submodel data +echo "Create sample data for asset 2..." +curl -X POST -H 'Content-Type: application/json' -s --data "@resources/payloads/NCR186850B.json" $SERVER_URL/provider_backend/data/${ASSET_ID_2} +echo + +# Create a asset +echo "Create asset 2..." +curl -X POST -H 'Content-Type: application/json' -s --data "@resources/assets/NCR186850B.json" --header 'X-Api-Key: '${API_KEY} $SERVER_URL/management/v2/assets +echo + +# Create a general policy +echo "Create policy for asset 2..." +curl -X POST -H 'Content-Type: application/json' -s --data "@resources/contractpolicies/NCR186850B.json" --header 'X-Api-Key: '${API_KEY} $SERVER_URL/management/v2/policydefinitions +echo + +# Create a contract definition +echo "Create contract definition for asset 2..." +curl -X POST -H 'Content-Type: application/json' -s --data "@resources/contractdefinitions/NCR186850B.json" --header 'X-Api-Key: '${API_KEY} $SERVER_URL/management/v2/contractdefinitions +echo + + +# Create a digital twin and register inside CX registry +# To authenticate against CX registry, one needs a valid bearer token which can be issued through postman given the clientId and clientSecret +echo "Create a DT for asset 2 and register it devo CX registry..." + +curl -X POST -s --header 'Content-Type: application/json' --header "Authorization: Bearer ${BEARER_TOKEN//[$'\t\r\n ']}" --data "@resources/digitaltwins/NCR186850B.json" $REGISTRY_URL +echo +echo + + + +echo '**************************Asset 3 **********************' +# Create Submodel data +echo "Create sample data for asset 3..." +curl -X POST -H 'Content-Type: application/json' -s --data "@resources/payloads/IMR18650V1.json" $SERVER_URL/provider_backend/data/${ASSET_ID_3} +echo + +# Create a asset +echo "Create asset 1..." +curl -X POST -H 'Content-Type: application/json' -s --data "@resources/assets/IMR18650V1.json" --header 'X-Api-Key: '${API_KEY} $SERVER_URL/management/v2/assets +echo + +# Create a general policy +echo "Create policy for asset 3..." +curl -X POST -H 'Content-Type: application/json' -s --data "@resources/contractpolicies/IMR18650V1.json" --header 'X-Api-Key: '${API_KEY} $SERVER_URL/management/v2/policydefinitions +echo + +# Create a contract definition +echo "Create contract definition for asset 3..." +curl -X POST -H 'Content-Type: application/json' -s --data "@resources/contractdefinitions/IMR18650V1.json" --header 'X-Api-Key: '${API_KEY} $SERVER_URL/management/v2/contractdefinitions +echo + +# Create a digital twin and register inside CX registry +# To authenticate against CX registry, one needs a valid bearer token which can be issued through postman given the clientId and clientSecret +echo "Create a DT for asset 3 and register it devo CX registry..." + +curl -X POST -s --header 'Content-Type: application/json' --header "Authorization: Bearer ${BEARER_TOKEN//[$'\t\r\n ']}" --data "@resources/digitaltwins/IMR18650V1.json" $REGISTRY_URL +echo + + +echo '**************************Asset 4 **********************' +# Create Submodel data +echo "Create sample data for asset 4..." +curl -X POST -H 'Content-Type: application/json' -s --data "@resources/payloads/Y792927456954B81677903848654570.json" $SERVER_URL/provider_backend/data/${ASSET_ID_4} +echo + +# Create a asset +echo "Create asset 4..." +curl -X POST -H 'Content-Type: application/json' -s --data "@resources/assets/Y792927456954B81677903848654570.json" --header 'X-Api-Key: '${API_KEY} $SERVER_URL/management/v2/assets +echo + +# Create a general policy +echo "Create policy for asset 4..." +curl -X POST -H 'Content-Type: application/json' -s --data "@resources/contractpolicies/Y792927456954B81677903848654570.json" --header 'X-Api-Key: '${API_KEY} $SERVER_URL/management/v2/policydefinitions +echo + +# Create a contract definition +echo "Create contract definition for asset 4..." +curl -X POST -H 'Content-Type: application/json' -s --data "@resources/contractdefinitions/Y792927456954B81677903848654570.json" --header 'X-Api-Key: '${API_KEY} $SERVER_URL/management/v2/contractdefinitions +echo + + +# Create a digital twin and register inside CX registry +# To authenticate against CX registry, one needs a valid bearer token which can be issued through postman given the clientId and clientSecret +echo "Create a DT for asset 4 and register it devo CX registry..." + +curl -X POST -s --header 'Content-Type: application/json' --header "Authorization: Bearer ${BEARER_TOKEN//[$'\t\r\n ']}" --data "@resources/digitaltwins/Y792927456954B81677903848654570.json" $REGISTRY_URL +echo + +echo 'Provider setup completed...' +echo 'Done' diff --git a/deployment/infrastructure/resources/assets/IMR18650V1.json b/deployment/infrastructure/resources/assets/IMR18650V1.json new file mode 100644 index 000000000..087df0b33 --- /dev/null +++ b/deployment/infrastructure/resources/assets/IMR18650V1.json @@ -0,0 +1,15 @@ +{ + "@context": {}, + "asset": { + "@type": "Asset", + "@id": "365e6fbe-bb34-11ec-8422-0242ac120002-61125dc3-5e6f-4f4b-838d-447432b97918", + "properties": { + "description": "Battery Passport test data" + } + }, + "dataAddress": { + "@type": "DataAddress", + "type": "HttpData", + "baseUrl": "https://materialpass.dev.demo.catena-x.net/provider_backend/data/365e6fbe-bb34-11ec-8422-0242ac120002-61125dc3-5e6f-4f4b-838d-447432b97918" + } +} \ No newline at end of file diff --git a/deployment/infrastructure/resources/assets/NCR186850B.json b/deployment/infrastructure/resources/assets/NCR186850B.json new file mode 100644 index 000000000..a907597cb --- /dev/null +++ b/deployment/infrastructure/resources/assets/NCR186850B.json @@ -0,0 +1,15 @@ +{ + "@context": {}, + "asset": { + "@type": "Asset", + "@id": "1f4a64f0-aba9-498a-917c-4936c24c50cd-49a06ad2-64b7-46c8-9f3b-a718c462ca23", + "properties": { + "description": "Battery Passport test data" + } + }, + "dataAddress": { + "@type": "DataAddress", + "type": "HttpData", + "baseUrl": "https://materialpass.dev.demo.catena-x.net/provider_backend/data/1f4a64f0-aba9-498a-917c-4936c24c50cd-49a06ad2-64b7-46c8-9f3b-a718c462ca23" + } +} \ No newline at end of file diff --git a/deployment/infrastructure/resources/assets/X123456789012X12345678901234566.json b/deployment/infrastructure/resources/assets/X123456789012X12345678901234566.json new file mode 100644 index 000000000..8771995d0 --- /dev/null +++ b/deployment/infrastructure/resources/assets/X123456789012X12345678901234566.json @@ -0,0 +1,15 @@ +{ + "@context": {}, + "asset": { + "@type": "Asset", + "@id": "32aa72de-297a-4405-9148-13e12744028a-699f1245-f57e-4d6b-acdb-ab763665554a", + "properties": { + "description": "Battery Passport test data" + } + }, + "dataAddress": { + "@type": "DataAddress", + "type": "HttpData", + "baseUrl": "https://materialpass.dev.demo.catena-x.net/provider_backend/data/32aa72de-297a-4405-9148-13e12744028a-699f1245-f57e-4d6b-acdb-ab763665554a" + } +} \ No newline at end of file diff --git a/deployment/infrastructure/resources/assets/Y792927456954B81677903848654570.json b/deployment/infrastructure/resources/assets/Y792927456954B81677903848654570.json new file mode 100644 index 000000000..004087a0d --- /dev/null +++ b/deployment/infrastructure/resources/assets/Y792927456954B81677903848654570.json @@ -0,0 +1,15 @@ +{ + "@context": {}, + "asset": { + "@type": "Asset", + "@id": "1f0ef836-40b7-4f31-a9bd-cb6a8960779e-26bf39c5-68a5-43a1-8db7-d33e116a6f61", + "properties": { + "description": "Battery Passport test data" + } + }, + "dataAddress": { + "@type": "DataAddress", + "type": "HttpData", + "baseUrl": "https://materialpass.dev.demo.catena-x.net/provider_backend/data/1f0ef836-40b7-4f31-a9bd-cb6a8960779e-26bf39c5-68a5-43a1-8db7-d33e116a6f61" + } +} \ No newline at end of file diff --git a/deployment/infrastructure/resources/contractdefinitions/IMR18650V1.json b/deployment/infrastructure/resources/contractdefinitions/IMR18650V1.json new file mode 100644 index 000000000..b17a30a0f --- /dev/null +++ b/deployment/infrastructure/resources/contractdefinitions/IMR18650V1.json @@ -0,0 +1,13 @@ +{ + "@context": {}, + "@id": "3", + "@type": "ContractDefinition", + "accessPolicyId": "4b480f48-79a0-4851-a56c-6ef71e19ebb3", + "contractPolicyId": "4b480f48-79a0-4851-a56c-6ef71e19ebb3", + "assetsSelector" : { + "@type" : "CriterionDto", + "operandLeft": "https://w3id.org/edc/v0.0.1/ns/id", + "operator": "=", + "operandRight": "365e6fbe-bb34-11ec-8422-0242ac120002-61125dc3-5e6f-4f4b-838d-447432b97918" + } +} \ No newline at end of file diff --git a/deployment/infrastructure/resources/contractdefinitions/NCR186850B.json b/deployment/infrastructure/resources/contractdefinitions/NCR186850B.json new file mode 100644 index 000000000..3072643a5 --- /dev/null +++ b/deployment/infrastructure/resources/contractdefinitions/NCR186850B.json @@ -0,0 +1,13 @@ +{ + "@context": {}, + "@id": "2", + "@type": "ContractDefinition", + "accessPolicyId": "f873e234-112c-4598-893b-eda0671b7402", + "contractPolicyId": "f873e234-112c-4598-893b-eda0671b7402", + "assetsSelector" : { + "@type" : "CriterionDto", + "operandLeft": "https://w3id.org/edc/v0.0.1/ns/id", + "operator": "=", + "operandRight": "1f4a64f0-aba9-498a-917c-4936c24c50cd-49a06ad2-64b7-46c8-9f3b-a718c462ca23" + } +} \ No newline at end of file diff --git a/deployment/infrastructure/resources/contractdefinitions/X123456789012X12345678901234566.json b/deployment/infrastructure/resources/contractdefinitions/X123456789012X12345678901234566.json new file mode 100644 index 000000000..e0f9c1e38 --- /dev/null +++ b/deployment/infrastructure/resources/contractdefinitions/X123456789012X12345678901234566.json @@ -0,0 +1,13 @@ +{ + "@context": {}, + "@id": "1", + "@type": "ContractDefinition", + "accessPolicyId": "ad8d2c57-cf32-409c-96a8-be59675b6ae5", + "contractPolicyId": "ad8d2c57-cf32-409c-96a8-be59675b6ae5", + "assetsSelector" : { + "@type" : "CriterionDto", + "operandLeft": "https://w3id.org/edc/v0.0.1/ns/id", + "operator": "=", + "operandRight": "32aa72de-297a-4405-9148-13e12744028a-699f1245-f57e-4d6b-acdb-ab763665554a" + } +} \ No newline at end of file diff --git a/deployment/infrastructure/resources/contractdefinitions/Y792927456954B81677903848654570.json b/deployment/infrastructure/resources/contractdefinitions/Y792927456954B81677903848654570.json new file mode 100644 index 000000000..a7c32ec48 --- /dev/null +++ b/deployment/infrastructure/resources/contractdefinitions/Y792927456954B81677903848654570.json @@ -0,0 +1,13 @@ +{ + "@context": {}, + "@id": "131", + "@type": "ContractDefinition", + "accessPolicyId": "0a216bb0-934d-4c93-8e92-ca3b4f862e33", + "contractPolicyId": "0a216bb0-934d-4c93-8e92-ca3b4f862e33", + "assetsSelector" : { + "@type" : "CriterionDto", + "operandLeft": "https://w3id.org/edc/v0.0.1/ns/id", + "operator": "=", + "operandRight": "1f0ef836-40b7-4f31-a9bd-cb6a8960779e-26bf39c5-68a5-43a1-8db7-d33e116a6f61" + } +} \ No newline at end of file diff --git a/deployment/infrastructure/resources/contractpolicies/IMR18650V1.json b/deployment/infrastructure/resources/contractpolicies/IMR18650V1.json new file mode 100644 index 000000000..d11edfed9 --- /dev/null +++ b/deployment/infrastructure/resources/contractpolicies/IMR18650V1.json @@ -0,0 +1,26 @@ +{ + "@context": { + "odrl": "http://www.w3.org/ns/odrl/2/leftOperand" + }, + "@type": "PolicyDefinitionRequestDto", + "@id": "4b480f48-79a0-4851-a56c-6ef71e19ebb3", + "policy": { + "@type": "Policy", + "odrl:permission" : [{ + "odrl:action": "USE", + "odrl:constraint": { + "odrl:constraint": { + "@type": "LogicalConstradev", + "odrl:or": [ + { + "@type": "Contraint", + "odrl:leftOperand": "BusinessPartnerNumber", + "odrl:operator": "EQ", + "odrl:rightOperand": "BPNL0000000010AC" + } + ] + } + } + }] + } +} \ No newline at end of file diff --git a/deployment/infrastructure/resources/contractpolicies/NCR186850B.json b/deployment/infrastructure/resources/contractpolicies/NCR186850B.json new file mode 100644 index 000000000..5780781fd --- /dev/null +++ b/deployment/infrastructure/resources/contractpolicies/NCR186850B.json @@ -0,0 +1,26 @@ +{ + "@context": { + "odrl": "http://www.w3.org/ns/odrl/2/leftOperand" + }, + "@type": "PolicyDefinitionRequestDto", + "@id": "f873e234-112c-4598-893b-eda0671b7402", + "policy": { + "@type": "Policy", + "odrl:permission" : [{ + "odrl:action": "USE", + "odrl:constraint": { + "odrl:constraint": { + "@type": "LogicalConstradev", + "odrl:or": [ + { + "@type": "Contraint", + "odrl:leftOperand": "BusinessPartnerNumber", + "odrl:operator": "EQ", + "odrl:rightOperand": "BPNL0000000010AC" + } + ] + } + } + }] + } +} \ No newline at end of file diff --git a/deployment/infrastructure/resources/contractpolicies/X123456789012X12345678901234566.json b/deployment/infrastructure/resources/contractpolicies/X123456789012X12345678901234566.json new file mode 100644 index 000000000..688f87e6c --- /dev/null +++ b/deployment/infrastructure/resources/contractpolicies/X123456789012X12345678901234566.json @@ -0,0 +1,26 @@ +{ + "@context": { + "odrl": "http://www.w3.org/ns/odrl/2/leftOperand" + }, + "@type": "PolicyDefinitionRequestDto", + "@id": "ad8d2c57-cf32-409c-96a8-be59675b6ae5", + "policy": { + "@type": "Policy", + "odrl:permission" : [{ + "odrl:action": "USE", + "odrl:constraint": { + "odrl:constraint": { + "@type": "LogicalConstradev", + "odrl:or": [ + { + "@type": "Contraint", + "odrl:leftOperand": "BusinessPartnerNumber", + "odrl:operator": "EQ", + "odrl:rightOperand": "BPNL0000000010AC" + } + ] + } + } + }] + } +} \ No newline at end of file diff --git a/deployment/infrastructure/resources/contractpolicies/Y792927456954B81677903848654570.json b/deployment/infrastructure/resources/contractpolicies/Y792927456954B81677903848654570.json new file mode 100644 index 000000000..a5c04ebab --- /dev/null +++ b/deployment/infrastructure/resources/contractpolicies/Y792927456954B81677903848654570.json @@ -0,0 +1,28 @@ +{ + "@context": { + "odrl": "http://www.w3.org/ns/odrl/2/leftOperand" + }, + "@type": "PolicyDefinitionRequestDto", + "@id": "0a216bb0-934d-4c93-8e92-ca3b4f862e33", + "policy": { + "@type": "Policy", + "odrl:permission": [ + { + "odrl:action": "USE", + "odrl:constraint": { + "odrl:constraint": { + "@type": "LogicalConstradev", + "odrl:or": [ + { + "@type": "Contraint", + "odrl:leftOperand": "BusinessPartnerNumber", + "odrl:operator": "EQ", + "odrl:rightOperand": "BPNL0000000010AC" + } + ] + } + } + } + ] + } +} \ No newline at end of file diff --git a/deployment/infrastructure/resources/digitaltwins/IMR18650V1.json b/deployment/infrastructure/resources/digitaltwins/IMR18650V1.json new file mode 100644 index 000000000..90145778a --- /dev/null +++ b/deployment/infrastructure/resources/digitaltwins/IMR18650V1.json @@ -0,0 +1,43 @@ +{ + "description": [], + "globalAssetId": { + "value": [ + "365e6fbe-bb34-11ec-8422-0242ac120002" + ] + }, + "idShort": "Battery_IMR18650V1", + "identification": "365e6fbe-bb34-11ec-8422-0242ac120002", + "specificAssetIds": [ + { + "key": "partInstanceId", + "value": "IMR18650V1" + } + ], + "submodelDescriptors": [ + { + "description": [ + { + "language": "en", + "text": "Battery Passport Submodel" + } + ], + "idShort": "batteryPass", + "identification": "61125dc3-5e6f-4f4b-838d-447432b97918", + "semanticId": { + "value": [ + "urn:bamm:io.catenax.battery.battery_pass:3.0.1#BatteryPass" + ] + }, + "endpoints": [ + { + "interface": "EDC", + "protocolInformation": { + "endpointAddress": "https://materialpass.dev.demo.catena-x.net/BPNL000000000000/365e6fbe-bb34-11ec-8422-0242ac120002-61125dc3-5e6f-4f4b-838d-447432b97918/submodel?content=value&extent=WithBLOBValue", + "endpointProtocol": "IDS/ECLIPSE DATASPACE CONNECTOR", + "endpointProtocolVersion": "0.0.1-SNAPSHOT" + } + } + ] + } + ] +} diff --git a/deployment/infrastructure/resources/digitaltwins/NCR186850B.json b/deployment/infrastructure/resources/digitaltwins/NCR186850B.json new file mode 100644 index 000000000..a756b2b2e --- /dev/null +++ b/deployment/infrastructure/resources/digitaltwins/NCR186850B.json @@ -0,0 +1,43 @@ +{ + "description": [], + "globalAssetId": { + "value": [ + "1f4a64f0-aba9-498a-917c-4936c24c50cd" + ] + }, + "idShort": "Battery_NCR186850B", + "identification": "1f4a64f0-aba9-498a-917c-4936c24c50cd", + "specificAssetIds": [ + { + "key": "partInstanceId", + "value": "NCR186850B" + } + ], + "submodelDescriptors": [ + { + "description": [ + { + "language": "en", + "text": "Battery Passport Submodel" + } + ], + "idShort": "batteryPass", + "identification": "49a06ad2-64b7-46c8-9f3b-a718c462ca23", + "semanticId": { + "value": [ + "urn:bamm:io.catenax.battery.battery_pass:3.0.1#BatteryPass" + ] + }, + "endpoints": [ + { + "interface": "EDC", + "protocolInformation": { + "endpointAddress": "https://materialpass.dev.demo.catena-x.net/BPNL000000000000/1f4a64f0-aba9-498a-917c-4936c24c50cd-49a06ad2-64b7-46c8-9f3b-a718c462ca23/submodel?content=value&extent=WithBLOBValue", + "endpointProtocol": "IDS/ECLIPSE DATASPACE CONNECTOR", + "endpointProtocolVersion": "0.0.1-SNAPSHOT" + } + } + ] + } + ] +} diff --git a/deployment/infrastructure/resources/digitaltwins/X123456789012X12345678901234566.json b/deployment/infrastructure/resources/digitaltwins/X123456789012X12345678901234566.json new file mode 100644 index 000000000..2616cc15d --- /dev/null +++ b/deployment/infrastructure/resources/digitaltwins/X123456789012X12345678901234566.json @@ -0,0 +1,43 @@ +{ + "description": [], + "globalAssetId": { + "value": [ + "32aa72de-297a-4405-9148-13e12744028a" + ] + }, + "idShort": "Battery_X123456789012X12345678901234566", + "identification": "32aa72de-297a-4405-9148-13e12744028a", + "specificAssetIds": [ + { + "key": "partInstanceId", + "value": "X123456789012X12345678901234566" + } + ], + "submodelDescriptors": [ + { + "description": [ + { + "language": "en", + "text": "Battery Passport Submodel" + } + ], + "idShort": "batteryPass", + "identification": "699f1245-f57e-4d6b-acdb-ab763665554a", + "semanticId": { + "value": [ + "urn:bamm:io.catenax.battery.battery_pass:3.0.1#BatteryPass" + ] + }, + "endpoints": [ + { + "interface": "EDC", + "protocolInformation": { + "endpointAddress": "https://materialpass.dev.demo.catena-x.net/BPNL000000000000/32aa72de-297a-4405-9148-13e12744028a-699f1245-f57e-4d6b-acdb-ab763665554a/submodel?content=value&extent=WithBLOBValue", + "endpointProtocol": "IDS/ECLIPSE DATASPACE CONNECTOR", + "endpointProtocolVersion": "0.0.1-SNAPSHOT" + } + } + ] + } + ] +} diff --git a/deployment/infrastructure/resources/digitaltwins/Y792927456954B81677903848654570.json b/deployment/infrastructure/resources/digitaltwins/Y792927456954B81677903848654570.json new file mode 100644 index 000000000..f99dd57a7 --- /dev/null +++ b/deployment/infrastructure/resources/digitaltwins/Y792927456954B81677903848654570.json @@ -0,0 +1,43 @@ +{ + "description": [], + "globalAssetId": { + "value": [ + "1f0ef836-40b7-4f31-a9bd-cb6a8960779e" + ] + }, + "idShort": "Battery_Y792927456954B81677903848654570", + "identification": "1f0ef836-40b7-4f31-a9bd-cb6a8960779e", + "specificAssetIds": [ + { + "key": "partInstanceId", + "value": "Y792927456954B81677903848654570" + } + ], + "submodelDescriptors": [ + { + "description": [ + { + "language": "en", + "text": "Battery Passport Submodel" + } + ], + "idShort": "batteryPass", + "identification": "26bf39c5-68a5-43a1-8db7-d33e116a6f61", + "semanticId": { + "value": [ + "urn:bamm:io.catenax.battery.battery_pass:3.0.1#BatteryPass" + ] + }, + "endpoints": [ + { + "interface": "EDC", + "protocolInformation": { + "endpointAddress": "https://materialpass.dev.demo.catena-x.net/BPNL000000000000/1f0ef836-40b7-4f31-a9bd-cb6a8960779e-26bf39c5-68a5-43a1-8db7-d33e116a6f61/submodel?content=value&extent=WithBLOBValue", + "endpointProtocol": "IDS/ECLIPSE DATASPACE CONNECTOR", + "endpointProtocolVersion": "0.0.1-SNAPSHOT" + } + } + ] + } + ] +} diff --git a/deployment/infrastructure/resources/payloads/IMR18650V1.json b/deployment/infrastructure/resources/payloads/IMR18650V1.json new file mode 100644 index 000000000..3310386e8 --- /dev/null +++ b/deployment/infrastructure/resources/payloads/IMR18650V1.json @@ -0,0 +1,248 @@ +{ + "electrochemicalProperties" : { + "ratedCapacity" : 94, + "batteryEnergy" : { + "energyRoundtripEfficiencyChange" : 48.2, + "maximumAllowedBatteryEnergy" : 85000, + "energyRoundtripEfficiency" : 25 + }, + "ratioMaximumAllowedBatteryPowerAndMaximumAllowedBatteryEnergy" : 0.588, + "batteryVoltage" : { + "nominalVoltage" : 3.7, + "maxVoltage" : 4.2, + "minVoltage" : 2.5 + }, + "internalResistance" : { + "cellinternalResistance" : 0.36, + "packinternalResistanceIncrease" : 1, + "packinternalResistance" : 100 + }, + "capacityThresholdExhaustion" : 23, + "batteryPower" : { + "powerFade" : 23, + "originalPowerCapability" : -1.7976931348623157E308, + "originalPowerCapabilityLimits" : -1.7976931348623157E308, + "maximumAllowedBatteryPower" : -1.7976931348623157E308, + "powerCapabilityAt20Charge" : -1.7976931348623157E308, + "powerCapabilityAt80Charge" : -1.7976931348623157E308 + }, + "capacityFade" : 1.55 + }, + "document" : { + "responsibleSourcing" : [ { + "title" : "2021 Responsible Sourcing document", + "fileLocation" : null + } ], + "packagingInstructions" : [ { + "title" : "Packing Instruction v.2.0", + "fileLocation" : null + } ], + "transportationInstructions" : [ { + "title" : "Transport manual", + "fileLocation" : null + } ], + "vehicleDismantlingProcedure" : [ { + "title" : "Car dismantling manual", + "fileLocation" : "http://www.ietf.org/rfc/rfc2396.txt" + } ], + "testReportsResults" : [ { + "title" : "Battery Test Reports", + "fileLocation" : "http://www.Batterytestreports.de" + } ], + "batteryDismantlingProcedure" : [ { + "title" : "Dismantling Manual", + "fileLocation" : "http://www.dissmantlingmanual.org" + } ], + "safetyMeasures" : [ { + "title" : "Safety Instruction", + "fileLocation" : "http://www.safetyinstructions.txt" + } ], + "declarationOfConformity" : [ { + "title" : "Declaration of Conformity No. 3", + "fileLocation" : null + } ] + }, + "datePlacedOnMarket" : "27.04.2022", + "cellChemistry" : { + "electrolyteComposition" : [ { + "materialPercentageMassFraction" : null, + "materialWeight" : null, + "materialName" : "dimethyl carbonate (DCM)" + } ], + "anodeCompositionOther" : [ { + "materialPercentageMassFraction" : null, + "materialWeight" : null, + "materialName" : "Carboxymethyl cellulose" + } ], + "recyclateContentActiveMaterials" : [ { + "materialPercentageMassFraction" : 6, + "materialWeight" : null, + "materialName" : "Ni/2021/PlantE" + }, { + "materialPercentageMassFraction" : 4, + "materialWeight" : null, + "materialName" : "Li/2021/PlantE" + }, { + "materialPercentageMassFraction" : 0, + "materialWeight" : null, + "materialName" : "Pb(battery model does not contain Pb)" + }, { + "materialPercentageMassFraction" : 0, + "materialWeight" : null, + "materialName" : "Co(battery model does not contain Pb)" + } ], + "anodeActiveMaterials" : [ { + "materialPercentageMassFraction" : null, + "materialWeight" : null, + "materialName" : "Graphite" + } ], + "cathodeActiveMaterials" : [ { + "materialPercentageMassFraction" : null, + "materialWeight" : null, + "materialName" : "LiMn2O4 Lithium Manganese Oxide" + } ], + "cathodeCompositionOther" : [ { + "materialPercentageMassFraction" : null, + "materialWeight" : null, + "materialName" : "binder:PVDF" + } ] + }, + "physicalDimensions" : { + "length" : 2000, + "width" : 1000, + "weight" : 3500, + "diameter" : null, + "height" : 200 + }, + "temperatureRangeIdleState" : { + "temperatureRangeIdleStateUpperLimit" : 50, + "temperatureRangeIdleStateLowerLimit" : -20 + }, + "batteryCycleLife" : { + "cycleLifeTestCRate" : 2, + "cycleLifeTestDepthOfDischarge" : 1.8, + "expectedLifetime" : 2500 + }, + "manufacturer" : { + "name" : "CompanyE", + "contact" : { + "faxNumber" : "+49 89 0987654324", + "website" : "https://www.CompanyE.com", + "phoneNumber" : "+49 89 1234567893", + "email" : "companyE@company.com" + }, + "address" : { + "locality" : { + "value" : "CityE", + "technicalKey" : "BLOCK" + }, + "country" : { + "shortName" : "Germany" + }, + "postCode" : { + "value" : "65-250E", + "technicalKey" : "CEDEX" + }, + "thoroughfare" : { + "value" : "StreetE", + "number" : "1", + "technicalKey" : "STREET" + }, + "premise" : { + "value" : null, + "technicalKey" : "BUILDING" + }, + "postalDeliveryPoint" : { + "value" : null, + "technicalKey" : "intERURBAN_DELIVERY_POint" + } + } + }, + "warrantyPeriod" : "96", + "composition" : { + "compositionOfBattery" : [ { + "materialPercentageMassFraction" : null, + "materialWeight" : null, + "materialName" : "Separator: PE" + } ], + "criticalRawMaterials" : "Lithium, Natural graphite", + "components" : { + "componentsPartNumber" : "Voltage cables", + "componentsSupplier" : [ { + "componentsSupplierName" : "AB Corporation", + "address" : { + "locality" : { + "value" : "CityF", + "technicalKey" : "BLOCK" + }, + "country" : { + "shortName" : "Germany" + }, + "postCode" : { + "value" : "65-250F", + "technicalKey" : "CEDEX" + }, + "thoroughfare" : { + "value" : "StreetF", + "number" : "1", + "technicalKey" : "STREET" + }, + "premise" : { + "value" : "PlantF", + "technicalKey" : "BUILDING" + }, + "postalDeliveryPoint" : { + "value" : null, + "technicalKey" : "INTERURBAN_DELIVERY_POINT" + } + }, + "contact" : { + "faxNumber" : "+49 89 0987654324", + "website" : "https://www.companyF.com", + "phoneNumber" : "+49 89 1234567893", + "email" : "companyF@companyF.com" + } + } ] + } + }, + "manufacturing" : { + "dateOfManufacturing" : "2022-01-24", + "address" : { + "locality" : { + "value" : "CityE", + "technicalKey" : "BLOCK" + }, + "country" : { + "shortName" : "Germany" + }, + "postCode" : { + "value" : "65-250E", + "technicalKey" : "CEDEX" + }, + "thoroughfare" : { + "value" : "StreetE", + "number" : "1", + "technicalKey" : "STREET" + }, + "premise" : { + "value" : "PlantE", + "technicalKey" : "BUILDING" + }, + "postalDeliveryPoint" : { + "value" : "GateE", + "technicalKey" : "INTERURBAN_DELIVERY_POINT" + } + } + }, + "batteryIdentification" : { + "batteryType" : "Lithium-Manganese-Oxide (LMO)", + "batteryIDDMCCode" : "IMR18650V1", + "batteryModel" : "Pi4 Orionis" + }, + "stateOfBattery" : { + "stateOfHealth" : 20, + "statusBattery" : "first life", + "stateOfCharge" : 50 + }, + "cO2FootprintTotal" : 210 + } diff --git a/deployment/infrastructure/resources/payloads/NCR186850B.json b/deployment/infrastructure/resources/payloads/NCR186850B.json new file mode 100644 index 000000000..f83fdd423 --- /dev/null +++ b/deployment/infrastructure/resources/payloads/NCR186850B.json @@ -0,0 +1,283 @@ +{ + "electrochemicalProperties": { + "ratedCapacity": 56, + "batteryEnergy": { + "energyRoundtripEfficiencyChange": 45, + "maximumAllowedBatteryEnergy": 75000.0, + "energyRoundtripEfficiency": 80 + }, + "ratioMaximumAllowedBatteryPowerAndMaximumAllowedBatteryEnergy": 0.666, + "batteryVoltage": { + "nominalVoltage": 3.6, + "maxVoltage": 4.2, + "minVoltage": 2.5 + }, + "internalResistance": { + "cellinternalResistance": 3.0, + "packinternalResistanceIncrease": 2, + "packinternalResistance": 80 + }, + "capacityThresholdExhaustion": 23, + "batteryPower": { + "powerFade": 23, + "originalPowerCapability": -1.7976931348623157E308, + "originalPowerCapabilityLimits": -1.7976931348623157E308, + "maximumAllowedBatteryPower": -1.7976931348623157E308, + "powerCapabilityAt20Charge": -1.7976931348623157E308, + "powerCapabilityAt80Charge": -1.7976931348623157E308 + }, + "capacityFade": 2.0 + }, + "document": { + "responsibleSourcing": [ + { + "title": "Sustainability Report 2021", + "fileLocation": "telnet://192.0.2.16:80/" + } + ], + "packagingInstructions": [ + { + "title": "Packaging and transport Instruction", + "fileLocation": "telnet://192.0.2.16:80/" + } + ], + "transportationInstructions": [ + { + "title": "Packaging and transport Instruction", + "fileLocation": "ftp://ftp.is.co.za/rfc/rfc1808.txt" + } + ], + "vehicleDismantlingProcedure": [ + { + "title": "Packaging and transport Instruction", + "fileLocation": "http://www.ietf.org/rfc/rfc2396.txt" + } + ], + "testReportsResults": [ + { + "title": "Certificates of Testing battery", + "fileLocation": "" + } + ], + "batteryDismantlingProcedure": [ + { + "title": "Certificates of Testing battery", + "fileLocation": "http://www.wikipedia.org" + } + ], + "safetyMeasures": [ + { + "title": "Battery user safety precautions", + "fileLocation": "ftp://ftp.is.co.za/rfc/rfc1808.txt" + } + ], + "declarationOfConformity": [ + { + "title": "Declaration of Conformity No. 2", + "fileLocation": "" + } + ] + }, + "datePlacedOnMarket": "27.03.2022", + "cellChemistry": { + "electrolyteComposition": [ + { + "materialPercentageMassFraction": null, + "materialWeight": null, + "materialName": "LiPF6" + } + ], + "anodeCompositionOther": [ + { + "materialPercentageMassFraction": null, + "materialWeight": null, + "materialName": "Styren butadien" + } + ], + "recyclateContentActiveMaterials": [ + { + "materialPercentageMassFraction": 4, + "materialWeight": null, + "materialName": "Ni/2022/PlantC" + }, + { + "materialPercentageMassFraction": 5, + "materialWeight": null, + "materialName": "Li/2021/PlantC" + }, + { + "materialPercentageMassFraction": 0, + "materialWeight": null, + "materialName": "Pb(battery model does not contain Pb)" + }, + { + "materialPercentageMassFraction": 15, + "materialWeight": null, + "materialName": "Co/2021/PlantC" + } + ], + "anodeActiveMaterials": [ + { + "materialPercentageMassFraction": null, + "materialWeight": null, + "materialName": "SiO2-C" + } + ], + "cathodeActiveMaterials": [ + { + "materialPercentageMassFraction": null, + "materialWeight": null, + "materialName": "NCA (Lithium nickel cobalt aluminum oxide)" + } + ], + "cathodeCompositionOther": [ + { + "materialPercentageMassFraction": null, + "materialWeight": null, + "materialName": "carbon black" + } + ] + }, + "physicalDimensions": { + "length": 1800, + "width": 1000, + "weight": 2000, + "diameter": null, + "height": 150 + }, + "temperatureRangeIdleState": { + "temperatureRangeIdleStateUpperLimit": 40, + "temperatureRangeIdleStateLowerLimit": -20 + }, + "batteryCycleLife": { + "cycleLifeTestCRate": 2, + "cycleLifeTestDepthOfDischarge": 1.5, + "expectedLifetime": 3000 + }, + "manufacturer": { + "name": "Company C", + "contact": { + "faxNumber": "+49 89 0987654323", + "website": "http://www.CompanyC.com", + "phoneNumber": "+49 89 1234567892", + "email": "companyC@company.com" + }, + "address": { + "locality": { + "value": "CityC", + "technicalKey": "BLOCK" + }, + "country": { + "shortName": "Germany" + }, + "postCode": { + "value": "65-250A", + "technicalKey": "CEDEX" + }, + "thoroughfare": { + "value": "StreetA", + "number": "1", + "technicalKey": "STREET" + }, + "premise": { + "value": "", + "technicalKey": "CEDEX" + }, + "postalDeliveryPoint": { + "value": "Tor 1", + "technicalKey": "intERURBAN_DELIVERY_POint" + } + } + }, + "warrantyPeriod": "120", + "composition": { + "compositionOfBattery": [ + { + "materialPercentageMassFraction": null, + "materialWeight": null, + "materialName": "Co -hazardous, Current collector: Aluminum, LiPF6 - ( conducting lithium salt - toxic, in combination with moisture nad elevated temp. Decompose to HF) . Casing: iron, aluminum laminated plastic" + } + ], + "criticalRawMaterials": "Lithium, Cobalt, Natural graphite", + "components": { + "componentsPartNumber": "Casing Tray: Model C", + "componentsSupplier": [ + { + "componentsSupplierName": "XY Corporation", + "address": { + "locality": { + "value": "CityD", + "technicalKey": "BLOCK" + }, + "country": { + "shortName": "Germany" + }, + "postCode": { + "value": "65-250B", + "technicalKey": "CEDEX" + }, + "thoroughfare": { + "value": "StreetD", + "number": "1", + "technicalKey": "STREET" + }, + "premise": { + "value": "PlantD", + "technicalKey": "BUILDING" + }, + "postalDeliveryPoint": { + "value": "GateD", + "technicalKey": "INTERURBAN_DELIVERY_POINT" + } + }, + "contact": { + "faxNumber": "+49 89 0987654322", + "website": "https://www.companyD.com", + "phoneNumber": "+49 89 1234567890", + "email": "companyD@company.com" + } + } + ] + } + }, + "manufacturing": { + "dateOfManufacturing": "2022-01-24", + "address": { + "locality": { + "value": "CityC", + "technicalKey": "BLOCK" + }, + "country": { + "shortName": "Germany" + }, + "postCode": { + "value": "65-250A", + "technicalKey": "CEDEX" + }, + "thoroughfare": { + "value": "StreetC", + "number": "1", + "technicalKey": "STREET" + }, + "premise": { + "value": "PlantC", + "technicalKey": "BUILDING" + }, + "postalDeliveryPoint": { + "value": "GateC", + "technicalKey": "INTERURBAN_DELIVERY_POINT" + } + } + }, + "batteryIdentification": { + "batteryType": "NCA", + "batteryIDDMCCode": "NCR186850B", + "batteryModel": "Li-ion S-model" + }, + "stateOfBattery": { + "stateOfHealth": 50, + "statusBattery": "first life/ waste/ repaired/ repurposed/ recycled", + "stateOfCharge": 33 + }, + "cO2FootprintTotal": 124.0 +} diff --git a/deployment/infrastructure/resources/payloads/X123456789012X12345678901234566.json b/deployment/infrastructure/resources/payloads/X123456789012X12345678901234566.json new file mode 100644 index 000000000..e8129e4c1 --- /dev/null +++ b/deployment/infrastructure/resources/payloads/X123456789012X12345678901234566.json @@ -0,0 +1,344 @@ +{ + "electrochemicalProperties": { + "ratedCapacity": 120, + "batteryEnergy": { + "energyRoundtripEfficiencyChange": 67, + "maximumAllowedBatteryEnergy": 90000, + "energyRoundtripEfficiency": 56 + }, + "ratioMaximumAllowedBatteryPowerAndMaximumAllowedBatteryEnergy": 0.611, + "batteryVoltage": { + "nominalVoltage": 4.3, + "maxVoltage": 6, + "minVoltage": 2.04 + }, + "internalResistance": { + "cellinternalResistance": 45, + "packinternalResistanceIncrease": 23, + "packinternalResistance": 67 + }, + "capacityThresholdExhaustion": 23, + "batteryPower": { + "powerFade": 23, + "originalPowerCapability": 305, + "originalPowerCapabilityLimits": 12, + "maximumAllowedBatteryPower": 308, + "powerCapabilityAt20Charge": -308, + "powerCapabilityAt80Charge": 8 + }, + "capacityFade": 34 + }, + "document": { + "responsibleSourcing": [ + { + "title": "LlN", + "fileLocation": "telnet://192.0.2.16:80/" + }, + { + "title": "LlN 2222", + "fileLocation": "telnet://192.0.2.16:80/" + }, + { + "title": "LlN 2222", + "fileLocation": "telnet://192.0.2.16:80/" + }, + { + "title": "LlN 2222", + "fileLocation": "telnet://192.0.2.16:80/" + }, + { + "title": "LlN 2222", + "fileLocation": "telnet://192.0.2.16:80/" + }, + { + "title": "LlN 2222", + "fileLocation": "telnet://192.0.2.16:80/" + }, + { + "title": "LlN 2222", + "fileLocation": "telnet://192.0.2.16:80/" + } + ], + "packagingInstructions": [ + { + "title": "eOMtThyhVNLWUZNRcBaQKxI", + "fileLocation": "telnet://192.0.2.16:80/" + } + ], + "transportationInstructions": [ + { + "title": "yedUsFwdkelQbxeTeQOvaScfqIOOmaa", + "fileLocation": "ftp://ftp.is.co.za/rfc/rfc1808.txt" + } + ], + "vehicleDismantlingProcedure": [ + { + "title": "JxkyvRnL", + "fileLocation": "http://www.ietf.org/rfc/rfc2396.txt" + } + ], + "testReportsResults": [ + { + "title": "UMaAIKKIkknjWEXJUfPxxQHeWKEJ", + "fileLocation": "telnet://192.0.2.16:80/" + } + ], + "batteryDismantlingProcedure": [ + { + "title": "RYtGKbgicZaHCBRQDSx", + "fileLocation": "http://www.wikipedia.org" + } + ], + "safetyMeasures": [ + { + "title": "VLhpfQGTMDYpsBZxvfBoeygjb", + "fileLocation": "ftp://ftp.is.co.za/rfc/rfc1808.txt" + } + ], + "declarationOfConformity": [ + { + "title": "dpHYZGhtgdntugzvvKAXLhM", + "fileLocation": "http://www.wikipedia.org" + } + ] + }, + "datePlacedOnMarket": "2023-03-08", + "cellChemistry": { + "electrolyteComposition": [ + { + "materialPercentageMassFraction": 4, + "materialName": "Ni", + "materialWeight": 2.5 + } + ], + "anodeCompositionOther": [ + { + "materialPercentageMassFraction": 15, + "materialName": "Co", + "materialWeight": 2.5 + } + ], + "recyclateContentActiveMaterials": [ + { + "materialPercentageMassFraction": 5, + "materialName": "Li", + "materialWeight": 2.5 + } + ], + "anodeActiveMaterials": [ + { + "materialPercentageMassFraction": 5, + "materialName": "Graphite", + "materialWeight": 2.5 + } + ], + "cathodeActiveMaterials": [ + { + "materialPercentageMassFraction": 14, + "materialName": "Ni", + "materialWeight": 2.5 + }, + { + "materialPercentageMassFraction": 9, + "materialName": "Co", + "materialWeight": 2.5 + }, + { + "materialPercentageMassFraction": 19, + "materialName": "Li", + "materialWeight": 2.5 + }, + { + "materialPercentageMassFraction": 0, + "materialName": "Pb", + "materialWeight": 2.5 + } + ], + "cathodeCompositionOther": [ + { + "materialPercentageMassFraction": 19, + "materialName": "Pb", + "materialWeight": 2.5 + } + ] + }, + "physicalDimensions": { + "length": 20000, + "width": 1000, + "weight": 1007, + "diameter": 3, + "height": 1 + }, + "temperatureRangeIdleState": { + "temperatureRangeIdleStateUpperLimit": 67, + "temperatureRangeIdleStateLowerLimit": -22 + }, + "batteryCycleLife": { + "cycleLifeTestCRate": 45, + "cycleLifeTestDepthOfDischarge": 2, + "expectedLifetime": 1200 + }, + "manufacturer": { + "name": "Company A", + "contact": { + "faxNumber": "+49 89 0987654321", + "website": "https://www.samsung.com", + "phoneNumber": "+49 89 1234567890", + "email": "test.mail@example.com" + }, + "address": { + "locality": { + "value": "Mannheim", + "technicalKey": "BLOCK" + }, + "country": { + "shortName": "TG-Y" + }, + "postCode": { + "value": "68161\\12", + "technicalKey": "CEDEX" + }, + "thoroughfare": { + "value": "Bernstraße", + "number": "45", + "technicalKey": "STREET" + }, + "premise": { + "value": "Werk 1", + "technicalKey": "BUILDING" + }, + "postalDeliveryPoint": { + "value": "Tor 1", + "technicalKey": "intERURBAN_DELIVERY_POint" + } + } + }, + "warrantyPeriod": 60, + "composition": { + "compositionOfBattery": [ + { + "materialPercentageMassFraction": 19, + "materialName": "Graphite", + "materialWeight": 2.5 + }, + { + "materialPercentageMassFraction": 19, + "materialName": "Graphite", + "materialWeight": 2.5 + }, + { + "materialPercentageMassFraction": 19, + "materialName": "Graphite", + "materialWeight": 2.5 + }, + { + "materialPercentageMassFraction": 19, + "materialName": "Graphite", + "materialWeight": 2.5 + }, + { + "materialPercentageMassFraction": 19, + "materialName": "Graphite", + "materialWeight": 2.5 + }, + { + "materialPercentageMassFraction": 19, + "materialName": "Graphite", + "materialWeight": 2.5 + }, + { + "materialPercentageMassFraction": 19, + "materialName": "Graphite", + "materialWeight": 2.5 + }, + { + "materialPercentageMassFraction": 19, + "materialName": "Graphite", + "materialWeight": 2.5 + } + ], + "criticalRawMaterials": "Lithium, Cobalt, Natural graphite", + "components": { + "componentsPartNumber": [ + "Case xxxxxxx/xx; Controller xxxxxxx/xx" + ], + "componentsSupplier": [ + { + "componentsSupplierName": "XY Corporation", + "address": { + "locality": { + "value": "Mannheim", + "technicalKey": "BLOCK" + }, + "country": { + "shortName": "" + }, + "postCode": { + "value": "68161\\12", + "technicalKey": "CEDEX" + }, + "thoroughfare": { + "value": "Bernstraße", + "number": "45", + "technicalKey": "STREET" + }, + "premise": { + "value": "Werk 1", + "technicalKey": "BUILDING" + }, + "postalDeliveryPoint": { + "value": "Tor 1", + "technicalKey": "INTERURBAN_DELIVERY_POINT" + } + }, + "contact": { + "faxNumber": "+49 89 0987654321", + "website": "https://www.samsung.com", + "phoneNumber": "+49 89 1234567890", + "email": "test.mail@example.com" + } + } + ] + } + }, + "manufacturing": { + "dateOfManufacturing": "2023-03-07", + "address": { + "locality": { + "value": "Mannheim", + "technicalKey": "BLOCK" + }, + "country": { + "shortName": "" + }, + "postCode": { + "value": "68161\\12", + "technicalKey": "CEDEX" + }, + "thoroughfare": { + "value": "Bernstraße", + "number": "45", + "technicalKey": "STREET" + }, + "premise": { + "value": "Werk 1", + "technicalKey": "BUILDING" + }, + "postalDeliveryPoint": { + "value": "Tor 1", + "technicalKey": "INTERURBAN_DELIVERY_POINT" + } + } + }, + "batteryIdentification": { + "batteryType": "Li-Ion", + "batteryIDDMCCode": "X123456789012X12345678901234566", + "batteryModel": "SB 28" + }, + "stateOfBattery": { + "stateOfHealth": 12, + "statusBattery": "first life", + "stateOfCharge": 23 + }, + "cO2FootprintTotal": "110" + } diff --git a/deployment/infrastructure/resources/payloads/Y792927456954B81677903848654570.json b/deployment/infrastructure/resources/payloads/Y792927456954B81677903848654570.json new file mode 100644 index 000000000..caab69619 --- /dev/null +++ b/deployment/infrastructure/resources/payloads/Y792927456954B81677903848654570.json @@ -0,0 +1,390 @@ +{ + "electrochemicalProperties": { + "ratedCapacity": "103", + "batteryEnergy": { + "energyRoundtripEfficiencyChange": "0.2", + "maximumAllowedBatteryEnergy": "105", + "energyRoundtripEfficiency": "86" + }, + "ratioMaximumAllowedBatteryPowerAndMaximumAllowedBatteryEnergy": "5", + "batteryVoltage": { + "nominalVoltage": "376.4", + "maxVoltage": "438.6", + "minVoltage": "285.6" + }, + "internalResistance": { + "cellinternalResistance": "45", + "packinternalResistanceIncrease": "1.3", + "packinternalResistance": "3" + }, + "capacityThresholdExhaustion": "3", + "batteryPower": { + "powerFade": "0.3", + "originalPowerCapability": "395", + "originalPowerCapabilityLimits": "320", + "maximumAllowedBatteryPower": "420", + "powerCapabilityAt20Charge": "78", + "powerCapabilityAt80Charge": "97" + }, + "capacityFade": "1.43" + }, + "document": { + "responsibleSourcing": [ + { + "title": "Responsible sourcing report 2023", + "fileLocation": "telnet://192.0.2.16:84/" + } + ], + "packagingInstructions": [ + { + "title": "Packaging instruction for HVB B", + "fileLocation": "telnet://192.0.2.16:11/" + } + ], + "transportationInstructions": [ + { + "title": "Shipping guidelines", + "fileLocation": "ftp://ftp.is.co.za/rfc/rfc1808.txt" + } + ], + "vehicleDismantlingProcedure": [ + { + "title": "Dismantling procedure of HVB B from vehicle", + "fileLocation": "http://www.ietf.org/rfc/rfc2396.txt" + } + ], + "testReportsResults": [ + { + "title": "Laboratory test results HVB B", + "fileLocation": "telnet://192.0.2.16:81/" + } + ], + "batteryDismantlingProcedure": [ + { + "title": "Dismantling procedure of HVB B", + "fileLocation": "http://www.ietf.org/rfc/rfc2390.txt" + } + ], + "safetyMeasures": [ + { + "title": "HVB B safety document", + "fileLocation": "ftp://ftp.is.co.za/rfc/rfc1819.txt " + } + ], + "declarationOfConformity": [ + { + "title": "Declaration of conformity 3", + "fileLocation": "telnet://192.0.2.16:94/" + } + ] + }, + "cellChemistry": { + "electrolyteComposition": [ + { + "materialName": "electrolyte", + "materialWeight": 138.7, + "materialPercentageMassFraction": 23.3 + }, + { + "materialName": "others", + "materialWeight": 450.46, + "materialPercentageMassFraction": 56.2 + }, + { + "materialName": "methylpropiophenon", + "materialWeight": 444.03, + "materialPercentageMassFraction": 20.5 + } + ], + "anodeCompositionOther": [ + { + "materialName": "glass fibers", + "materialWeight": 122.98, + "materialPercentageMassFraction": 43.2 + }, + { + "materialName": "ferrum", + "materialWeight": 490.74, + "materialPercentageMassFraction": 19.7 + }, + { + "materialName": "aluminium", + "materialWeight": 261.17, + "materialPercentageMassFraction": 28.9 + }, + { + "materialName": "isolation material", + "materialWeight": 141.68, + "materialPercentageMassFraction": 8.2 + } + ], + "recyclateContentActiveMaterials": [ + { + "materialName": "lithium cobalt oxide", + "materialWeight": 145.49, + "materialPercentageMassFraction": 75.5 + }, + { + "materialName": "manganese", + "materialWeight": 111.98, + "materialPercentageMassFraction": 24.5 + } + ], + "anodeActiveMaterials": [ + { + "materialName": "graphite", + "materialWeight": 239.55, + "materialPercentageMassFraction": 0.6 + }, + { + "materialName": "copper foil", + "materialWeight": 492.93, + "materialPercentageMassFraction": 99.4 + } + ], + "cathodeActiveMaterials": [ + { + "materialName": "lithium cobalt oxide", + "materialWeight": 101.12, + "materialPercentageMassFraction": 15.9 + }, + { + "materialName": "lithium nickel manganese cobalt oxide", + "materialWeight": 337.73, + "materialPercentageMassFraction": 12.3 + }, + { + "materialName": "lithium nickel cobalt aluminium oxide", + "materialWeight": 437.02, + "materialPercentageMassFraction": 71.9 + } + ], + "cathodeCompositionOther": [ + { + "materialName": "aluminium", + "materialWeight": 326.06, + "materialPercentageMassFraction": 13 + }, + { + "materialName": "beryllium", + "materialWeight": 441.63, + "materialPercentageMassFraction": 5.5 + }, + { + "materialName": "styrene butadiene copolymer", + "materialWeight": 207.5, + "materialPercentageMassFraction": 47.8 + }, + { + "materialName": "cobalt nickel manganese", + "materialWeight": 471.56, + "materialPercentageMassFraction": 33.7 + } + ] + }, + "physicalDimensions": { + "length": "2573", + "width": "1740", + "weight": "684.2", + "diameter": "50", + "height": "280" + }, + "temperatureRangeIdleState": { + "temperatureRangeIdleStateUpperLimit": "45", + "temperatureRangeIdleStateLowerLimit": "-22" + }, + "batteryCycleLife": { + "cycleLifeTestCRate": "2", + "cycleLifeTestDepthOfDischarge": "43", + "expectedLifetime": "600" + }, + "manufacturer": { + "name": "BMW Group", + "contact": { + "faxNumber": "N/A", + "website": "https://www.bmwgroup.com/", + "phoneNumber": "+49893820", + "email": "werke@bmwgroup.com" + }, + "address": { + "locality": { + "value": "Munich", + "technicalKey": "CITY" + }, + "country": { + "shortName": "GER" + }, + "postCode": { + "value": "80809", + "technicalKey": "REGULAR" + }, + "thoroughfare": { + "value": "Am Olympiapark", + "number": "2", + "technicalKey": "STREET" + }, + "premise": { + "value": "PLANT 1", + "technicalKey": "OTHER" + }, + "postalDeliveryPoint": { + "value": "Gate 1", + "technicalKey": "INTERURBAN_DELIVERY_POINT" + } + } + }, + "warrantyPeriod": "60", + "composition": { + "compositionOfBattery": [ + { + "materialName": "steel", + "materialWeight": 69883, + "materialPercentageMassFraction": 11 + }, + { + "materialName": "aluminium", + "materialWeight": 101648, + "materialPercentageMassFraction": 16 + }, + { + "materialName": "lithium", + "materialWeight": 6353, + "materialPercentageMassFraction": 1 + }, + { + "materialName": "cobalt", + "materialWeight": 19059, + "materialPercentageMassFraction": 3 + }, + { + "materialName": "nickel", + "materialWeight": 19059, + "materialPercentageMassFraction": 3 + }, + { + "materialName": "manganese", + "materialWeight": 19059, + "materialPercentageMassFraction": 3 + }, + { + "materialName": "sealant", + "materialWeight": 3176.5, + "materialPercentageMassFraction": 0.5 + }, + { + "materialName": "graphite", + "materialWeight": 50824, + "materialPercentageMassFraction": 8 + }, + { + "materialName": "insulator", + "materialWeight": 12706, + "materialPercentageMassFraction": 2 + }, + { + "materialName": "uv varnish", + "materialWeight": 1270.6, + "materialPercentageMassFraction": 0.2 + }, + { + "materialName": "copper", + "materialWeight": 76236, + "materialPercentageMassFraction": 12 + }, + { + "materialName": "polyamid", + "materialWeight": 69883, + "materialPercentageMassFraction": 11 + }, + { + "materialName": "others", + "materialWeight": 186142.9, + "materialPercentageMassFraction": 29.3 + } + ], + "criticalRawMaterials": "lithium, nickel, cobalt, graphite, manganese, copper, aluminium", + "components": { + "componentsPartNumber": [ + "5819826-01", + "2389175-01" + ], + "componentsSupplier": [ + { + "componentsSupplierName": "Dräxlmaier", + "address": { + "locality": { + "value": "Vilsbiburg", + "technicalKey": "CITY" + }, + "country": { + "shortName": "GER" + }, + "postCode": { + "value": "84137", + "technicalKey": "REGULAR" + }, + "thoroughfare": { + "value": "Landshuter Straße", + "number": "100", + "technicalKey": "STREET" + }, + "premise": { + "value": "Headquarters", + "technicalKey": "OTHER" + }, + "postalDeliveryPoint": { + "value": "GATE 2", + "technicalKey": "INTERURBAN_DELIVERY_POINT" + } + }, + "contact": { + "faxNumber": "+498741471940", + "website": "https://www.draexlmaier.com/", + "phoneNumber": "+498741470", + "email": "info@draexlmaier.com" + } + } + ] + } + }, + "manufacturing": { + "dateOfManufacturing": "2022-11-22", + "address": { + "locality": { + "value": "Munich", + "technicalKey": "CITY" + }, + "country": { + "shortName": "GER" + }, + "postCode": { + "value": "80809", + "technicalKey": "REGULAR" + }, + "thoroughfare": { + "value": "Am Olympiapark", + "number": "2", + "technicalKey": "STREET" + }, + "premise": { + "value": "PLANT 1", + "technicalKey": "OTHER" + }, + "postalDeliveryPoint": { + "value": "Gate 1", + "technicalKey": "intERURBAN_DELIVERY_POint" + } + } + }, + "batteryIdentification": { + "batteryType": "Lithium-ion", + "batteryIDDMCCode": "Y792927456954B81677903848654570", + "batteryModel": "SE30H" + }, + "stateOfBattery": { + "stateOfHealth": "99", + "statusBattery": "first life", + "stateOfCharge": "54" + }, + "cO2FootprintTotal": "110" +} \ No newline at end of file From ff58ebfb57f59f146e4eef9b0ff65e319dff3d02 Mon Sep 17 00:00:00 2001 From: Mathias Brunkow Moser Date: Mon, 26 Jun 2023 18:43:23 +0200 Subject: [PATCH 23/35] feat: updated models to match negotiation --- .../models/edc/DataPlaneEndpoint.java | 112 ++++++++++ .../tractusx/productpass/models/edc/Jwt.java | 54 +++++ .../models/http/requests/Search.java | 99 +++++++++ .../models/http/requests/TokenRequest.java | 76 +++++++ .../models/http/responses/IdResponse.java | 75 +++++++ .../productpass/models/manager/DataModel.java | 64 ------ .../productpass/models/manager/History.java | 147 +++++++++++++ .../productpass/models/manager/Manager.java | 99 --------- .../productpass/models/manager/Process.java | 131 +++++++++++ .../productpass/models/manager/Status.java | 204 +++++++++++++++++ .../models/negotiation/Catalog.java | 67 ++++-- .../models/negotiation/CatalogRequest.java | 206 ++++++++++++++++++ .../models/negotiation/Constraint.java | 160 ++++++++++++++ .../models/negotiation/ContractOffer.java | 135 ------------ ...NegotiationOffer.java => DataService.java} | 50 ++--- .../models/negotiation/Dataset.java | 90 ++++++++ .../{Asset.java => DidDocument.java} | 37 ++-- .../models/negotiation/Distribution.java | 96 ++++++++ .../{MetaData.java => EdcResponse.java} | 54 ++--- .../models/negotiation/Negotiation.java | 126 ++++++++--- .../negotiation/NegotiationRequest.java | 147 +++++++++++++ .../productpass/models/negotiation/Offer.java | 44 +++- .../negotiation/{Policy.java => Set.java} | 99 +++------ .../models/negotiation/Transfer.java | 189 +++++++++------- .../models/negotiation/TransferRequest.java | 143 +++++++++--- 25 files changed, 2096 insertions(+), 608 deletions(-) create mode 100644 consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/edc/DataPlaneEndpoint.java create mode 100644 consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/edc/Jwt.java create mode 100644 consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/http/requests/Search.java create mode 100644 consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/http/requests/TokenRequest.java create mode 100644 consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/http/responses/IdResponse.java delete mode 100644 consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/manager/DataModel.java create mode 100644 consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/manager/History.java delete mode 100644 consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/manager/Manager.java create mode 100644 consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/manager/Process.java create mode 100644 consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/manager/Status.java create mode 100644 consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/CatalogRequest.java create mode 100644 consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/Constraint.java delete mode 100644 consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/ContractOffer.java rename consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/{NegotiationOffer.java => DataService.java} (57%) create mode 100644 consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/Dataset.java rename consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/{Asset.java => DidDocument.java} (72%) create mode 100644 consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/Distribution.java rename consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/{MetaData.java => EdcResponse.java} (60%) create mode 100644 consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/NegotiationRequest.java rename consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/{Policy.java => Set.java} (50%) diff --git a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/edc/DataPlaneEndpoint.java b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/edc/DataPlaneEndpoint.java new file mode 100644 index 000000000..338336a32 --- /dev/null +++ b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/edc/DataPlaneEndpoint.java @@ -0,0 +1,112 @@ +/********************************************************************************* + * + * 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. + * + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the + * License for the specific language govern in permissions and limitations + * under the License. + * + * SPDX-License-Identifier: Apache-2.0 + ********************************************************************************/ + +package org.eclipse.tractusx.productpass.models.edc; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class DataPlaneEndpoint { + @JsonProperty("id") + String id; + + @JsonProperty("endpoint") + String endpoint; + + @JsonProperty("authKey") + String authKey; + + @JsonProperty("authCode") + String authCode; + + @JsonProperty("properties") + Properties properties; + + public DataPlaneEndpoint(String id, String endpoint, String authKey, String authCode, Properties properties) { + this.id = id; + this.endpoint = endpoint; + this.authKey = authKey; + this.authCode = authCode; + this.properties = properties; + } + + public DataPlaneEndpoint() { + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getEndpoint() { + return endpoint; + } + + public void setEndpoint(String endpoint) { + this.endpoint = endpoint; + } + + public String getAuthKey() { + return authKey; + } + + public void setAuthKey(String authKey) { + this.authKey = authKey; + } + + public String getAuthCode() { + return authCode; + } + + public void setAuthCode(String authCode) { + this.authCode = authCode; + } + + public Properties getProperties() { + return properties; + } + + public void setProperties(Properties properties) { + this.properties = properties; + } + + public void setOfferId(String offerId) { + this.properties.offerId = offerId; + } + + public String getOfferId() { + return this.properties.offerId; + } + + static class Properties { + @JsonProperty("https://w3id.org/edc/v0.0.1/ns/cid") + String offerId; + + } + + +} diff --git a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/edc/Jwt.java b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/edc/Jwt.java new file mode 100644 index 000000000..8dbfa132d --- /dev/null +++ b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/edc/Jwt.java @@ -0,0 +1,54 @@ +/********************************************************************************* + * + * 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. + * + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the + * License for the specific language govern in permissions and limitations + * under the License. + * + * SPDX-License-Identifier: Apache-2.0 + ********************************************************************************/ + +package org.eclipse.tractusx.productpass.models.edc; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; + +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_NULL) +public class Jwt { + @JsonProperty("header") + Map header; + @JsonProperty("payload") Map payload; + + public Map getHeader() { + return header; + } + + public void setHeader(Map header) { + this.header = header; + } + + public Map getPayload() { + return payload; + } + + public void setPayload(Map payload) { + this.payload = payload; + } +} diff --git a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/http/requests/Search.java b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/http/requests/Search.java new file mode 100644 index 000000000..4b6e309b6 --- /dev/null +++ b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/http/requests/Search.java @@ -0,0 +1,99 @@ +/********************************************************************************* + * + * 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. + * + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the + * License for the specific language govern in permissions and limitations + * under the License. + * + * SPDX-License-Identifier: Apache-2.0 + ********************************************************************************/ + +package org.eclipse.tractusx.productpass.models.http.requests; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.validation.constraints.NotNull; + +public class Search { + + @NotNull(message = "Id needs to be defined!") + @JsonProperty("id") + String id; + + @NotNull(message = "Passport Version needs to be defined!") + @JsonProperty("version") + String version; + + @JsonProperty(value = "idType", defaultValue = "partInstanceId") + String idType = "partInstanceId"; + @JsonProperty(value = "dtIndex", defaultValue = "0") + Integer dtIndex = 0; + @JsonProperty(value = "idShort", defaultValue = "batteryPass") + String idShort = "batteryPass"; + + public Search(String id, String version, String idType, Integer dtIndex, String idShort) { + this.id = id; + this.version = version; + this.idType = idType; + this.dtIndex = dtIndex; + this.idShort = idShort; + } + public Search() { + } + + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getIdType() { + return idType; + } + + public void setIdType(String idType) { + this.idType = idType; + } + + public Integer getDtIndex() { + return dtIndex; + } + + public void setDtIndex(Integer dtIndex) { + this.dtIndex = dtIndex; + } + + public String getIdShort() { + return idShort; + } + + public void setIdShort(String idShort) { + this.idShort = idShort; + } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } +} diff --git a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/http/requests/TokenRequest.java b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/http/requests/TokenRequest.java new file mode 100644 index 000000000..4a73b514c --- /dev/null +++ b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/http/requests/TokenRequest.java @@ -0,0 +1,76 @@ +/********************************************************************************* + * + * 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. + * + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the + * License for the specific language govern in permissions and limitations + * under the License. + * + * SPDX-License-Identifier: Apache-2.0 + ********************************************************************************/ + +package org.eclipse.tractusx.productpass.models.http.requests; + +import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.validation.constraints.NotNull; + +public class TokenRequest { + @NotNull(message = "Process id needs to be defined!") + @JsonProperty("processId") + String processId; + + @NotNull(message = "ContractId needs to be defined!") + @JsonProperty("contractId") + String contractId; + @NotNull(message = "Token needs to be defined!") + @JsonProperty("token") + String token; + + + public TokenRequest(String processId, String contractId, String token) { + this.processId = processId; + this.contractId = contractId; + this.token = token; + } + + public String getToken() { + return token; + } + + public void setToken(String token) { + this.token = token; + } + + public TokenRequest() { + } + + public String getProcessId() { + return processId; + } + + public void setProcessId(String processId) { + this.processId = processId; + } + + public String getContractId() { + return contractId; + } + + public void setContractId(String contractId) { + this.contractId = contractId; + } +} diff --git a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/http/responses/IdResponse.java b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/http/responses/IdResponse.java new file mode 100644 index 000000000..a81ffacbb --- /dev/null +++ b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/http/responses/IdResponse.java @@ -0,0 +1,75 @@ +/********************************************************************************* + * + * 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. + * + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the + * License for the specific language govern in permissions and limitations + * under the License. + * + * SPDX-License-Identifier: Apache-2.0 + ********************************************************************************/ + +package org.eclipse.tractusx.productpass.models.http.responses; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.JsonNode; +import org.eclipse.tractusx.productpass.models.negotiation.DidDocument; + +@JsonInclude(JsonInclude.Include.NON_NULL) +public class IdResponse extends DidDocument { + + @JsonProperty("edc:createdAt") + public Long createdAt; + @JsonProperty("@context") + JsonNode context; + + + public IdResponse(String id, String type, Long createdAt, JsonNode context) { + super(id, type); + this.createdAt = createdAt; + this.context = context; + } + + public IdResponse(Long createdAt, JsonNode context) { + this.createdAt = createdAt; + this.context = context; + } + + public IdResponse() { + } + + public IdResponse(String id, String type) { + super(id, type); + } + + public Long getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(Long createdAt) { + this.createdAt = createdAt; + } + + public JsonNode getContext() { + return context; + } + + public void setContext(JsonNode context) { + this.context = context; + } +} diff --git a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/manager/DataModel.java b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/manager/DataModel.java deleted file mode 100644 index 0797c344c..000000000 --- a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/manager/DataModel.java +++ /dev/null @@ -1,64 +0,0 @@ -/********************************************************************************* - * - * Catena-X - Product Passport Consumer Backend - * - * 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. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, - * either express or implied. See the - * License for the specific language govern in permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ - -package org.eclipse.tractusx.productpass.models.manager; - -import java.nio.file.Paths; -import java.util.*; - -public class DataModel extends HashMap { - protected String dataModelName; - protected String dataModelDir; - protected String dataModelPath; - public DataModel(String dataModelName,String dataModelDir) { - this.dataModelName = dataModelName; - this.dataModelDir = dataModelDir; - this.dataModelPath = this.buildDataModelPath(); - super.put("name", this.dataModelName); - super.put("data", new HashMap()); - } - - @Override - public Object put(String key, Object value){ - Map tmpDataModel = (Map) super.get("data"); - tmpDataModel.put(key, value); - super.put("data", tmpDataModel); - return tmpDataModel; - } - - public Object get(String key){ - Map tmpDataModel = (Map) super.get("data"); - return tmpDataModel.get(key); - } - - public Map getData(){ - return (Map) super.get("data"); - } - public String buildDataModelPath(){ - return Paths.get(this.dataModelDir,this.dataModelName + ".json").toAbsolutePath().toString(); - } - - public void save(){ - // Save not implemented - } -} diff --git a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/manager/History.java b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/manager/History.java new file mode 100644 index 000000000..b2a581236 --- /dev/null +++ b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/manager/History.java @@ -0,0 +1,147 @@ +/********************************************************************************* + * + * 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. + * + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the + * License for the specific language govern in permissions and limitations + * under the License. + * + * SPDX-License-Identifier: Apache-2.0 + ********************************************************************************/ + +package org.eclipse.tractusx.productpass.models.manager; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import utils.DateTimeUtil; + +@JsonInclude(JsonInclude.Include.NON_NULL) +public class History { + + @JsonProperty("id") + public String id; + + @JsonProperty("status") + public String status; + + @JsonProperty("started") + public Long started; + + @JsonProperty("updated") + public Long updated; + @JsonProperty("attempts") + public Integer attempts; + + public History(String id, String status, Integer attempts) { + this.id = id; + this.status = status; + this.started = DateTimeUtil.getTimestamp(); + this.updated = DateTimeUtil.getTimestamp(); + this.attempts = attempts; + } + + public History(String id, String status, Long started) { + this.id = id; + this.status = status; + this.started = started; + this.updated = DateTimeUtil.getTimestamp(); + } + + public History(String id, String status, Long started, Integer attempts) { + this.id = id; + this.status = status; + this.started = started; + this.updated = DateTimeUtil.getTimestamp(); + this.attempts = attempts; + } + + public History(String id, String status) { + this.id = id; + this.status = status; + this.started = DateTimeUtil.getTimestamp(); + this.updated = DateTimeUtil.getTimestamp(); + } + + public History() { + } + + public History(String id,String status, Long started, Long updated) { + this.id = id; + this.status = status; + this.started = started; + this.updated = updated; + } + + public History(String id,String status, Long started, Long updated, Integer attempts) { + this.id = id; + this.status = status; + this.started = started; + this.updated = updated; + this.attempts = attempts; + } + + + public Long getStarted() { + return started; + } + + public void setStarted(Long started) { + this.started = started; + } + + public Long getUpdated() { + return updated; + } + + public void setUpdated(Long updated) { + this.updated = updated; + } + + public Integer getAttempts() { + return attempts; + } + + public void addAttempt(){ + this.updated = DateTimeUtil.getTimestamp(); + if(this.attempts==null){ + this.attempts=0; + } + this.attempts++; + } + + public void setAttempts(Integer attempts) { + this.updated = DateTimeUtil.getTimestamp(); + this.attempts = attempts; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + this.updated = DateTimeUtil.getTimestamp(); + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } +} diff --git a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/manager/Manager.java b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/manager/Manager.java deleted file mode 100644 index 879c76d53..000000000 --- a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/manager/Manager.java +++ /dev/null @@ -1,99 +0,0 @@ -/********************************************************************************* - * - * Catena-X - Product Passport Consumer Backend - * - * 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. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, - * either express or implied. See the - * License for the specific language govern in permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ - -package org.eclipse.tractusx.productpass.models.manager; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; -import utils.FileUtil; -import utils.JsonUtil; - -import java.io.File; -import java.nio.file.Paths; -@Component -public abstract class Manager { - - @Autowired - FileUtil fileUtil; - - @Autowired - JsonUtil jsonUtil; - - protected String dataModelName; - protected String dataDir; - protected String tmpDir; - - public DataModel dataModel; - protected String dataModelPath; - - public void setManager(String className){ - this.dataDir = fileUtil.createDataDir(className); - this.tmpDir = fileUtil.createTmpDir(className); - this.dataModelName = this.getDataModelName(); - this.dataModel = new DataModel(this.dataModelName, this.dataDir); - } - - public DataModel getDataModel() { - return dataModel; - } - - public String getDataModelPath() { - return dataModelPath; - } - - public String getDataDir() { - return dataDir; - } - - public void setDataDir(String dataDir) { - this.dataDir = dataDir; - } - - public String getTmpDir() { - return tmpDir; - } - - public void setTmpDir(String tmpDir) { - this.tmpDir = tmpDir; - } - public String buildDataModelPath(){ - return Paths.get(this.dataDir,this.dataModelName + ".json").toAbsolutePath().toString(); - } - public String getDataModelName(){ - return "dataModel"; - } - - public DataModel loadDataModel(){ - this.dataModelPath = this.buildDataModelPath(); - if(!fileUtil.pathExists(this.dataModelPath)){ - jsonUtil.toJsonFile(this.dataModelPath, this.dataModel, true); - } - return (DataModel) jsonUtil.fromJsonFile(this.dataModelPath); - } - public String saveDataModel(){ - this.dataModelPath = this.buildDataModelPath(); - return jsonUtil.toJsonFile(this.dataModelPath, this.dataModel, true); - } - - -} diff --git a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/manager/Process.java b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/manager/Process.java new file mode 100644 index 000000000..c7242b461 --- /dev/null +++ b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/manager/Process.java @@ -0,0 +1,131 @@ +/********************************************************************************* + * + * 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. + * + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the + * License for the specific language govern in permissions and limitations + * under the License. + * + * SPDX-License-Identifier: Apache-2.0 + ********************************************************************************/ + +package org.eclipse.tractusx.productpass.models.manager; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import utils.DateTimeUtil; + +@JsonInclude(JsonInclude.Include.NON_NULL) +public class Process { + + @JsonProperty("id") + public String id; + + @JsonProperty("state") + public String state; + + @JsonProperty("created") + public Long created; + + @JsonProperty("updated") + public Long updated; + + @JsonProperty("thread") + public Thread thread; + + public Process(String id, String state, Thread thread) { + this.id = id; + this.state = state; + this.created = DateTimeUtil.getTimestamp(); + this.updated = DateTimeUtil.getTimestamp(); + this.thread = thread; + } + + public Process() { + } + public Process(String id, String state, Long created, Long updated) { + this.id = id; + this.state = state; + this.created = created; + this.updated = updated; + } + public Process(String id, String state, Long created) { + this.id = id; + this.state = state; + this.created = created; + this.updated = DateTimeUtil.getTimestamp(); + } + + public Process(String id, String state) { + this.id = id; + this.state = state; + this.created = DateTimeUtil.getTimestamp(); + this.updated = DateTimeUtil.getTimestamp(); + } + + public Process(String id, String state, Long created, Long updated, Thread thread) { + this.id = id; + this.state = state; + this.created = created; + this.updated = updated; + this.thread = thread; + } + + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + this.updated = DateTimeUtil.getTimestamp(); + } + + public Thread getThread() { + return thread; + } + + public void setThread(Thread thread) { + this.thread = thread; + } + + + + public Long getUpdated() { + return updated; + } + + public void setUpdated(Long updated) { + this.updated = updated; + } + + public Long getCreated() { + return created; + } + + public void setCreated(Long created) { + this.created = created; + } +} diff --git a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/manager/Status.java b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/manager/Status.java new file mode 100644 index 000000000..5f1564838 --- /dev/null +++ b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/manager/Status.java @@ -0,0 +1,204 @@ +/********************************************************************************* + * + * 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. + * + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the + * License for the specific language govern in permissions and limitations + * under the License. + * + * SPDX-License-Identifier: Apache-2.0 + ********************************************************************************/ + +package org.eclipse.tractusx.productpass.models.manager; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import utils.DateTimeUtil; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_NULL) +public class Status { + @JsonProperty("id") + public String id; + + @JsonProperty("status") + public String status; + + @JsonProperty("created") + public Long created; + + @JsonProperty("modified") + public Long modified; + + + @JsonProperty("endpoint") + public String endpoint; + + @JsonProperty("history") + public Map history; + + public Status(String id, String status, Long created, Long modified, String endpoint, Map history) { + this.id = id; + this.status = status; + this.created = created; + this.modified = modified; + this.endpoint = endpoint; + this.history = history; + } + + public Status(String id, String status, Long modified, String endpoint, Map history) { + this.id = id; + this.status = status; + this.created = DateTimeUtil.getTimestamp(); + this.modified = modified; + this.endpoint = endpoint; + this.history = history; + } + + public Status(String id, String status, Long created, Long modified, String endpoint, String historyId, History history) { + this.id = id; + this.status = status; + this.created = created; + this.modified = modified; + this.endpoint = endpoint; + this.history = Map.of(historyId, history); + } + public Status(String id, String status, Long modified, String endpoint, String historyId, History history) { + this.id = id; + this.status = status; + this.created = DateTimeUtil.getTimestamp(); + this.modified = modified; + this.endpoint = endpoint; + this.history = Map.of(historyId, history); + } + + public Status(String id, String status, String endpoint, Long modified) { + this.id = id; + this.status = status; + this.created = DateTimeUtil.getTimestamp(); + this.modified = modified; + this.endpoint = endpoint; + this.history = new HashMap(); + } + + public Status(String id, String status, String endpoint, Long created, Long modified) { + this.id = id; + this.status = status; + this.created = created; + this.modified = modified; + this.endpoint = endpoint; + this.history = new HashMap(); + } + public Status() { + } + + public Status(String id, String status, Long created, Long modified) { + this.id = id; + this.status = status; + this.created = created; + this.modified = modified; + this.history = new HashMap(); + } + public Status(String id, String status, Long created, Long modified, String historyId, History history) { + this.id = id; + this.status = status; + this.created = created; + this.modified = modified; + this.history = Map.of(historyId, history); + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public Long getCreated() { + return created; + } + + public void setCreated(Long created) { + this.created = created; + } + + public Long getModified() { + return modified; + } + + public void setModified(Long modified) { + this.modified = modified; + } + + public Map getHistory() { + return history; + } + public Boolean historyExists(String name) { + return this.history.containsKey(name); + } + + public void setHistory(Map history) { + this.history = history; + } + + public void setHistory(String name, History history) { + this.history.put(name, history); + } + public void deleteHistory() { + this.history = new HashMap<>(); + } + public Boolean removeHistory(String name) { + if(!this.history.containsKey(name)){ + return false; + } + this.history.remove(name); + return true; + } + public History getHistory(String name) { + return this.history.getOrDefault(name, null); + } + + public String getEndpoint() { + return endpoint; + } + + public void setEndpoint(String endpoint) { + this.endpoint = endpoint; + } +} + + + + + + + + + + diff --git a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/Catalog.java b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/Catalog.java index 1a3c8f3b3..399da837b 100644 --- a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/Catalog.java +++ b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/Catalog.java @@ -26,41 +26,58 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.JsonNode; import java.util.HashMap; import java.util.List; import java.util.Map; @JsonInclude(JsonInclude.Include.NON_NULL) -public class Catalog { - @JsonProperty("id") - String id; - @JsonProperty("contractOffers") - List contractOffers; +public class Catalog extends DidDocument { + + @JsonProperty("dcat:dataset") + List contractOffers; + + @JsonProperty("dcat:service") + DataService service; + + @JsonProperty("edc:participantId") + String participantId; + + @JsonProperty("@context") + JsonNode context; @JsonIgnore protected Map contractOffersMap = new HashMap<>(); - public String getId() { - return id; + public Catalog(String id, String type, List contractOffers, DataService service, String participantId, JsonNode context) { + super(id, type); + this.contractOffers = contractOffers; + this.service = service; + this.participantId = participantId; + this.context = context; + } + + public Catalog(String id, String type) { + super(id, type); } - public void setId(String id) { - this.id = id; + public Catalog() { } - public List getContractOffers() { + + public List getContractOffers() { return contractOffers; } - public void setContractOffers(List contractOffers) { + public void setContractOffers(List contractOffers) { this.contractOffers = contractOffers; } public Map loadContractOffersMapByAssetId(){ int i = 0; - for(Offer contractOffer: this.contractOffers){ - this.contractOffersMap.put(contractOffer.getAsset().getId(),i); + for(Dataset contractOffer: this.contractOffers){ + this.contractOffersMap.put(contractOffer.getAssetId(),i); i++; } return this.contractOffersMap; @@ -72,4 +89,28 @@ public Map getContractOffersMap() { public void setContractOffersMap(Map contractOffersMap) { this.contractOffersMap = contractOffersMap; } + + public DataService getService() { + return service; + } + + public void setService(DataService service) { + this.service = service; + } + + public String getParticipantId() { + return participantId; + } + + public void setParticipantId(String participantId) { + this.participantId = participantId; + } + + public JsonNode getContext() { + return context; + } + + public void setContext(JsonNode context) { + this.context = context; + } } diff --git a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/CatalogRequest.java b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/CatalogRequest.java new file mode 100644 index 000000000..7406875e6 --- /dev/null +++ b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/CatalogRequest.java @@ -0,0 +1,206 @@ +/********************************************************************************* + * + * 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. + * + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the + * License for the specific language govern in permissions and limitations + * under the License. + * + * SPDX-License-Identifier: Apache-2.0 + ********************************************************************************/ + +package org.eclipse.tractusx.productpass.models.negotiation; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.JsonNode; + +@JsonInclude(JsonInclude.Include.NON_NULL) +public class CatalogRequest { + @JsonProperty("@context") + JsonNode context; + @JsonProperty("protocol") + String protocol; + @JsonProperty("providerUrl") + String providerUrl; + + @JsonProperty("querySpec") + QuerySpec querySpec; + + public CatalogRequest(JsonNode context, String providerUrl, QuerySpec querySpec) { + this.context = context; + this.protocol = "dataspace-protocol-http"; + this.providerUrl = providerUrl; + this.querySpec = querySpec; + } + public CatalogRequest(JsonNode context, String protocol, String providerUrl, QuerySpec querySpec) { + this.context = context; + this.protocol = protocol; + this.providerUrl = providerUrl; + this.querySpec = querySpec; + } + + public CatalogRequest() { + } + + public JsonNode getContext() { + return context; + } + + public void setContext(JsonNode context) { + this.context = context; + } + + public String getProtocol() { + return protocol; + } + + public void setProtocol(String protocol) { + this.protocol = protocol; + } + + public String getProviderUrl() { + return providerUrl; + } + + public void setProviderUrl(String providerUrl) { + this.providerUrl = providerUrl; + } + + public QuerySpec getQuerySpec() { + return querySpec; + } + + public void setQuerySpec(QuerySpec querySpec) { + this.querySpec = querySpec; + } + + + @JsonInclude(JsonInclude.Include.NON_NULL) + public static class QuerySpec { + @JsonProperty("offset") + Integer offset; + + @JsonProperty("limit") + Integer limit; + + @JsonProperty("filter") + String filter; + + @JsonProperty("range") + Range range; + + public QuerySpec(Integer offset, Integer limit, String filter, Range range, String sortField, String criterion) { + this.offset = offset; + this.limit = limit; + this.filter = filter; + this.range = range; + this.sortField = sortField; + this.criterion = criterion; + } + + public QuerySpec() { + } + + @JsonInclude(JsonInclude.Include.NON_NULL) + public static class Range { + @JsonProperty("from") + Integer from; + + @JsonProperty("to") + Integer to; + + public Range(Integer from, Integer to) { + this.from = from; + this.to = to; + } + + public Range() { + } + + public Integer getFrom() { + return from; + } + + public void setFrom(Integer from) { + this.from = from; + } + + public Integer getTo() { + return to; + } + + public void setTo(Integer to) { + this.to = to; + } + } + + @JsonProperty("sortField") + String sortField; + + @JsonProperty("criterion") + String criterion; + public Integer getOffset() { + return offset; + } + + public void setOffset(Integer offset) { + this.offset = offset; + } + + public Integer getLimit() { + return limit; + } + + public void setLimit(Integer limit) { + this.limit = limit; + } + + public String getFilter() { + return filter; + } + + public void setFilter(String filter) { + this.filter = filter; + } + + public Range getRange() { + return range; + } + + public void setRange(Range range) { + this.range = range; + } + + public String getSortField() { + return sortField; + } + + public void setSortField(String sortField) { + this.sortField = sortField; + } + + public String getCriterion() { + return criterion; + } + + public void setCriterion(String criterion) { + this.criterion = criterion; + } + + } +} diff --git a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/Constraint.java b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/Constraint.java new file mode 100644 index 000000000..df002a1b3 --- /dev/null +++ b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/Constraint.java @@ -0,0 +1,160 @@ +/********************************************************************************* + * + * 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. + * + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the + * License for the specific language govern in permissions and limitations + * under the License. + * + * SPDX-License-Identifier: Apache-2.0 + ********************************************************************************/ + +package org.eclipse.tractusx.productpass.models.negotiation; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; + +import java.util.List; + +@JsonInclude(JsonInclude.Include.NON_NULL) +public class Constraint { + @JsonProperty("odrl:target") + String target; + + @JsonProperty("odrl:action") + Action action; + + public Constraint(String target, Action action, List constraints) { + this.target = target; + this.action = action; + this.constraints = constraints; + } + + public Constraint() { + } + + public String getTarget() { + return target; + } + + public void setTarget(String target) { + this.target = target; + } + + public Action getAction() { + return action; + } + + public void setAction(Action action) { + this.action = action; + } + static class Action{ + @JsonProperty("odrl:type") + String type; + + public Action(String type) { + this.type = type; + } + + public Action() { + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + } + + public List getConstraints() { + return constraints; + } + + public void setConstraints(List constraints) { + this.constraints = constraints; + } + + @JsonProperty("odrl:constraint") + List constraints; + + @JsonInclude(JsonInclude.Include.NON_NULL) + static class Operator{ + + @JsonProperty("odrl:or") + List orOperator; + + public Operator(List orOperator) { + this.orOperator = orOperator; + } + + public Operator() { + } + + public List getOrOperator() { + return orOperator; + } + + public void setOrOperator(List orOperator) { + this.orOperator = orOperator; + } + + static class OrOperator{ + @JsonProperty("odrl:leftOperand") + String leftOperand; + @JsonProperty("odrl:operator") + String operator; + @JsonProperty("odrl:rightOperand") + String rightOperand; + + public OrOperator(String leftOperand, String operator, String rightOperand) { + this.leftOperand = leftOperand; + this.operator = operator; + this.rightOperand = rightOperand; + } + + public OrOperator() { + } + + public String getLeftOperand() { + return leftOperand; + } + + public void setLeftOperand(String leftOperand) { + this.leftOperand = leftOperand; + } + + public String getOperator() { + return operator; + } + + public void setOperator(String operator) { + this.operator = operator; + } + + public String getRightOperand() { + return rightOperand; + } + + public void setRightOperand(String rightOperand) { + this.rightOperand = rightOperand; + } + } + } + +} diff --git a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/ContractOffer.java b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/ContractOffer.java deleted file mode 100644 index c81062bbe..000000000 --- a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/ContractOffer.java +++ /dev/null @@ -1,135 +0,0 @@ -/********************************************************************************* - * - * Catena-X - Product Passport Consumer Backend - * - * 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. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, - * either express or implied. See the - * License for the specific language govern in permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ - -package org.eclipse.tractusx.productpass.models.negotiation; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.Date; - -@JsonInclude(JsonInclude.Include.NON_NULL) -public class ContractOffer { - @JsonProperty("id") - String id; - @JsonProperty("policy") - Policy policy; - @JsonProperty("asset") - Asset asset; - - @JsonProperty("assetId") - String assetId; - @JsonProperty("provider") - String provider; - @JsonProperty("consumer") - String consumer; - - @JsonProperty("offerStart") - Date offerStart; - @JsonProperty("offerEnd") - Date offerEnd; - @JsonProperty("contractStart") - Date contractStart; - @JsonProperty("contractEnd") - Date contractEnd; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public Policy getPolicy() { - return policy; - } - - public void setPolicy(Policy policy) { - this.policy = policy; - } - - public Asset getAsset() { - return asset; - } - - public void setAsset(Asset asset) { - this.asset = asset; - } - - public String getAssetId() { - return assetId; - } - - public void setAssetId(String assetId) { - this.assetId = assetId; - } - - public String getProvider() { - return provider; - } - - public void setProvider(String provider) { - this.provider = provider; - } - - public String getConsumer() { - return consumer; - } - - public void setConsumer(String consumer) { - this.consumer = consumer; - } - - public Date getOfferStart() { - return offerStart; - } - - public void setOfferStart(Date offerStart) { - this.offerStart = offerStart; - } - - public Date getOfferEnd() { - return offerEnd; - } - - public void setOfferEnd(Date offerEnd) { - this.offerEnd = offerEnd; - } - - public Date getContractStart() { - return contractStart; - } - - public void setContractStart(Date contractStart) { - this.contractStart = contractStart; - } - - public Date getContractEnd() { - return contractEnd; - } - - public void setContractEnd(Date contractEnd) { - this.contractEnd = contractEnd; - } -} diff --git a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/NegotiationOffer.java b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/DataService.java similarity index 57% rename from consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/NegotiationOffer.java rename to consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/DataService.java index a84e75b17..55794203f 100644 --- a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/NegotiationOffer.java +++ b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/DataService.java @@ -3,6 +3,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. + * * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -27,46 +29,34 @@ import com.fasterxml.jackson.annotation.JsonProperty; @JsonInclude(JsonInclude.Include.NON_NULL) -public class NegotiationOffer { - @JsonProperty("connectorId") - String connectorId; - - @JsonProperty("connectorAddress") - String connectorAddress; - - @JsonProperty("offer") - Offer offer; - public NegotiationOffer(){ - - } - - public NegotiationOffer(String connectorId, String connectorAddress, Offer offer) { - this.connectorId = connectorId; - this.connectorAddress = connectorAddress; - this.offer = offer; - } +public class DataService extends DidDocument { + @JsonProperty("dct:terms") + String terms; + @JsonProperty("dct:endpointUrl") + String endpoint; - public String getConnectorId() { - return connectorId; + public DataService(String id, String type, String terms, String endpoint) { + super(id, type); + this.terms = terms; + this.endpoint = endpoint; } - public void setConnectorId(String connectorId) { - this.connectorId = connectorId; + public DataService() { } - public String getConnectorAddress() { - return connectorAddress; + public String getTerms() { + return terms; } - public void setConnectorAddress(String connectorAddress) { - this.connectorAddress = connectorAddress; + public void setTerms(String terms) { + this.terms = terms; } - public Offer getOffer() { - return offer; + public String getEndpoint() { + return endpoint; } - public void setOffer(Offer offer) { - this.offer = offer; + public void setEndpoint(String endpoint) { + this.endpoint = endpoint; } } diff --git a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/Dataset.java b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/Dataset.java new file mode 100644 index 000000000..3e0607839 --- /dev/null +++ b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/Dataset.java @@ -0,0 +1,90 @@ +/********************************************************************************* + * + * Catena-X - Product Passport Consumer Backend + * + * 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. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the + * License for the specific language govern in permissions and limitations + * under the License. + * + * SPDX-License-Identifier: Apache-2.0 + ********************************************************************************/ + +package org.eclipse.tractusx.productpass.models.negotiation; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; + +import java.util.List; + +@JsonInclude(JsonInclude.Include.NON_NULL) +public class Dataset extends DidDocument{ + @JsonProperty("odrl:hasPolicy") + Set policy; + @JsonProperty("dcat:distribution") + List distributions; + + @JsonProperty("edc:description") + String assetDescription; + @JsonProperty("edc:id") + String assetId; + + public Dataset(String id, String type, Set policy, List distributions, String assetDescription, String assetId) { + super(id, type); + this.policy = policy; + this.distributions = distributions; + this.assetDescription = assetDescription; + this.assetId = assetId; + } + + public Dataset(String id, String type) { + super(id, type); + } + + public Dataset() { + } + + + public Set getPolicy() { + return policy; + } + + public void setPolicy(Set policy) { + this.policy = policy; + } + + public List getDistributions() { + return distributions; + } + + public void setDistributions(List distributions) { + this.distributions = distributions; + } + + public String getAssetDescription() { + return assetDescription; + } + + public void setAssetDescription(String assetDescription) { + this.assetDescription = assetDescription; + } + + public String getAssetId() { + return assetId; + } + + public void setAssetId(String assetId) { + this.assetId = assetId; + } +} diff --git a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/Asset.java b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/DidDocument.java similarity index 72% rename from consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/Asset.java rename to consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/DidDocument.java index 7910e4934..df79e09bf 100644 --- a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/Asset.java +++ b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/DidDocument.java @@ -3,6 +3,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. + * * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -25,38 +27,35 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.databind.JsonNode; @JsonInclude(JsonInclude.Include.NON_NULL) -public class Asset { - @JsonProperty("id") +public class DidDocument { + @JsonProperty("@id") String id; - @JsonProperty("createdAt") - String createdAt; - @JsonProperty("properties") - JsonNode properties; + @JsonProperty("@type") + String type; - public String getId() { - return id; + public DidDocument(String id, String type) { + this.id = id; + this.type = type; } - public void setId(String id) { - this.id = id; + public DidDocument() { } - public String getCreatedAt() { - return createdAt; + public String getId() { + return id; } - public void setCreatedAt(String createdAt) { - this.createdAt = createdAt; + public void setId(String id) { + this.id = id; } - public JsonNode getProperties() { - return properties; + public String getType() { + return type; } - public void setProperties(JsonNode properties) { - this.properties = properties; + public void setType(String type) { + this.type = type; } } diff --git a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/Distribution.java b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/Distribution.java new file mode 100644 index 000000000..6d626ebd5 --- /dev/null +++ b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/Distribution.java @@ -0,0 +1,96 @@ +/********************************************************************************* + * + * 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. + * + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the + * License for the specific language govern in permissions and limitations + * under the License. + * + * SPDX-License-Identifier: Apache-2.0 + ********************************************************************************/ + +package org.eclipse.tractusx.productpass.models.negotiation; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; + +@JsonInclude(JsonInclude.Include.NON_NULL) +public class Distribution { + @JsonProperty("@type") + String type; + + @JsonProperty("dct:format") + Format format; + + @JsonProperty("dcat:accessService") + String accessService; + + public Distribution(String type, Format format, String accessService) { + this.type = type; + this.format = format; + this.accessService = accessService; + } + + public Distribution() { + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public Format getFormat() { + return format; + } + + public void setFormat(Format format) { + this.format = format; + } + + public String getAccessService() { + return accessService; + } + + public void setAccessService(String accessService) { + this.accessService = accessService; + } + + static class Format{ + @JsonProperty("@id") + String id; + + public Format(String id) { + this.id = id; + } + + public Format() { + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + } + + +} diff --git a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/MetaData.java b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/EdcResponse.java similarity index 60% rename from consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/MetaData.java rename to consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/EdcResponse.java index aeb2cc621..741d15f88 100644 --- a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/MetaData.java +++ b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/EdcResponse.java @@ -3,6 +3,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. + * * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -23,51 +25,25 @@ package org.eclipse.tractusx.productpass.models.negotiation; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.JsonNode; -public abstract class MetaData { - - @JsonProperty("createdAt") - Long createdAt; - - @JsonProperty("updatedAt") - Long updatedAt; - - @JsonProperty("state") - String state; +@JsonInclude(JsonInclude.Include.NON_NULL) +public class EdcResponse extends DidDocument{ + @JsonProperty("edc:createdAt") + Integer createdAt; - @JsonProperty("type") - String type; + @JsonProperty("@context") + JsonNode context; - public Long getCreatedAt() { - return createdAt; - } - - public void setCreatedAt(Long createdAt) { + public EdcResponse(String id, String type, Integer createdAt, JsonNode context) { + super(id, type); this.createdAt = createdAt; + this.context = context; } - public Long getUpdatedAt() { - return updatedAt; - } - - public void setUpdatedAt(Long updatedAt) { - this.updatedAt = updatedAt; - } - - public String getState() { - return state; - } - - public void setState(String state) { - this.state = state; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; + public EdcResponse(String id, String type) { + super(id, type); } } diff --git a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/Negotiation.java b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/Negotiation.java index 87cad4e5d..740f5cb2c 100644 --- a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/Negotiation.java +++ b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/Negotiation.java @@ -25,38 +25,99 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.JsonNode; + +import java.util.List; @JsonInclude(JsonInclude.Include.NON_NULL) -public class Negotiation extends MetaData { - @JsonProperty("id") - String id; - @JsonProperty("contractAgreementId") - String contractAgreementId; +public class Negotiation extends DidDocument { + @JsonProperty("edc:type") + String edcType; - @JsonProperty("counterPartyAddress") - String counterPartyAddress; + @JsonProperty("edc:protocol") + String protocol; - @JsonProperty("errorDetail") + @JsonProperty("edc:state") + String state; + @JsonProperty("edc:errorDetail") String errorDetail; - @JsonProperty("protocol") - String protocol; + @JsonProperty("edc:counterPartyAddress") + String counterPartyAddress; + + @JsonProperty("edc:callbackAddresses") + List callbackAddresses; + + @JsonProperty("edc:contractAgreementId") + String contractAgreementId; + @JsonProperty("@context") + JsonNode context; - public String getId() { - return id; + public Negotiation(String id, String type, String edcType, String protocol, String state, String counterPartyAddress, List callbackAddresses, String contractAgreementId, JsonNode context) { + super(id, type); + this.edcType = edcType; + this.protocol = protocol; + this.state = state; + this.counterPartyAddress = counterPartyAddress; + this.callbackAddresses = callbackAddresses; + this.contractAgreementId = contractAgreementId; + this.context = context; } - public void setId(String id) { - this.id = id; + public Negotiation(String edcType, String protocol, String state, String counterPartyAddress, List callbackAddresses, String contractAgreementId, JsonNode context) { + this.edcType = edcType; + this.protocol = protocol; + this.state = state; + this.counterPartyAddress = counterPartyAddress; + this.callbackAddresses = callbackAddresses; + this.contractAgreementId = contractAgreementId; + this.context = context; } - public String getContractAgreementId() { - return contractAgreementId; + + + public Negotiation() { } - public void setContractAgreementId(String contractAgreementId) { + public Negotiation(String id, String type) { + super(id, type); + } + + public Negotiation(String id, String type, String edcType, String protocol, String state, String errorDetail, String counterPartyAddress, List callbackAddresses, String contractAgreementId, JsonNode context) { + super(id, type); + this.edcType = edcType; + this.protocol = protocol; + this.state = state; + this.errorDetail = errorDetail; + this.counterPartyAddress = counterPartyAddress; + this.callbackAddresses = callbackAddresses; this.contractAgreementId = contractAgreementId; + this.context = context; + } + + public String getEdcType() { + return edcType; + } + + public void setEdcType(String edcType) { + this.edcType = edcType; + } + + public String getProtocol() { + return protocol; + } + + public void setProtocol(String protocol) { + this.protocol = protocol; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; } public String getCounterPartyAddress() { @@ -67,20 +128,35 @@ public void setCounterPartyAddress(String counterPartyAddress) { this.counterPartyAddress = counterPartyAddress; } - public String getErrorDetail() { - return errorDetail; + public List getCallbackAddresses() { + return callbackAddresses; } - public void setErrorDetail(String errorDetail) { - this.errorDetail = errorDetail; + public void setCallbackAddresses(List callbackAddresses) { + this.callbackAddresses = callbackAddresses; } - public String getProtocol() { - return protocol; + public String getContractAgreementId() { + return contractAgreementId; } - public void setProtocol(String protocol) { - this.protocol = protocol; + public void setContractAgreementId(String contractAgreementId) { + this.contractAgreementId = contractAgreementId; + } + + public JsonNode getContext() { + return context; + } + + public void setContext(JsonNode context) { + this.context = context; + } + + public String getErrorDetail() { + return errorDetail; } + public void setErrorDetail(String errorDetail) { + this.errorDetail = errorDetail; + } } diff --git a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/NegotiationRequest.java b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/NegotiationRequest.java new file mode 100644 index 000000000..097f460d1 --- /dev/null +++ b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/NegotiationRequest.java @@ -0,0 +1,147 @@ +/********************************************************************************* + * + * Catena-X - Product Passport Consumer Backend + * + * 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. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the + * License for the specific language govern in permissions and limitations + * under the License. + * + * SPDX-License-Identifier: Apache-2.0 + ********************************************************************************/ + +package org.eclipse.tractusx.productpass.models.negotiation; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.JsonNode; + +@JsonInclude(JsonInclude.Include.NON_NULL) +public class NegotiationRequest { + + @JsonProperty("@context") + JsonNode context; + + @JsonProperty("@type") + String type; + @JsonProperty("connectorAddress") + String connectorAddress; + @JsonProperty("protocol") + String protocol; + + @JsonProperty("connectorId") + String connectorId; + + @JsonProperty("providerId") + String providerId; + + @JsonProperty("offer") + Offer offer; + + public NegotiationRequest(JsonNode context, String connectorAddress, String protocol, String connectorId, String providerId, Offer offer) { + this.context = context; + this.type = "NegotiationInitiateRequestDto"; + this.connectorAddress = connectorAddress; + this.protocol = protocol; + this.connectorId = connectorId; + this.providerId = providerId; + this.offer = offer; + } + public NegotiationRequest(JsonNode context, String connectorAddress, String connectorId, String providerId, Offer offer) { + this.context = context; + this.type = "NegotiationInitiateRequestDto"; + this.connectorAddress = connectorAddress; + this.protocol = "dataspace-protocol-http"; + this.connectorId = connectorId; + this.providerId = providerId; + this.offer = offer; + } + public NegotiationRequest(JsonNode context, String connectorAddress, String connectorId, Offer offer) { + this.context = context; + this.type = "NegotiationInitiateRequestDto"; + this.connectorAddress = connectorAddress; + this.protocol = "dataspace-protocol-http"; + this.connectorId = connectorId; + this.offer = offer; + } + public NegotiationRequest(JsonNode context, String type, String connectorAddress, String protocol, String connectorId, String providerId, Offer offer) { + this.context = context; + this.type = type; + this.connectorAddress = connectorAddress; + this.protocol = protocol; + this.connectorId = connectorId; + this.providerId = providerId; + this.offer = offer; + } + + + public NegotiationRequest() { + } + + public String getConnectorId() { + return connectorId; + } + + public void setConnectorId(String connectorId) { + this.connectorId = connectorId; + } + + public String getConnectorAddress() { + return connectorAddress; + } + + public void setConnectorAddress(String connectorAddress) { + this.connectorAddress = connectorAddress; + } + + public Offer getOffer() { + return offer; + } + + public void setOffer(Offer offer) { + this.offer = offer; + } + + public JsonNode getContext() { + return context; + } + + public void setContext(JsonNode context) { + this.context = context; + } + + public String getProtocol() { + return protocol; + } + + public void setProtocol(String protocol) { + this.protocol = protocol; + } + + public String getProviderId() { + return providerId; + } + + public void setProviderId(String providerId) { + this.providerId = providerId; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } +} diff --git a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/Offer.java b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/Offer.java index 6b389d049..3969fe419 100644 --- a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/Offer.java +++ b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/Offer.java @@ -23,34 +23,54 @@ package org.eclipse.tractusx.productpass.models.negotiation; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -public class Offer extends ContractOffer { +import java.util.List; + +@JsonInclude(JsonInclude.Include.NON_NULL) +public class Offer { @JsonProperty("offerId") String offerId; - public void open(){ - this.offerId = this.id; - this.assetId = this.getAssetId(); + @JsonProperty("assetId") + String assetId; + + @JsonProperty("policy") + Set policy; + + + public Offer(String offerId, String assetId, Set policy) { + this.offerId = offerId; + this.assetId = assetId; + this.policy = policy; } - public void close(){ - this.offerId = null; - this.assetId = null; + + public Offer() { } public String getOfferId() { return offerId; } - public String getConnectorId() { - return this.id.split(":")[1]; + public void setOfferId(String offerId) { + this.offerId = offerId; } + public String getAssetId() { - return this.id.split(":")[0]; + return assetId; } - public void setOfferId(String offerId) { - this.offerId = offerId; + public void setAssetId(String assetId) { + this.assetId = assetId; + } + + public Set getPolicy() { + return policy; + } + + public void setPolicy(Set policy) { + this.policy = policy; } } diff --git a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/Policy.java b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/Set.java similarity index 50% rename from consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/Policy.java rename to consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/Set.java index 79ba7baa4..3cf3413c8 100644 --- a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/Policy.java +++ b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/Set.java @@ -30,96 +30,69 @@ import java.util.List; @JsonInclude(JsonInclude.Include.NON_NULL) -public class Policy { - @JsonProperty("permissions") - List permissions; - @JsonProperty("prohibitions") - List prohibitions; - @JsonProperty("obligations") - List obligations; - @JsonProperty("extensibleProperties") - JsonNode extensibleProperties; - @JsonProperty("inheritsFrom") - String inheritsFrom; - @JsonProperty("assigner") - String assigner; - @JsonProperty("assignee") - String assignee; - @JsonProperty("target") +public class Set extends DidDocument{ + @JsonProperty("odrl:permission") + List permissions; + @JsonProperty("odrl:prohibition") + List prohibitions; + @JsonProperty("odrl:obligation") + List obligations; + @JsonProperty("odrl:target") String target; - @JsonProperty("@type") - JsonNode type; - - public List getPermissions() { - return permissions; - } - - public void setPermissions(List permissions) { + public Set(String id, String type, List permissions, List prohibitions, List obligations, String target) { + super(id, type); this.permissions = permissions; - } - - public List getProhibitions() { - return prohibitions; - } - - public void setProhibitions(List prohibitions) { this.prohibitions = prohibitions; - } - - public List getObligations() { - return obligations; - } - - public void setObligations(List obligations) { this.obligations = obligations; + this.target = target; } - public JsonNode getExtensibleProperties() { - return extensibleProperties; + public Set(List permissions, List prohibitions, List obligations, String target) { + this.permissions = permissions; + this.prohibitions = prohibitions; + this.obligations = obligations; + this.target = target; } - public void setExtensibleProperties(JsonNode extensibleProperties) { - this.extensibleProperties = extensibleProperties; + public Set(String id, String type) { + super(id, type); } - public String getInheritsFrom() { - return inheritsFrom; + public Set() { } + - public void setInheritsFrom(String inheritsFrom) { - this.inheritsFrom = inheritsFrom; + public String getTarget() { + return target; } - public String getAssigner() { - return assigner; + public void setTarget(String target) { + this.target = target; } - public void setAssigner(String assigner) { - this.assigner = assigner; + public List getPermissions() { + return permissions; } - public String getAssignee() { - return assignee; + public void setPermissions(List permissions) { + this.permissions = permissions; } - public void setAssignee(String assignee) { - this.assignee = assignee; + public List getProhibitions() { + return prohibitions; } - public String getTarget() { - return target; + public void setProhibitions(List prohibitions) { + this.prohibitions = prohibitions; } - public void setTarget(String target) { - this.target = target; + public List getObligations() { + return obligations; } - public JsonNode getType() { - return type; + public void setObligations(List obligations) { + this.obligations = obligations; } - public void setType(JsonNode type) { - this.type = type; - } } diff --git a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/Transfer.java b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/Transfer.java index fb8f6b723..b4200a840 100644 --- a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/Transfer.java +++ b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/Transfer.java @@ -27,38 +27,76 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.JsonNode; +import java.util.List; + @JsonInclude(JsonInclude.Include.NON_NULL) -public class Transfer { - @JsonProperty("id") - String id; - @JsonProperty("createdAt") - String createdAt; - - @JsonProperty("updatedAt") - String updatedAt; - @JsonProperty("type") - String type; - @JsonProperty("state") +public class Transfer extends DidDocument{ + @JsonProperty("edc:state") String state; - - @JsonProperty("stateTimestamp") + @JsonProperty("edc:stateTimestamp") Long stateTimestamp; - - @JsonProperty("errorDetail") + @JsonProperty("edc:errorDetail") String errorDetail; + @JsonProperty("edc:type") + String edcType; + + @JsonProperty("edc:callbackAddresses") + List callbackAddresses; + + @JsonProperty("edc:dataDestination") + DataDestination dataDestination; - @JsonProperty("dataRequest") + + @JsonProperty("edc:dataRequest") DataRequest dataRequest; - @JsonProperty("dataDestination") - JsonNode dataDestination; + @JsonProperty("edc:receiverHttpEndpoint") + String receiverHttpEndpoint; + + @JsonProperty("@context") + JsonNode context; + + public Transfer(String id, String type, String state, Long stateTimestamp, String edcType, List callbackAddresses, DataDestination dataDestination, DataRequest dataRequest, String receiverHttpEndpoint, JsonNode context) { + super(id, type); + this.state = state; + this.stateTimestamp = stateTimestamp; + this.edcType = edcType; + this.callbackAddresses = callbackAddresses; + this.dataDestination = dataDestination; + this.dataRequest = dataRequest; + this.receiverHttpEndpoint = receiverHttpEndpoint; + this.context = context; + } + + public Transfer(String state, Long stateTimestamp, String edcType, List callbackAddresses, DataDestination dataDestination, DataRequest dataRequest, String receiverHttpEndpoint, JsonNode context) { + this.state = state; + this.stateTimestamp = stateTimestamp; + this.edcType = edcType; + this.callbackAddresses = callbackAddresses; + this.dataDestination = dataDestination; + this.dataRequest = dataRequest; + this.receiverHttpEndpoint = receiverHttpEndpoint; + this.context = context; + } + + public Transfer(String id, String type) { + super(id, type); + } - public String getType() { - return type; + public Transfer() { } - public void setType(String type) { - this.type = type; + public Transfer(String id, String type, String state, Long stateTimestamp, String errorDetail, String edcType, List callbackAddresses, DataDestination dataDestination, DataRequest dataRequest, String receiverHttpEndpoint, JsonNode context) { + super(id, type); + this.state = state; + this.stateTimestamp = stateTimestamp; + this.errorDetail = errorDetail; + this.edcType = edcType; + this.callbackAddresses = callbackAddresses; + this.dataDestination = dataDestination; + this.dataRequest = dataRequest; + this.receiverHttpEndpoint = receiverHttpEndpoint; + this.context = context; } public String getState() { @@ -77,12 +115,28 @@ public void setStateTimestamp(Long stateTimestamp) { this.stateTimestamp = stateTimestamp; } - public String getErrorDetail() { - return errorDetail; + public String getEdcType() { + return edcType; } - public void setErrorDetail(String errorDetail) { - this.errorDetail = errorDetail; + public void setEdcType(String edcType) { + this.edcType = edcType; + } + + public List getCallbackAddresses() { + return callbackAddresses; + } + + public void setCallbackAddresses(List callbackAddresses) { + this.callbackAddresses = callbackAddresses; + } + + public DataDestination getDataDestination() { + return dataDestination; + } + + public void setDataDestination(DataDestination dataDestination) { + this.dataDestination = dataDestination; } public DataRequest getDataRequest() { @@ -93,13 +147,36 @@ public void setDataRequest(DataRequest dataRequest) { this.dataRequest = dataRequest; } - static class DataRequest { - @JsonProperty("assetId") + public String getReceiverHttpEndpoint() { + return receiverHttpEndpoint; + } + + public void setReceiverHttpEndpoint(String receiverHttpEndpoint) { + this.receiverHttpEndpoint = receiverHttpEndpoint; + } + + public JsonNode getContext() { + return context; + } + + public void setContext(JsonNode context) { + this.context = context; + } + + public String getErrorDetail() { + return errorDetail; + } + + public void setErrorDetail(String errorDetail) { + this.errorDetail = errorDetail; + } + + + static class DataRequest extends DidDocument{ + @JsonProperty("edc:assetId") String assetId; - @JsonProperty("contractId") + @JsonProperty("edc:contractId") String contractId; - @JsonProperty("connectorId") - String connectorId; public String getAssetId() { return assetId; @@ -116,57 +193,19 @@ public String getContractId() { public void setContractId(String contractId) { this.contractId = contractId; } - - public String getConnectorId() { - return connectorId; - } - - public void setConnectorId(String connectorId) { - this.connectorId = connectorId; - } } static class DataDestination { - @JsonProperty("properties") - Properties properties; + @JsonProperty("edc:type") + String type; - public Properties getProperties() { - return properties; + public String getType() { + return type; } - public void setProperties(Properties properties) { - this.properties = properties; + public void setType(String type) { + this.type = type; } } - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getCreatedAt() { - return createdAt; - } - - public void setCreatedAt(String createdAt) { - this.createdAt = createdAt; - } - - public JsonNode getDataDestination() { - return dataDestination; - } - - public void setDataDestination(JsonNode properties) { - this.dataDestination = properties; - } - public String getUpdatedAt() { - return updatedAt; - } - - public void setUpdatedAt(String updatedAt) { - this.updatedAt = updatedAt; - } } diff --git a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/TransferRequest.java b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/TransferRequest.java index 5f3391834..8076c7db3 100644 --- a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/TransferRequest.java +++ b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/TransferRequest.java @@ -25,52 +25,61 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.JsonNode; +import org.springframework.cglib.core.Block; @JsonInclude(JsonInclude.Include.NON_NULL) public class TransferRequest { - @JsonProperty("id") - String id; - @JsonProperty("connectorId") - String connectorId; + + @JsonProperty("@context") + JsonNode context; + @JsonProperty("assetId") + String assetId; @JsonProperty("connectorAddress") String connectorAddress; @JsonProperty("contractId") String contractId; - @JsonProperty("assetId") - String assetId; + @JsonProperty("dataDestination") + DataDestination dataDestination; @JsonProperty("managedResources") Boolean managedResources; - @JsonProperty("dataDestination") - Properties dataDestination; - - public TransferRequest(String id, String connectorId, String connectorAddress, String contractId, String assetId, Boolean managedResources, String destinationType) { - this.id = id; - this.connectorId = connectorId; + @JsonProperty("privateProperties") + PrivateProperties privateProperties; + @JsonProperty("protocol") + String protocol; + @JsonProperty("transferType") + TransferType transferType; + + public TransferRequest(JsonNode context, String assetId, String connectorAddress, String contractId, DataDestination dataDestination, Boolean managedResources, PrivateProperties privateProperties, String protocol, TransferType transferType) { + this.context = context; + this.assetId = assetId; this.connectorAddress = connectorAddress; this.contractId = contractId; - this.assetId = assetId; + this.dataDestination = dataDestination; this.managedResources = managedResources; - this.dataDestination = new Properties(destinationType); + this.privateProperties = privateProperties; + this.protocol = protocol; + this.transferType = transferType; } public TransferRequest() { } - public String getId() { - return id; + public JsonNode getContext() { + return context; } - public void setId(String id) { - this.id = id; + public void setContext(JsonNode context) { + this.context = context; } - public String getConnectorId() { - return connectorId; + public String getAssetId() { + return assetId; } - public void setConnectorId(String connectorId) { - this.connectorId = connectorId; + public void setAssetId(String assetId) { + this.assetId = assetId; } public String getConnectorAddress() { @@ -81,12 +90,21 @@ public void setConnectorAddress(String connectorAddress) { this.connectorAddress = connectorAddress; } - public String getAssetId() { - return assetId; + + public String getContractId() { + return contractId; } - public void setAssetId(String assetId) { - this.assetId = assetId; + public void setContractId(String contractId) { + this.contractId = contractId; + } + + public DataDestination getDataDestination() { + return dataDestination; + } + + public void setDataDestination(DataDestination dataDestination) { + this.dataDestination = dataDestination; } public Boolean getManagedResources() { @@ -97,20 +115,77 @@ public void setManagedResources(Boolean managedResources) { this.managedResources = managedResources; } - public Properties getDataDestination() { - return dataDestination; + public PrivateProperties getPrivateProperties() { + return privateProperties; } - public void setDataDestination(Properties dataDestination) { - this.dataDestination = dataDestination; + public void setPrivateProperties(PrivateProperties privateProperties) { + this.privateProperties = privateProperties; } - public String getContractId() { - return contractId; + public String getProtocol() { + return protocol; } - public void setContractId(String contractId) { - this.contractId = contractId; + public void setProtocol(String protocol) { + this.protocol = protocol; } + public TransferType getTransferType() { + return transferType; + } + + public void setTransferType(TransferType transferType) { + this.transferType = transferType; + } + + @JsonInclude(JsonInclude.Include.NON_NULL) + public static class TransferType{ + @JsonProperty("contentType") + String contentType; + @JsonProperty("isFinite") + Boolean isFinite; + + public String getContentType() { + return contentType; + } + + public void setContentType(String contentType) { + this.contentType = contentType; + } + + public Boolean getIsFinite() { + return isFinite; + } + + public void setIsFinite(Boolean isFinite) { + this.isFinite = isFinite; + } + } + @JsonInclude(JsonInclude.Include.NON_NULL) + public static class DataDestination { + @JsonProperty("properties") + Properties properties; + + public Properties getProperties() { + return properties; + } + + public void setProperties(Properties properties) { + this.properties = properties; + } + } + @JsonInclude(JsonInclude.Include.NON_NULL) + public static class PrivateProperties{ + @JsonProperty("receiverHttpEndpoint") + String receiverHttpEndpoint; + + public String getReceiverHttpEndpoint() { + return receiverHttpEndpoint; + } + + public void setReceiverHttpEndpoint(String receiverHttpEndpoint) { + this.receiverHttpEndpoint = receiverHttpEndpoint; + } + } } From 79ab9af128b85da939f5e016b570f8238134741d Mon Sep 17 00:00:00 2001 From: Mathias Brunkow Moser Date: Mon, 26 Jun 2023 18:53:37 +0200 Subject: [PATCH 24/35] feat: added the core components of the backend --- .../tractusx/productpass/Application.java | 4 +- .../productpass/config/ProcessConfig.java | 78 +++ .../DataModelException.java} | 26 +- .../ManagerException.java} | 25 +- .../http/controllers/AppController.java | 80 ++- .../http/controllers/api/ApiController.java | 335 +++-------- .../controllers/api/ContractController.java | 535 ++++++++++++++++++ .../productpass/listeners/AppListener.java | 12 +- .../managers/ProcessDataModel.java | 94 +++ .../productpass/managers/ProcessManager.java | 518 +++++++++++++++++ .../productpass/services/AasService.java | 11 +- .../services/DataPlaneService.java | 85 +++ .../services/DataTransferService.java | 512 ++++++++++++++--- 13 files changed, 1916 insertions(+), 399 deletions(-) create mode 100644 consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/config/ProcessConfig.java rename consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/{managers/PassportManager.java => exceptions/DataModelException.java} (60%) rename consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/{managers/PassportV1Manager.java => exceptions/ManagerException.java} (62%) create mode 100644 consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/http/controllers/api/ContractController.java create mode 100644 consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/managers/ProcessDataModel.java create mode 100644 consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/managers/ProcessManager.java create mode 100644 consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/services/DataPlaneService.java diff --git a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/Application.java b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/Application.java index 10b025baf..7bc26e141 100644 --- a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/Application.java +++ b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/Application.java @@ -32,6 +32,7 @@ import io.swagger.v3.oas.models.info.License; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.media.StringSchema; +import jakarta.servlet.http.HttpServletRequest; import org.eclipse.tractusx.productpass.models.http.Response; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; @@ -40,6 +41,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration; import org.springframework.boot.info.BuildProperties; +import org.springframework.cache.annotation.EnableCaching; import org.springframework.context.annotation.Bean; import org.springframework.core.env.Environment; import org.springframework.scheduling.annotation.EnableAsync; @@ -63,7 +65,6 @@ public class Application { @Autowired BuildProperties buildProperties; - @Autowired Environment env; public static void main(String[] args) { @@ -73,7 +74,6 @@ public static void main(String[] args) { application.run(args); } - @Bean public OpenAPI openApiConfig(){ return new OpenAPI().info(getApiInfo()); diff --git a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/config/ProcessConfig.java b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/config/ProcessConfig.java new file mode 100644 index 000000000..a2af5300d --- /dev/null +++ b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/config/ProcessConfig.java @@ -0,0 +1,78 @@ +/********************************************************************************* + * + * 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. + * + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the + * License for the specific language govern in permissions and limitations + * under the License. + * + * SPDX-License-Identifier: Apache-2.0 + ********************************************************************************/ + +package org.eclipse.tractusx.productpass.config; + +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.Configuration; + +import java.util.List; + +@Configuration +@ConfigurationProperties(prefix="configuration.process") +public class ProcessConfig { + + private Boolean store = true; + + + private String dir; + + private Boolean indent = true; + + + private String signToken; + public String getSignToken() { + return signToken; + } + + public void setSignToken(String signToken) { + this.signToken = signToken; + } + + public Boolean getIndent() { + return indent; + } + + public void setIndent(Boolean indent) { + this.indent = indent; + } + + + public Boolean getStore() { + return store; + } + + public void setStore(Boolean store) { + this.store = store; + } + + public String getDir() { + return dir; + } + + public void setDir(String dir) { + this.dir = dir; + } +} diff --git a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/managers/PassportManager.java b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/exceptions/DataModelException.java similarity index 60% rename from consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/managers/PassportManager.java rename to consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/exceptions/DataModelException.java index 30f47bdca..b4da28a28 100644 --- a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/managers/PassportManager.java +++ b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/exceptions/DataModelException.java @@ -21,25 +21,19 @@ * SPDX-License-Identifier: Apache-2.0 ********************************************************************************/ -package org.eclipse.tractusx.productpass.managers; +package org.eclipse.tractusx.productpass.exceptions; -import org.eclipse.tractusx.productpass.models.manager.Manager; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; import utils.LogUtil; -import utils.ReflectionUtil; -public abstract class PassportManager extends Manager { +public class DataModelException extends RuntimeException{ - public PassportManager(){ - super(); - this.setManager(ReflectionUtil.getCurrentClassName(this.getClass())); - LogUtil.printMessage("[DEBUG] "+this.getDataModelName()+" created! : ["+this.dataModelPath +"]"); - } - - @Override - public String getDataModelName(){ - return "passportDataModel"; - } + public DataModelException(String configuration, String errorMessage) { + super("["+configuration+"] " + errorMessage); + LogUtil.printException(this, "["+configuration+"] " + errorMessage); + } + public DataModelException(String configuration, Exception e, String errorMessage) { + super("["+configuration+"] " + errorMessage+", "+e.getMessage()); + LogUtil.printException(this, "["+configuration+"] " + errorMessage); + } } diff --git a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/managers/PassportV1Manager.java b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/exceptions/ManagerException.java similarity index 62% rename from consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/managers/PassportV1Manager.java rename to consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/exceptions/ManagerException.java index 25a08ea5b..98b537b4a 100644 --- a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/managers/PassportV1Manager.java +++ b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/exceptions/ManagerException.java @@ -21,22 +21,19 @@ * SPDX-License-Identifier: Apache-2.0 ********************************************************************************/ -package org.eclipse.tractusx.productpass.managers; +package org.eclipse.tractusx.productpass.exceptions; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; import utils.LogUtil; -import utils.ReflectionUtil; -public class PassportV1Manager extends PassportManager { - public PassportV1Manager(){ - super(); - this.setManager(ReflectionUtil.getCurrentClassName(this.getClass())); - LogUtil.printMessage("[DEBUG] "+this.getDataModelName()+" created! : ["+this.dataModelPath +"]"); - } +public class ManagerException extends RuntimeException{ + + public ManagerException(String serviceName, String errorMessage) { + super("["+serviceName+"] " + errorMessage); + LogUtil.printException(this, "["+serviceName+"] " + errorMessage); + } + public ManagerException(String serviceName, Exception e, String errorMessage) { + super("["+serviceName+"] " + errorMessage+", "+e.getMessage()); + LogUtil.printException(this, "["+serviceName+"] " + errorMessage); + } - @Override - public String getDataModelName(){ - return "passportV1DataModel"; - } } diff --git a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/http/controllers/AppController.java b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/http/controllers/AppController.java index 2128b78dd..aeacd131c 100644 --- a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/http/controllers/AppController.java +++ b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/http/controllers/AppController.java @@ -29,14 +29,17 @@ import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.tags.Tag; +import org.eclipse.tractusx.productpass.config.ProcessConfig; +import org.eclipse.tractusx.productpass.exceptions.ControllerException; +import org.eclipse.tractusx.productpass.managers.ProcessManager; +import org.eclipse.tractusx.productpass.models.edc.DataPlaneEndpoint; import org.eclipse.tractusx.productpass.models.http.Response; +import org.eclipse.tractusx.productpass.models.passports.Passport; +import org.eclipse.tractusx.productpass.services.DataPlaneService; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; -import utils.CatenaXUtil; -import utils.DateTimeUtil; -import utils.HttpUtil; +import org.springframework.core.env.Environment; +import org.springframework.web.bind.annotation.*; +import utils.*; import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; @@ -50,7 +53,21 @@ public class AppController { @Autowired HttpUtil httpUtil; + @Autowired + EdcUtil edcUtil; + + @Autowired + Environment env; + + @Autowired + PassportUtil passportUtil; + @Autowired + DataPlaneService dataPlaneService; + + @Autowired + ProcessManager processManager; + private @Autowired ProcessConfig processConfig; @GetMapping("/") @Hidden // hides this endpoint from api documentation - swagger-ui public Response index(){ @@ -72,5 +89,54 @@ public Response health(){ response.data = DateTimeUtil.getDateTimeFormatted(null); return response; } - + + public DataPlaneEndpoint getEndpointData(Object body) throws ControllerException { + DataPlaneEndpoint endpointData = edcUtil.parseDataPlaneEndpoint(body); + if(endpointData == null){ + throw new ControllerException(this.getClass().getName(),"The endpoint data request is empty!"); + } + if(endpointData.getEndpoint().isEmpty()){ + throw new ControllerException(this.getClass().getName(),"The data plane endpoint address is empty!"); + } + if(endpointData.getAuthCode().isEmpty()){ + throw new ControllerException(this.getClass().getName(),"The authorization code is empty!"); + } + if(endpointData.getOfferId().isEmpty()){ + throw new ControllerException(this.getClass().getName(),"The Offer Id is empty!"); + } + return endpointData; + } + + @RequestMapping(value = "/endpoint/{processId}", method = RequestMethod.POST) + public Response endpoint(@RequestBody Object body, @PathVariable String processId){ + try{ + DataPlaneEndpoint endpointData = null; + try { + endpointData = this.getEndpointData(body); + }catch (Exception e){ + return httpUtil.buildResponse(httpUtil.getBadRequest(e.getMessage()), httpResponse); + } + if(endpointData == null){ + return httpUtil.buildResponse(httpUtil.getBadRequest("Failed to get data plane endpoint data"), httpResponse); + } + + if(!processManager.checkProcess(processId)){ + return httpUtil.buildResponse(httpUtil.getNotFound("Process not found!"), httpResponse); + } + + Passport passport = dataPlaneService.getPassport(endpointData); + if(passport == null){ + return httpUtil.buildResponse(httpUtil.getNotFound("Passport not found in data plane!"), httpResponse); + } + String passportPath = processManager.savePassport(processId, endpointData, passport); + LogUtil.printMessage("[EDC] Passport Transfer Data ["+endpointData.getId()+"] Saved Successfully in ["+passportPath+"]!"); + }catch(Exception e) { + LogUtil.printException(e, "This request is not allowed! It must contain the valid attributes from an EDC endpoint"); + return httpUtil.buildResponse(httpUtil.getForbiddenResponse(), httpResponse); + } + return httpUtil.buildResponse(httpUtil.getResponse("ok"), httpResponse); + } + + + } diff --git a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/http/controllers/api/ApiController.java b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/http/controllers/api/ApiController.java index c1517a29d..0ebd32df4 100644 --- a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/http/controllers/api/ApiController.java +++ b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/http/controllers/api/ApiController.java @@ -30,12 +30,19 @@ import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.Valid; import org.bouncycastle.pqc.crypto.lms.LMOtsParameters; import org.eclipse.tractusx.productpass.config.PassportConfig; import org.eclipse.tractusx.productpass.exceptions.ControllerException; +import org.eclipse.tractusx.productpass.managers.ProcessManager; import org.eclipse.tractusx.productpass.models.dtregistry.DigitalTwin; import org.eclipse.tractusx.productpass.models.dtregistry.SubModel; import org.eclipse.tractusx.productpass.models.http.Response; +import org.eclipse.tractusx.productpass.models.http.requests.TokenRequest; +import org.eclipse.tractusx.productpass.models.http.responses.IdResponse; +import org.eclipse.tractusx.productpass.models.manager.History; +import org.eclipse.tractusx.productpass.models.manager.Process; +import org.eclipse.tractusx.productpass.models.manager.Status; import org.eclipse.tractusx.productpass.models.negotiation.*; import org.eclipse.tractusx.productpass.models.passports.Passport; import org.eclipse.tractusx.productpass.models.passports.PassportResponse; @@ -51,6 +58,7 @@ import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; +import javax.xml.crypto.Data; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -65,28 +73,14 @@ public class ApiController { private @Autowired HttpServletResponse httpResponse; private @Autowired DataTransferService dataService; private @Autowired AasService aasService; - private @Autowired DataController dataController; private @Autowired Environment env; private @Autowired AuthenticationService authService; private @Autowired PassportConfig passportConfig; private @Autowired HttpUtil httpUtil; + private @Autowired JsonUtil jsonUtil; + + private @Autowired ProcessManager processManager; - public Offer getContractOfferByAssetId(String assetId, String providerUrl) throws ControllerException { - /* - * This method receives the assetId (partInstanceId or Battery_ID_DMC_Code) and looks up for targets with the same name. - */ - try { - Catalog catalog = dataService.getContractOfferCatalog(providerUrl); - Map offers = catalog.loadContractOffersMapByAssetId(); - if (!offers.containsKey(assetId)) { - return null; - } - Integer index = offers.get(assetId); - return catalog.getContractOffers().get(index); - } catch (Exception e) { - throw new ControllerException(this.getClass().getName(), e, "It was not possible to get Contract Offer for assetId [" + assetId + "]"); - } - } @RequestMapping(value="/api/*", method = RequestMethod.GET) @Hidden // hide this endpoint from api documentation - swagger-ui Response index() throws Exception{ @@ -94,304 +88,115 @@ Response index() throws Exception{ return httpUtil.getResponse("Redirect to UI"); } - @RequestMapping(value = "/contracts/{assetId}", method = {RequestMethod.GET}) - @Operation(summary = "Returns first found available contract offers for asset Id", responses = { + @RequestMapping(value = "/passport", method = {RequestMethod.POST}) + @Operation(summary = "Returns versioned product passport by id", responses = { @ApiResponse(description = "Default Response Structure", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))), @ApiResponse(description = "Content of Data Field in Response", responseCode = "200", content = @Content(mediaType = "application/json", - schema = @Schema(implementation = ContractOffer.class))) + schema = @Schema(implementation = PassportResponse.class))), + @ApiResponse(description = "Content of Passport Field in Data Field",useReturnTypeSchema = true, content = @Content(mediaType = "application/json", + schema = @Schema(implementation = PassportV3.class))) }) - public Response getContract( - @PathVariable("assetId") String assetId, - @RequestParam(value = "providerUrl", required = false, defaultValue = "") String providerUrl - ) { - // Check if user is Authenticated - if(!authService.isAuthenticated(httpRequest)){ - Response response = httpUtil.getNotAuthorizedResponse(); - return httpUtil.buildResponse(response, httpResponse); - } - if(providerUrl == null || providerUrl.equals("")){ - providerUrl = env.getProperty("configuration.endpoints.providerUrl", ""); - } - Response response = httpUtil.getResponse(); - ContractOffer contractOffer = null; - try { - contractOffer = this.getContractOfferByAssetId(assetId, providerUrl); - } catch (ControllerException e) { - response.message = e.getMessage(); - response.status = 500; - response.statusText = "Server Internal Error"; - return httpUtil.buildResponse(response, httpResponse); - } - if (contractOffer == null) { - response.message = "Asset ID not found in any contract!"; - response.status = 404; - response.statusText = "Not Found"; - return httpUtil.buildResponse(response, httpResponse); - } - ; - response.message = "Asset ID: " + assetId + " found in contractOffer [" + contractOffer.getId() + "]"; - response.data = contractOffer; - return httpUtil.buildResponse(response, httpResponse); - } + public Response getPassport(@Valid @RequestBody TokenRequest tokenRequestBody) { + Response response = httpUtil.getInternalError(); - - /** - * @param id Asset id that identifies the object that has a passport - * @param idType Type of asset id, the name of the code in the digital twin registry - * Default: "Battery_ID_DMC_Code" - * @param dtIndex Index from the asset in the digital twin registry - * Default: 0 - * @param idShort Id from subModel - * Default: 0 - * @return PassportV3 - */ - @RequestMapping(value = "/passport/{version}/{id}", method = {RequestMethod.GET}) - @Operation(summary = "Returns versioned product passport by id", responses = { - @ApiResponse(description = "Default Response Structure", content = @Content(mediaType = "application/json", - schema = @Schema(implementation = Response.class))), - @ApiResponse(description = "Content of Data Field in Response", responseCode = "200", content = @Content(mediaType = "application/json", - schema = @Schema(implementation = PassportResponse.class))), - @ApiResponse(description = "Content of Passport Field in Data Field",useReturnTypeSchema = true, content = @Content(mediaType = "application/json", - schema = @Schema(implementation = PassportV3.class))) - }) - public Response getPassport( - @PathVariable("id") String id, - @PathVariable("version") String version, - @RequestParam(value = "idType", required = false, defaultValue = "partInstanceId") String idType, - @RequestParam(value = "idShort", required = false, defaultValue = "batteryPass") String idShort, - @RequestParam(value = "dtIndex", required = false, defaultValue = "0") Integer dtIndex - ) { - // Check if user is Authenticated - if(!authService.isAuthenticated(httpRequest)){ - Response response = httpUtil.getNotAuthorizedResponse(); + // Check for authentication + if (!authService.isAuthenticated(httpRequest)) { + response = httpUtil.getNotAuthorizedResponse(); return httpUtil.buildResponse(response, httpResponse); } - // Initialize response - Response response = httpUtil.getResponse(); - List versions = passportConfig.getVersions(); try { - // Configure digital twin registry query and params - AasService.DigitalTwinRegistryQueryById digitalTwinRegistry = aasService.new DigitalTwinRegistryQueryById(id, idType, dtIndex, idShort); - Thread digitalTwinRegistryThread = ThreadUtil.runThread(digitalTwinRegistry); - - // Initialize variables - Offer contractOffer = null; - // Check if version is available - if (!versions.contains(version)) { - response.message = "This passport version is not available at the moment!"; - response.status = 403; - response.statusText = "Forbidden"; + // Check for the mandatory fields + List mandatoryParams = List.of("processId", "contractId", "token"); + if (!jsonUtil.checkJsonKeys(tokenRequestBody, mandatoryParams, ".", false)) { + response = httpUtil.getBadRequest("One or all the mandatory parameters " + mandatoryParams + " are missing"); return httpUtil.buildResponse(response, httpResponse); } - // Wait for thread to close and give a response - digitalTwinRegistryThread.join(); - DigitalTwin digitalTwin; - SubModel subModel; - String connectorId; - String connectorAddress; - try { - digitalTwin = digitalTwinRegistry.getDigitalTwin(); - subModel = digitalTwinRegistry.getSubModel(); - connectorId = subModel.getIdShort(); - // Get first connectorAddress, a posibility is to check for "EDC" type - connectorAddress = subModel.getEndpoints().get(0).getProtocolInformation().getEndpointAddress(); - - } catch (Exception e) { - response.message = "Failed to get the submodel from the digital twin registry!"; - response.status = 404; - response.statusText = "Not Found"; - return httpUtil.buildResponse(response, httpResponse); - } - if (connectorId.isEmpty() || connectorAddress.isEmpty()) { - response.message = "Failed to get connectorId and connectorAddress!"; - response.status = 400; - response.statusText = "Bad Request"; - response.data = subModel; + // Check for processId + String processId = tokenRequestBody.getProcessId(); + if (!processManager.checkProcess(httpRequest, processId)) { + response = httpUtil.getBadRequest("The process id does not exists!"); return httpUtil.buildResponse(response, httpResponse); } - try { - connectorAddress = CatenaXUtil.buildEndpoint(connectorAddress); - }catch (Exception e) { - response.message = "Failed to build endpoint url to ["+connectorAddress+"]!"; - response.status = 422; - response.statusText = "Unprocessable Content"; - return httpUtil.buildResponse(response, httpResponse); - } - if (connectorAddress.isEmpty()) { - response.message = "Failed to parse endpoint ["+connectorAddress+"]!"; - response.status = 422; - response.statusText = "Unprocessable Content"; - response.data = subModel; + + Process process = processManager.getProcess(httpRequest, processId); + if (process == null) { + response = httpUtil.getBadRequest("The process id does not exists!"); return httpUtil.buildResponse(response, httpResponse); } - String assetId = String.join("-",digitalTwin.getIdentification(), subModel.getIdentification()); + // Get status to check for contract id + String contractId = tokenRequestBody.getContractId(); + Status status = processManager.getStatus(processId); - /*[1]=========================================*/ - // Get catalog with all the contract offers - try { - contractOffer = this.getContractOfferByAssetId(assetId, connectorAddress); - } catch (ControllerException e) { - response.message = "The EDC is not reachable, it was not possible to retrieve catalog!"; - response.status = 502; - response.statusText = "Bad Gateway"; + if (status.historyExists("contract-decline")) { + response = httpUtil.getForbiddenResponse("The contract for this passport has been declined!"); return httpUtil.buildResponse(response, httpResponse); } - - // Check if contract offer was not received - if (contractOffer == null) { - response.message = "Asset Id not found in any contract!"; - response.status = 404; - response.statusText = "Not Found"; + if (status.historyExists("negotiation-canceled")) { + response = httpUtil.getForbiddenResponse("This negotiation has been canceled! Please request a new one"); return httpUtil.buildResponse(response, httpResponse); } - - /*[2]=========================================*/ - // Start Negotiation - Negotiation negotiation; - try { - negotiation = dataService.doContractNegotiations(contractOffer, connectorAddress); - } catch (Exception e) { - response.message = "Negotiation Id not received, something went wrong" + " [" + e.getMessage() + "]"; - response.status = 400; - response.statusText = "Bad Request"; + // Check if the contract id is correct + History history = status.getHistory("contract-dataset"); + if (!history.getId().equals(contractId)) { + response = httpUtil.getBadRequest("This contract id is incorrect!"); return httpUtil.buildResponse(response, httpResponse); } - if (negotiation.getId() == null) { - response.message = "Negotiation Id not received, something went wrong"; - response.status = 400; - response.statusText = "Bad Request"; + // Check the validity of the token + String expectedToken = processManager.generateToken(process, contractId); + String token = tokenRequestBody.getToken(); + if (!expectedToken.equals(token)) { + response = httpUtil.getForbiddenResponse("The token is invalid!"); return httpUtil.buildResponse(response, httpResponse); } - /*[3]=========================================*/ - // Check for negotiation status - try { - negotiation = dataService.getNegotiation(negotiation.getId()); - } catch (Exception e) { - response.message = "The negotiation for asset id failed!" + " [" + e.getMessage() + "]"; - response.status = 400; - response.statusText = "Bad Request"; - return httpUtil.buildResponse(response, httpResponse); - } - if (negotiation.getState().equals("ERROR")) { - response.message = "The negotiation for asset id failed!"; - response.status = 400; - response.data = negotiation; - response.statusText = "Bad Request"; + if (status.historyExists("contract-decline")) { + response = httpUtil.getForbiddenResponse("The contract for this passport has been declined!"); return httpUtil.buildResponse(response, httpResponse); } - - /*[6]=========================================*/ - // Configure Transfer Request - TransferRequest transferRequest = new TransferRequest( - DataTransferService.generateTransferId(negotiation, connectorId, connectorAddress), - connectorId, - connectorAddress, - negotiation.getContractAgreementId(), - assetId, - false, - "HttpProxy" - ); - /*[7]=========================================*/ - // Initiate the transfer process - Transfer transfer = null; - try { - transfer = dataService.initiateTransfer(transferRequest); - } catch (Exception e) { - response.message = "It was not posible to initiate the transfer process!"; - response.status = 500; - response.statusText = "Internal Server Error"; + if (!status.historyExists("transfer-completed")) { + response = httpUtil.getNotFound("The passport transfer was not completed!"); return httpUtil.buildResponse(response, httpResponse); } - if (transfer.getId() == null) { - response.message = "Transfer Id not received, something went wrong"; - response.status = 400; - response.statusText = "Bad Request"; - return httpUtil.buildResponse(response, httpResponse); - } - - /*[8]=========================================*/ - // Check for transfer updates and the status - try { - transfer = dataService.getTransfer(transfer.getId()); - } catch (Exception e) { - response.message = "It was not possible to retrieve the transfer!"; - response.status = 500; - response.statusText = "Internal Server Error"; + if (!status.historyExists("passport-received")) { + response = httpUtil.getNotFound("The passport is not available!"); return httpUtil.buildResponse(response, httpResponse); } - // If error return transfer message - if (transfer.getState().equals("ERROR")) { - response.data = transfer; - response.message = "The transfer process failed!"; - response.status = 400; - response.statusText = "Bad Request"; + if (status.historyExists("passport-retrieved")) { + response = httpUtil.getNotFound("The passport was already retrieved and is no longer available!"); return httpUtil.buildResponse(response, httpResponse); } - /*[9]=========================================*/ - // Get passport by versions - int actualRetries = 1; - Integer maxRetries = env.getProperty("configuration.maxRetries", Integer.class,5); - while (actualRetries <= maxRetries) { - try { - response = dataController.getPassport(transferRequest.getId(), version); - } catch (Exception e) { - LogUtil.printError("[" + transferRequest.getId() + "] Waiting 5 seconds and retrying #"+actualRetries+" of "+maxRetries+"... "); - Thread.sleep(5000); - } - if(response.data!=null){ - break; - } - actualRetries++; - } + PassportV3 passport = processManager.loadPassport(processId); - // Correct Response - if(response.data != null) { - Passport passport = (Passport) response.data; - Map metadata = Map.of( - "contractOffer", contractOffer, - "negotiation", negotiation, - "transferRequest", transferRequest, - "transfer", transfer - ); - response.data = new PassportResponse(metadata, passport); + if(passport == null){ + response = httpUtil.getNotFound("Failed to load passport!"); return httpUtil.buildResponse(response, httpResponse); } - - // Error or Exception response - if(response.message == null){ - response.message = "Passport for transfer [" + transferRequest.getId() + "] not found in provider!"; - response.status = 404; - response.statusText = "Not Found"; - LogUtil.printError("["+response.status+" Not Found]: "+response.message); - } - return httpUtil.buildResponse(response, httpResponse); - - } catch (InterruptedException e) { - // Restore interrupted state... - Thread.currentThread().interrupt(); - response.message = e.getMessage(); - response.status = 500; - response.statusText = "Internal Server Error"; + Dataset dataset = processManager.loadDataset(processId); + Map negotiation = processManager.loadNegotiation(processId); + Map transfer =processManager.loadTransfer(processId); + response = httpUtil.getResponse(); + response.data = Map.of( + "contract", dataset, + "negotiation", negotiation, + "transfer", transfer, + "passport", passport + ); return httpUtil.buildResponse(response, httpResponse); } catch (Exception e) { response.message = e.getMessage(); - response.status = 500; - response.statusText = "Internal Server Error"; return httpUtil.buildResponse(response, httpResponse); } - } } diff --git a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/http/controllers/api/ContractController.java b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/http/controllers/api/ContractController.java new file mode 100644 index 000000000..3d30dc385 --- /dev/null +++ b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/http/controllers/api/ContractController.java @@ -0,0 +1,535 @@ +/********************************************************************************* + * + * Catena-X - Product Passport Consumer Backend + * + * 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. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the + * License for the specific language govern in permissions and limitations + * under the License. + * + * SPDX-License-Identifier: Apache-2.0 + ********************************************************************************/ + +package org.eclipse.tractusx.productpass.http.controllers.api; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.Valid; +import org.eclipse.tractusx.productpass.config.PassportConfig; +import org.eclipse.tractusx.productpass.config.ProcessConfig; +import org.eclipse.tractusx.productpass.exceptions.ControllerException; +import org.eclipse.tractusx.productpass.managers.ProcessManager; +import org.eclipse.tractusx.productpass.models.dtregistry.DigitalTwin; +import org.eclipse.tractusx.productpass.models.dtregistry.EndPoint; +import org.eclipse.tractusx.productpass.models.dtregistry.SubModel; +import org.eclipse.tractusx.productpass.models.http.Response; +import org.eclipse.tractusx.productpass.models.http.requests.TokenRequest; +import org.eclipse.tractusx.productpass.models.http.requests.Search; +import org.eclipse.tractusx.productpass.models.manager.History; +import org.eclipse.tractusx.productpass.models.manager.Process; +import org.eclipse.tractusx.productpass.models.manager.Status; +import org.eclipse.tractusx.productpass.models.negotiation.Dataset; +import org.eclipse.tractusx.productpass.services.AasService; +import org.eclipse.tractusx.productpass.services.AuthenticationService; +import org.eclipse.tractusx.productpass.services.DataTransferService; +import org.eclipse.tractusx.productpass.services.VaultService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.env.Environment; +import org.springframework.web.bind.annotation.*; +import utils.*; + +import java.util.List; +import java.util.Map; + +@RestController +@RequestMapping("/api/contract") +@Tag(name = "Contract Controller") +@SecurityRequirement(name = "BearerAuthentication") +public class ContractController { + private @Autowired HttpServletRequest httpRequest; + private @Autowired HttpServletResponse httpResponse; + private @Autowired DataTransferService dataService; + private @Autowired VaultService vaultService; + private @Autowired AasService aasService; + private @Autowired AuthenticationService authService; + private @Autowired PassportConfig passportConfig; + private @Autowired Environment env; + @Autowired + ProcessManager processManager; + private @Autowired ProcessConfig processConfig; + @Autowired + HttpUtil httpUtil; + private @Autowired JsonUtil jsonUtil; + + @RequestMapping(value = "/search", method = RequestMethod.POST) + @Operation(summary = "Searches for a passport with the following id", responses = { + @ApiResponse(description = "Default Response Structure", content = @Content(mediaType = "application/json", + schema = @Schema(implementation = Response.class))), + @ApiResponse(description = "Content of Data Field in Response", responseCode = "200", content = @Content(mediaType = "application/json", + schema = @Schema(implementation = Dataset.class))) + }) + public Response search(@Valid @RequestBody Search searchBody) { + Response response = httpUtil.getInternalError(); + if (!authService.isAuthenticated(httpRequest)) { + response = httpUtil.getNotAuthorizedResponse(); + return httpUtil.buildResponse(response, httpResponse); + } + try { + List mandatoryParams = List.of("id", "version"); + if (!jsonUtil.checkJsonKeys(searchBody, mandatoryParams, ".", false)) { + response = httpUtil.getBadRequest("One or all the mandatory parameters " + mandatoryParams + " are missing"); + return httpUtil.buildResponse(response, httpResponse); + } + + + List versions = passportConfig.getVersions(); + // Initialize variables + // Check if version is available + if (!versions.contains(searchBody.getVersion())) { + return httpUtil.buildResponse(httpUtil.getForbiddenResponse("This passport version is not available at the moment!"), httpResponse); + } + + // Start Digital Twin Query + AasService.DigitalTwinRegistryQueryById digitalTwinRegistry = aasService.new DigitalTwinRegistryQueryById(searchBody); + Long dtRequestTime = DateTimeUtil.getTimestamp(); + Thread digitalTwinRegistryThread = ThreadUtil.runThread(digitalTwinRegistry); + + // Wait for digital twin query + digitalTwinRegistryThread.join(); + DigitalTwin digitalTwin; + SubModel subModel; + String connectorId; + String connectorAddress; + try { + digitalTwin = digitalTwinRegistry.getDigitalTwin(); + subModel = digitalTwinRegistry.getSubModel(); + connectorId = subModel.getIdShort(); + EndPoint endpoint = subModel.getEndpoints().stream().filter(obj -> obj.getInterfaceName().equals("EDC")).findFirst().orElse(null); + if (endpoint == null) { + throw new ControllerException(this.getClass().getName(), "No EDC endpoint found in DTR SubModel!"); + } + connectorAddress = endpoint.getProtocolInformation().getEndpointAddress(); + } catch (Exception e) { + response.message = "Failed to get the submodel from the digital twin registry!"; + response.status = 404; + response.statusText = "Not Found"; + return httpUtil.buildResponse(response, httpResponse); + } + if (connectorId.isEmpty() || connectorAddress.isEmpty()) { + response.message = "Failed to get connectorId and connectorAddress!"; + response.status = 400; + response.statusText = "Bad Request"; + response.data = subModel; + return httpUtil.buildResponse(response, httpResponse); + } + + + try { + connectorAddress = CatenaXUtil.buildEndpoint(connectorAddress); + } catch (Exception e) { + response.message = "Failed to build endpoint url to [" + connectorAddress + "]!"; + response.status = 422; + response.statusText = "Unprocessable Content"; + return httpUtil.buildResponse(response, httpResponse); + } + if (connectorAddress.isEmpty()) { + response.message = "Failed to parse endpoint [" + connectorAddress + "]!"; + response.status = 422; + response.statusText = "Unprocessable Content"; + response.data = subModel; + return httpUtil.buildResponse(response, httpResponse); + } + + + Process process = processManager.createProcess(httpRequest, connectorAddress); + + processManager.saveDigitalTwin(process.id, digitalTwin, dtRequestTime); + LogUtil.printDebug("[PROCESS " + process.id + "] Digital Twin [" + digitalTwin.getIdentification() + "] and Submodel [" + subModel.getIdentification() + "] with EDC endpoint [" + connectorAddress + "] retrieved from DTR"); + String assetId = String.join("-", digitalTwin.getIdentification(), subModel.getIdentification()); + + /*[1]=========================================*/ + // Get catalog with all the contract offers + + Dataset dataset = null; + Long startedTime = DateTimeUtil.getTimestamp(); + try { + dataset = dataService.getContractOfferByAssetId(assetId, connectorAddress); + } catch (ControllerException e) { + LogUtil.printException(e, "Exception on edc"); + response.message = "The EDC is not reachable, it was not possible to retrieve catalog!"; + response.status = 502; + response.statusText = "Bad Gateway"; + return httpUtil.buildResponse(response, httpResponse); + } + + // Check if contract offer was not received + if (dataset == null) { + response.message = "Asset Id not found in any contract!"; + response.status = 404; + response.statusText = "Not Found"; + return httpUtil.buildResponse(response, httpResponse); + } + LogUtil.printDebug("[PROCESS " + process.id + "] Contract found for asset [" + assetId + "] in EDC Endpoint [" + connectorAddress + "]"); + + response = null; + response = httpUtil.getResponse(); + response.data = Map.of( + "id", process.id, + "contract", dataset, + "token", processManager.generateToken(process, dataset.getId()) + ); + + if (processConfig.getStore()) { + processManager.saveDataset(process.id, dataset, startedTime); + } + + return httpUtil.buildResponse(response, httpResponse); + } catch (InterruptedException e) { + // Restore interrupted state... + Thread.currentThread().interrupt(); + response.message = e.getMessage(); + return httpUtil.buildResponse(response, httpResponse); + } catch (Exception e) { + assert response != null; + response.message = e.getMessage(); + return httpUtil.buildResponse(response, httpResponse); + } + } + + @RequestMapping(value = "/status/{processId}", method = RequestMethod.GET) + @Operation(summary = "Get status from process") + public Response status(@PathVariable String processId) { + Response response = httpUtil.getInternalError(); + // Check for authentication + if (!authService.isAuthenticated(httpRequest)) { + response = httpUtil.getNotAuthorizedResponse(); + return httpUtil.buildResponse(response, httpResponse); + } + try { + // Check for processId + if (!processManager.checkProcess(httpRequest, processId)) { + response = httpUtil.getBadRequest("The process id does not exists!"); + return httpUtil.buildResponse(response, httpResponse); + } + + // Get status + response = httpUtil.getResponse(); + response.data = processManager.getStatus(processId); + return httpUtil.buildResponse(response, httpResponse); + + } catch (Exception e) { + response.message = e.getMessage(); + return httpUtil.buildResponse(response, httpResponse); + } + } + + + @RequestMapping(value = "/cancel", method = RequestMethod.POST) + @Operation(summary = "Cancel the negotiation") + public Response cancel(@Valid @RequestBody TokenRequest tokenRequestBody) { + Response response = httpUtil.getInternalError(); + + // Check for authentication + if (!authService.isAuthenticated(httpRequest)) { + response = httpUtil.getNotAuthorizedResponse(); + return httpUtil.buildResponse(response, httpResponse); + } + try { + // Check for the mandatory fields + List mandatoryParams = List.of("processId", "contractId", "token"); + if (!jsonUtil.checkJsonKeys(tokenRequestBody, mandatoryParams, ".", false)) { + response = httpUtil.getBadRequest("One or all the mandatory parameters " + mandatoryParams + " are missing"); + return httpUtil.buildResponse(response, httpResponse); + } + + // Check for processId + String processId = tokenRequestBody.getProcessId(); + if (!processManager.checkProcess(httpRequest, processId)) { + response = httpUtil.getBadRequest("The process id does not exists!"); + return httpUtil.buildResponse(response, httpResponse); + } + + + Process process = processManager.getProcess(httpRequest, processId); + if (process == null) { + response = httpUtil.getBadRequest("The process id does not exists!"); + return httpUtil.buildResponse(response, httpResponse); + } + + // Get status to check for contract id + String contractId = tokenRequestBody.getContractId(); + Status status = processManager.getStatus(processId); + + // Check if was already declined + if (status.historyExists("contract-decline")) { + response = httpUtil.getForbiddenResponse("This contract was declined! Please request a new one"); + return httpUtil.buildResponse(response, httpResponse); + } + + if (status.historyExists("negotiation-canceled")) { + response = httpUtil.getForbiddenResponse("This negotiation has already been canceled! Please request a new one"); + return httpUtil.buildResponse(response, httpResponse); + } + + // Check if there is a contract available + if (!status.historyExists("contract-dataset")) { + response = httpUtil.getBadRequest("No contract is available!"); + return httpUtil.buildResponse(response, httpResponse); + } + + // Check if the contract id is correct + History history = status.getHistory("contract-dataset"); + if (!history.getId().equals(contractId)) { + response = httpUtil.getBadRequest("This contract id is incorrect!"); + return httpUtil.buildResponse(response, httpResponse); + } + + // Check the validity of the token + String expectedToken = processManager.generateToken(process, contractId); + String token = tokenRequestBody.getToken(); + if (!expectedToken.equals(token)) { + response = httpUtil.getForbiddenResponse("The token is invalid!"); + return httpUtil.buildResponse(response, httpResponse); + } + + if (status.getStatus().equals("COMPLETED") || status.getStatus().equals("RETRIEVED") || status.historyExists("transfer-request") || status.historyExists("transfer-completed") || status.historyExists("passport-received") || status.historyExists("passport-retrieved")) { + response = httpUtil.getForbiddenResponse("This negotiation can not be canceled! It was already transferred!"); + return httpUtil.buildResponse(response, httpResponse); + } + String metaFile = null; + try { + metaFile = processManager.cancelProcess(httpRequest, processId); + } catch (Exception e) { + response.message = "This negotiation can not be canceled! The process has already finished!"; + return httpUtil.buildResponse(response, httpResponse); + } + if(metaFile == null){ + response.message = "Failed to cancel the negotiation!"; + return httpUtil.buildResponse(response, httpResponse); + } + + LogUtil.printStatus("[PROCESS " + processId + "] Negotiation [" + contractId + "] was canceled!"); + + response = httpUtil.getResponse("The negotiation was canceled!"); + response.data = processManager.getStatus(processId); + return httpUtil.buildResponse(response, httpResponse); + } catch (Exception e) { + response.message = e.getMessage(); + return httpUtil.buildResponse(response, httpResponse); + } + } + + + @RequestMapping(value = "/sign", method = RequestMethod.POST) + @Operation(summary = "Sign contract retrieved from provider and start negotiation") + public Response sign(@Valid @RequestBody TokenRequest tokenRequestBody) { + Long signedAt = DateTimeUtil.getTimestamp(); + Response response = httpUtil.getInternalError(); + + // Check for authentication + if (!authService.isAuthenticated(httpRequest)) { + response = httpUtil.getNotAuthorizedResponse(); + return httpUtil.buildResponse(response, httpResponse); + } + try { + // Check for the mandatory fields + List mandatoryParams = List.of("processId", "contractId", "token"); + if (!jsonUtil.checkJsonKeys(tokenRequestBody, mandatoryParams, ".", false)) { + response = httpUtil.getBadRequest("One or all the mandatory parameters " + mandatoryParams + " are missing"); + return httpUtil.buildResponse(response, httpResponse); + } + + // Check for processId + String processId = tokenRequestBody.getProcessId(); + if (!processManager.checkProcess(httpRequest, processId)) { + response = httpUtil.getBadRequest("The process id does not exists!"); + return httpUtil.buildResponse(response, httpResponse); + } + + + Process process = processManager.getProcess(httpRequest, processId); + if (process == null) { + response = httpUtil.getBadRequest("The process id does not exists!"); + return httpUtil.buildResponse(response, httpResponse); + } + + // Get status to check for contract id + String contractId = tokenRequestBody.getContractId(); + Status status = processManager.getStatus(processId); + + // Check if was already declined + if (status.historyExists("contract-decline")) { + response = httpUtil.getForbiddenResponse("This contract was declined! Please request a new one"); + return httpUtil.buildResponse(response, httpResponse); + } + if (status.historyExists("negotiation-canceled")) { + response = httpUtil.getForbiddenResponse("This negotiation has been canceled! Please request a new one"); + return httpUtil.buildResponse(response, httpResponse); + } + + // Check if was already signed + if (status.historyExists("contract-signed")) { + response = httpUtil.getForbiddenResponse("This contract is already signed!"); + return httpUtil.buildResponse(response, httpResponse); + } + + // Check if there is a contract available + if (!status.historyExists("contract-dataset")) { + response = httpUtil.getBadRequest("No contract is available!"); + return httpUtil.buildResponse(response, httpResponse); + } + + // Check if the contract id is correct + History history = status.getHistory("contract-dataset"); + if (!history.getId().equals(contractId)) { + response = httpUtil.getBadRequest("This contract id is incorrect!"); + return httpUtil.buildResponse(response, httpResponse); + } + + // Check the validity of the token + String expectedToken = processManager.generateToken(process, contractId); + String token = tokenRequestBody.getToken(); + if (!expectedToken.equals(token)) { + response = httpUtil.getForbiddenResponse("The token is invalid!"); + return httpUtil.buildResponse(response, httpResponse); + } + Dataset dataset = processManager.loadDataset(processId); + + if (dataset == null) { + response.message = "Dataset not found!"; + return httpUtil.buildResponse(response, httpResponse); + } + + String statusPath = processManager.setSigned(httpRequest, processId, contractId, signedAt); + if (statusPath == null) { + response.message = "Something went wrong when signing the contract!"; + return httpUtil.buildResponse(response, httpResponse); + } + LogUtil.printMessage("[PROCESS " + processId + "] Contract [" + contractId + "] signed! Starting negotiation..."); + + DataTransferService.NegotiateContract contractNegotiation = dataService + .new NegotiateContract( + processManager.loadDataModel(httpRequest), + processId, + dataset, + processManager.getStatus(processId) + ); + processManager.startNegotiation(httpRequest, processId, contractNegotiation); + LogUtil.printStatus("[PROCESS " + processId + "] Negotiation for [" + contractId + "] started!"); + + response = httpUtil.getResponse("The contract was signed successfully! Negotiation started!"); + response.data = processManager.getStatus(processId); + return httpUtil.buildResponse(response, httpResponse); + + } catch (Exception e) { + response.message = e.getMessage(); + return httpUtil.buildResponse(response, httpResponse); + } + } + + + @RequestMapping(value = "/decline", method = RequestMethod.POST) + @Operation(summary = "Decline passport negotiation") + public Response decline(@Valid @RequestBody TokenRequest tokenRequestBody) { + Response response = httpUtil.getInternalError(); + + // Check for authentication + if (!authService.isAuthenticated(httpRequest)) { + response = httpUtil.getNotAuthorizedResponse(); + return httpUtil.buildResponse(response, httpResponse); + } + try { + // Check for the mandatory fields + List mandatoryParams = List.of("processId", "contractId", "token"); + if (!jsonUtil.checkJsonKeys(tokenRequestBody, mandatoryParams, ".", false)) { + response = httpUtil.getBadRequest("One or all the mandatory parameters " + mandatoryParams + " are missing"); + return httpUtil.buildResponse(response, httpResponse); + } + + // Check for processId + String processId = tokenRequestBody.getProcessId(); + if (!processManager.checkProcess(httpRequest, processId)) { + response = httpUtil.getBadRequest("The process id does not exists!"); + return httpUtil.buildResponse(response, httpResponse); + } + + + Process process = processManager.getProcess(httpRequest, processId); + if (process == null) { + response = httpUtil.getBadRequest("The process id does not exists!"); + return httpUtil.buildResponse(response, httpResponse); + } + + // Get status to check for contract id + String contractId = tokenRequestBody.getContractId(); + Status status = processManager.getStatus(processId); + + // Check if was already declined + if (status.historyExists("contract-decline")) { + response = httpUtil.getForbiddenResponse("This contract has already been declined!"); + return httpUtil.buildResponse(response, httpResponse); + } + + if (status.historyExists("negotiation-canceled")) { + response = httpUtil.getForbiddenResponse("This negotiation has been canceled! Please request a new one"); + return httpUtil.buildResponse(response, httpResponse); + } + + // Check if there is a contract available + if (!status.historyExists("contract-dataset")) { + response = httpUtil.getBadRequest("No contract is available!"); + return httpUtil.buildResponse(response, httpResponse); + } + + // Check if the contract id is correct + History history = status.getHistory("contract-dataset"); + if (!history.getId().equals(contractId)) { + response = httpUtil.getBadRequest("This contract id is incorrect!"); + return httpUtil.buildResponse(response, httpResponse); + } + + // Check the validity of the token + String expectedToken = processManager.generateToken(process, contractId); + String token = tokenRequestBody.getToken(); + if (!expectedToken.equals(token)) { + response = httpUtil.getForbiddenResponse("The token is invalid!"); + return httpUtil.buildResponse(response, httpResponse); + } + + // Decline contract + String statusPath = processManager.setDecline(httpRequest, processId); + if (statusPath == null) { + response.message = "Something went wrong when declining the contract!"; + return httpUtil.buildResponse(response, httpResponse); + } + + LogUtil.printMessage("[PROCESS " + processId + "] Contract [" + contractId + "] declined!"); + response = httpUtil.getResponse("The contract negotiation was successfully declined"); + return httpUtil.buildResponse(response, httpResponse); + + } catch (Exception e) { + response.message = e.getMessage(); + return httpUtil.buildResponse(response, httpResponse); + } + + + } + +} diff --git a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/listeners/AppListener.java b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/listeners/AppListener.java index ba913de6c..da0239041 100644 --- a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/listeners/AppListener.java +++ b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/listeners/AppListener.java @@ -23,6 +23,9 @@ package org.eclipse.tractusx.productpass.listeners; +import jakarta.servlet.http.HttpServletRequest; +import org.eclipse.tractusx.productpass.managers.ProcessDataModel; +import org.eclipse.tractusx.productpass.managers.ProcessManager; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.context.event.ApplicationReadyEvent; import org.springframework.boot.context.properties.ConfigurationProperties; @@ -32,6 +35,11 @@ import org.springframework.context.event.EventListener; import org.springframework.core.env.Environment; import org.springframework.stereotype.Component; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.context.request.RequestAttributes; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; +import utils.HttpUtil; import utils.LogUtil; @Component @@ -41,8 +49,6 @@ public class AppListener { @Autowired BuildProperties buildProperties; - @Autowired - Environment env; @EventListener(ApplicationReadyEvent.class) public void onStartUp() { @@ -58,7 +64,7 @@ public void onStartUp() { LogUtil.printMessage(serverStartUpMessage); LogUtil.printMessage("[ LOGGING STARTED ] <-----------------------------------------"); LogUtil.printMessage("Creating log file..."); - + // Store the process manager in memory } } diff --git a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/managers/ProcessDataModel.java b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/managers/ProcessDataModel.java new file mode 100644 index 000000000..03176086d --- /dev/null +++ b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/managers/ProcessDataModel.java @@ -0,0 +1,94 @@ +/********************************************************************************* + * + * 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. + * + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the + * License for the specific language govern in permissions and limitations + * under the License. + * + * SPDX-License-Identifier: Apache-2.0 + ********************************************************************************/ + +package org.eclipse.tractusx.productpass.managers; + +import org.eclipse.tractusx.productpass.exceptions.DataModelException; +import org.eclipse.tractusx.productpass.exceptions.ManagerException; +import org.eclipse.tractusx.productpass.models.manager.Process; +import org.springframework.stereotype.Component; +import utils.DateTimeUtil; +import utils.LogUtil; +import utils.ThreadUtil; + +import java.util.HashMap; +import java.util.Map; + +@Component +public class ProcessDataModel { + + public Map dataModel; + + public ProcessDataModel() { + this.dataModel = new HashMap<>(); + } + public ProcessDataModel addProcess(Process process){ + this.dataModel.put(process.id, process); + return this; + } + public ProcessDataModel setState(String processId, String state){ + Process process = this.dataModel.getOrDefault(processId, null); + if(process == null){ + throw new DataModelException(this.getClass().getName(), "The process does not exists!"); + } + process.state = state; + process.updated = DateTimeUtil.getTimestamp(); + this.dataModel.put(processId, process); + return this; + } + public String getState(String processId){ + return this.dataModel.get(processId).getState(); + } + public ProcessDataModel startProcess(String processId, Runnable processRunnable){ + try { + Process process = this.dataModel.getOrDefault(processId, null); + if (process == null) { + throw new DataModelException(this.getClass().getName(), "The process does not exists!"); + } + process.state = "RUNNING"; + process.thread = ThreadUtil.runThread(processRunnable, processId); + process.updated = DateTimeUtil.getTimestamp(); + this.dataModel.put(processId, process); + return this; + }catch (Exception e){ + throw new DataModelException(this.getClass().getName(), e, "It was not possible to start the process"); + } + } + + public Process getProcess(String processId){ + return this.dataModel.getOrDefault(processId, null); + } + + public Boolean processExists(String processId){ + return this.dataModel.containsKey(processId); + } + public Map getDataModel() { + return dataModel; + } + + public void setDataModel(Map dataModel) { + this.dataModel = dataModel; + } +} diff --git a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/managers/ProcessManager.java b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/managers/ProcessManager.java new file mode 100644 index 000000000..8807d87ce --- /dev/null +++ b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/managers/ProcessManager.java @@ -0,0 +1,518 @@ +/********************************************************************************* + * + * 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. + * + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the + * License for the specific language govern in permissions and limitations + * under the License. + * + * SPDX-License-Identifier: Apache-2.0 + ********************************************************************************/ + +package org.eclipse.tractusx.productpass.managers; + +import jakarta.servlet.http.HttpServletRequest; +import org.apache.juli.logging.Log; +import org.eclipse.tractusx.productpass.config.ProcessConfig; +import org.eclipse.tractusx.productpass.exceptions.ManagerException; +import org.eclipse.tractusx.productpass.models.dtregistry.DigitalTwin; +import org.eclipse.tractusx.productpass.models.dtregistry.EndPoint; +import org.eclipse.tractusx.productpass.models.edc.DataPlaneEndpoint; +import org.eclipse.tractusx.productpass.models.http.responses.IdResponse; +import org.eclipse.tractusx.productpass.models.manager.History; +import org.eclipse.tractusx.productpass.models.manager.Process; +import org.eclipse.tractusx.productpass.models.manager.Status; +import org.eclipse.tractusx.productpass.models.negotiation.*; +import org.eclipse.tractusx.productpass.models.passports.Passport; +import org.eclipse.tractusx.productpass.models.passports.PassportV3; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.env.Environment; +import org.springframework.stereotype.Component; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; +import utils.*; + +import javax.xml.crypto.Data; +import java.nio.file.Path; +import java.util.HashMap; +import java.util.Map; + +@Component +public class ProcessManager { + + private HttpUtil httpUtil; + private JsonUtil jsonUtil; + + private FileUtil fileUtil; + private @Autowired ProcessConfig processConfig; + private @Autowired Environment env; + private final String metaFileName = "meta"; + private final String datasetFileName = "dataset"; + private final String negotiationFileName = "negotiation"; + private final String transferFileName = "transfer"; + + private final String processDataModelName = "processDataModel"; + + private final String digitalTwinFileName = "digitalTwin"; + private final String passportFileName = "passport"; + + + @Autowired + public ProcessManager(HttpUtil httpUtil, JsonUtil jsonUtil, FileUtil fileUtil, ProcessConfig processConfig) { + this.httpUtil = httpUtil; + this.jsonUtil = jsonUtil; + this.fileUtil = fileUtil; + this.processConfig = processConfig; + } + + public ProcessDataModel loadDataModel(HttpServletRequest httpRequest) { + try { + ProcessDataModel processDataModel = (ProcessDataModel) httpUtil.getSessionValue(httpRequest, this.processDataModelName); + if (processDataModel == null) { + processDataModel = new ProcessDataModel(); + this.httpUtil.setSessionValue(httpRequest, "processDataModel", processDataModel); + LogUtil.printMessage("[PROCESS] Process Data Model created for Session ["+this.httpUtil.getSessionId(httpRequest)+"], the server is ready to start processing requests..."); + } + return processDataModel; + } catch (Exception e) { + throw new ManagerException(this.getClass().getName(), e, "Failed to load Process DataModel!"); + } + } + + public void saveDataModel(HttpServletRequest httpRequest, ProcessDataModel dataModel) { + try { + httpUtil.setSessionValue(httpRequest, this.processDataModelName, dataModel); + } catch (Exception e) { + throw new ManagerException(this.getClass().getName(), e, "Failed to save Process DataModel!"); + } + } + + public Process getProcess(HttpServletRequest httpRequest, String processId) { + try { + // Getting a process + ProcessDataModel dataModel = this.loadDataModel(httpRequest); + return dataModel.getProcess(processId); + } catch (Exception e) { + throw new ManagerException(this.getClass().getName(), e, "It was not possible to get process [" + processId + "]"); + } + } + + public String generateStatusToken(Status status, String contractId) { + return CrypUtil.sha256("signToken=[" + status.getCreated() + "|" + status.id + "|" + contractId + "|" + processConfig.getSignToken() + "]"); // Add extra level of security, that just the user that has this token can sign + } + + public String generateToken(Process process, String contractId) { + return CrypUtil.sha256("signToken=[" + process.getCreated() + "|" + process.id + "|" + contractId + "|" + processConfig.getSignToken() + "]"); // Add extra level of security, that just the user that has this token can sign + } + + public Boolean checkProcess(HttpServletRequest httpRequest, String processId) { + try { + // Getting a process + ProcessDataModel dataModel = this.loadDataModel(httpRequest); + return dataModel.processExists(processId); + } catch (Exception e) { + throw new ManagerException(this.getClass().getName(), e, "It was not possible to check if process exists [" + processId + "]"); + } + } + public Boolean checkProcess(String processId) { + try { + // Getting a process + String path = this.getProcessFilePath(processId, this.metaFileName); + return fileUtil.pathExists(path); + } catch (Exception e) { + throw new ManagerException(this.getClass().getName(), e, "It was not possible to check if process exists [" + processId + "]"); + } + } + + + + + public void startNegotiation(HttpServletRequest httpRequest, String processId, Runnable contractNegotiation) { + try { + // Start the negotiation + ProcessDataModel dataModel = this.loadDataModel(httpRequest); + dataModel.startProcess(processId, contractNegotiation); + } catch (Exception e) { + throw new ManagerException(this.getClass().getName(), e, "It was not possible to start negotiation for [" + processId + "]"); + } + } + + public void setProcess(HttpServletRequest httpRequest, Process process) { + try { // Setting and updating a process + ProcessDataModel dataModel = this.loadDataModel(httpRequest); + dataModel.addProcess(process); + } catch (Exception e) { + throw new ManagerException(this.getClass().getName(), e, "It was not possible to set process [" + process.id + "]"); + } + } + + public void setProcessState(HttpServletRequest httpRequest, String processId, String processState) { + try { // Setting and updating a process state + ProcessDataModel dataModel = (ProcessDataModel) httpUtil.getSessionValue(httpRequest, this.processDataModelName); + dataModel.setState(processId, processState); + } catch (Exception e) { + throw new ManagerException(this.getClass().getName(), e, "It was not possible to set process state [" + processState + "] for process [" + processId + "]"); + } + } + public String getProcessState(HttpServletRequest httpRequest, String processId) { + try { // Setting and updating a process state + ProcessDataModel dataModel = (ProcessDataModel) httpUtil.getSessionValue(httpRequest, this.processDataModelName); + return dataModel.getState(processId); + } catch (Exception e) { + throw new ManagerException(this.getClass().getName(), e, "It was not possible to get process state for process [" + processId + "]"); + } + } + private String getProcessDir(String processId, Boolean absolute) { + String dataDir = fileUtil.getDataDir(); + if (absolute) { + return Path.of(dataDir, processConfig.getDir(), processId).toAbsolutePath().toString(); + } else { + return Path.of(dataDir, processConfig.getDir(), processId).toString(); + } + } + + public Process createProcess(HttpServletRequest httpRequest, String connectorAddress) { + Long createdTime = DateTimeUtil.getTimestamp(); + Process process = new Process(CrypUtil.getUUID(), "CREATED", createdTime); + LogUtil.printMessage("Process Created [" + process.id + "], waiting for user to sign or decline..."); + this.setProcess(httpRequest, process); // Add process to session storage + this.newStatusFile(process.id, connectorAddress, createdTime); // Set the status from the process in file system logs. + return process; + } + + public String newStatusFile(String processId, String connectorAddress, Long created){ + try { + String path = this.getProcessFilePath(processId, this.metaFileName); + return jsonUtil.toJsonFile( + path, + new Status( + processId, + "CREATED", + connectorAddress, + created, + DateTimeUtil.getTimestamp() + ), + processConfig.getIndent()); // Store the plain JSON + } catch (Exception e) { + throw new ManagerException(this.getClass().getName(), e, "It was not possible to create the status file"); + } + } + + public String getProcessFilePath(String processId, String filename) { + String processDir = this.getProcessDir(processId, false); + return Path.of(processDir, filename + ".json").toAbsolutePath().toString(); + } + + public Status getStatus(String processId) { + try { + String path = this.getProcessFilePath(processId, this.metaFileName); + return (Status) jsonUtil.fromJsonFileToObject(path, Status.class); + } catch (Exception e) { + throw new ManagerException(this.getClass().getName(), e, "It was not possible to get the status file"); + } + } + + public String setStatus(String processId, String historyId, History history) { + try { + String path = this.getProcessFilePath(processId, this.metaFileName); + Status statusFile = null; + if (!fileUtil.pathExists(path)) { + throw new ManagerException(this.getClass().getName(), "Process file does not exists for id ["+processId+"]!"); + } + + statusFile = (Status) jsonUtil.fromJsonFileToObject(path, Status.class); + statusFile.setStatus(history.getStatus()); + statusFile.setModified(DateTimeUtil.getTimestamp()); + statusFile.setHistory(historyId, history); + return jsonUtil.toJsonFile(path, statusFile, processConfig.getIndent()); // Store the plain JSON + } catch (Exception e) { + throw new ManagerException(this.getClass().getName(), e, "It was not possible to create/update the status file"); + } + } + public String setStatus(String processId, String status) { + try { + String path = this.getProcessFilePath(processId, this.metaFileName); + Status statusFile = null; + if (!fileUtil.pathExists(path)) { + throw new ManagerException(this.getClass().getName(), "Process file does not exists for id ["+processId+"]!"); + } + statusFile = (Status) jsonUtil.fromJsonFileToObject(path, Status.class); + statusFile.setStatus(status); + statusFile.setModified(DateTimeUtil.getTimestamp()); + return jsonUtil.toJsonFile(path, statusFile, processConfig.getIndent()); // Store the plain JSON + } catch (Exception e) { + throw new ManagerException(this.getClass().getName(), e, "It was not possible to create/update the status file"); + } + } + + + public String setDecline(HttpServletRequest httpRequest, String processId) { + + this.setProcessState(httpRequest, processId, "ABORTED"); + + return this.setStatus(processId, "contract-decline", new History( + processId, + "DECLINED" + )); + } + public String cancelProcess(HttpServletRequest httpRequest, String processId) { + try { + Process process = this.getProcess(httpRequest, processId); + Thread thread = process.getThread(); + if (thread == null) { + throw new ManagerException(this.getClass().getName(), "Thread not found!"); + } + this.setProcessState(httpRequest, processId, "TERMINATED"); + thread.interrupt(); // Interrupt thread + + return this.setStatus(processId, "negotiation-canceled", new History( + processId, + "CANCELLED" + )); + }catch (Exception e){ + throw new ManagerException(this.getClass().getName(),e, "It was not possible to cancel the negotiation thread for process ["+processId+"]!"); + } + } + public String setSigned(HttpServletRequest httpRequest, String processId, String contractId, Long signedAt) { + + this.setProcessState(httpRequest, processId, "STARTING"); + + return this.setStatus(processId, "contract-signed", new History( + contractId, + "SIGNED", + signedAt + )); + } + + public Dataset loadDataset(String processId) { + try { + String path = this.getProcessFilePath(processId, this.datasetFileName); + return (Dataset) jsonUtil.fromJsonFileToObject(path, Dataset.class); + } catch (Exception e) { + throw new ManagerException(this.getClass().getName(), e, "It was not possible to load the dataset for process id [" + processId + "]"); + } + } + + public Map loadNegotiation(String processId) { + try { + String path = this.getProcessFilePath(processId, this.negotiationFileName); + return (Map) jsonUtil.fromJsonFileToObject(path, Map.class); + } catch (Exception e) { + throw new ManagerException(this.getClass().getName(), e, "It was not possible to load the negotiation file for process id [" + processId + "]"); + } + } + public Map loadTransfer(String processId) { + try { + String path = this.getProcessFilePath(processId, this.transferFileName); + return (Map) jsonUtil.fromJsonFileToObject(path, Map.class); + } catch (Exception e) { + throw new ManagerException(this.getClass().getName(), e, "It was not possible to load the transfer file for process id [" + processId + "]"); + } + } + public String saveProcessPayload(String processId, Object payload, String fileName, Long startedTime, String assetId, String status, String eventKey) { + try { + Boolean encrypt = env.getProperty("passport.dataTransfer.encrypt", Boolean.class, true); + // Define history + History history = new History( + assetId, + status, + startedTime + ); + // Set status + this.setStatus(processId, eventKey, history); + String path = this.getProcessFilePath(processId, fileName); + String returnPath = ""; + if(eventKey.equals("passport-received") && encrypt) { + returnPath = fileUtil.toFile(path, payload.toString(), false); + }else { + returnPath = jsonUtil.toJsonFile(path, payload, processConfig.getIndent()); + } + if (returnPath == null) { + history.setStatus("FAILED"); + this.setStatus(processId, assetId, history); + } + return returnPath; + } catch (Exception e) { + throw new ManagerException(this.getClass().getName(), e, "It was not possible to save the payload [" + assetId + "] with eventKey [" + eventKey + "]!"); + } + } + + public String saveProcessPayload(String processId, Object payload, String fileName, String assetId, String status, String eventKey) { + try { + return this.saveProcessPayload(processId, payload, fileName, DateTimeUtil.getTimestamp(), assetId, status, eventKey); + } catch (Exception e) { + throw new ManagerException(this.getClass().getName(), e, "Failed to save payload!"); + } + } + public String saveNegotiation(String processId, Negotiation negotiation) { + try { + + String path = this.getProcessFilePath(processId, this.negotiationFileName); + Map negotiationPayload = (Map) jsonUtil.fromJsonFileToObject(path, Map.class); + negotiationPayload.put("get", Map.of("response", negotiation)); + + return this.saveProcessPayload( + processId, + negotiationPayload, + this.negotiationFileName, + negotiation.getContractAgreementId(), + "ACCEPTED", + "negotiation-accepted"); + } catch (Exception e) { + throw new ManagerException(this.getClass().getName(), e, "It was not possible to save the negotiation!"); + } + } + public String saveTransfer(String processId, Transfer transfer) { + try { + + String path = this.getProcessFilePath(processId, this.transferFileName); + Map transferPayload = (Map) jsonUtil.fromJsonFileToObject(path, Map.class); + transferPayload.put("get", Map.of( "response", transfer)); + + return this.saveProcessPayload( + processId, + transferPayload, + this.transferFileName, + transfer.getId(), + "COMPLETED", + "transfer-completed"); + } catch (Exception e) { + throw new ManagerException(this.getClass().getName(), e, "It was not possible to save the transfer!"); + } + } + public String saveNegotiationRequest(String processId, NegotiationRequest negotiationRequest, IdResponse negotiationResponse) { + try { + return this.saveProcessPayload( + processId, + Map.of("init",Map.of("request", negotiationRequest, "response", negotiationResponse)), + this.negotiationFileName, + negotiationResponse.getId(), + "NEGOTIATING", + "negotiation-request"); + } catch (Exception e) { + throw new ManagerException(this.getClass().getName(), e, "It was not possible to save the negotiation request!"); + } + } + + public String saveTransferRequest(String processId, TransferRequest transferRequest, IdResponse transferResponse) { + try { + return this.saveProcessPayload( + processId, + Map.of("init",Map.of("request", transferRequest, "response", transferResponse)), + this.transferFileName, + transferResponse.getId(), + "TRANSFERRING", + "transfer-request"); + } catch (Exception e) { + throw new ManagerException(this.getClass().getName(), e, "It was not possible to save the transfer request!"); + } + } + public PassportV3 loadPassport(String processId){ + try { + String path = this.getProcessFilePath(processId, this.passportFileName); + History history = new History( + processId, + "RETRIEVED" + ); + if(!fileUtil.pathExists(path)){ + throw new ManagerException(this.getClass().getName(), "Passport file ["+path+"] not found!"); + } + PassportV3 passport = null; + Boolean encrypt = env.getProperty("passport.dataTransfer.encrypt", Boolean.class, true); + if(encrypt){ + Status status = this.getStatus(processId); + History negotiationHistory = status.getHistory("negotiation-accepted"); + String decryptedPassportJson = CrypUtil.decryptAes(fileUtil.readFile(path), this.generateStatusToken(status, negotiationHistory.getId())); + // Delete passport file + + passport = (PassportV3) jsonUtil.loadJson(decryptedPassportJson, PassportV3.class); + }else{ + passport = (PassportV3) jsonUtil.fromJsonFileToObject(path, PassportV3.class); + } + + if(passport == null){ + throw new ManagerException(this.getClass().getName(), "Failed to load the passport"); + } + Boolean deleteResponse = fileUtil.deleteFile(path); + + if(deleteResponse==null){ + LogUtil.printStatus("[PROCESS " + processId +"] Passport file not found, failed to delete!"); + } else if (deleteResponse) { + LogUtil.printStatus("[PROCESS " + processId +"] Passport file deleted successfully!"); + } else{ + LogUtil.printStatus("[PROCESS " + processId +"] Failed to delete passport file!"); + } + + this.setStatus(processId,"passport-retrieved", history); + return passport; + } catch (Exception e) { + throw new ManagerException(this.getClass().getName(), e, "It was not possible to load the passport!"); + } + } + public String savePassport(String processId, DataPlaneEndpoint endpointData, Passport passport) { + try { + Boolean prettyPrint = env.getProperty("passport.dataTransfer.indent", Boolean.class, true); + Boolean encrypt = env.getProperty("passport.dataTransfer.encrypt", Boolean.class, true); + + Object passportContent = passport; + Status status = getStatus(processId); + if(encrypt) { + passportContent = CrypUtil.encryptAes(jsonUtil.toJson(passport, prettyPrint), this.generateStatusToken(status, endpointData.getOfferId())); // Encrypt the data with the token + } + return this.saveProcessPayload( + processId, + passportContent, + this.passportFileName, + endpointData.getId(), + "RECEIVED", + "passport-received"); + } catch (Exception e) { + throw new ManagerException(this.getClass().getName(), e, "It was not possible to save the passport!"); + } + } + + public String saveDigitalTwin(String processId, DigitalTwin digitalTwin, Long startedTime) { + try { + return this.saveProcessPayload( + processId, + digitalTwin, + this.digitalTwinFileName, + startedTime, + digitalTwin.getIdentification(), + "READY", + "digital-twin-request"); + } catch (Exception e) { + throw new ManagerException(this.getClass().getName(), e, "It was not possible to save the digitalTwin!"); + } + } + + public String saveDataset(String processId, Dataset dataset, Long startedTime) { + try { + return this.saveProcessPayload( + processId, + dataset, + this.datasetFileName, + startedTime, + dataset.getId(), + "AVAILABLE", + "contract-dataset"); + } catch (Exception e) { + throw new ManagerException(this.getClass().getName(), e, "It was not possible to save the dataset!"); + } + } + +} diff --git a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/services/AasService.java b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/services/AasService.java index 438ceaade..7ab5f945d 100644 --- a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/services/AasService.java +++ b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/services/AasService.java @@ -25,6 +25,7 @@ import org.eclipse.tractusx.productpass.exceptions.ServiceException; import org.eclipse.tractusx.productpass.exceptions.ServiceInitializationException; +import org.eclipse.tractusx.productpass.models.http.requests.Search; import org.eclipse.tractusx.productpass.models.service.BaseService; import org.eclipse.tractusx.productpass.models.dtregistry.DigitalTwin; import org.eclipse.tractusx.productpass.models.auth.JwtToken; @@ -274,11 +275,11 @@ public class DigitalTwinRegistryQueryById implements Runnable{ private final String idShort; - public DigitalTwinRegistryQueryById(String assetId, String idType, Integer dtIndex, String idShort){ - this.assetId = assetId; - this.idType = idType; - this.dtIndex = dtIndex; - this.idShort = idShort; + public DigitalTwinRegistryQueryById(Search search){ + this.assetId = search.getId(); + this.idType = search.getIdType(); + this.dtIndex = search.getDtIndex(); + this.idShort = search.getIdShort(); } @Override diff --git a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/services/DataPlaneService.java b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/services/DataPlaneService.java new file mode 100644 index 000000000..b45c8acf9 --- /dev/null +++ b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/services/DataPlaneService.java @@ -0,0 +1,85 @@ +/********************************************************************************* + * + * Catena-X - Product Passport Consumer Backend + * + * 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. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the + * License for the specific language govern in permissions and limitations + * under the License. + * + * SPDX-License-Identifier: Apache-2.0 + ********************************************************************************/ + +package org.eclipse.tractusx.productpass.services; + +import org.eclipse.tractusx.productpass.exceptions.ServiceException; +import org.eclipse.tractusx.productpass.exceptions.ServiceInitializationException; +import org.eclipse.tractusx.productpass.models.auth.JwtToken; +import org.eclipse.tractusx.productpass.models.dtregistry.DigitalTwin; +import org.eclipse.tractusx.productpass.models.edc.DataPlaneEndpoint; +import org.eclipse.tractusx.productpass.models.passports.Passport; +import org.eclipse.tractusx.productpass.models.passports.PassportV3; +import org.eclipse.tractusx.productpass.models.service.BaseService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpHeaders; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Service; +import utils.HttpUtil; +import utils.JsonUtil; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +@Service +public class DataPlaneService extends BaseService { + + @Autowired + HttpUtil httpUtil; + + @Autowired + JsonUtil jsonUtil; + + public DataPlaneService() throws ServiceInitializationException { + this.checkEmptyVariables(); + } + public Object getTransferData(DataPlaneEndpoint endpointData) { + try { + Map params = httpUtil.getParams(); + HttpHeaders headers = new HttpHeaders(); + headers.add(endpointData.getAuthKey(), endpointData.getAuthCode()); + ResponseEntity response = httpUtil.doGet(endpointData.getEndpoint(), Object.class, headers, params, true, true); + return response.getBody(); + }catch (Exception e){ + throw new ServiceException(this.getClass().getName()+"."+"getTransferData", + e, + "It was not possible to get transfer from transfer id ["+endpointData.getId()+"]"); + } + } + public Passport getPassport(DataPlaneEndpoint endpointData) { + try { + return (PassportV3) jsonUtil.bindObject(this.getTransferData(endpointData), PassportV3.class); + }catch (Exception e){ + throw new ServiceException(this.getClass().getName()+"."+"getPassport", + e, + "It was not possible to get and parse passport for transfer ["+endpointData.getId()+"]"); + } + } + + + @Override + public List getEmptyVariables() { + return new ArrayList<>(); + } +} diff --git a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/services/DataTransferService.java b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/services/DataTransferService.java index 678cd0441..ed8bc0b0e 100644 --- a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/services/DataTransferService.java +++ b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/services/DataTransferService.java @@ -24,20 +24,26 @@ package org.eclipse.tractusx.productpass.services; import com.fasterxml.jackson.databind.JsonNode; +import org.eclipse.tractusx.productpass.exceptions.ControllerException; import org.eclipse.tractusx.productpass.exceptions.ServiceException; import org.eclipse.tractusx.productpass.exceptions.ServiceInitializationException; +import org.eclipse.tractusx.productpass.managers.ProcessDataModel; +import org.eclipse.tractusx.productpass.managers.ProcessManager; +import org.eclipse.tractusx.productpass.models.http.responses.IdResponse; +import org.eclipse.tractusx.productpass.models.manager.History; +import org.eclipse.tractusx.productpass.models.manager.Status; import org.eclipse.tractusx.productpass.models.negotiation.*; import org.eclipse.tractusx.productpass.models.passports.PassportV3; import org.eclipse.tractusx.productpass.models.service.BaseService; -import org.sonarsource.scanner.api.internal.shaded.minimaljson.Json; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; import org.springframework.core.env.Environment; import org.springframework.http.HttpHeaders; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Service; import utils.*; +import javax.xml.crypto.Data; +import java.nio.file.Paths; import java.time.Duration; import java.time.Instant; import java.util.ArrayList; @@ -48,118 +54,443 @@ public class DataTransferService extends BaseService { + private final HttpUtil httpUtil; private final JsonUtil jsonUtil; - public String APIKey; + public String apiKey; + public String bpnNumber; + + public String edcEndpoint; + + public String managementPath; + public String catalogPath; + public String negotiationPath; + public String transferPath; - public String serverUrl; - public String providerUrl; + public Environment env; + public ProcessManager processManager; @Autowired - public DataTransferService(Environment env, HttpUtil httpUtil, JsonUtil jsonUtil, VaultService vaultService) throws ServiceInitializationException { + public DataTransferService(Environment env, HttpUtil httpUtil, JsonUtil jsonUtil, VaultService vaultService, ProcessManager processManager) throws ServiceInitializationException { this.httpUtil = httpUtil; this.jsonUtil = jsonUtil; + this.processManager = processManager; + this.env = env; this.init(vaultService, env); - this.checkEmptyVariables(List.of("APIKey")); // Add API Key as optional for initialization + this.checkEmptyVariables(List.of("apiKey")); // Add API Key as optional for initialization } public void init(VaultService vaultService, Environment env){ - this.APIKey = (String) vaultService.getLocalSecret("apiKey"); - this.serverUrl = env.getProperty("configuration.endpoints.serverUrl", ""); - this.providerUrl = env.getProperty("configuration.endpoints.providerUrl", ""); + this.apiKey = (String) vaultService.getLocalSecret("edc.apiKey"); + this.bpnNumber = (String) vaultService.getLocalSecret("edc.participantId"); + this.edcEndpoint = env.getProperty("configuration.edc.endpoint", ""); + this.catalogPath = env.getProperty("configuration.edc.catalog", ""); + this.managementPath = env.getProperty("configuration.edc.management", ""); + this.negotiationPath = env.getProperty("configuration.edc.negotiation", ""); + this.transferPath = env.getProperty("configuration.edc.transfer", ""); } @Override public List getEmptyVariables() { List missingVariables = new ArrayList<>(); - if (this.serverUrl == null || this.serverUrl.isEmpty()) { - missingVariables.add("serverUrl"); + if (this.edcEndpoint == null || this.edcEndpoint.isEmpty()) { + missingVariables.add("endpoint"); + } + if (this.apiKey == null || this.apiKey.isEmpty()) { + missingVariables.add("apiKey"); + } + if (this.bpnNumber == null || this.bpnNumber.isEmpty()) { + missingVariables.add("bpnNumber"); } - if (APIKey == null || APIKey.isEmpty()) { - missingVariables.add("APIKey"); + if (this.managementPath == null || this.managementPath.isEmpty()) { + missingVariables.add("management"); } - if (this.serverUrl == null || this.providerUrl.isEmpty()) { - missingVariables.add("providerUrl"); + if (this.catalogPath == null || this.catalogPath.isEmpty()) { + missingVariables.add("catalog"); } + if (this.negotiationPath == null || this.negotiationPath.isEmpty()) { + missingVariables.add("negotiation"); + } + if (this.transferPath == null || this.transferPath.isEmpty()) { + missingVariables.add("transfer"); + } + return missingVariables; } + public Dataset getContractOfferByAssetId(String assetId, String providerUrl) throws ControllerException { + /* + * This method receives the assetId and looks up for targets with the same name. + */ + try { + Catalog catalog = this.getContractOfferCatalog(providerUrl); + Map offers = catalog.loadContractOffersMapByAssetId(); + if (!offers.containsKey(assetId)) { + return null; + } + Integer index = offers.get(assetId); + return catalog.getContractOffers().get(index); + } catch (Exception e) { + throw new ControllerException(this.getClass().getName(), e, "It was not possible to get Contract Offer for assetId [" + assetId + "]"); + } + } + + public class NegotiateContract implements Runnable{ + private NegotiationRequest negotiationRequest; + private ProcessDataModel dataModel; + private Dataset dataset; + + private Negotiation negotiation; + private Transfer transfer; + private TransferRequest transferRequest; + private IdResponse negotiationResponse; + + private IdResponse tranferResponse; + private Integer negotiationAttempts; + + private Integer transferAttempts; + private Status status; + + private String processId; + + public NegotiateContract(ProcessDataModel dataModel, String processId, Dataset dataset, Status status){ + this.dataModel = dataModel; + this.processId = processId; + this.dataset = dataset; + this.status = status; + this.negotiationRequest = this.buildRequest(dataset, status); + } + + public NegotiationRequest buildRequest(Dataset dataset, Status status){ + Offer contractOffer = this.buildOffer(dataset); + return new NegotiationRequest( + jsonUtil.toJsonNode(Map.of("odrl", "http://www.w3.org/ns/odrl/2/")), + status.getEndpoint(), + bpnNumber, + contractOffer + ); + } + + public TransferRequest buildTransferRequest(Dataset dataset, Status status, Negotiation negotiation){ + try { + Offer contractOffer = this.buildOffer(dataset); + String receiverEndpoint = env.getProperty("configuration.edc.receiverEndpoint") + "/" + this.processId; // Send process Id to identification the session. + TransferRequest.TransferType transferType = new TransferRequest.TransferType(); + + transferType.setContentType("application/octet-stream"); + transferType.setIsFinite(true); + + TransferRequest.DataDestination dataDestination = new TransferRequest.DataDestination(); + dataDestination.setProperties(new Properties("HttpProxy")); + + TransferRequest.PrivateProperties privateProperties = new TransferRequest.PrivateProperties(); + privateProperties.setReceiverHttpEndpoint(receiverEndpoint); + return new TransferRequest( + jsonUtil.toJsonNode(Map.of("odrl", "http://www.w3.org/ns/odrl/2/")), + dataset.getAssetId(), + status.getEndpoint(), + negotiation.getContractAgreementId(), + dataDestination, + false, + privateProperties, + "dataspace-protocol-http", + transferType + ); + }catch (Exception e){ + throw new ServiceException(this.getClass().getName(), e, "Failed to build the transfer request!"); + } + } + @Override + public void run() { + // NEGOTIATIONGIH PROCESS + try { + processManager.saveNegotiationRequest(processId, negotiationRequest, new IdResponse(processId, null)); + this.negotiationResponse = this.requestNegotiation(this.negotiationRequest); + processManager.saveNegotiationRequest(processId, negotiationRequest, negotiationResponse); + this.negotiation = this.getNegotiationData(negotiationResponse); + if(this.negotiation == null){ + return; + } + processManager.saveNegotiation(this.processId, this.negotiation); + String state = this.negotiation.getState(); + if (!(state.equals("CONFIRMED") || state.equals("FINALIZED"))) { + throw new ServiceException(this.getClass().getName(), "Contract Negotiation Process Failed ["+this.negotiation.getId()+"]"); + } + }catch (Exception e){ + processManager.setStatus(this.processId, "negotiation-failed", new History( + this.processId, + "FAILED" + )); + this.dataModel.setState(processId, "FAILED"); + throw new ServiceException(this.getClass().getName(), e, "Failed to do the contract negotiation!"); + } + + if(this.dataModel.getState(processId).equals("TERMINATED")){ + LogUtil.printMessage("Terminated process " + processId + "stopped transfer!"); + return; + }; + this.dataModel.setState(processId, "NEGOTIATED"); + LogUtil.printStatus("[PROCESS "+ this.processId+"] Negotiation Finished with status ["+negotiation.getState()+"]!"); + // TRANSFER PROCESS + try{ + this.transferRequest = buildTransferRequest(this.dataset, this.status, this.negotiation); + processManager.saveTransferRequest(this.processId, transferRequest, new IdResponse(processId, null)); + this.tranferResponse = this.requestTransfer(transferRequest); + processManager.saveTransferRequest(this.processId, transferRequest, this.tranferResponse); + this.transfer = this.getTransferData(this.tranferResponse); + if(this.transfer == null){ + return; + } + processManager.saveTransfer(this.processId, transfer); + if (!transfer.getState().equals("COMPLETED")) { + throw new ServiceException(this.getClass().getName(), "Transfer Process Failed ["+this.tranferResponse.getId()+"]"); + } + }catch (Exception e){ + processManager.setStatus(processId, "transfer-failed", new History( + processId, + "FAILED" + )); + this.dataModel.setState(processId, "FAILED"); + throw new ServiceException(this.getClass().getName(), e, "Failed to do the contract transfer"); + } + this.dataModel.setState(processId, "COMPLETED"); + LogUtil.printStatus("[PROCESS "+ this.processId+"] Negotiation and Transfer Completed!"); + } + public Negotiation getNegotiationData(IdResponse negotiationResponse) { + Negotiation negotiation = null; + try { + negotiation = seeNegotiation(negotiationResponse.getId(), this.processId, this.dataModel); + } catch (Exception e) { + throw new ServiceException(this.getClass().getName(), e, "Failed to get the negotiation ["+negotiationResponse.getId()+"]"); + } + return negotiation; + } + + public IdResponse requestNegotiation(NegotiationRequest negotiationRequest) { + IdResponse negotiationResponse = null; + try { + negotiationResponse = doContractNegotiation(negotiationRequest); + } catch (Exception e) { + throw new ServiceException(this.getClass().getName(), e, "Failed to start the negotiation for offer ["+negotiationRequest.getOffer().getOfferId()+"]"); + } + + if (negotiationResponse.getId() == null) { + throw new ServiceException(this.getClass().getName(), "The ID from the Offer is null ["+negotiationRequest.getOffer().getOfferId()+"]"); + } + LogUtil.printMessage("[PROCESS "+ this.processId+"] Negotiation Requested ["+negotiationResponse.getId()+"]"); + return negotiationResponse; + } + public IdResponse requestTransfer(TransferRequest transferRequest) { + IdResponse transferResponse = null; + try { + transferResponse = initiateTransfer(transferRequest); + } catch (Exception e) { + throw new ServiceException(this.getClass().getName(), e, "Failed to start the transfer for contract ["+transferRequest.getContractId()+"]"); + } + if (transferResponse.getId() == null) { + throw new ServiceException(this.getClass().getName(), "The ID from the transfer is null for contract ["+transferRequest.getContractId()+"]"); + } + LogUtil.printStatus("[PROCESS "+ this.processId+"] Transfer Requested ["+transferResponse.getId()+"]"); + return transferResponse; + } + + public Transfer getTransferData(IdResponse transferData){ + /*[8]=========================================*/ + // Check for transfer updates and the status + Transfer transfer = null; + try { + transfer = seeTransfer(transferData.getId(), this.processId, this.dataModel); + } catch (Exception e) { + throw new ServiceException(this.getClass().getName(), e, "Failed to get the negotiation ["+transferData.getId()+"]"); + } + return transfer; + } + + public void setNegotiationRequest(NegotiationRequest negotiationRequest) { + this.negotiationRequest = negotiationRequest; + } + + public Dataset getDataset() { + return dataset; + } + + public void setDataset(Dataset dataset) { + this.dataset = dataset; + } + + public Offer buildOffer(Dataset dataset){ + Set policyCopy = (Set) jsonUtil.bindObject(dataset.getPolicy(), Set.class); + policyCopy.setId(null); + return new Offer( + dataset.getPolicy().getId(), + dataset.getAssetId(), + policyCopy + ); + } + + public Negotiation getNegotiation() { + return negotiation; + } + + public void setNegotiation(Negotiation negotiation) { + this.negotiation = negotiation; + } + + public NegotiationRequest getNegotiationRequest() { + return negotiationRequest; + } + + public ProcessDataModel getDataModel() { + return dataModel; + } + + public void setDataModel(ProcessDataModel dataModel) { + this.dataModel = dataModel; + } + + public Integer getNegotiationAttempts() { + return negotiationAttempts; + } + + public void setNegotiationAttempts(Integer negotiationAttempts) { + this.negotiationAttempts = negotiationAttempts; + } + + public Integer getTransferAttempts() { + return transferAttempts; + } + + public void setTransferAttempts(Integer transferAttempts) { + this.transferAttempts = transferAttempts; + } + + public Status getStatus() { + return status; + } + + public void setStatus(Status status) { + this.status = status; + } + + public String getProcessId() { + return processId; + } + + public void setProcessId(String processId) { + this.processId = processId; + } + + public Transfer getTransfer() { + return transfer; + } + + public void setTransfer(Transfer transfer) { + this.transfer = transfer; + } + + public TransferRequest getTransferRequest() { + return transferRequest; + } + + public void setTransferRequest(TransferRequest transferRequest) { + this.transferRequest = transferRequest; + } + + public IdResponse getNegotiationResponse() { + return negotiationResponse; + } + + public void setNegotiationResponse(IdResponse negotiationResponse) { + this.negotiationResponse = negotiationResponse; + } + + public IdResponse getTranferResponse() { + return tranferResponse; + } + + public void setTranferResponse(IdResponse tranferResponse) { + this.tranferResponse = tranferResponse; + } + } + public Catalog getContractOfferCatalog(String providerUrl) { try { this.checkEmptyVariables(); - String provider = providerUrl; - String path = "/consumer/data/catalog"; - if (providerUrl == null) { - provider = this.providerUrl; - } - String url = this.serverUrl + path; - Map params = httpUtil.getParams(); - params.put("providerUrl", provider); + + String url = CatenaXUtil.buildManagementEndpoint(env, this.catalogPath); + // Simple catalog request query with no limitation. + Object body = new CatalogRequest( + jsonUtil.newJsonNode(), + providerUrl, + new CatalogRequest.QuerySpec() + ); + HttpHeaders headers = httpUtil.getHeaders(); headers.add("Content-Type", "application/json"); - headers.add("X-Api-Key", APIKey); - ResponseEntity response = httpUtil.doGet(url, String.class, headers, params, false, false); - String body = (String) response.getBody(); - JsonNode json = jsonUtil.toJsonNode(body); - return (Catalog) jsonUtil.bindJsonNode(json, Catalog.class); + headers.add("X-Api-Key", this.apiKey); + ResponseEntity response = httpUtil.doPost(url, JsonNode.class, headers, httpUtil.getParams(), body, false, false); + JsonNode result = (JsonNode) response.getBody(); + return (Catalog) jsonUtil.bindJsonNode(result, Catalog.class); } catch (Exception e) { throw new ServiceException(this.getClass().getName() + "." + "getContractOfferCatalog", e, "It was not possible to retrieve the catalog!"); } } - - public Negotiation doContractNegotiations(Offer contractOffer,String providerUrl) { + public IdResponse doContractNegotiation(NegotiationRequest negotiationRequest) { try { this.checkEmptyVariables(); - contractOffer.open(); - String provider = providerUrl; - LogUtil.printDebug("["+contractOffer.getId()+"] ===== [INITIALIZING CONTRACT NEGOTIATION] ===========================================", true); + LogUtil.printDebug("["+negotiationRequest.getOffer().getOfferId()+"] ===== [INITIALIZING CONTRACT NEGOTIATION] ==========================================="); + String url = CatenaXUtil.buildManagementEndpoint(env, this.negotiationPath); HttpHeaders headers = httpUtil.getHeaders(); - String path = "/consumer/data/contractnegotiations"; - // Get variables from configuration - if (providerUrl == null) { - provider = this.providerUrl; - } - if (this.serverUrl .equals("") || APIKey == null) { - return null; - } - String url = this.serverUrl + path; headers.add("Content-Type", "application/json"); - headers.add("X-Api-Key", APIKey); - Object body = new NegotiationOffer(contractOffer.getConnectorId(), provider, contractOffer); - ResponseEntity response = httpUtil.doPost(url, JsonNode.class, headers, httpUtil.getParams(), body, false, false); + headers.add("X-Api-Key", this.apiKey); + ResponseEntity response = httpUtil.doPost(url, JsonNode.class, headers, httpUtil.getParams(), negotiationRequest, false, false); JsonNode result = (JsonNode) response.getBody(); - return (Negotiation) jsonUtil.bindJsonNode(result, Negotiation.class); + return (IdResponse) jsonUtil.bindJsonNode(result, IdResponse.class); } catch (Exception e) { throw new ServiceException(this.getClass().getName() + "." + "doContractNegotiations", e, - "It was not possible to retrieve the catalog!"); + "It was not possible to retrieve the contract negotiation!"); + } + } + public IdResponse doContractNegotiations(Offer contractOffer, String providerUrl) { + try { + this.checkEmptyVariables(); + NegotiationRequest body = new NegotiationRequest( + jsonUtil.toJsonNode(Map.of("odrl", "http://www.w3.org/ns/odrl/2/")), + providerUrl, + this.bpnNumber, + contractOffer + ); + return this.doContractNegotiation(body); + } catch (Exception e) { + throw new ServiceException(this.getClass().getName() + "." + "doContractNegotiations", + e, + "It was not possible to execute the contract negotiation!"); } } - public Negotiation getNegotiation(String Id) { + public Negotiation seeNegotiation(String id, String processId, ProcessDataModel dataModel) { try { this.checkEmptyVariables(); - HttpHeaders headers = httpUtil.getHeaders(); - String path = "/consumer/data/contractnegotiations"; + + String endpoint = CatenaXUtil.buildManagementEndpoint(env, this.negotiationPath); // Get variables from configuration - if (this.serverUrl .equals("") || APIKey == null) { - return null; - } - String url = this.serverUrl + path + "/" + Id; + String url = endpoint + "/" + id; + HttpHeaders headers = httpUtil.getHeaders(); headers.add("Content-Type", "application/json"); - headers.add("X-Api-Key", APIKey); + headers.add("X-Api-Key", this.apiKey); Map params = httpUtil.getParams(); JsonNode body = null; String actualState = ""; boolean sw = true; Instant start = Instant.now(); Instant end = start; - LogUtil.printDebug("["+Id+"] ===== [STARTING CHECKING STATUS FOR CONTRACT NEGOTIATION] ===========================================", true); + LogUtil.printDebug("["+id+"] ===== [STARTING CHECKING STATUS FOR CONTRACT NEGOTIATION] ==========================================="); while (sw) { ResponseEntity response = httpUtil.doGet(url, JsonNode.class, headers, params, false, false); body = (JsonNode) response.getBody(); @@ -168,46 +499,50 @@ public Negotiation getNegotiation(String Id) { throw new ServiceException(this.getClass().getName() + "." + "getNegotiations", "No response received from url [" + url + "]!"); } - if (!body.has("state") || body.get("state") == null) { - LogUtil.printDebug("["+Id+"] ===== [ERROR CONTRACT NEGOTIATION] ===========================================", true); + if (!body.has("edc:state") || body.get("edc:state") == null) { + LogUtil.printDebug("["+id+"] ===== [ERROR CONTRACT NEGOTIATION] ==========================================="); throw new ServiceException(this.getClass().getName() + "." + "getNegotiations", "It was not possible to do contract negotiations!"); } - String state = body.get("state").asText(); - if (state.equals("CONFIRMED") || state.equals("ERROR")) { + String state = body.get("edc:state").asText(); + if (state.equals("CONFIRMED") || state.equals("ERROR") || state.equals("FINALIZED") || state.equals("TERMINATED") || state.equals("TERMINATING")) { sw = false; - LogUtil.printDebug("["+Id+"] ===== [FINISHED CONTRACT NEGOTIATION] ===========================================", true); + LogUtil.printDebug("["+id+"] ===== [FINISHED CONTRACT NEGOTIATION] ==========================================="); } if (!state.equals(actualState)) { actualState = state; // Update current state end = Instant.now(); Duration timeElapsed = Duration.between(start, end); - LogUtil.printDebug("["+Id+"] The contract negotiation status changed: [" + state + "] - TIME->[" + timeElapsed + "]s", true); + LogUtil.printDebug("["+id+"] The contract negotiation status changed: [" + state + "] - TIME->[" + timeElapsed + "]s"); start = Instant.now(); } + if(dataModel.getState(processId).equals("TERMINATED")){ + LogUtil.printStatus("["+id+"] The negotiation was cancelled"); + return null; + } } return (Negotiation) jsonUtil.bindJsonNode(body, Negotiation.class); } catch (Exception e) { throw new ServiceException(this.getClass().getName() + "." + "getNegotiation", e, - "It was not possible to retrieve the catalog!"); + "It was not possible to see the contract negotiation!"); } } - public Transfer initiateTransfer(TransferRequest transferRequest) { + public IdResponse initiateTransfer(TransferRequest transferRequest) { try { this.checkEmptyVariables(); HttpHeaders headers = httpUtil.getHeaders(); - String path = "/consumer/data/transferprocess"; // Get variables from configuration - String url = this.serverUrl + path; + String url = CatenaXUtil.buildManagementEndpoint(env, this.transferPath); + headers.add("Content-Type", "application/json"); - headers.add("X-Api-Key", APIKey); + headers.add("X-Api-Key", this.apiKey); Object body = transferRequest; ResponseEntity response = httpUtil.doPost(url, String.class, headers, httpUtil.getParams(), body, false, false); String responseBody = (String) response.getBody(); - return (Transfer) jsonUtil.bindJsonNode(jsonUtil.toJsonNode(responseBody), Transfer.class); + return (IdResponse) jsonUtil.bindJsonNode(jsonUtil.toJsonNode(responseBody), IdResponse.class); } catch (Exception e) { throw new ServiceException(this.getClass().getName() + "." + "doTransferProcess", e, @@ -215,68 +550,71 @@ public Transfer initiateTransfer(TransferRequest transferRequest) { } } - public Transfer getTransfer(String Id) { + public Transfer seeTransfer(String id, String processId, ProcessDataModel dataModel) { try { this.checkEmptyVariables(); HttpHeaders headers = httpUtil.getHeaders(); - String path = "/consumer/data/transferprocess"; - String url = this.serverUrl + path + "/" + Id; + String endpoint = CatenaXUtil.buildManagementEndpoint(env, this.transferPath); + String path = endpoint + "/" + id; headers.add("Content-Type", "application/json"); - headers.add("X-Api-Key", APIKey); + headers.add("X-Api-Key", this.apiKey); Map params = httpUtil.getParams(); JsonNode body = null; String actualState = ""; boolean sw = true; Instant start = Instant.now(); Instant end = start; - LogUtil.printDebug("["+Id+"] ===== [STARTING CONTRACT TRANSFER] ===========================================", true); + LogUtil.printDebug("["+id+"] ===== [STARTING CONTRACT TRANSFER] ==========================================="); while (sw) { - ResponseEntity response = httpUtil.doGet(url, JsonNode.class, headers, params, false, false); + ResponseEntity response = httpUtil.doGet(path, JsonNode.class, headers, params, false, false); body = (JsonNode) response.getBody(); if(body == null){ sw = false; throw new ServiceException(this.getClass().getName() + "." + "getNegotiations", - "No response received from url [" + url + "]!"); + "No response received from url [" + path + "]!"); } - if (!body.has("state") || body.get("state") == null) { - LogUtil.printDebug("["+Id+"] ===== [ERROR CONTRACT TRANSFER]===========================================", true); + if (!body.has("edc:state") || body.get("edc:state") == null) { + LogUtil.printDebug("["+id+"] ===== [ERROR CONTRACT TRANSFER]==========================================="); throw new ServiceException(this.getClass().getName() + "." + "getTransfer", "It was not possible to do the transfer process!"); } - String state = body.get("state").asText(); - if (state.equals("COMPLETED") || state.equals("ERROR")) { - LogUtil.printDebug("["+Id+"] ===== [FINISHED CONTRACT TRANSFER] ["+Id+"]===========================================", true); + String state = body.get("edc:state").asText(); + if (state.equals("COMPLETED") || state.equals("ERROR") || state.equals("FINALIZED") || state.equals("VERIFIED") || state.equals("TERMINATED") || state.equals("TERMINATING")) { + LogUtil.printDebug("["+id+"] ===== [FINISHED CONTRACT TRANSFER] ["+id+"]==========================================="); sw = false; } if (!state.equals(actualState)) { actualState = state; // Update current state end = Instant.now(); Duration timeElapsed = Duration.between(start, end); - LogUtil.printDebug("["+Id+"] The data transfer status changed: [" + state + "] - TIME->[" + timeElapsed + "]s", true); + LogUtil.printDebug("["+id+"] The data transfer status changed: [" + state + "] - TIME->[" + timeElapsed + "]s"); start = Instant.now(); } + if(dataModel.getState(processId).equals("TERMINATED")){ + LogUtil.printStatus("["+id+"] The transfer was cancelled"); + return null; + } } return (Transfer) jsonUtil.bindJsonNode(body, Transfer.class); } catch (Exception e) { throw new ServiceException(this.getClass().getName() + "." + "getTransfer", e, - "It was not possible to transfer the contract! " + Id); + "It was not possible to transfer the contract! " + id); } } - public PassportV3 getPassportV3(String transferProcessId) { + public PassportV3 getPassportV3(String transferProcessId, String endpoint) { try { this.checkEmptyVariables(); - String path = "/consumer_backend"; - String url = this.serverUrl + path + "/" + transferProcessId; Map params = httpUtil.getParams(); HttpHeaders headers = httpUtil.getHeaders(); headers.add("Accept", "application/octet-stream"); boolean retry = false; + ResponseEntity response = null; try { - response = httpUtil.doGet(url, String.class, headers, params, false, false); + response = httpUtil.doGet(endpoint, String.class, headers, params, false, false); }catch (Exception e){ throw new ServiceException(this.getClass().getName() + ".getPassportV3", "It was not possible to get passport with id " + transferProcessId); } From 84bf33c958cf7c3c0da310d7e68f3250b6ca63be Mon Sep 17 00:00:00 2001 From: Mathias Brunkow Moser Date: Mon, 26 Jun 2023 18:55:49 +0200 Subject: [PATCH 25/35] feat: added utils and backend config --- .../http/controllers/api/DataController.java | 101 ------------------ .../src/main/java/utils/CatenaXUtil.java | 20 +++- .../src/main/java/utils/CrypUtil.java | 65 ++++++++++- .../src/main/java/utils/DateTimeUtil.java | 5 + .../src/main/java/utils/EdcUtil.java | 50 +++++++++ .../src/main/java/utils/FileUtil.java | 20 +++- .../src/main/java/utils/HttpUtil.java | 98 ++++++++++++++++- .../src/main/java/utils/JsonUtil.java | 76 ++++++++++++- .../src/main/java/utils/LogUtil.java | 86 ++++----------- .../src/main/java/utils/PassportUtil.java | 71 ++++++++++++ .../src/main/resources/application.yml | 29 ++++- .../src/main/resources/logback-spring.xml | 2 +- 12 files changed, 440 insertions(+), 183 deletions(-) delete mode 100644 consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/http/controllers/api/DataController.java create mode 100644 consumer-backend/productpass/src/main/java/utils/EdcUtil.java create mode 100644 consumer-backend/productpass/src/main/java/utils/PassportUtil.java diff --git a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/http/controllers/api/DataController.java b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/http/controllers/api/DataController.java deleted file mode 100644 index 04c0a4521..000000000 --- a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/http/controllers/api/DataController.java +++ /dev/null @@ -1,101 +0,0 @@ -/********************************************************************************* - * - * Catena-X - Product Passport Consumer Backend - * - * 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. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, - * either express or implied. See the - * License for the specific language govern in permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ - -package org.eclipse.tractusx.productpass.http.controllers.api; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.eclipse.tractusx.productpass.models.dtregistry.SubModel; -import org.eclipse.tractusx.productpass.models.http.Response; -import org.eclipse.tractusx.productpass.models.negotiation.Catalog; -import org.eclipse.tractusx.productpass.models.passports.Passport; -import org.eclipse.tractusx.productpass.models.passports.PassportV3; -import org.eclipse.tractusx.productpass.services.AasService; -import org.eclipse.tractusx.productpass.services.AuthenticationService; -import org.eclipse.tractusx.productpass.services.DataTransferService; -import org.eclipse.tractusx.productpass.services.VaultService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; -import utils.HttpUtil; -import utils.LogUtil; - -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; -import utils.ThreadUtil; - -@RestController -@RequestMapping("/api/data") -@Tag(name = "Data Controller") -@SecurityRequirement(name = "BearerAuthentication") -public class DataController { - private @Autowired HttpServletRequest httpRequest; - private @Autowired HttpServletResponse httpResponse; - private @Autowired DataTransferService dataService; - private @Autowired VaultService vaultService; - private @Autowired AasService aasService; - private @Autowired AuthenticationService authService; - - - @Autowired - HttpUtil httpUtil; - - @RequestMapping(value = "/passport/{transferId}", method = {RequestMethod.GET}) - @Operation(summary = "Returns product passport by transfer process Id", responses = { - @ApiResponse(description = "Default Response Structure", content = @Content(mediaType = "application/json", - schema = @Schema(implementation = Response.class))), - @ApiResponse(description = "Content of Data Field in Response", responseCode = "200", content = @Content(mediaType = "application/json", - schema = @Schema(implementation = PassportV3.class))) - }) - public Response getPassport(@PathVariable("transferId") String transferId, @RequestParam(value="version", required = false, defaultValue = "v3.0.1") String version) { - // Check if user is Authenticated - if(!authService.isAuthenticated(httpRequest)){ - Response response = httpUtil.getNotAuthorizedResponse(); - return httpUtil.buildResponse(response, httpResponse); - } - Response response = httpUtil.getResponse(); - Passport passport = null; - if(version.equals("v3.0.1")) { // Currently supporting just version v3 - passport = dataService.getPassportV3(transferId); - }else{ - response.message = "Version is not available!"; - response.status = 400; - response.statusText = "Bad Request"; - response.data = null; - return httpUtil.buildResponse(response, httpResponse); - } - if (passport == null) { - response.message = "Passport for transfer [" + transferId + "] not found!"; - response.status = 404; - response.statusText = "Not Found"; - response.data = null; - return httpUtil.buildResponse(response, httpResponse); - } - response.data = passport; - LogUtil.printMessage("Passport for transfer [" + transferId + "] retrieved successfully!"); - return httpUtil.buildResponse(response, httpResponse); - } -} diff --git a/consumer-backend/productpass/src/main/java/utils/CatenaXUtil.java b/consumer-backend/productpass/src/main/java/utils/CatenaXUtil.java index 90be58a56..129979482 100644 --- a/consumer-backend/productpass/src/main/java/utils/CatenaXUtil.java +++ b/consumer-backend/productpass/src/main/java/utils/CatenaXUtil.java @@ -23,18 +23,21 @@ package utils; +import org.apache.juli.logging.Log; import org.checkerframework.checker.units.qual.A; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.env.Environment; import org.springframework.stereotype.Component; import utils.exceptions.UtilException; +import java.nio.file.Paths; import java.util.regex.Matcher; import java.util.regex.Pattern; public final class CatenaXUtil { private final static String bpnNumberPattern = "BPN[LSA][A-Z0-9]{12}"; - private final static String edcDataEndpoint = "/api/v1/ids/data"; + private final static String edcDataEndpoint = "/api/v1/dsp"; public static Boolean containsBPN(String str){ return str.matches(".*"+bpnNumberPattern+".*"); @@ -52,6 +55,19 @@ public static String getBPN(String str){ } return matcher.group(); } + public static String buildManagementEndpoint(Environment env, String path){ + try { + String edcEndpoint = env.getProperty("configuration.edc.endpoint"); + String managementEndpoint = env.getProperty("configuration.edc.management"); + if(edcEndpoint == null || managementEndpoint == null){ + throw new UtilException(CatenaXUtil.class,"[ERROR] EDC endpoint is null or Management endpoint is null"); + } + return edcEndpoint + managementEndpoint + path; + }catch (Exception e){ + throw new UtilException(CatenaXUtil.class,e, "[ERROR] Invalid edc endpoint or management endpoint"); + } + } + public static String buildEndpoint(String endpoint){ try { if (CatenaXUtil.containsEdcEndpoint(endpoint)) { @@ -66,7 +82,7 @@ public static String buildEndpoint(String endpoint){ return String.format("%s"+edcDataEndpoint,cleanUrl); } }catch (Exception e){ - throw new UtilException(CatenaXUtil.class,"[ERROR] Invalid url ["+endpoint+"] given!"); + throw new UtilException(CatenaXUtil.class,e,"[ERROR] Invalid url ["+endpoint+"] given!"); } } diff --git a/consumer-backend/productpass/src/main/java/utils/CrypUtil.java b/consumer-backend/productpass/src/main/java/utils/CrypUtil.java index 26c49239b..078697886 100644 --- a/consumer-backend/productpass/src/main/java/utils/CrypUtil.java +++ b/consumer-backend/productpass/src/main/java/utils/CrypUtil.java @@ -24,11 +24,27 @@ package utils; import com.google.common.hash.Hashing; +import utils.exceptions.UtilException; +import javax.crypto.Cipher; +import javax.crypto.spec.SecretKeySpec; +import java.io.UnsupportedEncodingException; import java.net.URLDecoder; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; import java.util.Base64; +import java.io.UnsupportedEncodingException; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.util.Arrays; +import java.util.Base64; +import java.util.UUID; + +import javax.crypto.Cipher; +import javax.crypto.spec.SecretKeySpec; + public final class CrypUtil { private CrypUtil() { @@ -37,9 +53,15 @@ private CrypUtil() { public static String toBase64(String str){ return Base64.getEncoder().encodeToString(str.getBytes()); } + public static String toBase64(byte[] bytes){ + return Base64.getEncoder().encodeToString(bytes); + } public static String fromBase64(String base64){ return new String(Base64.getDecoder().decode(base64)); } + public static byte[] fromBase64ToByte(String base64){ + return Base64.getDecoder().decode(base64); + } public static String toBase64Url(String str){ return Base64.getUrlEncoder().encodeToString(str.getBytes()); } @@ -47,17 +69,58 @@ public static String fromBase64Url(String base64){ return new String(Base64.getUrlDecoder().decode(base64)); } + public static String getUUID(){ + return UUID.randomUUID().toString(); + } - public static String sha256(String digest){ + public static String sha256(final String digest){ return Hashing.sha256() .hashString(digest, StandardCharsets.UTF_8) .toString(); } + + public static byte[] sha1Bytes(final String digest){ + try { + return MessageDigest.getInstance("SHA-1").digest(digest.getBytes("UTF-8")); + } catch (Exception e) + { + throw new UtilException(CrypUtil.class,"It was not possible to generate sha1 hash" + e.getMessage()) ; + } + } public static String decodeFromUtf8(String encodedURL){ return URLDecoder.decode(encodedURL, StandardCharsets.UTF_8); } public static String encodeToUtf8(String decodedURL){ return URLEncoder.encode(decodedURL, StandardCharsets.UTF_8); } + public static SecretKeySpec buildAesKey(final String secret) { + try { + byte[] bytesKey = CrypUtil.sha1Bytes(secret); + return new SecretKeySpec(Arrays.copyOf(bytesKey, 16), "AES"); + } catch (Exception e) { + throw new UtilException(CrypUtil.class,"It was not possible to set key " + e.getMessage()) ; + } + } + public static String encryptAes(final String decoded, final String key) { + try { + SecretKeySpec secretKey = CrypUtil.buildAesKey(key); + Cipher encryptor = Cipher.getInstance("AES/ECB/PKCS5Padding"); + encryptor.init(Cipher.ENCRYPT_MODE, secretKey); + return CrypUtil.toBase64(encryptor.doFinal(decoded.getBytes("UTF-8"))); + } catch (Exception e) { + throw new UtilException(CrypUtil.class,"It was not possible encrypt data" + e.getMessage()) ; + } + } + + public static String decryptAes(final String encoded, final String key) { + try { + SecretKeySpec secretKey = CrypUtil.buildAesKey(key); + Cipher decryptor = Cipher.getInstance("AES/ECB/PKCS5Padding"); + decryptor.init(Cipher.DECRYPT_MODE, secretKey); + return new String(decryptor.doFinal(CrypUtil.fromBase64ToByte(encoded))); + } catch (Exception e) { + throw new UtilException(CrypUtil.class, "It was not possible encrypt dat" + e.getMessage()); + } + } } diff --git a/consumer-backend/productpass/src/main/java/utils/DateTimeUtil.java b/consumer-backend/productpass/src/main/java/utils/DateTimeUtil.java index ef3cd65ce..4b812b763 100644 --- a/consumer-backend/productpass/src/main/java/utils/DateTimeUtil.java +++ b/consumer-backend/productpass/src/main/java/utils/DateTimeUtil.java @@ -23,6 +23,7 @@ package utils; +import java.sql.Timestamp; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; @@ -54,4 +55,8 @@ public static String getFileDateTimeFormatted(String pattern){ return dtf.format(now); } + public static Long getTimestamp(){ + return new Timestamp(System.currentTimeMillis()).getTime(); + } + } diff --git a/consumer-backend/productpass/src/main/java/utils/EdcUtil.java b/consumer-backend/productpass/src/main/java/utils/EdcUtil.java new file mode 100644 index 000000000..452d760a9 --- /dev/null +++ b/consumer-backend/productpass/src/main/java/utils/EdcUtil.java @@ -0,0 +1,50 @@ +/********************************************************************************* + * + * 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. + * + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the + * License for the specific language govern in permissions and limitations + * under the License. + * + * SPDX-License-Identifier: Apache-2.0 + ********************************************************************************/ + +package utils; + +import org.eclipse.tractusx.productpass.models.edc.DataPlaneEndpoint; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import utils.exceptions.UtilException; + +@Component +public class EdcUtil { + + private final JsonUtil jsonUtil; + @Autowired + public EdcUtil(JsonUtil jsonUtil) { + this.jsonUtil = jsonUtil; + } + public DataPlaneEndpoint parseDataPlaneEndpoint(Object body){ + try { + return (DataPlaneEndpoint) this.jsonUtil.bindObject(body, DataPlaneEndpoint.class); + }catch (Exception e){ + throw new UtilException(EdcUtil.class, e, "It was not possible to parse the data plain endpoint"); + } + } + + +} diff --git a/consumer-backend/productpass/src/main/java/utils/FileUtil.java b/consumer-backend/productpass/src/main/java/utils/FileUtil.java index 171842bc0..cbd3c1865 100644 --- a/consumer-backend/productpass/src/main/java/utils/FileUtil.java +++ b/consumer-backend/productpass/src/main/java/utils/FileUtil.java @@ -67,9 +67,6 @@ public String createFile(String filePath){ try { File myObj = new File(filePath); myObj.getParentFile().mkdirs(); - if (myObj.createNewFile()) { - LogUtil.printMessage("File created in path [" + filePath + "]"); - } return myObj.getPath(); } catch (Exception e) { throw new UtilException(FileUtil.class,"It was not possible to create new file at ["+filePath+"], " + e.getMessage()) ; @@ -108,6 +105,10 @@ public String getResourcePath(Class selectedClass, String resourcePath){ throw new UtilException(FileUtil.class,"[ERROR] Something when wrong when reading file in path [" + resourcePath + "], " + e.getMessage()); } } + public String getDataDir(){ + String workDir = this.getWorkdirPath(); + return Paths.get(workDir ,"data").toAbsolutePath().toString(); + } public String createDataDir(String name){ String workDir = this.getWorkdirPath(); @@ -149,6 +150,19 @@ public String readFile(String path){ } + + public Boolean deleteFile(String path){ + try { + if(!this.pathExists(path)) { + LogUtil.printError("The file does not exists in [" + path + "]!"); + return null; + } + return Files.deleteIfExists(Paths.get(path)); + } catch (Exception e) { + throw new UtilException(FileUtil.class, "It was not possible to delete file [" + path + "]"); + } + } + public String getRootPath(){ try { return System.getProperty("user.dir"); diff --git a/consumer-backend/productpass/src/main/java/utils/HttpUtil.java b/consumer-backend/productpass/src/main/java/utils/HttpUtil.java index aed0260fe..6c1999339 100644 --- a/consumer-backend/productpass/src/main/java/utils/HttpUtil.java +++ b/consumer-backend/productpass/src/main/java/utils/HttpUtil.java @@ -23,7 +23,9 @@ package utils; +import org.apache.juli.logging.Log; import org.checkerframework.checker.units.qual.C; +import org.eclipse.tractusx.productpass.models.edc.Jwt; import org.eclipse.tractusx.productpass.models.http.Response; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.env.Environment; @@ -45,6 +47,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.ArrayList; +import java.util.Base64; import java.util.HashMap; import java.util.Map; @@ -56,6 +59,8 @@ public class HttpUtil { private Environment env; + @Autowired + JsonUtil jsonUtil; public Integer maxRetries; @Autowired @@ -67,13 +72,17 @@ public HttpUtil(Environment env) { private final String POST_ERROR_MESSAGE = "It was not possible to do POST request to "; - public Object getSessionValue(HttpServletRequest httpRequest, String key) { + public Object getSessionValue(HttpServletRequest httpRequest, String key) { return httpRequest.getSession().getAttribute(key); } public void setSessionValue(HttpServletRequest httpRequest, String key, Object value) { httpRequest.getSession().setAttribute(key, value); } + public String getSessionId(HttpServletRequest httpRequest) { + return httpRequest.getSession().getId(); + } + public Boolean isInSession(HttpServletRequest httpRequest, String key) { try { @@ -96,6 +105,9 @@ public Boolean isInSession(HttpServletRequest httpRequest, String key) { public String getHttpInfo(HttpServletRequest httpRequest, Integer status) { return "[" + httpRequest.getProtocol() + " " + httpRequest.getMethod() + "] " + status + ": " + httpRequest.getRequestURI(); } + public String getResponseHttpInfo(Response response) { + return "[HTTP Response] " + response.status + " " + response.statusText+ ": " + response.getMessage(); + } public String getParamOrDefault(HttpServletRequest httpRequest, String param, String defaultPattern) { String requestParam = httpRequest.getParameter(param); @@ -165,6 +177,22 @@ public String getCurrentHost(HttpServletRequest httpRequest){ } } + public Jwt parseToken(String token){ + try { + String[] chunks = token.split("\\."); + Jwt jwt = new Jwt(); + + String header = CrypUtil.fromBase64Url(chunks[0]); + String payload = CrypUtil.fromBase64Url(chunks[1]); + LogUtil.printMessage("token header: " + header + " payload: " + payload); + jwt.setHeader((Map) jsonUtil.parseJson(header)); + jwt.setPayload((Map) jsonUtil.parseJson(payload)); + return jwt; + }catch(Exception e){ + throw new UtilException(HttpUtil.class, e, "It was not possible to parse JWT Token"); + } + + } public String getCurrentUrl(HttpServletRequest httpRequest){ try { return httpRequest.getRequestURL().toString(); @@ -214,6 +242,9 @@ public Response buildResponse(Response response, HttpServletResponse servletRes servletResponse.setStatus(response.getStatus()); servletResponse.setHeader("Access-Control-Allow-Origin", "*"); servletResponse.setHeader("Access-Control-Allow-Methods", "GET, POST, OPTIONS"); + if(response.getStatus() != 200){ + LogUtil.printHTTPErrorMessage(this.getResponseHttpInfo(response)); + } return response; } public Response getResponse() { @@ -237,10 +268,71 @@ public Response getResponse(String message, Object data) { data ); } + public Response getBadRequest() { + return new Response( + null, + 400, + "Bad Request" + ); + } + public Response getBadRequest(String message) { + return new Response( + message, + 400, + "Bad Request" + ); + } + public Response getNotFound() { + return new Response( + null, + 404, + "Not Found" + ); + } + + public Response getNotFound(String message) { + return new Response( + message, + 404, + "Not Found" + ); + } + + + public Response getInternalError() { + return new Response( + null, + 500, + "Internal Server Error" + ); + } + + public Response getInternalError(String message) { + return new Response( + message, + 500, + "Internal Server Error" + ); + } + public Response getForbiddenResponse(String message) { + return new Response( + message, + 403, + "Forbidden" + ); + } + public Response getForbiddenResponse() { + return new Response( + null, + 403, + "Forbidden" + ); + } public Response getNotAuthorizedResponse() { return new Response( - "Not Authorized", - 401 + null, + 401, + "Not Authorized" ); } public void redirect(HttpServletResponse httpResponse, String url) { diff --git a/consumer-backend/productpass/src/main/java/utils/JsonUtil.java b/consumer-backend/productpass/src/main/java/utils/JsonUtil.java index f0076396e..83cbbce1e 100644 --- a/consumer-backend/productpass/src/main/java/utils/JsonUtil.java +++ b/consumer-backend/productpass/src/main/java/utils/JsonUtil.java @@ -84,9 +84,20 @@ public Object parseJson(String jsonString){ throw new UtilException(JsonUtil.class, "I was not possible to parse JSON! -> [" + e.getMessage() + "]"); } } + public Object parseJson(String jsonString, Class bindClass){ + try { + ObjectMapper mapper = new ObjectMapper(); + return mapper.readValue(jsonString, bindClass); + } catch (Exception e) { + throw new UtilException(JsonUtil.class, "I was not possible to parse JSON! -> [" + e.getMessage() + "]"); + } + } public ObjectNode newJson(){ return JsonNodeFactory.instance.objectNode(); } + public JsonNode newJsonNode(){ + return JsonNodeFactory.instance.objectNode(); + } public Boolean isJson(String jsonString){ try { @@ -125,6 +136,43 @@ public Object fromJsonFile(String path){ throw new UtilException(JsonUtil.class, "I was not possible to create JSON file ["+path+"]! -> [" + e.getMessage() + "]"); } } + public Object fromJsonFileToObject(String path, Class bindClass){ + try { + 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() + "]"); + } + } + + public Boolean checkJsonKeys(Object sourceObj, List keyPaths, String pathSep, Boolean allowEmpty){ + try { + if(sourceObj == null){ + //Uncomment for debug logTools.printError("[DEBUG] Object == null!"); + return false; + } + if(keyPaths == null || keyPaths.isEmpty() || pathSep.equals("")){ + //Uncomment for debug logTools.printError("[DEBUG] keyPath empty or pathSep empty!"); + return false; + } + Object trigger = null; + for (String keyPath : keyPaths) { + + trigger = this.getValue(sourceObj, keyPath, pathSep, null); + if(trigger == null){ + return false; + } + if(!allowEmpty && trigger.equals("")){ + return false; + } + } + return true; + } catch (Exception e) { + throw new UtilException(JsonUtil.class, e, "It was not possible to check for json keys!"); + } + } + + public Object getValue(Object sourceObj, String keyPath, String pathSep, Object defaultValue){ try { @@ -252,6 +300,16 @@ public JsonNode toJsonNode(String json){ } } + public JsonNode toJsonNode(Map json){ + ObjectMapper mapper = new ObjectMapper(); + try { + return mapper.valueToTree(json); + } catch (Exception e) { + throw new UtilException(JsonUtil.class, "It was not possible to parse json -> [" + e.getMessage() + "]"); + } + } + + public Map toMap(Object obj){ ObjectMapper mapper = new ObjectMapper(); try { @@ -261,7 +319,7 @@ public Map toMap(Object obj){ } } - public Object bindJsonNode(JsonNode jsonNode, Class bindClass){ + public Object bindJsonNode(JsonNode jsonNode, Class bindClass){ ObjectMapper mapper = new ObjectMapper(); try { return mapper.treeToValue(jsonNode, bindClass); @@ -269,4 +327,20 @@ public Object bindJsonNode(JsonNode jsonNode, Class bindClass){ throw new UtilException(JsonUtil.class, "It was not possible to parse json -> [" + e.getMessage() + "]"); } } + public Object bindMap(Map json, Class bindClass){ + ObjectMapper mapper = new ObjectMapper(); + try { + return mapper.convertValue(mapper.valueToTree(json), bindClass); + } catch (Exception e) { + throw new UtilException(JsonUtil.class, "It was not possible to parse json -> [" + e.getMessage() + "]"); + } + } + public Object bindObject(Object json, Class bindClass){ + ObjectMapper mapper = new ObjectMapper(); + try { + return this.bindJsonNode(mapper.valueToTree(json), bindClass); + } catch (Exception e) { + throw new UtilException(JsonUtil.class, "It was not possible to parse json -> [" + e.getMessage() + "]"); + } + } } diff --git a/consumer-backend/productpass/src/main/java/utils/LogUtil.java b/consumer-backend/productpass/src/main/java/utils/LogUtil.java index 66e80416c..a8294f30c 100644 --- a/consumer-backend/productpass/src/main/java/utils/LogUtil.java +++ b/consumer-backend/productpass/src/main/java/utils/LogUtil.java @@ -34,38 +34,23 @@ import java.util.Map; public final class LogUtil { - private static final Integer level = 7; - private static final Boolean asyncLog = false; - /** * Static Tools to print logs with format and current date. */ static Logger logger = LogManager.getLogger(LogUtil.class); private static final Level INFO = Level.forName("INFO", 400); private static final Level HTTP = Level.forName("HTTP", 420); - private static final Level DEBUG = Level.forName("DEBUGGER", 450); + private static final Level STATUS = Level.forName("STATUS", 430); + private static final Level DEBUG = Level.forName("DEBUG", 500); private static final Level EXCEPTION = Level.forName( "EXCEPTION", 100); private static final Level WARNING = Level.forName("WARNING", 300); + private static final Level HTTPError = Level.forName("HTTP ERROR", 200); private static final Level ERROR = Level.forName("ERROR", 200); private static final Level FATAL = Level.forName("FATAL", 200); private static final Level TEST = Level.forName("TEST", 400); - private static final Map LOGLEVELS = Map.of( - FATAL,1, - ERROR, 2, - EXCEPTION,3, - WARNING, 5, - HTTP, 6, - INFO, 7, - DEBUG, 8 - ); - private static boolean checkLogLevel(Level logLevel){ - Integer currentLevel = level; - Integer assignedLevel = LOGLEVELS.get(logLevel); - return currentLevel >= assignedLevel; - } public static void printTest(String strMessage){ Level logLevel = TEST; Long pid = SystemUtil.getPid(); @@ -74,58 +59,33 @@ public static void printTest(String strMessage){ ThreadUtil.runThread(new LogPrinter(logLevel, message), "testLogThread"); } public static void printMessage(String strMessage){ - Level logLevel = INFO; - if(!LogUtil.checkLogLevel(logLevel)){ - return; - } - - LogUtil.printLog(logLevel, strMessage); - + LogUtil.printLog(INFO, strMessage); } public static void printHTTPMessage(String strMessage){ - Level logLevel = HTTP; - if(!LogUtil.checkLogLevel(logLevel)){ - return; - } - LogUtil.printLog(logLevel, strMessage); + LogUtil.printLog(HTTP, strMessage); + } + public static void printHTTPErrorMessage(String strMessage){ + LogUtil.printLog(HTTPError, strMessage); } public static void printException(Exception e, String strMessage){ - Level logLevel = EXCEPTION; - if(!LogUtil.checkLogLevel(logLevel)){ - return; - } String message = " ["+e.getMessage()+"] "+strMessage; - LogUtil.printLog(logLevel, message); + LogUtil.printLog(EXCEPTION, message); } public static void printError(String strMessage){ - Level logLevel = ERROR; - if(!LogUtil.checkLogLevel(logLevel)){ - return; - } - LogUtil.printLog(logLevel, strMessage); + LogUtil.printLog(ERROR, strMessage); } public static void printWarning(String strMessage){ - Level logLevel = WARNING; - if(!LogUtil.checkLogLevel(logLevel)){ - return; - } - LogUtil.printLog(logLevel, strMessage); + LogUtil.printLog(WARNING, strMessage); } public static void printDebug(String strMessage) { - Level logLevel = DEBUG; - if(!LogUtil.checkLogLevel(logLevel)){ - return; - } - LogUtil.printLog(logLevel, strMessage); + Long pid = SystemUtil.getPid(); + String memoryUsage = SystemUtil.getUsedHeapMemory(); + String message = "|"+pid+"|"+ memoryUsage+"| [DEBUG] " + strMessage; + logger.debug(message); } - - public static void printDebug(String strMessage, Boolean keepLog) { - Level logLevel = Level.forName("DEBUG",500); // Real debug level - if(keepLog){ - ThreadUtil.runThread(new LogPrinter(logLevel, strMessage), "keepLogLogger"); - } - LogUtil.printDebug(strMessage); + public static void printStatus(String strMessage) { + LogUtil.printLog(STATUS, strMessage); } public static void printLog(Level logLevel, String strMessage){ @@ -133,18 +93,10 @@ public static void printLog(Level logLevel, String strMessage){ Long pid = SystemUtil.getPid(); String memoryUsage = SystemUtil.getUsedHeapMemory(); String message = "|"+pid+"|"+ memoryUsage+"| [" + logLevel.name()+"] " + strMessage; - if(LogUtil.asyncLog){ - ThreadUtil.runThread(new LogPrinter(logLevel, message), "logThread"); - }else { - logger.log(logLevel, message); - } + logger.log(logLevel, message); } public static void printFatal(String strMessage){ - Level logLevel = FATAL; - if(!LogUtil.checkLogLevel(logLevel)){ - return; - } - LogUtil.printLog(logLevel, strMessage); + LogUtil.printLog(FATAL, strMessage); } private static class LogPrinter implements Runnable { diff --git a/consumer-backend/productpass/src/main/java/utils/PassportUtil.java b/consumer-backend/productpass/src/main/java/utils/PassportUtil.java new file mode 100644 index 000000000..9eafb50e9 --- /dev/null +++ b/consumer-backend/productpass/src/main/java/utils/PassportUtil.java @@ -0,0 +1,71 @@ +/********************************************************************************* + * + * 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. + * + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the + * License for the specific language govern in permissions and limitations + * under the License. + * + * SPDX-License-Identifier: Apache-2.0 + ********************************************************************************/ + +package utils; + +import org.eclipse.tractusx.productpass.models.edc.DataPlaneEndpoint; +import org.eclipse.tractusx.productpass.models.passports.Passport; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.env.Environment; +import org.springframework.stereotype.Component; +import utils.exceptions.UtilException; + +import java.io.File; +import java.nio.file.Path; + +@Component +public class PassportUtil { + private final JsonUtil jsonUtil; + private final FileUtil fileUtil; + private final String transferDir; + + @Autowired + public PassportUtil(JsonUtil jsonUtil, FileUtil fileUtil, Environment env) { + this.transferDir = env.getProperty("passport.dataTransfer.dir", String.class, "data/transfer"); + this.jsonUtil = jsonUtil; + this.fileUtil = fileUtil; + } + public String savePassport(Passport passport, DataPlaneEndpoint endpointData, Boolean prettyPrint, Boolean encrypted){ + try { + fileUtil.createDir(this.transferDir); + String path = Path.of(this.transferDir, endpointData.getId() + ".json").toAbsolutePath().toString(); + return this.savePassport(passport, endpointData, prettyPrint, encrypted, path); + }catch (Exception e){ + throw new UtilException(PassportUtil.class, e, "Something went wrong while creating the path and saving the passport for transfer ["+endpointData.getId()+"]"); + } + } + + public String savePassport(Passport passport, DataPlaneEndpoint endpointData, Boolean prettyPrint, Boolean encrypted, String filePath){ + try { + if(!encrypted) { + return jsonUtil.toJsonFile(filePath, passport, prettyPrint); // Store the plain JSON + }else{ + return fileUtil.toFile(filePath, CrypUtil.encryptAes(jsonUtil.toJson(passport, prettyPrint), endpointData.getOfferId()+endpointData.getId()), false); // Store Encrypted + } + }catch (Exception e){ + throw new UtilException(PassportUtil.class, e, "Something went wrong while saving the passport for transfer ["+endpointData.getId()+"]"); + } + } +} diff --git a/consumer-backend/productpass/src/main/resources/application.yml b/consumer-backend/productpass/src/main/resources/application.yml index 9236dc900..5c91b5c8c 100644 --- a/consumer-backend/productpass/src/main/resources/application.yml +++ b/consumer-backend/productpass/src/main/resources/application.yml @@ -31,6 +31,11 @@ spring: serialization: indent_output: true +logging: + level: + root: INFO + utils: INFO + configuration: maxRetries: 5 @@ -40,12 +45,28 @@ configuration: tokenUri: 'https://centralidp.dev.demo.catena-x.net/auth/realms/CX-Central/protocol/openid-connect/token' userInfoUri: 'https://centralidp.dev.demo.catena-x.net/auth/realms/CX-Central/protocol/openid-connect/userinfo' + edc: + endpoint: 'https://materialpass.dev.demo.catena-x.net/consumer' + management: '/management/v2' + catalog: '/catalog/request' + negotiation: '/contractnegotiations' + transfer: '/transferprocesses' + receiverEndpoint: 'https://materialpass.dev.demo.catena-x.net/endpoint' + + process: + store: true + dir: 'process' + indent: true + signKey: 'c55e3f35200f6afedbce37cefdaf40eadd15c92814edfdbc4d6ab0eacdcdd56dbcd5a2a34ca4b675084d33f9f479d7d79347795148aaf4443e1b47ab96b27e72' + endpoints: - providerUrl: 'https://materialpass.dev.demo.catena-x.net/BPNL000000000000' - serverUrl: 'https://materialpass.dev.demo.catena-x.net' registryUrl: 'https://semantics.dev.demo.catena-x.net' passport: + dataTransfer: + encrypt: true + indent: true + dir: "data/transfer" versions: - 'v3.0.1' @@ -57,10 +78,10 @@ configuration: indent: 2 defaultValue: '' attributes: - - "token" - "client.id" - "client.secret" - - "apiKey" + - "edc.apiKey" + - "edc.participantId" server: error: diff --git a/consumer-backend/productpass/src/main/resources/logback-spring.xml b/consumer-backend/productpass/src/main/resources/logback-spring.xml index 3002cb501..b50cb7caa 100644 --- a/consumer-backend/productpass/src/main/resources/logback-spring.xml +++ b/consumer-backend/productpass/src/main/resources/logback-spring.xml @@ -49,7 +49,7 @@ ${LOGS}/${day}/${day}_${time}-${LOG_FILE}.log - %d %p %C{1} %m%n + %d %p %t %C{1} %m%n Date: Mon, 26 Jun 2023 18:57:12 +0200 Subject: [PATCH 26/35] feat: updated POM version --- consumer-backend/productpass/pom.xml | 2 +- consumer-backend/productpass/readme.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/consumer-backend/productpass/pom.xml b/consumer-backend/productpass/pom.xml index ed0c79ce1..57dbc46a3 100644 --- a/consumer-backend/productpass/pom.xml +++ b/consumer-backend/productpass/pom.xml @@ -33,7 +33,7 @@ org.eclipse.tractusx productpass - 0.6.1-SNAPSHOT + 0.8.0-SNAPSHOT jar Catena-X Digital Product Passport Backend Product Passport Consumer Backend System for Product Passport Consumer Frontend Application diff --git a/consumer-backend/productpass/readme.md b/consumer-backend/productpass/readme.md index f1b974fcc..b35102b2a 100644 --- a/consumer-backend/productpass/readme.md +++ b/consumer-backend/productpass/readme.md @@ -23,7 +23,7 @@

  Digital Product Pass Backend

-

Version: 0.6.1-SNAPSHOT

+

Version: 0.8.0-SNAPSHOT


From bdc56cec1cca2d43ee569cf614260fee449c0d20 Mon Sep 17 00:00:00 2001 From: Mathias Brunkow Moser Date: Mon, 26 Jun 2023 19:20:44 +0200 Subject: [PATCH 27/35] feat: added important documentation and helm charts for the backend --- CHANGELOG.md | 44 +- charts/digital-product-pass/Chart.yaml | 4 +- .../templates/deployment-backend.yaml | 9 +- .../templates/secret-backend.yaml | 1 + charts/digital-product-pass/values-beta.yaml | 112 ++- charts/digital-product-pass/values-dev.yaml | 113 ++- charts/digital-product-pass/values-int.yaml | 121 ++- charts/digital-product-pass/values.yaml | 124 +-- deployment/helm/edc-consumer/Chart.yaml | 89 +- deployment/helm/edc-consumer/README.md.gotmpl | 26 + deployment/helm/edc-consumer/values-beta.yaml | 845 +++++++++++------ deployment/helm/edc-consumer/values-int.yaml | 849 +++++++++++------- deployment/helm/edc-consumer/values.yaml | 582 ++++++++++++ deployment/helm/edc-provider/Chart.yaml | 89 +- deployment/helm/edc-provider/README.md.gotmpl | 26 + deployment/helm/edc-provider/values-beta.yaml | 816 +++++++++++------ deployment/helm/edc-provider/values-int.yaml | 816 +++++++++++------ deployment/helm/edc-provider/values.yaml | 580 ++++++++++++ docs/RELEASE_USER.md | 41 +- package-lock.json | 4 +- package.json | 2 +- 21 files changed, 3877 insertions(+), 1416 deletions(-) create mode 100644 deployment/helm/edc-consumer/README.md.gotmpl create mode 100644 deployment/helm/edc-consumer/values.yaml create mode 100644 deployment/helm/edc-provider/README.md.gotmpl create mode 100644 deployment/helm/edc-provider/values.yaml diff --git a/CHANGELOG.md b/CHANGELOG.md index 74905c976..41f45a605 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,49 @@ The changelog format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [in preparation] +## [1.0.0] - xxxx-xx-xx + +## Deleted +- Deleted the cx-backend-service from the EDC Consumer and Provider deployments +- Removed inrelevant infrastructure files +- Remove not necesarry logs that affected the performance + +## Added +- Added new `/endpoint` api to store the payload incomming from the EDC data plane +- Added the encryption and decryption in AES from passport payload. +- Added AES unit tests +- Added the DataPlane service in the backend to comunicate with the data plane. +- Added process manager to manage the asyncronous processes executing in parallel. +- Added process dataModel in session. +- Added new passport util. +- Added new models to negotiate and transfer with the new EDC `v0.4.1` +- Added new utils methods like to delete files. +- Added contract controller apis + - Added contract search `/api/contract/search` + - Added contract decline `/api/contract/decline` + - Added contract sign `/api/contract/sign` + - Added contract cancel `/api/contract/cancel` + - Added contract status `/api/contract/status` +- Added new Backend configuration +- Integrated the EDC Data Plane retrieval logic +- Added `.tractusx` metafile +- Align chart version with app version. +- Added file system logging of the negotiation and transfer. + +## Updated +- Updated charts configurations related to the backend. +- Updated the EDC test charts to remote the cx-backend-service configurations +- Updated payloads +- Update the backend chart configuration +- Refactor secrets structure +- Updated postman collection + +## Security Improvements +- Added logic to create and authenticate with unique session tokens the sign and other methods. +- Added Encryption of passport payload when coming from Data Plane endpoint, until it is retrieved to the user which is authenticated and is using the unique session token as decryption key. +- Added unique signKey to backend, which is used to the unique session key. + ## [released] ## [0.9.0] - 2023-06-20 @@ -56,7 +99,6 @@ The changelog format is based on [Keep a Changelog](https://keepachangelog.com/e - Updated version from vite to `v4.1.5` to fix critical vulnerability raised by the dependapot: https://github.com/eclipse-tractusx/digital-product-pass/security/dependabot/2 - ## [released] ## [0.8.0] - 2023-05-19 diff --git a/charts/digital-product-pass/Chart.yaml b/charts/digital-product-pass/Chart.yaml index ad74d4164..4083c8f72 100644 --- a/charts/digital-product-pass/Chart.yaml +++ b/charts/digital-product-pass/Chart.yaml @@ -37,10 +37,10 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.3.5 +version: 1.0.0 # 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: "0.9.0" +appVersion: "1.0.0" diff --git a/charts/digital-product-pass/templates/deployment-backend.yaml b/charts/digital-product-pass/templates/deployment-backend.yaml index e8a066924..6192ccd34 100644 --- a/charts/digital-product-pass/templates/deployment-backend.yaml +++ b/charts/digital-product-pass/templates/deployment-backend.yaml @@ -58,11 +58,18 @@ spec: secretKeyRef: key: clientSecret name: avp-consumer-backend-cx-registry-auth - - name: "apiKey" + - name: "edc.apiKey" valueFrom: secretKeyRef: key: xApiKey name: avp-consumer-backend-edc-oauth + - name: "edc.participantId" + valueFrom: + secretKeyRef: + key: participantId + name: avp-consumer-backend-edc-oauth + + volumeMounts: - name: backend-config mountPath: /app/config diff --git a/charts/digital-product-pass/templates/secret-backend.yaml b/charts/digital-product-pass/templates/secret-backend.yaml index d87fb965f..78a46a355 100644 --- a/charts/digital-product-pass/templates/secret-backend.yaml +++ b/charts/digital-product-pass/templates/secret-backend.yaml @@ -43,3 +43,4 @@ metadata: type: Opaque stringData: xApiKey: {{ .Values.backend.avp.helm.xApiKey }} + participantId: {{ .Values.backend.avp.helm.participantId }} diff --git a/charts/digital-product-pass/values-beta.yaml b/charts/digital-product-pass/values-beta.yaml index 88d98c16d..96419c933 100644 --- a/charts/digital-product-pass/values-beta.yaml +++ b/charts/digital-product-pass/values-beta.yaml @@ -79,56 +79,78 @@ backend: clientId: clientSecret: xApiKey: + participantId: application: yml: |- - spring: - application: - name: 'Catena-X Product Passport Consumer Backend' - main: - allow-bean-definition-overriding: true - devtools: - add-properties: false - jackson: - serialization: - indent_output: true - configuration: - maxRetries: 5 + spring: + name: 'Catena-X Product Passport Consumer Backend' + main: + allow-bean-definition-overriding: true + devtools: + add-properties: false + jackson: + serialization: + indent_output: true - keycloak: - realm: CX-Central - resource: Cl13-CX-Battery - tokenUri: 'https://centralidp.beta.demo.catena-x.net/auth/realms/CX-Central/protocol/openid-connect/token' - userInfoUri: 'https://centralidp.beta.demo.catena-x.net/auth/realms/CX-Central/protocol/openid-connect/userinfo' + logging: + level: + root: INFO + utils: INFO - endpoints: - providerUrl: 'https://materialpass.beta.demo.catena-x.net/BPNL000000000000' - serverUrl: 'https://materialpass.beta.demo.catena-x.net' - registryUrl: 'https://semantics.beta.demo.catena-x.net' + configuration: + maxRetries: 5 - passport: - versions: - - 'v3.0.1' + keycloak: + realm: CX-Central + resource: Cl13-CX-Battery + tokenUri: 'https://centralidp.beta.demo.catena-x.net/auth/realms/CX-Central/protocol/openid-connect/token' + userInfoUri: 'https://centralidp.beta.demo.catena-x.net/auth/realms/CX-Central/protocol/openid-connect/userinfo' - vault: - type: 'local' - file: 'vault.token.yml' - pathSep: "." - prettyPrint: true - indent: 2 - defaultValue: '' - attributes: - - "token" - - "client.id" - - "client.secret" - - "apiKey" - server: - error: - include-message: ALWAYS - include-binding-errors: ALWAYS - include-stacktrace: ON_PARAM - include-exception: false - port: 8888 - tomcat: - max-connections: 10000 + edc: + endpoint: 'https://materialpass.beta.demo.catena-x.net/consumer' + management: '/management/v2' + catalog: '/catalog/request' + negotiation: '/contractnegotiations' + transfer: '/transferprocesses' + receiverEndpoint: 'https://materialpass.beta.demo.catena-x.net/endpoint' + process: + store: true + dir: 'process' + indent: true + signKey: '' + + endpoints: + registryUrl: 'https://semantics.beta.demo.catena-x.net' + + passport: + dataTransfer: + encrypt: true + indent: true + dir: "data/transfer" + versions: + - 'v3.0.1' + + vault: + type: 'local' + file: 'vault.token.yml' + pathSep: "." + prettyPrint: true + indent: 2 + defaultValue: '' + attributes: + - "client.id" + - "client.secret" + - "edc.apiKey" + - "edc.participantId" + + server: + error: + include-message: ALWAYS + include-binding-errors: ALWAYS + include-stacktrace: ON_PARAM + include-exception: false + port: 8888 + tomcat: + max-connections: 10000 \ No newline at end of file diff --git a/charts/digital-product-pass/values-dev.yaml b/charts/digital-product-pass/values-dev.yaml index 22d701ca9..dd11ede33 100644 --- a/charts/digital-product-pass/values-dev.yaml +++ b/charts/digital-product-pass/values-dev.yaml @@ -79,55 +79,78 @@ backend: clientId: clientSecret: xApiKey: + participantId: application: yml: |- - spring: - application: - name: 'Catena-X Product Passport Consumer Backend' - main: - allow-bean-definition-overriding: true - devtools: - add-properties: false - jackson: - serialization: - indent_output: true - configuration: - maxRetries: 5 + spring: + name: 'Catena-X Product Passport Consumer Backend' + main: + allow-bean-definition-overriding: true + devtools: + add-properties: false + jackson: + serialization: + indent_output: true - keycloak: - realm: CX-Central - resource: Cl13-CX-Battery - tokenUri: 'https://centralidp.dev.demo.catena-x.net/auth/realms/CX-Central/protocol/openid-connect/token' - userInfoUri: 'https://centralidp.dev.demo.catena-x.net/auth/realms/CX-Central/protocol/openid-connect/userinfo' + logging: + level: + root: INFO + utils: INFO - endpoints: - providerUrl: 'https://materialpass.dev.demo.catena-x.net/BPNL000000000000' - serverUrl: 'https://materialpass.dev.demo.catena-x.net' - registryUrl: 'https://semantics.dev.demo.catena-x.net' + configuration: + maxRetries: 5 - passport: - versions: - - 'v3.0.1' + keycloak: + realm: CX-Central + resource: Cl13-CX-Battery + tokenUri: 'https://centralidp.dev.demo.catena-x.net/auth/realms/CX-Central/protocol/openid-connect/token' + userInfoUri: 'https://centralidp.dev.demo.catena-x.net/auth/realms/CX-Central/protocol/openid-connect/userinfo' - vault: - type: 'local' - file: 'vault.token.yml' - pathSep: "." - prettyPrint: true - indent: 2 - defaultValue: '' - attributes: - - "token" - - "client.id" - - "client.secret" - - "apiKey" - server: - error: - include-message: ALWAYS - include-binding-errors: ALWAYS - include-stacktrace: ON_PARAM - include-exception: false - port: 8888 - tomcat: - max-connections: 10000 + edc: + endpoint: 'https://materialpass.dev.demo.catena-x.net/consumer' + management: '/management/v2' + catalog: '/catalog/request' + negotiation: '/contractnegotiations' + transfer: '/transferprocesses' + receiverEndpoint: 'https://materialpass.dev.demo.catena-x.net/endpoint' + + process: + store: true + dir: 'process' + indent: true + signKey: '' + + endpoints: + registryUrl: 'https://semantics.dev.demo.catena-x.net' + + passport: + dataTransfer: + encrypt: true + indent: true + dir: "data/transfer" + versions: + - 'v3.0.1' + + vault: + type: 'local' + file: 'vault.token.yml' + pathSep: "." + prettyPrint: true + indent: 2 + defaultValue: '' + attributes: + - "client.id" + - "client.secret" + - "edc.apiKey" + - "edc.participantId" + + server: + error: + include-message: ALWAYS + include-binding-errors: ALWAYS + include-stacktrace: ON_PARAM + include-exception: false + port: 8888 + tomcat: + max-connections: 10000 \ No newline at end of file diff --git a/charts/digital-product-pass/values-int.yaml b/charts/digital-product-pass/values-int.yaml index f6be2d258..4a53a8098 100644 --- a/charts/digital-product-pass/values-int.yaml +++ b/charts/digital-product-pass/values-int.yaml @@ -79,57 +79,80 @@ backend: clientId: clientSecret: xApiKey: + participantId: application: yml: |- - spring: - application: - name: 'Catena-X Product Passport Consumer Backend' - main: - allow-bean-definition-overriding: true - devtools: - add-properties: false - jackson: - serialization: - indent_output: true - configuration: - maxRetries: 5 - - keycloak: - realm: CX-Central - resource: Cl13-CX-Battery - tokenUri: 'https://centralidp.int.demo.catena-x.net/auth/realms/CX-Central/protocol/openid-connect/token' - userInfoUri: 'https://centralidp.int.demo.catena-x.net/auth/realms/CX-Central/protocol/openid-connect/userinfo' - - endpoints: - providerUrl: 'https://materialpass.int.demo.catena-x.net/BPNL000000000000' - serverUrl: 'https://materialpass.int.demo.catena-x.net' - registryUrl: 'https://semantics.int.demo.catena-x.net' - - passport: - versions: - - 'v3.0.1' - - vault: - type: 'local' - file: 'vault.token.yml' - pathSep: "." - prettyPrint: true - indent: 2 - defaultValue: '' - attributes: - - "token" - - "client.id" - - "client.secret" - - "apiKey" - server: - error: - include-message: ALWAYS - include-binding-errors: ALWAYS - include-stacktrace: ON_PARAM - include-exception: false - port: 8888 - tomcat: - max-connections: 10000 + spring: + name: 'Catena-X Product Passport Consumer Backend' + main: + allow-bean-definition-overriding: true + devtools: + add-properties: false + jackson: + serialization: + indent_output: true + + logging: + level: + root: INFO + utils: INFO + + configuration: + maxRetries: 5 + + keycloak: + realm: CX-Central + resource: Cl13-CX-Battery + tokenUri: 'https://centralidp.int.demo.catena-x.net/auth/realms/CX-Central/protocol/openid-connect/token' + userInfoUri: 'https://centralidp.int.demo.catena-x.net/auth/realms/CX-Central/protocol/openid-connect/userinfo' + + edc: + endpoint: 'https://materialpass.int.demo.catena-x.net/consumer' + management: '/management/v2' + catalog: '/catalog/request' + negotiation: '/contractnegotiations' + transfer: '/transferprocesses' + receiverEndpoint: 'https://materialpass.int.demo.catena-x.net/endpoint' + + process: + store: true + dir: 'process' + indent: true + signKey: '' + + endpoints: + registryUrl: 'https://semantics.int.demo.catena-x.net' + + passport: + dataTransfer: + encrypt: true + indent: true + dir: "data/transfer" + versions: + - 'v3.0.1' + + vault: + type: 'local' + file: 'vault.token.yml' + pathSep: "." + prettyPrint: true + indent: 2 + defaultValue: '' + attributes: + - "client.id" + - "client.secret" + - "edc.apiKey" + - "edc.participantId" + + server: + error: + include-message: ALWAYS + include-binding-errors: ALWAYS + include-stacktrace: ON_PARAM + include-exception: false + port: 8888 + tomcat: + max-connections: 10000 diff --git a/charts/digital-product-pass/values.yaml b/charts/digital-product-pass/values.yaml index 4bda0722b..bdd251cf0 100644 --- a/charts/digital-product-pass/values.yaml +++ b/charts/digital-product-pass/values.yaml @@ -43,7 +43,7 @@ frontend: ingress: enabled: false hosts: - - host: # Default URL + - host: materialpass.dev.demo.catena-x.net # Default URL paths: - path: /passport(/|$)(.*) pathType: Prefix @@ -89,58 +89,82 @@ backend: clientId: "Add your secret here" clientSecret: "Add your secret here" xApiKey: "Add your secret here" + participantId: "Add your secret here" application: yml: |- - spring: - application: - name: 'Catena-X Product Passport Consumer Backend' - main: - allow-bean-definition-overriding: true - devtools: - add-properties: false - jackson: - serialization: - indent_output: true - configuration: - maxRetries: 5 - - keycloak: - realm: CX-Central - resource: Cl13-CX-Battery - tokenUri: 'https://centralidp.dev.demo.catena-x.net/auth/realms/CX-Central/protocol/openid-connect/token' - userInfoUri: 'https://centralidp.dev.demo.catena-x.net/auth/realms/CX-Central/protocol/openid-connect/userinfo' - - endpoints: - providerUrl: 'https://materialpass.dev.demo.catena-x.net/BPNL000000000000' - serverUrl: 'https://materialpass.dev.demo.catena-x.net' - registryUrl: 'https://semantics.dev.demo.catena-x.net' - - passport: - versions: - - 'v3.0.1' - - vault: - type: 'local' - file: 'vault.token.yml' - pathSep: "." - prettyPrint: true - indent: 2 - defaultValue: '' - attributes: - - "token" - - "client.id" - - "client.secret" - - "apiKey" - server: - error: - include-message: ALWAYS - include-binding-errors: ALWAYS - include-stacktrace: ON_PARAM - include-exception: false - port: 8888 - tomcat: - max-connections: 10000 + spring: + name: 'Catena-X Product Passport Consumer Backend' + main: + allow-bean-definition-overriding: true + devtools: + add-properties: false + jackson: + serialization: + indent_output: true + + logging: + level: + root: INFO + utils: INFO + + configuration: + maxRetries: 5 + + keycloak: + realm: CX-Central + resource: Cl13-CX-Battery + tokenUri: 'https://centralidp.dev.demo.catena-x.net/auth/realms/CX-Central/protocol/openid-connect/token' + userInfoUri: 'https://centralidp.dev.demo.catena-x.net/auth/realms/CX-Central/protocol/openid-connect/userinfo' + + edc: + endpoint: 'https://materialpass.dev.demo.catena-x.net/consumer' + management: '/management/v2' + catalog: '/catalog/request' + negotiation: '/contractnegotiations' + transfer: '/transferprocesses' + receiverEndpoint: 'https://materialpass.dev.demo.catena-x.net/endpoint' + + process: + store: true + dir: 'process' + indent: true + signKey: '' + + endpoints: + registryUrl: 'https://semantics.dev.demo.catena-x.net' + + passport: + dataTransfer: + encrypt: true + indent: true + dir: "data/transfer" + versions: + - 'v3.0.1' + + vault: + type: 'local' + file: 'vault.token.yml' + pathSep: "." + prettyPrint: true + indent: 2 + defaultValue: '' + attributes: + - "client.id" + - "client.secret" + - "edc.apiKey" + - "edc.participantId" + + server: + error: + include-message: ALWAYS + include-binding-errors: ALWAYS + include-stacktrace: ON_PARAM + include-exception: false + port: 8888 + tomcat: + max-connections: 10000 + resources: {} diff --git a/deployment/helm/edc-consumer/Chart.yaml b/deployment/helm/edc-consumer/Chart.yaml index 6dfa9e967..5290350fd 100644 --- a/deployment/helm/edc-consumer/Chart.yaml +++ b/deployment/helm/edc-consumer/Chart.yaml @@ -1,50 +1,63 @@ -################################################################################# -# Catena-X - Product Passport Consumer Frontend # -# Copyright (c) 2022, 2023 BASF SE, BMW AG, Henkel AG & Co. KGaA +# Copyright (c) 2023 ZF Friedrichshafen AG +# Copyright (c) 2023 Mercedes-Benz Tech Innovation GmbH +# Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +# Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation # -# See the NOTICE file(s) distributed with this work for additional -# information regarding copyright ownership. +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. # -# This program and the accompanying materials are made available under the -# terms of the Apache License, Version 2.0 which is available at -# https://www.apache.org/licenses/LICENSE-2.0. +# This program and the accompanying materials are made available under the +# terms of the Apache License, Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 # -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -# either express or implied. See the -# License for the specific language govern in permissions and limitations -# under the License. +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +# SPDX-License-Identifier: Apache-2.0 # -# SPDX-License-Identifier: Apache-2.0 -################################################################################## --- apiVersion: v2 -name: edc -description: A Helm chart for Kubernetes +name: tractusx-connector +description: | + A Helm chart for Tractus-X Eclipse Data Space Connector. The connector deployment consists of two runtime consists of a + Control Plane and a Data Plane. Note that _no_ external dependencies such as a PostgreSQL database and HashiCorp Vault are included. + + This chart is intended for use with an _existing_ PostgreSQL database and an _existing_ HashiCorp Vault. +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. type: application -version: 0.0.3 -appVersion: "0.4.3" +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.3.3 +# 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: "0.4.1" +home: https://github.com/eclipse-tractusx/tractusx-edc/tree/main/charts/tractusx-connector +sources: + - https://github.com/eclipse-tractusx/tractusx-edc/tree/main/charts/tractusx-connector +urls: + - https://github.com/eclipse-tractusx/tractusx-edc/releases/download/tractusx-connector-0.4.1/tractusx-connector-0.4.1.tgz dependencies: - - name: edc-controlplane - alias: controlplane - version: "0.1.6" - repository: https://catenax-ng.github.io/product-edc - condition: controlplane.enabled - - name: edc-dataplane - alias: dataplane - version: "0.1.6" - repository: https://catenax-ng.github.io/product-edc - condition: dataplane.enabled - - name: backend-service - version: "0.0.6" - repository: file://backend-service - alias: consumerbackendapplication - condition: consumerbackendapplication.enabled + - name: tractusx-connector + version: 0.4.1 + repository: https://eclipse-tractusx.github.io/charts/dev + condition: enabled - name: postgresql - alias: postgres - version: 12.1.5 + alias: postgresql + version: 12.1.6 repository: https://charts.bitnami.com/bitnami - condition: postgres.enabled + condition: postgresql.enabled diff --git a/deployment/helm/edc-consumer/README.md.gotmpl b/deployment/helm/edc-consumer/README.md.gotmpl new file mode 100644 index 000000000..b1671f5a2 --- /dev/null +++ b/deployment/helm/edc-consumer/README.md.gotmpl @@ -0,0 +1,26 @@ +{{ template "chart.header" . }} + +{{ template "chart.deprecationWarning" . }} + +{{ template "chart.badgesSection" . }} + +{{ template "chart.description" . }} + +{{ template "chart.homepageLine" . }} + +## TL;DR + +```shell +helm repo add tractusx-edc https://eclipse-tractusx.github.io/charts/dev +helm install my-release tractusx-edc/tractusx-connector --version {{ .Version }} +``` + +{{ template "chart.maintainersSection" . }} + +{{ template "chart.sourcesSection" . }} + +{{ template "chart.requirementsSection" . }} + +{{ template "chart.valuesSection" . }} + +{{ template "helm-docs.versionFooter" . }} diff --git a/deployment/helm/edc-consumer/values-beta.yaml b/deployment/helm/edc-consumer/values-beta.yaml index 01ea5aa9b..11db200e0 100644 --- a/deployment/helm/edc-consumer/values-beta.yaml +++ b/deployment/helm/edc-consumer/values-beta.yaml @@ -1,29 +1,33 @@ -################################################################################# -# Catena-X - Product Passport Consumer Frontend # -# Copyright (c) 2022, 2023 BASF SE, BMW AG, Henkel AG & Co. KGaA +# Copyright (c) 2023 ZF Friedrichshafen AG +# Copyright (c) 2023 Mercedes-Benz Tech Innovation GmbH +# Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +# Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation # -# See the NOTICE file(s) distributed with this work for additional -# information regarding copyright ownership. +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. # -# This program and the accompanying materials are made available under the -# terms of the Apache License, Version 2.0 which is available at -# https://www.apache.org/licenses/LICENSE-2.0. +# This program and the accompanying materials are made available under the +# terms of the Apache License, Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 # -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -# either express or implied. See the -# License for the specific language govern in permissions and limitations -# under the License. +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. # -# SPDX-License-Identifier: Apache-2.0 -################################################################################## +# SPDX-License-Identifier: Apache-2.0 +# + --- -consumerbackendapplication: +# Default values for eclipse-dataspace-connector. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. +mockbackend: enabled: true - fullnameOverride: "materialpass-edc-backend" + fullnameOverride: "dpp-edc-consumer-backend" service: type: NodePort frontend: @@ -31,310 +35,559 @@ consumerbackendapplication: backend: port: 8081 -postgres: - enabled: true - fullnameOverride: "consumer-postgresql" - auth: - password: - username: &psqlUsername - database: "edc" - persistence: - enabled: true -dataplane: - image: - repository: ghcr.io/catenax-ng/product-edc/edc-dataplane-hashicorp-vault - tag: 0.1.6 - pullPolicy: IfNotPresent - envSecretName: "consumer-dataplane-secret" - fullnameOverride: "materialpass-edc-dataplane" - edc: +tractusx-connector: + install: + daps: false + postgresql: false + vault: false + fullnameOverride: "dpp-edc-consumer" + nameOverride: "" + # -- Existing image pull secret to use to [obtain the container image from private registries](https://kubernetes.io/docs/concepts/containers/images/#using-a-private-registry) + imagePullSecrets: [] + customLabels: {} + + + participant: + id: &bpnNumber "" + + controlplane: + enabled: true + image: + # -- Which derivate of the control plane to use. when left empty the deployment will select the correct image automatically + repository: "tractusx/edc-controlplane-postgresql-hashicorp-vault" + # -- [Kubernetes image pull policy](https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy) to use + pullPolicy: IfNotPresent + # -- Overrides the image tag whose default is the chart appVersion + tag: "0.4.1" + initContainers: [] + debug: + enabled: false + port: 1044 + suspendOnStart: false + internationalDataSpaces: + id: TXDC + description: Tractus-X Eclipse IDS Data Space Connector + title: "" + maintainer: "" + curator: "" + catalogId: TXDC-Catalog + livenessProbe: + # -- Whether to enable kubernetes [liveness-probe](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) + enabled: true + # -- seconds to wait before performing the first liveness check + initialDelaySeconds: 30 + # -- this fields specifies that kubernetes should perform a liveness check every 10 seconds + periodSeconds: 10 + # -- number of seconds after which the probe times out + timeoutSeconds: 5 + # -- when a probe fails kubernetes will try 6 times before giving up + failureThreshold: 6 + # -- number of consecutive successes for the probe to be considered successful after having failed + successThreshold: 1 + readinessProbe: + # -- Whether to enable kubernetes [readiness-probes](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) + enabled: true + # -- seconds to wait before performing the first readiness check + initialDelaySeconds: 30 + # -- this fields specifies that kubernetes should perform a readiness check every 10 seconds + periodSeconds: 10 + # -- number of seconds after which the probe times out + timeoutSeconds: 5 + # -- when a probe fails kubernetes will try 6 times before giving up + failureThreshold: 6 + # -- number of consecutive successes for the probe to be considered successful after having failed + successThreshold: 1 + # -- endpoints of the control plane endpoints: + # -- default api for health checks, should not be added to any ingress default: + # -- port for incoming api calls port: 8080 + # -- path for incoming api calls path: /consumer/api - public: - port: 8185 - path: /consumer/api/public + # -- data management api, used by internal users, can be added to an ingress and must not be internet facing + management: + # -- port for incoming api calls + port: 8081 + # -- path for incoming api calls + path: /consumer/management + # -- authentication key, must be attached to each 'X-Api-Key' request header + authKey: + # -- control api, used for internal control calls. can be added to the internal ingress, but should probably not control: - port: 9999 - path: /consumer/api/dataplane/control + # -- port for incoming api calls + port: 8083 + # -- path for incoming api calls + path: /consumer/control + # -- ids api, used for inter connector communication and must be internet facing + protocol: + # -- port for incoming api calls + port: 8084 + # -- path for incoming api calls + path: /consumer/api/v1/dsp + # -- metrics api, used for application metrics, must not be internet facing metrics: + # -- port for incoming api calls port: 9090 + # -- path for incoming api calls path: /consumer/metrics - ingresses: - - enabled: true - hostname: "materialpass.beta.demo.catena-x.net" - endpoints: - - default - - public - - control - - metrics - className: "nginx" - # # -- Enables TLS on the ingress resource - # tls: true - # secretName: tls-secret - tls: - # -- Enables TLS on the ingress resource - enabled: true - # -- If present overwrites the default secret name - secretName: "tls-secret" - - opentelemetry: - properties: |- - otel.javaagent.enabled=false - otel.javaagent.debug=false - env: + # -- observability api with unsecured access, must not be internet facing + observability: + # -- port for incoming API calls + port: 8085 + # -- observability api, provides /health /readiness and /liveness endpoints + path: /consumer/observability + # -- allow or disallow insecure access, i.e. access without authentication + insecure: true + businessPartnerValidation: + log: + agreementValidation: true + service: + # -- [Service type](https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types) to expose the running application on a set of Pods as a network service. + type: ClusterIP + annotations: {} + # -- additional labels for the pod + podLabels: {} + # -- additional annotations for the pod + podAnnotations: {} + # -- The [pod security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod) defines privilege and access control settings for a Pod within the deployment + podSecurityContext: + seccompProfile: + # -- Restrict a Container's Syscalls with seccomp + type: RuntimeDefault + # -- Runs all processes within a pod with a special uid + runAsUser: 10001 + # -- Processes within a pod will belong to this guid + runAsGroup: 10001 + # -- The owner for volumes and any files created within volumes will belong to this guid + fsGroup: 10001 + # The [container security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container) defines privilege and access control settings for a Container within a pod + securityContext: + capabilities: + # -- Specifies which capabilities to drop to reduce syscall attack surface + drop: + - ALL + # -- Specifies which capabilities to add to issue specialized syscalls + add: [] + # -- Whether the root filesystem is mounted in read-only mode + readOnlyRootFilesystem: true + # -- Controls [Privilege Escalation](https://kubernetes.io/docs/concepts/security/pod-security-policy/#privilege-escalation) enabling setuid binaries changing the effective user ID + allowPrivilegeEscalation: false + # -- Requires the container to run without root privileges + runAsNonRoot: true + # -- The container's process will run with the specified uid + runAsUser: 10001 + # Extra environment variables that will be pass onto deployment pods + env: {} + # ENV_NAME: value - ############# - ## GENERAL ## - ############# + # "valueFrom" environment variable references that will be added to deployment pods. Name is templated. + # ref: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.19/#envvarsource-v1-core + envValueFrom: {} + # ENV_NAME: + # configMapKeyRef: + # name: configmap-name + # key: value_key + # secretKeyRef: + # name: secret-name + # key: value_key - JAVA_TOOL_OPTIONS: "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=1044" - EDC_DATAPLANE_TOKEN_VALIDATION_ENDPOINT: http://materialpass-edc-controlplane:8182/consumer/validation/token + # [Kubernetes Secret Resource](https://kubernetes.io/docs/concepts/configuration/secret/) names to load environment variables from + envSecretNames: [] + # - first-secret + # - second-secret - ############### - ## KEY VAULT ## - ############### + # [Kubernetes ConfigMap Resource](https://kubernetes.io/docs/concepts/configuration/configmap/) names to load environment variables from + envConfigMapNames: [] + # - first-config-map + # - second-config-map - EDC_VAULT_HASHICORP_URL: - EDC_VAULT_HASHICORP_API_SECRET_PATH: - EDC_VAULT_HASHICORP_TOKEN: - EDC_OAUTH_TOKEN_URL: https://daps.beta.demo.catena-x.net/token - EDC_OAUTH_PROVIDER_JWKS_URL: https://daps.beta.demo.catena-x.net/.well-known/jwks.json - EDC_OAUTH_PROVIDER_AUDIENCE: idsc:IDS_CONNECTORS_ALL - EDC_VAULT_HASHICORP_HEALTH_CHECK_STANDBY_OK: "true" - -controlplane: - enabled: true - fullnameOverride: "materialpass-edc-controlplane" - image: - repository: ghcr.io/catenax-ng/product-edc/edc-controlplane-postgresql-hashicorp-vault - tag: 0.1.6 - pullPolicy: IfNotPresent - envSecretName: "consumer-controlplane-secret" - edc: + ## Ingress declaration to expose the network service. + ingresses: + ## Public / Internet facing Ingress + - enabled: true + # -- The hostname to be used to precisely map incoming traffic onto the underlying network service + hostname: "materialpass.beta.demo.catena-x.net" + # -- Additional ingress annotations to add + annotations: {} + # -- EDC endpoints exposed by this ingress resource + endpoints: + - default + - management + - control + - protocol + - metrics + - observability + # -- Defines the [ingress class](https://kubernetes.io/docs/concepts/services-networking/ingress/#ingress-class) to use + className: "nginx" + # -- TLS [tls class](https://kubernetes.io/docs/concepts/services-networking/ingress/#tls) applied to the ingress resource + tls: + # -- Enables TLS on the ingress resource + enabled: true + # -- If present overwrites the default secret name + secretName: "tls-secret" + ## Adds [cert-manager](https://cert-manager.io/docs/) annotations to the ingress resource + certManager: + # -- If preset enables certificate generation via cert-manager namespace scoped issuer + issuer: "" + # -- If preset enables certificate generation via cert-manager cluster-wide issuer + clusterIssuer: "" + ## Private / Intranet facing Ingress + - enabled: false + # -- The hostname to be used to precisely map incoming traffic onto the underlying network service + hostname: "edc-control.intranet" + # -- Additional ingress annotations to add + annotations: {} + # -- EDC endpoints exposed by this ingress resource + endpoints: + - management + - control + # -- Defines the [ingress class](https://kubernetes.io/docs/concepts/services-networking/ingress/#ingress-class) to use + className: "nginx" + # -- TLS [tls class](https://kubernetes.io/docs/concepts/services-networking/ingress/#tls) applied to the ingress resource + tls: + # -- Enables TLS on the ingress resource + enabled: true + # -- If present overwrites the default secret name + secretName: "tls-secret" + ## Adds [cert-manager](https://cert-manager.io/docs/) annotations to the ingress resource + certManager: + # -- If preset enables certificate generation via cert-manager namespace scoped issuer + issuer: "" + # -- If preset enables certificate generation via cert-manager cluster-wide issuer + clusterIssuer: "" + # -- declare where to mount [volumes](https://kubernetes.io/docs/concepts/storage/volumes/) into the container + volumeMounts: [] + # -- [volume](https://kubernetes.io/docs/concepts/storage/volumes/) directories + volumes: [] + # -- [resource management](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) for the container + resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + replicaCount: 1 + autoscaling: + # -- Enables [horizontal pod autoscaling](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/) + enabled: false + # -- Minimal replicas if resource consumption falls below resource threshholds + minReplicas: 1 + # -- Maximum replicas if resource consumption exceeds resource threshholds + maxReplicas: 100 + # -- targetAverageUtilization of cpu provided to a pod + targetCPUUtilizationPercentage: 80 + # -- targetAverageUtilization of memory provided to a pod + targetMemoryUtilizationPercentage: 80 + # -- configuration of the [Open Telemetry Agent](https://opentelemetry.io/docs/instrumentation/java/automatic/agent-config/) to collect and expose metrics + opentelemetry: |- + otel.javaagent.enabled=false + otel.javaagent.debug=false + # -- configuration of the [Java Util Logging Facade](https://docs.oracle.com/javase/7/docs/technotes/guides/logging/overview.html) + logging: |- + .level=INFO + org.eclipse.edc.level=ALL + handlers=java.util.logging.ConsoleHandler + java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter + java.util.logging.ConsoleHandler.level=ALL + java.util.logging.SimpleFormatter.format=[%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS] [%4$-7s] %5$s%6$s%n + # [node selector](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector) to constrain pods to nodes + nodeSelector: {} + # [tolerations](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) to configure preferred nodes + tolerations: [] + # [affinity](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity) to configure which nodes the pods can be scheduled on + affinity: {} + url: + # -- Explicitly declared url for reaching the ids api (e.g. if ingresses not used) + ids: "" + dataplane: + enabled: true + image: + # -- Which derivate of the data plane to use. when left empty the deployment will select the correct image automatically + repository: "tractusx/edc-dataplane-hashicorp-vault" + # -- [Kubernetes image pull policy](https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy) to use + pullPolicy: IfNotPresent + # -- Overrides the image tag whose default is the chart appVersion + tag: "0.4.1" + initContainers: [] + debug: + enabled: false + port: 1044 + suspendOnStart: false + livenessProbe: + # -- Whether to enable kubernetes [liveness-probe](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) + enabled: true + # -- seconds to wait before performing the first liveness check + initialDelaySeconds: 30 + # -- this fields specifies that kubernetes should perform a liveness check every 10 seconds + periodSeconds: 10 + # -- number of seconds after which the probe times out + timeoutSeconds: 5 + # -- when a probe fails kubernetes will try 6 times before giving up + failureThreshold: 6 + # -- number of consecutive successes for the probe to be considered successful after having failed + successThreshold: 1 + readinessProbe: + # -- Whether to enable kubernetes [readiness-probes](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) + enabled: true + # -- seconds to wait before performing the first readiness check + initialDelaySeconds: 30 + # -- this fields specifies that kubernetes should perform a liveness check every 10 seconds + periodSeconds: 10 + # -- number of seconds after which the probe times out + timeoutSeconds: 5 + # -- when a probe fails kubernetes will try 6 times before giving up + failureThreshold: 6 + # -- number of consecutive successes for the probe to be considered successful after having failed + successThreshold: 1 + service: + # -- [Service type](https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types) to expose the running application on a set of Pods as a network service. + type: ClusterIP + port: 80 endpoints: default: port: 8080 - path: /consumer/controlplane/api - data: - port: 8181 - path: /consumer/data - validation: - port: 8182 - path: /consumer/validation + path: /consumer/api + public: + port: 8081 + path: /consumer/api/public control: - port: 9999 - path: /consumer/api/controlplane/control - ids: - port: 8282 - path: /consumer/api/v1/ids + port: 8083 + path: /consumer/api/dataplane/control + proxy: + port: 8186 + path: /consumer/proxy + observability: + # -- port for incoming API calls + port: 8085 + # -- observability api, provides /health /readiness and /liveness endpoints + path: /consumer/observability + # -- allow or disallow insecure access, i.e. access without authentication + insecure: true metrics: port: 9090 - path: /consumer/controlplane/metrics - ingresses: - - enabled: true - hostname: "materialpass.beta.demo.catena-x.net" - endpoints: - - default - - data - - validation - - control - - ids - - metrics - className: "nginx" - tls: - # -- Enables TLS on the ingress resource - enabled: true - # -- If present overwrites the default secret name - secretName: "tls-secret" - - ## Private / Intranet facing Ingress - - enabled: false - # -- The hostname to be used to precisely map incoming traffic onto the underlying network service - hostname: "edc-controlplane.intranet" - # -- EDC endpoints exposed by this ingress resource - endpoints: - - data - - control - # -- Defines the [ingress class](https://kubernetes.io/docs/concepts/services-networking/ingress/#ingress-class) to use - className: "nginx" - tls: - # -- Enables TLS on the ingress resource - enabled: true - # -- If present overwrites the default secret name - secretName: "tls-secret" - - opentelemetry: - properties: |- - otel.javaagent.enabled=false - otel.javaagent.debug=false - env: - JAVA_TOOL_OPTIONS: "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=1044" - EDC_DATASOURCE_ASSET_NAME: asset - EDC_DATASOURCE_ASSET_USER: *psqlUsername - EDC_DATASOURCE_ASSET_URL: &psqlJdbcUrl "jdbc:postgresql://consumer-postgresql:5432/edc" - EDC_DATASOURCE_CONTRACTDEFINITION_NAME: contractdefinition - EDC_DATASOURCE_CONTRACTDEFINITION_USER: *psqlUsername - EDC_DATASOURCE_CONTRACTDEFINITION_URL: *psqlJdbcUrl - EDC_DATASOURCE_CONTRACTNEGOTIATION_NAME: contractnegotiation - EDC_DATASOURCE_CONTRACTNEGOTIATION_USER: *psqlUsername - EDC_DATASOURCE_CONTRACTNEGOTIATION_URL: *psqlJdbcUrl - EDC_DATASOURCE_POLICY_NAME: policy - EDC_DATASOURCE_POLICY_USER: *psqlUsername - EDC_DATASOURCE_POLICY_URL: *psqlJdbcUrl - EDC_DATASOURCE_TRANSFERPROCESS_NAME: transferprocess - EDC_DATASOURCE_TRANSFERPROCESS_USER: *psqlUsername - EDC_DATASOURCE_TRANSFERPROCESS_URL: *psqlJdbcUrl - EDC_VAULT_HASHICORP_URL: - EDC_VAULT_HASHICORP_API_SECRET_PATH: - EDC_VAULT_HASHICORP_TOKEN: - EDC_API_AUTH_KEY: - - # see extension https://github.com/catenax-ng/product-edc/tree/develop/edc-extensions/dataplane-selector-configuration - EDC_DATAPLANE_SELECTOR_CONSUMERPLANE_URL: http://materialpass-edc-dataplane:9999/consumer/api/dataplane/control - EDC_DATAPLANE_SELECTOR_CONSUMERPLANE_SOURCETYPES : HttpData - EDC_DATAPLANE_SELECTOR_CONSUMERPLANE_DESTINATIONTYPES: HttpProxy - EDC_DATAPLANE_SELECTOR_CONSUMERPLANE_PROPERTIES: >- - { - "publicApiUrl": "http://materialpass-edc-dataplane:8185/consumer/api/public/" - } - - # EDC_DATAPLANE_SELECTOR_HTTPPROXY_PROPERTIES: >- - # { - # "publicApiUrl": "https://materialpass.beta.demo.catena-x.net/consumer/dataplane/api/public" - # } + path: /consumer/metrics + aws: + endpointOverride: "" + accessKeyId: "" + secretAccessKey: "" + # -- additional labels for the pod + podLabels: {} + # -- additional annotations for the pod + podAnnotations: {} + # -- The [pod security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod) defines privilege and access control settings for a Pod within the deployment + podSecurityContext: + seccompProfile: + # -- Restrict a Container's Syscalls with seccomp + type: RuntimeDefault + # -- Runs all processes within a pod with a special uid + runAsUser: 10001 + # -- Processes within a pod will belong to this guid + runAsGroup: 10001 + # -- The owner for volumes and any files created within volumes will belong to this guid + fsGroup: 10001 + # The [container security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container) defines privilege and access control settings for a Container within a pod + securityContext: + capabilities: + # -- Specifies which capabilities to drop to reduce syscall attack surface + drop: + - ALL + # -- Specifies which capabilities to add to issue specialized syscalls + add: [] + # -- Whether the root filesystem is mounted in read-only mode + readOnlyRootFilesystem: true + # -- Controls [Privilege Escalation](https://kubernetes.io/docs/concepts/security/pod-security-policy/#privilege-escalation) enabling setuid binaries changing the effective user ID + allowPrivilegeEscalation: false + # -- Requires the container to run without root privileges + runAsNonRoot: true + # -- The container's process will run with the specified uid + runAsUser: 10001 + # Extra environment variables that will be pass onto deployment pods + env: {} + # ENV_NAME: value - configuration: - properties: |- - #edc.api.auth.key= - # edc.atomikos.checkpoint.interval= - # edc.atomikos.directory= - # edc.atomikos.logging= - # edc.atomikos.threaded2pc= - # edc.atomikos.timeout= - # edc.aws.access.key= - # edc.aws.provision.retry.retries.max= - # edc.aws.provision.role.duration.session.max= - # edc.aws.secret.access.key= - # edc.blobstore.endpoint= - # edc.controlplane.validation-endpoint= - # edc.core.retry.backoff.max= - # edc.core.retry.backoff.min= - # edc.core.retry.retries.max= - # edc.core.system.health.check.liveness-period= - # edc.core.system.health.check.readiness-period= - # edc.core.system.health.check.startup-period= - # edc.core.system.health.check.threadpool-size= - # edc.dataplane.queue.capacity= - # edc.dataplane.wait= - # edc.dataplane.workers= - edc.datasource.asset.name=asset - edc.datasource.asset.user= - edc.datasource.asset.url=jdbc:postgresql://consumer-postgresql:5432/edc - - edc.datasource.contractdefinition.name=contractdefinition - edc.datasource.contractdefinition.user= - edc.datasource.contractdefinition.url=jdbc:postgresql://consumer-postgresql:5432/edc + # "valueFrom" environment variable references that will be added to deployment pods. Name is templated. + # ref: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.19/#envvarsource-v1-core + envValueFrom: {} + # ENV_NAME: + # configMapKeyRef: + # name: configmap-name + # key: value_key + # secretKeyRef: + # name: secret-name + # key: value_key - edc.datasource.contractnegotiation.name=contractnegotiation - edc.datasource.contractnegotiation.user= - edc.datasource.contractnegotiation.url=jdbc:postgresql://consumer-postgresql:5432/edc + # [Kubernetes Secret Resource](https://kubernetes.io/docs/concepts/configuration/secret/) names to load environment variables from + envSecretNames: [] + # - first-secret + # - second-secret - edc.datasource.policy.name=policy - edc.datasource.policy.user= - edc.datasource.policy.url=jdbc:postgresql://consumer-postgresql:5432/edc + # [Kubernetes ConfigMap Resource](https://kubernetes.io/docs/concepts/configuration/configmap/) names to load environment variables from + envConfigMapNames: [] + # - first-config-map + # - second-config-map - edc.datasource.transferprocess.name=transferprocess - edc.datasource.transferprocess.user= - edc.datasource.transferprocess.url=jdbc:postgresql://consumer-postgresql:5432/edc + ## Ingress declaration to expose the network service. + ingresses: + ## Public / Internet facing Ingress + - enabled: true + # -- The hostname to be used to precisely map incoming traffic onto the underlying network service + hostname: "materialpass.beta.demo.catena-x.net" + # -- Additional ingress annotations to add + annotations: {} + # -- EDC endpoints exposed by this ingress resource + endpoints: + - public + # -- Defines the [ingress class](https://kubernetes.io/docs/concepts/services-networking/ingress/#ingress-class) to use + className: "nginx" + # -- TLS [tls class](https://kubernetes.io/docs/concepts/services-networking/ingress/#tls) applied to the ingress resource + tls: + # -- Enables TLS on the ingress resource + enabled: true + # -- If present overwrites the default secret name + secretName: "tls-secret" + ## Adds [cert-manager](https://cert-manager.io/docs/) annotations to the ingress resource + certManager: + # -- If preset enables certificate generation via cert-manager namespace scoped issuer + issuer: "" + # -- If preset enables certificate generation via cert-manager cluster-wide issuer + clusterIssuer: "" + # -- declare where to mount [volumes](https://kubernetes.io/docs/concepts/storage/volumes/) into the container + volumeMounts: [] + # -- [volume](https://kubernetes.io/docs/concepts/storage/volumes/) directories + volumes: [] + # -- [resource management](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) for the container + resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + replicaCount: 1 + autoscaling: + # -- Enables [horizontal pod autoscaling](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/) + enabled: false + # -- Minimal replicas if resource consumption falls below resource threshholds + minReplicas: 1 + # -- Maximum replicas if resource consumption exceeds resource threshholds + maxReplicas: 100 + # -- targetAverageUtilization of cpu provided to a pod + targetCPUUtilizationPercentage: 80 + # -- targetAverageUtilization of memory provided to a pod + targetMemoryUtilizationPercentage: 80 + # -- configuration of the [Open Telemetry Agent](https://opentelemetry.io/docs/instrumentation/java/automatic/agent-config/) to collect and expose metrics + opentelemetry: |- + otel.javaagent.enabled=false + otel.javaagent.debug=false + # -- configuration of the [Java Util Logging Facade](https://docs.oracle.com/javase/7/docs/technotes/guides/logging/overview.html) + logging: |- + .level=INFO + org.eclipse.edc.level=ALL + handlers=java.util.logging.ConsoleHandler + java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter + java.util.logging.ConsoleHandler.level=ALL + java.util.logging.SimpleFormatter.format=[%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS] [%4$-7s] %5$s%6$s%n + # [node selector](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector) to constrain pods to nodes + nodeSelector: {} + # [tolerations](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) to configure preferred nodes + tolerations: [] + # [affinity](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity) to configure which nodes the pods can be scheduled on + affinity: {} + url: + # -- Explicitly declared url for reaching the public api (e.g. if ingresses not used) + public: "" + postgresql: + jdbcUrl: "jdbc:postgresql://postgresql:5432/edc" + fullnameOverride: "postgresql" + username: + password: + auth: + database: "edc" + username: + password: - # edc.datasource.default.pool.maxIdleConnections= - # edc.datasource.default.pool.maxTotalConnections= - # edc.datasource.default.pool.minIdleConnections= - # edc.datasource.default.pool.testConnectionOnBorrow= - # edc.datasource.default.pool.testConnectionOnCreate= - # edc.datasource.default.pool.testConnectionOnReturn= - # edc.datasource.default.pool.testConnectionWhileIdle= - # edc.datasource.default.pool.testQuery= - edc.datasource.default.url= - edc.datasource.default.user= - edc.datasource.default.password= + vault: + fullnameOverride: "vault" + injector: + enabled: false + server: + dev: + enabled: true + devRootToken: "root" + # Must be the same certificate that is configured in section 'daps' + postStart: # must be set externally! + hashicorp: + url: + token: + timeout: 30 + healthCheck: + enabled: true + standbyOk: true + paths: + secret: + health: /v1/sys/health + secretNames: + transferProxyTokenSignerPrivateKey: ids-daps_key + transferProxyTokenSignerPublicKey: ids-daps_crt + transferProxyTokenEncryptionAesKey: edc-encryption-key + dapsPrivateKey: ids-daps_key + dapsPublicKey: ids-daps_crt - edc.data.encryption.algorithm=NONE - edc.data.encryption.keys.alias=edc-encryption-key - # edc.dataplane.selector.httpproxy.url=https://materialpass-edc-dataplane:9999/consumer/api/dataplane/control + daps: + fullnameOverride: "daps" + url: "https://daps.beta.demo.catena-x.net" + clientId: + paths: + jwks: /.well-known/jwks.json + token: /token + connectors: + - id: + name: edcconector + attributes: + referringConnector: "https://materialpass.beta.demo.catena-x.net/consumer/" + # Must be the same certificate that is stores in section 'sokrates-vault' + certificate: - # edc.dpf.selector.url= - # edc.events.topic.endpoint= - # edc.events.topic.name= - # edc.fs.config= - # edc.hostname= - # edc.identity.did.url= - # edc.ids.catalog.id= - # edc.ids.curator= - edc.ids.description="Consumer Control Plane" - edc.ids.endpoint=https://materialpass.beta.demo.catena-x.net/consumer/api/v1/ids - edc.ids.endpoint.audience=https://materialpass.beta.demo.catena-x.net/consumer/api/v1/ids/data + backendService: + httpProxyTokenReceiverUrl: "https://materialpass.beta.demo.catena-x.net/endpoint" - # localhost configuration - # edc.ids.endpoint=http://materialpass-edc-controlplane:8282/consumer/api/v1/ids - # edc.ids.endpoint.audience=http://materialpass-edc-controlplane:8282/consumer/api/v1/ids/data - # localhost configuration + serviceAccount: + # Specifies whether a service account should be created + create: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + # -- Existing image pull secret bound to the service account to use to [obtain the container image from private registries](https://kubernetes.io/docs/concepts/containers/images/#using-a-private-registry) + imagePullSecrets: [] + + idsdaps: + connectors: + - certificate: - # edc.ids.id= - # edc.ids.maintainer= - # edc.ids.security.profile= - # edc.ids.title= - # edc.ids.validation.referringconnector= - # edc.ion.crawler.did-type= - # edc.ion.crawler.interval-minutes= - # edc.ion.crawler.ion.url= - # edc.metrics.enabled= - # edc.metrics.executor.enabled= - # edc.metrics.jersey.enabled= - # edc.metrics.jetty.enabled= - # edc.metrics.okhttp.enabled= - # edc.metrics.system.enabled= - # edc.negotiation.consumer.state-machine.batch-size= - # edc.negotiation.provider.state-machine.batch-size= - edc.oauth.client.id= - edc.oauth.private.key.alias=ids-daps_key - edc.oauth.provider.audience=idsc:IDS_CONNECTORS_ALL - # edc.oauth.provider.jwks.refresh= - edc.oauth.provider.jwks.url=https://daps.beta.demo.catena-x.net/.well-known/jwks.json - edc.oauth.public.key.alias=ids-daps_crt - edc.oauth.token.url=https://daps.beta.demo.catena-x.net/token - # edc.oauth.validation.nbf.leeway= - # edc.receiver.http.auth-code= - # edc.receiver.http.auth-key= - edc.receiver.http.endpoint=http://materialpass-edc-backend - edc.transfer.proxy.endpoint=http://materialpass-edc-dataplane:8185/consumer/api/public - # edc.transfer.proxy.token.validity.seconds= - edc.transfer.proxy.token.signer.privatekey.alias=ids-daps_key - edc.transfer.proxy.token.verifier.publickey.alias=ids-daps_crt - # edc.transfer.functions.check.endpoint= - # edc.transfer.functions.enabled.protocols= - # edc.transfer.functions.transfer.endpoint= - # edc.transfer-process-store.database.name= - # edc.transfer.state-machine.batch-size= - # edc.vault= - # edc.vault.certificate= - # edc.vault.clientid= - # edc.vault.clientsecret= - # edc.vault.name= - # edc.vault.tenantid= - edc.vault.hashicorp.url= - edc.vault.hashicorp.token= - edc.vault.hashicorp.api.secret.path= - edc.vault.hashicorp.health.check.standby.ok=true - # edc.vault.hashicorp.timeout.seconds= - # edc.webdid.doh.url= - # edc.web.rest.cors.enabled= - # edc.web.rest.cors.headers= - # edc.web.rest.cors.methods= - # edc.web.rest.cors.origins= - ids.webhook.address=https://materialpass.beta.demo.catena-x.net - # ids.webhook.address=http://materialpass-edc-controlplane:8282 +postgresql: + jdbcUrl: "jdbc:postgresql://postgresql:5432/edc" + fullnameOverride: "postgresql" + primary: + persistence: + enabled: true + readReplicas: + persistence: + enabled: true + auth: + database: "edc" + username: + password: diff --git a/deployment/helm/edc-consumer/values-int.yaml b/deployment/helm/edc-consumer/values-int.yaml index 09c5e1db1..dd8c088cf 100644 --- a/deployment/helm/edc-consumer/values-int.yaml +++ b/deployment/helm/edc-consumer/values-int.yaml @@ -1,340 +1,583 @@ -################################################################################# -# Catena-X - Product Passport Consumer Frontend # -# Copyright (c) 2022, 2023 BASF SE, BMW AG, Henkel AG & Co. KGaA +# Copyright (c) 2023 ZF Friedrichshafen AG +# Copyright (c) 2023 Mercedes-Benz Tech Innovation GmbH +# Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +# Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation # -# See the NOTICE file(s) distributed with this work for additional -# information regarding copyright ownership. +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. # -# This program and the accompanying materials are made available under the -# terms of the Apache License, Version 2.0 which is available at -# https://www.apache.org/licenses/LICENSE-2.0. +# This program and the accompanying materials are made available under the +# terms of the Apache License, Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 # -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -# either express or implied. See the -# License for the specific language govern in permissions and limitations -# under the License. +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. # -# SPDX-License-Identifier: Apache-2.0 -################################################################################## +# SPDX-License-Identifier: Apache-2.0 +# + --- -consumerbackendapplication: - enabled: true - fullnameOverride: "materialpass-edc-backend" - service: - type: NodePort - frontend: - port: 80 - backend: - port: 8081 +# Default values for eclipse-dataspace-connector. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. -postgres: - enabled: true - fullnameOverride: "consumer-postgresql" - auth: - password: - username: &psqlUsername - database: "edc" - persistence: - enabled: true +tractusx-connector: + install: + daps: false + postgresql: false + vault: false + fullnameOverride: "dpp-edc-consumer" + nameOverride: "" + # -- Existing image pull secret to use to [obtain the container image from private registries](https://kubernetes.io/docs/concepts/containers/images/#using-a-private-registry) + imagePullSecrets: [] + customLabels: {} + + + participant: + id: &bpnNumber "" -dataplane: - image: - repository: ghcr.io/catenax-ng/product-edc/edc-dataplane-hashicorp-vault - tag: 0.1.6 - pullPolicy: IfNotPresent - envSecretName: "consumer-dataplane-secret" - fullnameOverride: "materialpass-edc-dataplane" - edc: + controlplane: + enabled: true + image: + # -- Which derivate of the control plane to use. when left empty the deployment will select the correct image automatically + repository: "tractusx/edc-controlplane-postgresql-hashicorp-vault" + # -- [Kubernetes image pull policy](https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy) to use + pullPolicy: IfNotPresent + # -- Overrides the image tag whose default is the chart appVersion + tag: "0.4.1" + initContainers: [] + debug: + enabled: false + port: 1044 + suspendOnStart: false + internationalDataSpaces: + id: TXDC + description: Tractus-X Eclipse IDS Data Space Connector + title: "" + maintainer: "" + curator: "" + catalogId: TXDC-Catalog + livenessProbe: + # -- Whether to enable kubernetes [liveness-probe](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) + enabled: true + # -- seconds to wait before performing the first liveness check + initialDelaySeconds: 30 + # -- this fields specifies that kubernetes should perform a liveness check every 10 seconds + periodSeconds: 10 + # -- number of seconds after which the probe times out + timeoutSeconds: 5 + # -- when a probe fails kubernetes will try 6 times before giving up + failureThreshold: 6 + # -- number of consecutive successes for the probe to be considered successful after having failed + successThreshold: 1 + readinessProbe: + # -- Whether to enable kubernetes [readiness-probes](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) + enabled: true + # -- seconds to wait before performing the first readiness check + initialDelaySeconds: 30 + # -- this fields specifies that kubernetes should perform a readiness check every 10 seconds + periodSeconds: 10 + # -- number of seconds after which the probe times out + timeoutSeconds: 5 + # -- when a probe fails kubernetes will try 6 times before giving up + failureThreshold: 6 + # -- number of consecutive successes for the probe to be considered successful after having failed + successThreshold: 1 + # -- endpoints of the control plane endpoints: + # -- default api for health checks, should not be added to any ingress default: + # -- port for incoming api calls port: 8080 + # -- path for incoming api calls path: /consumer/api - public: - port: 8185 - path: /consumer/api/public + # -- data management api, used by internal users, can be added to an ingress and must not be internet facing + management: + # -- port for incoming api calls + port: 8081 + # -- path for incoming api calls + path: /consumer/management + # -- authentication key, must be attached to each 'X-Api-Key' request header + authKey: + # -- control api, used for internal control calls. can be added to the internal ingress, but should probably not control: - port: 9999 - path: /consumer/api/dataplane/control + # -- port for incoming api calls + port: 8083 + # -- path for incoming api calls + path: /consumer/control + # -- ids api, used for inter connector communication and must be internet facing + protocol: + # -- port for incoming api calls + port: 8084 + # -- path for incoming api calls + path: /consumer/api/v1/dsp + # -- metrics api, used for application metrics, must not be internet facing metrics: + # -- port for incoming api calls port: 9090 + # -- path for incoming api calls path: /consumer/metrics - ingresses: - - enabled: true - hostname: "materialpass.int.demo.catena-x.net" - endpoints: - - default - - public - - control - - metrics - className: "nginx" - # # -- Enables TLS on the ingress resource - # tls: true - # secretName: tls-secret - tls: - # -- Enables TLS on the ingress resource - enabled: true - # -- If present overwrites the default secret name - secretName: "tls-secret" - - opentelemetry: - properties: |- - otel.javaagent.enabled=false - otel.javaagent.debug=false - env: + # -- observability api with unsecured access, must not be internet facing + observability: + # -- port for incoming API calls + port: 8085 + # -- observability api, provides /health /readiness and /liveness endpoints + path: /consumer/observability + # -- allow or disallow insecure access, i.e. access without authentication + insecure: true + businessPartnerValidation: + log: + agreementValidation: true + service: + # -- [Service type](https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types) to expose the running application on a set of Pods as a network service. + type: ClusterIP + annotations: {} + # -- additional labels for the pod + podLabels: {} + # -- additional annotations for the pod + podAnnotations: {} + # -- The [pod security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod) defines privilege and access control settings for a Pod within the deployment + podSecurityContext: + seccompProfile: + # -- Restrict a Container's Syscalls with seccomp + type: RuntimeDefault + # -- Runs all processes within a pod with a special uid + runAsUser: 10001 + # -- Processes within a pod will belong to this guid + runAsGroup: 10001 + # -- The owner for volumes and any files created within volumes will belong to this guid + fsGroup: 10001 + # The [container security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container) defines privilege and access control settings for a Container within a pod + securityContext: + capabilities: + # -- Specifies which capabilities to drop to reduce syscall attack surface + drop: + - ALL + # -- Specifies which capabilities to add to issue specialized syscalls + add: [] + # -- Whether the root filesystem is mounted in read-only mode + readOnlyRootFilesystem: true + # -- Controls [Privilege Escalation](https://kubernetes.io/docs/concepts/security/pod-security-policy/#privilege-escalation) enabling setuid binaries changing the effective user ID + allowPrivilegeEscalation: false + # -- Requires the container to run without root privileges + runAsNonRoot: true + # -- The container's process will run with the specified uid + runAsUser: 10001 + # Extra environment variables that will be pass onto deployment pods + env: {} + # ENV_NAME: value - ############# - ## GENERAL ## - ############# + # "valueFrom" environment variable references that will be added to deployment pods. Name is templated. + # ref: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.19/#envvarsource-v1-core + envValueFrom: {} + # ENV_NAME: + # configMapKeyRef: + # name: configmap-name + # key: value_key + # secretKeyRef: + # name: secret-name + # key: value_key - JAVA_TOOL_OPTIONS: "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=1044" - EDC_DATAPLANE_TOKEN_VALIDATION_ENDPOINT: http://materialpass-edc-controlplane:8182/consumer/validation/token + # [Kubernetes Secret Resource](https://kubernetes.io/docs/concepts/configuration/secret/) names to load environment variables from + envSecretNames: [] + # - first-secret + # - second-secret - ############### - ## KEY VAULT ## - ############### + # [Kubernetes ConfigMap Resource](https://kubernetes.io/docs/concepts/configuration/configmap/) names to load environment variables from + envConfigMapNames: [] + # - first-config-map + # - second-config-map - EDC_VAULT_HASHICORP_URL: - EDC_VAULT_HASHICORP_API_SECRET_PATH: - EDC_VAULT_HASHICORP_TOKEN: - EDC_OAUTH_TOKEN_URL: https://daps1.int.demo.catena-x.net/token - EDC_OAUTH_PROVIDER_JWKS_URL: https://daps1.int.demo.catena-x.net/.well-known/jwks.json - EDC_OAUTH_PROVIDER_AUDIENCE: idsc:IDS_CONNECTORS_ALL - EDC_VAULT_HASHICORP_HEALTH_CHECK_STANDBY_OK: "true" - -controlplane: - enabled: true - fullnameOverride: "materialpass-edc-controlplane" - image: - repository: ghcr.io/catenax-ng/product-edc/edc-controlplane-postgresql-hashicorp-vault - tag: 0.1.6 - pullPolicy: IfNotPresent - envSecretName: "consumer-controlplane-secret" - edc: + ## Ingress declaration to expose the network service. + ingresses: + ## Public / Internet facing Ingress + - enabled: true + # -- The hostname to be used to precisely map incoming traffic onto the underlying network service + hostname: "materialpass.int.demo.catena-x.net" + # -- Additional ingress annotations to add + annotations: {} + # -- EDC endpoints exposed by this ingress resource + endpoints: + - default + - management + - control + - protocol + - metrics + - observability + # -- Defines the [ingress class](https://kubernetes.io/docs/concepts/services-networking/ingress/#ingress-class) to use + className: "nginx" + # -- TLS [tls class](https://kubernetes.io/docs/concepts/services-networking/ingress/#tls) applied to the ingress resource + tls: + # -- Enables TLS on the ingress resource + enabled: true + # -- If present overwrites the default secret name + secretName: "tls-secret" + ## Adds [cert-manager](https://cert-manager.io/docs/) annotations to the ingress resource + certManager: + # -- If preset enables certificate generation via cert-manager namespace scoped issuer + issuer: "" + # -- If preset enables certificate generation via cert-manager cluster-wide issuer + clusterIssuer: "" + ## Private / Intranet facing Ingress + - enabled: false + # -- The hostname to be used to precisely map incoming traffic onto the underlying network service + hostname: "edc-control.intranet" + # -- Additional ingress annotations to add + annotations: {} + # -- EDC endpoints exposed by this ingress resource + endpoints: + - management + - control + # -- Defines the [ingress class](https://kubernetes.io/docs/concepts/services-networking/ingress/#ingress-class) to use + className: "nginx" + # -- TLS [tls class](https://kubernetes.io/docs/concepts/services-networking/ingress/#tls) applied to the ingress resource + tls: + # -- Enables TLS on the ingress resource + enabled: true + # -- If present overwrites the default secret name + secretName: "tls-secret" + ## Adds [cert-manager](https://cert-manager.io/docs/) annotations to the ingress resource + certManager: + # -- If preset enables certificate generation via cert-manager namespace scoped issuer + issuer: "" + # -- If preset enables certificate generation via cert-manager cluster-wide issuer + clusterIssuer: "" + # -- declare where to mount [volumes](https://kubernetes.io/docs/concepts/storage/volumes/) into the container + volumeMounts: [] + # -- [volume](https://kubernetes.io/docs/concepts/storage/volumes/) directories + volumes: [] + # -- [resource management](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) for the container + resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + replicaCount: 1 + autoscaling: + # -- Enables [horizontal pod autoscaling](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/) + enabled: false + # -- Minimal replicas if resource consumption falls below resource threshholds + minReplicas: 1 + # -- Maximum replicas if resource consumption exceeds resource threshholds + maxReplicas: 100 + # -- targetAverageUtilization of cpu provided to a pod + targetCPUUtilizationPercentage: 80 + # -- targetAverageUtilization of memory provided to a pod + targetMemoryUtilizationPercentage: 80 + # -- configuration of the [Open Telemetry Agent](https://opentelemetry.io/docs/instrumentation/java/automatic/agent-config/) to collect and expose metrics + opentelemetry: |- + otel.javaagent.enabled=false + otel.javaagent.debug=false + # -- configuration of the [Java Util Logging Facade](https://docs.oracle.com/javase/7/docs/technotes/guides/logging/overview.html) + logging: |- + .level=INFO + org.eclipse.edc.level=ALL + handlers=java.util.logging.ConsoleHandler + java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter + java.util.logging.ConsoleHandler.level=ALL + java.util.logging.SimpleFormatter.format=[%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS] [%4$-7s] %5$s%6$s%n + # [node selector](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector) to constrain pods to nodes + nodeSelector: {} + # [tolerations](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) to configure preferred nodes + tolerations: [] + # [affinity](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity) to configure which nodes the pods can be scheduled on + affinity: {} + url: + # -- Explicitly declared url for reaching the ids api (e.g. if ingresses not used) + ids: "" + dataplane: + enabled: true + image: + # -- Which derivate of the data plane to use. when left empty the deployment will select the correct image automatically + repository: "tractusx/edc-dataplane-hashicorp-vault" + # -- [Kubernetes image pull policy](https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy) to use + pullPolicy: IfNotPresent + # -- Overrides the image tag whose default is the chart appVersion + tag: "0.4.1" + initContainers: [] + debug: + enabled: false + port: 1044 + suspendOnStart: false + livenessProbe: + # -- Whether to enable kubernetes [liveness-probe](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) + enabled: true + # -- seconds to wait before performing the first liveness check + initialDelaySeconds: 30 + # -- this fields specifies that kubernetes should perform a liveness check every 10 seconds + periodSeconds: 10 + # -- number of seconds after which the probe times out + timeoutSeconds: 5 + # -- when a probe fails kubernetes will try 6 times before giving up + failureThreshold: 6 + # -- number of consecutive successes for the probe to be considered successful after having failed + successThreshold: 1 + readinessProbe: + # -- Whether to enable kubernetes [readiness-probes](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) + enabled: true + # -- seconds to wait before performing the first readiness check + initialDelaySeconds: 30 + # -- this fields specifies that kubernetes should perform a liveness check every 10 seconds + periodSeconds: 10 + # -- number of seconds after which the probe times out + timeoutSeconds: 5 + # -- when a probe fails kubernetes will try 6 times before giving up + failureThreshold: 6 + # -- number of consecutive successes for the probe to be considered successful after having failed + successThreshold: 1 + service: + # -- [Service type](https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types) to expose the running application on a set of Pods as a network service. + type: ClusterIP + port: 80 endpoints: default: port: 8080 - path: /consumer/controlplane/api - data: - port: 8181 - path: /consumer/data - validation: - port: 8182 - path: /consumer/validation + path: /consumer/api + public: + port: 8081 + path: /consumer/api/public control: - port: 9999 - path: /consumer/api/controlplane/control - ids: - port: 8282 - path: /consumer/api/v1/ids + port: 8083 + path: /consumer/api/dataplane/control + proxy: + port: 8186 + path: /consumer/proxy + observability: + # -- port for incoming API calls + port: 8085 + # -- observability api, provides /health /readiness and /liveness endpoints + path: /consumer/observability + # -- allow or disallow insecure access, i.e. access without authentication + insecure: true metrics: port: 9090 - path: /consumer/controlplane/metrics - ingresses: - - enabled: true - hostname: "materialpass.int.demo.catena-x.net" - endpoints: - - default - - data - - validation - - control - - ids - - metrics - className: "nginx" - tls: - # -- Enables TLS on the ingress resource - enabled: true - # -- If present overwrites the default secret name - secretName: "tls-secret" - - ## Private / Intranet facing Ingress - - enabled: false - # -- The hostname to be used to precisely map incoming traffic onto the underlying network service - hostname: "edc-controlplane.intranet" - # -- EDC endpoints exposed by this ingress resource - endpoints: - - data - - control - # -- Defines the [ingress class](https://kubernetes.io/docs/concepts/services-networking/ingress/#ingress-class) to use - className: "nginx" - tls: - # -- Enables TLS on the ingress resource - enabled: true - # -- If present overwrites the default secret name - secretName: "tls-secret" - - opentelemetry: - properties: |- - otel.javaagent.enabled=false - otel.javaagent.debug=false - env: - JAVA_TOOL_OPTIONS: "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=1044" - EDC_DATASOURCE_ASSET_NAME: asset - EDC_DATASOURCE_ASSET_USER: *psqlUsername - EDC_DATASOURCE_ASSET_URL: &psqlJdbcUrl "jdbc:postgresql://consumer-postgresql:5432/edc" - EDC_DATASOURCE_CONTRACTDEFINITION_NAME: contractdefinition - EDC_DATASOURCE_CONTRACTDEFINITION_USER: *psqlUsername - EDC_DATASOURCE_CONTRACTDEFINITION_URL: *psqlJdbcUrl - EDC_DATASOURCE_CONTRACTNEGOTIATION_NAME: contractnegotiation - EDC_DATASOURCE_CONTRACTNEGOTIATION_USER: *psqlUsername - EDC_DATASOURCE_CONTRACTNEGOTIATION_URL: *psqlJdbcUrl - EDC_DATASOURCE_POLICY_NAME: policy - EDC_DATASOURCE_POLICY_USER: *psqlUsername - EDC_DATASOURCE_POLICY_URL: *psqlJdbcUrl - EDC_DATASOURCE_TRANSFERPROCESS_NAME: transferprocess - EDC_DATASOURCE_TRANSFERPROCESS_USER: *psqlUsername - EDC_DATASOURCE_TRANSFERPROCESS_URL: *psqlJdbcUrl - EDC_VAULT_HASHICORP_URL: - EDC_VAULT_HASHICORP_API_SECRET_PATH: - EDC_VAULT_HASHICORP_TOKEN: - EDC_API_AUTH_KEY: - - # see extension https://github.com/catenax-ng/product-edc/tree/develop/edc-extensions/dataplane-selector-configuration - EDC_DATAPLANE_SELECTOR_CONSUMERPLANE_URL: http://materialpass-edc-dataplane:9999/consumer/api/dataplane/control - EDC_DATAPLANE_SELECTOR_CONSUMERPLANE_SOURCETYPES : HttpData - EDC_DATAPLANE_SELECTOR_CONSUMERPLANE_DESTINATIONTYPES: HttpProxy - EDC_DATAPLANE_SELECTOR_CONSUMERPLANE_PROPERTIES: >- - { - "publicApiUrl": "http://materialpass-edc-dataplane:8185/consumer/api/public/" - } - - # EDC_DATAPLANE_SELECTOR_HTTPPROXY_PROPERTIES: >- - # { - # "publicApiUrl": "https://materialpass.int.demo.catena-x.net/consumer/dataplane/api/public" - # } + path: /consumer/metrics + aws: + endpointOverride: "" + accessKeyId: "" + secretAccessKey: "" + # -- additional labels for the pod + podLabels: {} + # -- additional annotations for the pod + podAnnotations: {} + # -- The [pod security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod) defines privilege and access control settings for a Pod within the deployment + podSecurityContext: + seccompProfile: + # -- Restrict a Container's Syscalls with seccomp + type: RuntimeDefault + # -- Runs all processes within a pod with a special uid + runAsUser: 10001 + # -- Processes within a pod will belong to this guid + runAsGroup: 10001 + # -- The owner for volumes and any files created within volumes will belong to this guid + fsGroup: 10001 + # The [container security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container) defines privilege and access control settings for a Container within a pod + securityContext: + capabilities: + # -- Specifies which capabilities to drop to reduce syscall attack surface + drop: + - ALL + # -- Specifies which capabilities to add to issue specialized syscalls + add: [] + # -- Whether the root filesystem is mounted in read-only mode + readOnlyRootFilesystem: true + # -- Controls [Privilege Escalation](https://kubernetes.io/docs/concepts/security/pod-security-policy/#privilege-escalation) enabling setuid binaries changing the effective user ID + allowPrivilegeEscalation: false + # -- Requires the container to run without root privileges + runAsNonRoot: true + # -- The container's process will run with the specified uid + runAsUser: 10001 + # Extra environment variables that will be pass onto deployment pods + env: {} + # ENV_NAME: value - configuration: - properties: |- - #edc.api.auth.key= - # edc.atomikos.checkpoint.interval= - # edc.atomikos.directory= - # edc.atomikos.logging= - # edc.atomikos.threaded2pc= - # edc.atomikos.timeout= - # edc.aws.access.key= - # edc.aws.provision.retry.retries.max= - # edc.aws.provision.role.duration.session.max= - # edc.aws.secret.access.key= - # edc.blobstore.endpoint= - # edc.controlplane.validation-endpoint= - # edc.core.retry.backoff.max= - # edc.core.retry.backoff.min= - # edc.core.retry.retries.max= - # edc.core.system.health.check.liveness-period= - # edc.core.system.health.check.readiness-period= - # edc.core.system.health.check.startup-period= - # edc.core.system.health.check.threadpool-size= - # edc.dataplane.queue.capacity= - # edc.dataplane.wait= - # edc.dataplane.workers= - edc.datasource.asset.name=asset - edc.datasource.asset.user= - edc.datasource.asset.url=jdbc:postgresql://consumer-postgresql:5432/edc - - edc.datasource.contractdefinition.name=contractdefinition - edc.datasource.contractdefinition.user= - edc.datasource.contractdefinition.url=jdbc:postgresql://consumer-postgresql:5432/edc + # "valueFrom" environment variable references that will be added to deployment pods. Name is templated. + # ref: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.19/#envvarsource-v1-core + envValueFrom: {} + # ENV_NAME: + # configMapKeyRef: + # name: configmap-name + # key: value_key + # secretKeyRef: + # name: secret-name + # key: value_key - edc.datasource.contractnegotiation.name=contractnegotiation - edc.datasource.contractnegotiation.user= - edc.datasource.contractnegotiation.url=jdbc:postgresql://consumer-postgresql:5432/edc + # [Kubernetes Secret Resource](https://kubernetes.io/docs/concepts/configuration/secret/) names to load environment variables from + envSecretNames: [] + # - first-secret + # - second-secret - edc.datasource.policy.name=policy - edc.datasource.policy.user= - edc.datasource.policy.url=jdbc:postgresql://consumer-postgresql:5432/edc + # [Kubernetes ConfigMap Resource](https://kubernetes.io/docs/concepts/configuration/configmap/) names to load environment variables from + envConfigMapNames: [] + # - first-config-map + # - second-config-map - edc.datasource.transferprocess.name=transferprocess - edc.datasource.transferprocess.user= - edc.datasource.transferprocess.url=jdbc:postgresql://consumer-postgresql:5432/edc + ## Ingress declaration to expose the network service. + ingresses: + ## Public / Internet facing Ingress + - enabled: true + # -- The hostname to be used to precisely map incoming traffic onto the underlying network service + hostname: "materialpass.int.demo.catena-x.net" + # -- Additional ingress annotations to add + annotations: {} + # -- EDC endpoints exposed by this ingress resource + endpoints: + - public + # -- Defines the [ingress class](https://kubernetes.io/docs/concepts/services-networking/ingress/#ingress-class) to use + className: "nginx" + # -- TLS [tls class](https://kubernetes.io/docs/concepts/services-networking/ingress/#tls) applied to the ingress resource + tls: + # -- Enables TLS on the ingress resource + enabled: true + # -- If present overwrites the default secret name + secretName: "tls-secret" + ## Adds [cert-manager](https://cert-manager.io/docs/) annotations to the ingress resource + certManager: + # -- If preset enables certificate generation via cert-manager namespace scoped issuer + issuer: "" + # -- If preset enables certificate generation via cert-manager cluster-wide issuer + clusterIssuer: "" + # -- declare where to mount [volumes](https://kubernetes.io/docs/concepts/storage/volumes/) into the container + volumeMounts: [] + # -- [volume](https://kubernetes.io/docs/concepts/storage/volumes/) directories + volumes: [] + # -- [resource management](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) for the container + resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + replicaCount: 1 + autoscaling: + # -- Enables [horizontal pod autoscaling](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/) + enabled: false + # -- Minimal replicas if resource consumption falls below resource threshholds + minReplicas: 1 + # -- Maximum replicas if resource consumption exceeds resource threshholds + maxReplicas: 100 + # -- targetAverageUtilization of cpu provided to a pod + targetCPUUtilizationPercentage: 80 + # -- targetAverageUtilization of memory provided to a pod + targetMemoryUtilizationPercentage: 80 + # -- configuration of the [Open Telemetry Agent](https://opentelemetry.io/docs/instrumentation/java/automatic/agent-config/) to collect and expose metrics + opentelemetry: |- + otel.javaagent.enabled=false + otel.javaagent.debug=false + # -- configuration of the [Java Util Logging Facade](https://docs.oracle.com/javase/7/docs/technotes/guides/logging/overview.html) + logging: |- + .level=INFO + org.eclipse.edc.level=ALL + handlers=java.util.logging.ConsoleHandler + java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter + java.util.logging.ConsoleHandler.level=ALL + java.util.logging.SimpleFormatter.format=[%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS] [%4$-7s] %5$s%6$s%n + # [node selector](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector) to constrain pods to nodes + nodeSelector: {} + # [tolerations](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) to configure preferred nodes + tolerations: [] + # [affinity](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity) to configure which nodes the pods can be scheduled on + affinity: {} + url: + # -- Explicitly declared url for reaching the public api (e.g. if ingresses not used) + public: "" + postgresql: + jdbcUrl: "jdbc:postgresql://postgresql:5432/edc" + fullnameOverride: "postgresql" + username: + password: + auth: + database: "edc" + username: + password: - # edc.datasource.default.pool.maxIdleConnections= - # edc.datasource.default.pool.maxTotalConnections= - # edc.datasource.default.pool.minIdleConnections= - # edc.datasource.default.pool.testConnectionOnBorrow= - # edc.datasource.default.pool.testConnectionOnCreate= - # edc.datasource.default.pool.testConnectionOnReturn= - # edc.datasource.default.pool.testConnectionWhileIdle= - # edc.datasource.default.pool.testQuery= - edc.datasource.default.url= - edc.datasource.default.user= - edc.datasource.default.password= + vault: + fullnameOverride: "vault" + injector: + enabled: false + server: + dev: + enabled: true + devRootToken: "root" + # Must be the same certificate that is configured in section 'daps' + postStart: # must be set externally! + hashicorp: + url: + token: + timeout: 30 + healthCheck: + enabled: true + standbyOk: true + paths: + secret: + health: /v1/sys/health + secretNames: + transferProxyTokenSignerPrivateKey: ids-daps_key + transferProxyTokenSignerPublicKey: ids-daps_crt + transferProxyTokenEncryptionAesKey: edc-encryption-key + dapsPrivateKey: ids-daps_key + dapsPublicKey: ids-daps_crt - edc.data.encryption.algorithm=NONE - edc.data.encryption.keys.alias=edc-encryption-key - # edc.dataplane.selector.httpproxy.url=https://materialpass-edc-dataplane:9999/consumer/api/dataplane/control + daps: + fullnameOverride: "daps" + url: "https://daps1.int.demo.catena-x.net" + clientId: + paths: + jwks: /.well-known/jwks.json + token: /token + connectors: + - id: + name: edcconector + attributes: + referringConnector: "https://materialpass.int.demo.catena-x.net/consumer/" + # Must be the same certificate that is stores in section 'sokrates-vault' + certificate: - # edc.dpf.selector.url= - # edc.events.topic.endpoint= - # edc.events.topic.name= - # edc.fs.config= - # edc.hostname= - # edc.identity.did.url= - # edc.ids.catalog.id= - # edc.ids.curator= - edc.ids.description="Consumer Control Plane" - edc.ids.endpoint=https://materialpass.int.demo.catena-x.net/consumer/api/v1/ids - edc.ids.endpoint.audience=https://materialpass.int.demo.catena-x.net/consumer/api/v1/ids/data + backendService: + httpProxyTokenReceiverUrl: "https://materialpass.int.demo.catena-x.net/endpoint" - # localhost configuration - # edc.ids.endpoint=http://materialpass-edc-controlplane:8282/consumer/api/v1/ids - # edc.ids.endpoint.audience=http://materialpass-edc-controlplane:8282/consumer/api/v1/ids/data - # localhost configuration + serviceAccount: + # Specifies whether a service account should be created + create: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + # -- Existing image pull secret bound to the service account to use to [obtain the container image from private registries](https://kubernetes.io/docs/concepts/containers/images/#using-a-private-registry) + imagePullSecrets: [] + + idsdaps: + connectors: + - certificate: - # edc.ids.id= - # edc.ids.maintainer= - # edc.ids.security.profile= - # edc.ids.title= - # edc.ids.validation.referringconnector= - # edc.ion.crawler.did-type= - # edc.ion.crawler.interval-minutes= - # edc.ion.crawler.ion.url= - # edc.metrics.enabled= - # edc.metrics.executor.enabled= - # edc.metrics.jersey.enabled= - # edc.metrics.jetty.enabled= - # edc.metrics.okhttp.enabled= - # edc.metrics.system.enabled= - # edc.negotiation.consumer.state-machine.batch-size= - # edc.negotiation.provider.state-machine.batch-size= - edc.oauth.client.id= - edc.oauth.private.key.alias=ids-daps_key - edc.oauth.provider.audience=idsc:IDS_CONNECTORS_ALL - # edc.oauth.provider.jwks.refresh= - edc.oauth.provider.jwks.url=https://daps1.int.demo.catena-x.net/.well-known/jwks.json - edc.oauth.public.key.alias=ids-daps_crt - edc.oauth.token.url=https://daps1.int.demo.catena-x.net/token - # edc.oauth.validation.nbf.leeway= - # edc.receiver.http.auth-code= - # edc.receiver.http.auth-key= - edc.receiver.http.endpoint=http://materialpass-edc-backend - edc.transfer.proxy.endpoint=http://materialpass-edc-dataplane:8185/consumer/api/public - # edc.transfer.proxy.token.validity.seconds= - edc.transfer.proxy.token.signer.privatekey.alias=ids-daps_key - edc.transfer.proxy.token.verifier.publickey.alias=ids-daps_crt - # edc.transfer.functions.check.endpoint= - # edc.transfer.functions.enabled.protocols= - # edc.transfer.functions.transfer.endpoint= - # edc.transfer-process-store.database.name= - # edc.transfer.state-machine.batch-size= - # edc.vault= - # edc.vault.certificate= - # edc.vault.clientid= - # edc.vault.clientsecret= - # edc.vault.name= - # edc.vault.tenantid= - edc.vault.hashicorp.url= - edc.vault.hashicorp.token= - edc.vault.hashicorp.api.secret.path= - edc.vault.hashicorp.health.check.standby.ok=true - # edc.vault.hashicorp.timeout.seconds= - # edc.webdid.doh.url= - # edc.web.rest.cors.enabled= - # edc.web.rest.cors.headers= - # edc.web.rest.cors.methods= - # edc.web.rest.cors.origins= - ids.webhook.address=https://materialpass.int.demo.catena-x.net - # ids.webhook.address=http://materialpass-edc-controlplane:8282 +postgresql: + jdbcUrl: "jdbc:postgresql://postgresql:5432/edc" + fullnameOverride: "postgresql" + primary: + persistence: + enabled: true + readReplicas: + persistence: + enabled: true + auth: + database: "edc" + username: + password: diff --git a/deployment/helm/edc-consumer/values.yaml b/deployment/helm/edc-consumer/values.yaml new file mode 100644 index 000000000..0e85cc7cc --- /dev/null +++ b/deployment/helm/edc-consumer/values.yaml @@ -0,0 +1,582 @@ +# +# Copyright (c) 2023 ZF Friedrichshafen AG +# Copyright (c) 2023 Mercedes-Benz Tech Innovation GmbH +# Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +# Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License, Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +# SPDX-License-Identifier: Apache-2.0 +# + + +--- +# Default values for eclipse-dataspace-connector. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. +tractusx-connector: + install: + daps: false + postgresql: false + vault: false + fullnameOverride: "dpp-edc-consumer" + nameOverride: "" + # -- Existing image pull secret to use to [obtain the container image from private registries](https://kubernetes.io/docs/concepts/containers/images/#using-a-private-registry) + imagePullSecrets: [] + customLabels: {} + + + participant: + id: &bpnNumber "" + + controlplane: + enabled: true + image: + # -- Which derivate of the control plane to use. when left empty the deployment will select the correct image automatically + repository: "tractusx/edc-controlplane-postgresql-hashicorp-vault" + # -- [Kubernetes image pull policy](https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy) to use + pullPolicy: IfNotPresent + # -- Overrides the image tag whose default is the chart appVersion + tag: "0.4.1" + initContainers: [] + debug: + enabled: false + port: 1044 + suspendOnStart: false + internationalDataSpaces: + id: TXDC + description: Tractus-X Eclipse IDS Data Space Connector + title: "" + maintainer: "" + curator: "" + catalogId: TXDC-Catalog + livenessProbe: + # -- Whether to enable kubernetes [liveness-probe](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) + enabled: true + # -- seconds to wait before performing the first liveness check + initialDelaySeconds: 30 + # -- this fields specifies that kubernetes should perform a liveness check every 10 seconds + periodSeconds: 10 + # -- number of seconds after which the probe times out + timeoutSeconds: 5 + # -- when a probe fails kubernetes will try 6 times before giving up + failureThreshold: 6 + # -- number of consecutive successes for the probe to be considered successful after having failed + successThreshold: 1 + readinessProbe: + # -- Whether to enable kubernetes [readiness-probes](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) + enabled: true + # -- seconds to wait before performing the first readiness check + initialDelaySeconds: 30 + # -- this fields specifies that kubernetes should perform a readiness check every 10 seconds + periodSeconds: 10 + # -- number of seconds after which the probe times out + timeoutSeconds: 5 + # -- when a probe fails kubernetes will try 6 times before giving up + failureThreshold: 6 + # -- number of consecutive successes for the probe to be considered successful after having failed + successThreshold: 1 + # -- endpoints of the control plane + endpoints: + # -- default api for health checks, should not be added to any ingress + default: + # -- port for incoming api calls + port: 8080 + # -- path for incoming api calls + path: /consumer/api + # -- data management api, used by internal users, can be added to an ingress and must not be internet facing + management: + # -- port for incoming api calls + port: 8081 + # -- path for incoming api calls + path: /consumer/management + # -- authentication key, must be attached to each 'X-Api-Key' request header + authKey: + # -- control api, used for internal control calls. can be added to the internal ingress, but should probably not + control: + # -- port for incoming api calls + port: 8083 + # -- path for incoming api calls + path: /consumer/control + # -- ids api, used for inter connector communication and must be internet facing + protocol: + # -- port for incoming api calls + port: 8084 + # -- path for incoming api calls + path: /consumer/api/v1/dsp + # -- metrics api, used for application metrics, must not be internet facing + metrics: + # -- port for incoming api calls + port: 9090 + # -- path for incoming api calls + path: /consumer/metrics + # -- observability api with unsecured access, must not be internet facing + observability: + # -- port for incoming API calls + port: 8085 + # -- observability api, provides /health /readiness and /liveness endpoints + path: /consumer/observability + # -- allow or disallow insecure access, i.e. access without authentication + insecure: true + businessPartnerValidation: + log: + agreementValidation: true + service: + # -- [Service type](https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types) to expose the running application on a set of Pods as a network service. + type: ClusterIP + annotations: {} + # -- additional labels for the pod + podLabels: {} + # -- additional annotations for the pod + podAnnotations: {} + # -- The [pod security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod) defines privilege and access control settings for a Pod within the deployment + podSecurityContext: + seccompProfile: + # -- Restrict a Container's Syscalls with seccomp + type: RuntimeDefault + # -- Runs all processes within a pod with a special uid + runAsUser: 10001 + # -- Processes within a pod will belong to this guid + runAsGroup: 10001 + # -- The owner for volumes and any files created within volumes will belong to this guid + fsGroup: 10001 + # The [container security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container) defines privilege and access control settings for a Container within a pod + securityContext: + capabilities: + # -- Specifies which capabilities to drop to reduce syscall attack surface + drop: + - ALL + # -- Specifies which capabilities to add to issue specialized syscalls + add: [] + # -- Whether the root filesystem is mounted in read-only mode + readOnlyRootFilesystem: true + # -- Controls [Privilege Escalation](https://kubernetes.io/docs/concepts/security/pod-security-policy/#privilege-escalation) enabling setuid binaries changing the effective user ID + allowPrivilegeEscalation: false + # -- Requires the container to run without root privileges + runAsNonRoot: true + # -- The container's process will run with the specified uid + runAsUser: 10001 + # Extra environment variables that will be pass onto deployment pods + env: {} + # ENV_NAME: value + + # "valueFrom" environment variable references that will be added to deployment pods. Name is templated. + # ref: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.19/#envvarsource-v1-core + envValueFrom: {} + # ENV_NAME: + # configMapKeyRef: + # name: configmap-name + # key: value_key + # secretKeyRef: + # name: secret-name + # key: value_key + + # [Kubernetes Secret Resource](https://kubernetes.io/docs/concepts/configuration/secret/) names to load environment variables from + envSecretNames: [] + # - first-secret + # - second-secret + + # [Kubernetes ConfigMap Resource](https://kubernetes.io/docs/concepts/configuration/configmap/) names to load environment variables from + envConfigMapNames: [] + # - first-config-map + # - second-config-map + + ## Ingress declaration to expose the network service. + ingresses: + ## Public / Internet facing Ingress + - enabled: true + # -- The hostname to be used to precisely map incoming traffic onto the underlying network service + hostname: "materialpass.dev.demo.catena-x.net" + # -- Additional ingress annotations to add + annotations: {} + # -- EDC endpoints exposed by this ingress resource + endpoints: + - default + - management + - control + - protocol + - metrics + - observability + # -- Defines the [ingress class](https://kubernetes.io/docs/concepts/services-networking/ingress/#ingress-class) to use + className: "nginx" + # -- TLS [tls class](https://kubernetes.io/docs/concepts/services-networking/ingress/#tls) applied to the ingress resource + tls: + # -- Enables TLS on the ingress resource + enabled: true + # -- If present overwrites the default secret name + secretName: "tls-secret" + ## Adds [cert-manager](https://cert-manager.io/docs/) annotations to the ingress resource + certManager: + # -- If preset enables certificate generation via cert-manager namespace scoped issuer + issuer: "" + # -- If preset enables certificate generation via cert-manager cluster-wide issuer + clusterIssuer: "" + ## Private / Intranet facing Ingress + - enabled: false + # -- The hostname to be used to precisely map incoming traffic onto the underlying network service + hostname: "edc-control.intranet" + # -- Additional ingress annotations to add + annotations: {} + # -- EDC endpoints exposed by this ingress resource + endpoints: + - management + - control + # -- Defines the [ingress class](https://kubernetes.io/docs/concepts/services-networking/ingress/#ingress-class) to use + className: "nginx" + # -- TLS [tls class](https://kubernetes.io/docs/concepts/services-networking/ingress/#tls) applied to the ingress resource + tls: + # -- Enables TLS on the ingress resource + enabled: true + # -- If present overwrites the default secret name + secretName: "tls-secret" + ## Adds [cert-manager](https://cert-manager.io/docs/) annotations to the ingress resource + certManager: + # -- If preset enables certificate generation via cert-manager namespace scoped issuer + issuer: "" + # -- If preset enables certificate generation via cert-manager cluster-wide issuer + clusterIssuer: "" + # -- declare where to mount [volumes](https://kubernetes.io/docs/concepts/storage/volumes/) into the container + volumeMounts: [] + # -- [volume](https://kubernetes.io/docs/concepts/storage/volumes/) directories + volumes: [] + # -- [resource management](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) for the container + resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + replicaCount: 1 + autoscaling: + # -- Enables [horizontal pod autoscaling](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/) + enabled: false + # -- Minimal replicas if resource consumption falls below resource threshholds + minReplicas: 1 + # -- Maximum replicas if resource consumption exceeds resource threshholds + maxReplicas: 100 + # -- targetAverageUtilization of cpu provided to a pod + targetCPUUtilizationPercentage: 80 + # -- targetAverageUtilization of memory provided to a pod + targetMemoryUtilizationPercentage: 80 + # -- configuration of the [Open Telemetry Agent](https://opentelemetry.io/docs/instrumentation/java/automatic/agent-config/) to collect and expose metrics + opentelemetry: |- + otel.javaagent.enabled=false + otel.javaagent.debug=false + # -- configuration of the [Java Util Logging Facade](https://docs.oracle.com/javase/7/docs/technotes/guides/logging/overview.html) + logging: |- + .level=INFO + org.eclipse.edc.level=ALL + handlers=java.util.logging.ConsoleHandler + java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter + java.util.logging.ConsoleHandler.level=ALL + java.util.logging.SimpleFormatter.format=[%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS] [%4$-7s] %5$s%6$s%n + # [node selector](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector) to constrain pods to nodes + nodeSelector: {} + # [tolerations](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) to configure preferred nodes + tolerations: [] + # [affinity](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity) to configure which nodes the pods can be scheduled on + affinity: {} + url: + # -- Explicitly declared url for reaching the ids api (e.g. if ingresses not used) + ids: "" + dataplane: + enabled: true + image: + # -- Which derivate of the data plane to use. when left empty the deployment will select the correct image automatically + repository: "tractusx/edc-dataplane-hashicorp-vault" + # -- [Kubernetes image pull policy](https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy) to use + pullPolicy: IfNotPresent + # -- Overrides the image tag whose default is the chart appVersion + tag: "0.4.1" + initContainers: [] + debug: + enabled: false + port: 1044 + suspendOnStart: false + livenessProbe: + # -- Whether to enable kubernetes [liveness-probe](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) + enabled: true + # -- seconds to wait before performing the first liveness check + initialDelaySeconds: 30 + # -- this fields specifies that kubernetes should perform a liveness check every 10 seconds + periodSeconds: 10 + # -- number of seconds after which the probe times out + timeoutSeconds: 5 + # -- when a probe fails kubernetes will try 6 times before giving up + failureThreshold: 6 + # -- number of consecutive successes for the probe to be considered successful after having failed + successThreshold: 1 + readinessProbe: + # -- Whether to enable kubernetes [readiness-probes](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) + enabled: true + # -- seconds to wait before performing the first readiness check + initialDelaySeconds: 30 + # -- this fields specifies that kubernetes should perform a liveness check every 10 seconds + periodSeconds: 10 + # -- number of seconds after which the probe times out + timeoutSeconds: 5 + # -- when a probe fails kubernetes will try 6 times before giving up + failureThreshold: 6 + # -- number of consecutive successes for the probe to be considered successful after having failed + successThreshold: 1 + service: + # -- [Service type](https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types) to expose the running application on a set of Pods as a network service. + type: ClusterIP + port: 80 + endpoints: + default: + port: 8080 + path: /consumer/api + public: + port: 8081 + path: /consumer/api/public + control: + port: 8083 + path: /consumer/api/dataplane/control + proxy: + port: 8186 + path: /consumer/proxy + observability: + # -- port for incoming API calls + port: 8085 + # -- observability api, provides /health /readiness and /liveness endpoints + path: /consumer/observability + # -- allow or disallow insecure access, i.e. access without authentication + insecure: true + metrics: + port: 9090 + path: /consumer/metrics + aws: + endpointOverride: "" + accessKeyId: "" + secretAccessKey: "" + # -- additional labels for the pod + podLabels: {} + # -- additional annotations for the pod + podAnnotations: {} + # -- The [pod security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod) defines privilege and access control settings for a Pod within the deployment + podSecurityContext: + seccompProfile: + # -- Restrict a Container's Syscalls with seccomp + type: RuntimeDefault + # -- Runs all processes within a pod with a special uid + runAsUser: 10001 + # -- Processes within a pod will belong to this guid + runAsGroup: 10001 + # -- The owner for volumes and any files created within volumes will belong to this guid + fsGroup: 10001 + # The [container security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container) defines privilege and access control settings for a Container within a pod + securityContext: + capabilities: + # -- Specifies which capabilities to drop to reduce syscall attack surface + drop: + - ALL + # -- Specifies which capabilities to add to issue specialized syscalls + add: [] + # -- Whether the root filesystem is mounted in read-only mode + readOnlyRootFilesystem: true + # -- Controls [Privilege Escalation](https://kubernetes.io/docs/concepts/security/pod-security-policy/#privilege-escalation) enabling setuid binaries changing the effective user ID + allowPrivilegeEscalation: false + # -- Requires the container to run without root privileges + runAsNonRoot: true + # -- The container's process will run with the specified uid + runAsUser: 10001 + # Extra environment variables that will be pass onto deployment pods + env: {} + # ENV_NAME: value + + # "valueFrom" environment variable references that will be added to deployment pods. Name is templated. + # ref: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.19/#envvarsource-v1-core + envValueFrom: {} + # ENV_NAME: + # configMapKeyRef: + # name: configmap-name + # key: value_key + # secretKeyRef: + # name: secret-name + # key: value_key + + # [Kubernetes Secret Resource](https://kubernetes.io/docs/concepts/configuration/secret/) names to load environment variables from + envSecretNames: [] + # - first-secret + # - second-secret + + # [Kubernetes ConfigMap Resource](https://kubernetes.io/docs/concepts/configuration/configmap/) names to load environment variables from + envConfigMapNames: [] + # - first-config-map + # - second-config-map + + ## Ingress declaration to expose the network service. + ingresses: + ## Public / Internet facing Ingress + - enabled: true + # -- The hostname to be used to precisely map incoming traffic onto the underlying network service + hostname: "materialpass.dev.demo.catena-x.net" + # -- Additional ingress annotations to add + annotations: {} + # -- EDC endpoints exposed by this ingress resource + endpoints: + - public + # -- Defines the [ingress class](https://kubernetes.io/docs/concepts/services-networking/ingress/#ingress-class) to use + className: "nginx" + # -- TLS [tls class](https://kubernetes.io/docs/concepts/services-networking/ingress/#tls) applied to the ingress resource + tls: + # -- Enables TLS on the ingress resource + enabled: true + # -- If present overwrites the default secret name + secretName: "tls-secret" + ## Adds [cert-manager](https://cert-manager.io/docs/) annotations to the ingress resource + certManager: + # -- If preset enables certificate generation via cert-manager namespace scoped issuer + issuer: "" + # -- If preset enables certificate generation via cert-manager cluster-wide issuer + clusterIssuer: "" + # -- declare where to mount [volumes](https://kubernetes.io/docs/concepts/storage/volumes/) into the container + volumeMounts: [] + # -- [volume](https://kubernetes.io/docs/concepts/storage/volumes/) directories + volumes: [] + # -- [resource management](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) for the container + resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + replicaCount: 1 + autoscaling: + # -- Enables [horizontal pod autoscaling](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/) + enabled: false + # -- Minimal replicas if resource consumption falls below resource threshholds + minReplicas: 1 + # -- Maximum replicas if resource consumption exceeds resource threshholds + maxReplicas: 100 + # -- targetAverageUtilization of cpu provided to a pod + targetCPUUtilizationPercentage: 80 + # -- targetAverageUtilization of memory provided to a pod + targetMemoryUtilizationPercentage: 80 + # -- configuration of the [Open Telemetry Agent](https://opentelemetry.io/docs/instrumentation/java/automatic/agent-config/) to collect and expose metrics + opentelemetry: |- + otel.javaagent.enabled=false + otel.javaagent.debug=false + # -- configuration of the [Java Util Logging Facade](https://docs.oracle.com/javase/7/docs/technotes/guides/logging/overview.html) + logging: |- + .level=INFO + org.eclipse.edc.level=ALL + handlers=java.util.logging.ConsoleHandler + java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter + java.util.logging.ConsoleHandler.level=ALL + java.util.logging.SimpleFormatter.format=[%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS] [%4$-7s] %5$s%6$s%n + # [node selector](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector) to constrain pods to nodes + nodeSelector: {} + # [tolerations](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) to configure preferred nodes + tolerations: [] + # [affinity](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity) to configure which nodes the pods can be scheduled on + affinity: {} + url: + # -- Explicitly declared url for reaching the public api (e.g. if ingresses not used) + public: "" + + postgresql: + jdbcUrl: "jdbc:postgresql://postgresql:5432/edc" + fullnameOverride: "postgresql" + username: + password: + auth: + database: "edc" + username: + password: + + vault: + fullnameOverride: "vault" + injector: + enabled: false + server: + dev: + enabled: true + devRootToken: "root" + # Must be the same certificate that is configured in section 'daps' + postStart: # must be set externally! + hashicorp: + url: + token: + timeout: 30 + healthCheck: + enabled: true + standbyOk: true + paths: + secret: + health: /v1/sys/health + secretNames: + transferProxyTokenSignerPrivateKey: daps-key-dev + transferProxyTokenSignerPublicKey: daps-crt-dev + transferProxyTokenEncryptionAesKey: edc-encryption-key + dapsPrivateKey: daps-key-dev + dapsPublicKey: daps-crt-dev + + daps: + fullnameOverride: "daps" + url: "https://daps1.int.demo.catena-x.net" + clientId: + paths: + jwks: /.well-known/jwks.json + token: /token + connectors: + - id: + name: edcconector + attributes: + referringConnector: "https://materialpass.dev.demo.catena-x.net/consumer/" + certificate: + + + backendService: + httpProxyTokenReceiverUrl: "https://materialpass.dev.demo.catena-x.net/endpoint" + + serviceAccount: + # Specifies whether a service account should be created + create: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + # -- Existing image pull secret bound to the service account to use to [obtain the container image from private registries](https://kubernetes.io/docs/concepts/containers/images/#using-a-private-registry) + imagePullSecrets: [] + + idsdaps: + connectors: + - certificate: + +postgresql: + jdbcUrl: "jdbc:postgresql://postgresql:5432/edc" + fullnameOverride: "postgresql" + primary: + persistence: + enabled: true + readReplicas: + persistence: + enabled: true + auth: + database: "edc" + username: + password: \ No newline at end of file diff --git a/deployment/helm/edc-provider/Chart.yaml b/deployment/helm/edc-provider/Chart.yaml index 9fff56cb5..202bc868c 100644 --- a/deployment/helm/edc-provider/Chart.yaml +++ b/deployment/helm/edc-provider/Chart.yaml @@ -1,50 +1,63 @@ -################################################################################# -# Catena-X - Product Passport Consumer Frontend # -# Copyright (c) 2022, 2023 BASF SE, BMW AG, Henkel AG & Co. KGaA +# Copyright (c) 2023 ZF Friedrichshafen AG +# Copyright (c) 2023 Mercedes-Benz Tech Innovation GmbH +# Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +# Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation # -# See the NOTICE file(s) distributed with this work for additional -# information regarding copyright ownership. +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. # -# This program and the accompanying materials are made available under the -# terms of the Apache License, Version 2.0 which is available at -# https://www.apache.org/licenses/LICENSE-2.0. +# This program and the accompanying materials are made available under the +# terms of the Apache License, Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 # -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -# either express or implied. See the -# License for the specific language govern in permissions and limitations -# under the License. +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +# SPDX-License-Identifier: Apache-2.0 # -# SPDX-License-Identifier: Apache-2.0 -################################################################################## --- apiVersion: v2 -name: edc -description: A Helm chart for Kubernetes +name: tractusx-connector +description: | + A Helm chart for Tractus-X Eclipse Data Space Connector. The connector deployment consists of two runtime consists of a + Control Plane and a Data Plane. Note that _no_ external dependencies such as a PostgreSQL database and HashiCorp Vault are included. + + This chart is intended for use with an _existing_ PostgreSQL database and an _existing_ HashiCorp Vault. +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. type: application -version: 0.0.2 -appVersion: "0.4.3" +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.3.3 +# 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: "0.4.1" +home: https://github.com/eclipse-tractusx/tractusx-edc/tree/main/charts/tractusx-connector +sources: + - https://github.com/eclipse-tractusx/tractusx-edc/tree/main/charts/tractusx-connector +urls: + - https://github.com/eclipse-tractusx/tractusx-edc/releases/download/tractusx-connector-0.4.0/tractusx-connector-0.4.0.tgz dependencies: - - name: edc-controlplane - alias: controlplane - version: "0.1.6" - repository: https://catenax-ng.github.io/product-edc - condition: controlplane.enabled - - name: edc-dataplane - alias: dataplane - version: "0.1.6" - repository: https://catenax-ng.github.io/product-edc - condition: dataplane.enabled - - name: backend-service - version: "0.0.6" - repository: https://denisneuling.github.io/cx-backend-service - alias: providerbackendapplication - condition: providerbackendapplication.enabled + - name: tractusx-connector + version: 0.4.1 + repository: https://eclipse-tractusx.github.io/charts/dev + condition: enabled - name: postgresql - alias: postgres - version: 12.1.5 + alias: postgresql + version: 12.1.6 repository: https://charts.bitnami.com/bitnami - condition: postgres.enabled + condition: postgresql.enabled diff --git a/deployment/helm/edc-provider/README.md.gotmpl b/deployment/helm/edc-provider/README.md.gotmpl new file mode 100644 index 000000000..b1671f5a2 --- /dev/null +++ b/deployment/helm/edc-provider/README.md.gotmpl @@ -0,0 +1,26 @@ +{{ template "chart.header" . }} + +{{ template "chart.deprecationWarning" . }} + +{{ template "chart.badgesSection" . }} + +{{ template "chart.description" . }} + +{{ template "chart.homepageLine" . }} + +## TL;DR + +```shell +helm repo add tractusx-edc https://eclipse-tractusx.github.io/charts/dev +helm install my-release tractusx-edc/tractusx-connector --version {{ .Version }} +``` + +{{ template "chart.maintainersSection" . }} + +{{ template "chart.sourcesSection" . }} + +{{ template "chart.requirementsSection" . }} + +{{ template "chart.valuesSection" . }} + +{{ template "helm-docs.versionFooter" . }} diff --git a/deployment/helm/edc-provider/values-beta.yaml b/deployment/helm/edc-provider/values-beta.yaml index ffd9905ba..f0965cc00 100644 --- a/deployment/helm/edc-provider/values-beta.yaml +++ b/deployment/helm/edc-provider/values-beta.yaml @@ -1,307 +1,579 @@ -################################################################################# -# Catena-X - Product Passport Consumer Frontend # -# Copyright (c) 2022, 2023 BASF SE, BMW AG, Henkel AG & Co. KGaA +# Copyright (c) 2023 ZF Friedrichshafen AG +# Copyright (c) 2023 Mercedes-Benz Tech Innovation GmbH +# Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +# Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation # -# See the NOTICE file(s) distributed with this work for additional -# information regarding copyright ownership. +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. # -# This program and the accompanying materials are made available under the -# terms of the Apache License, Version 2.0 which is available at -# https://www.apache.org/licenses/LICENSE-2.0. +# This program and the accompanying materials are made available under the +# terms of the Apache License, Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 # -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -# either express or implied. See the -# License for the specific language govern in permissions and limitations -# under the License. +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. # -# SPDX-License-Identifier: Apache-2.0 -################################################################################## +# SPDX-License-Identifier: Apache-2.0 +# + --- -providerbackendapplication: - enabled: true - fullnameOverride: "materialpass-edc-provider-backend" - service: - type: NodePort - frontend: - port: 80 - backend: - port: 8081 -postgres: - enabled: true - fullnameOverride: "provider-postgresql" - auth: - password: - username: &psqlUsername - database: "edc" - persistence: - enabled: true +tractusx-connector: + install: + daps: false + postgresql: false + vault: false + fullnameOverride: "dpp-edc-provider" + nameOverride: "" + # -- Existing image pull secret to use to [obtain the container image from private registries](https://kubernetes.io/docs/concepts/containers/images/#using-a-private-registry) + imagePullSecrets: [] + customLabels: {} -dataplane: - enabled: true - fullnameOverride: "materialpass-edc-provider-dataplane" - image: - repository: ghcr.io/catenax-ng/product-edc/edc-dataplane-hashicorp-vault - tag: 0.1.6 - pullPolicy: IfNotPresent - envSecretName: "provider-dataplane-secret" - edc: + + participant: + id: &bpnNumber "" + + controlplane: + enabled: true + image: + # -- Which derivate of the control plane to use. when left empty the deployment will select the correct image automatically + repository: "tractusx/edc-controlplane-postgresql-hashicorp-vault" + # -- [Kubernetes image pull policy](https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy) to use + pullPolicy: IfNotPresent + # -- Overrides the image tag whose default is the chart appVersion + tag: "0.4.1" + initContainers: [] + debug: + enabled: false + port: 1044 + suspendOnStart: false + internationalDataSpaces: + id: TXDC + description: Tractus-X Eclipse IDS Data Space Connector + title: "" + maintainer: "" + curator: "" + catalogId: TXDC-Catalog + livenessProbe: + # -- Whether to enable kubernetes [liveness-probe](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) + enabled: true + # -- seconds to wait before performing the first liveness check + initialDelaySeconds: 30 + # -- this fields specifies that kubernetes should perform a liveness check every 10 seconds + periodSeconds: 10 + # -- number of seconds after which the probe times out + timeoutSeconds: 5 + # -- when a probe fails kubernetes will try 6 times before giving up + failureThreshold: 6 + # -- number of consecutive successes for the probe to be considered successful after having failed + successThreshold: 1 + readinessProbe: + # -- Whether to enable kubernetes [readiness-probes](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) + enabled: true + # -- seconds to wait before performing the first readiness check + initialDelaySeconds: 30 + # -- this fields specifies that kubernetes should perform a readiness check every 10 seconds + periodSeconds: 10 + # -- number of seconds after which the probe times out + timeoutSeconds: 5 + # -- when a probe fails kubernetes will try 6 times before giving up + failureThreshold: 6 + # -- number of consecutive successes for the probe to be considered successful after having failed + successThreshold: 1 + # -- endpoints of the control plane endpoints: + # -- default api for health checks, should not be added to any ingress default: + # -- port for incoming api calls port: 8080 + # -- path for incoming api calls path: /BPNL000000000000/api - public: - port: 8185 - path: /BPNL000000000000/api/public + # -- data management api, used by internal users, can be added to an ingress and must not be internet facing + management: + # -- port for incoming api calls + port: 8081 + # -- path for incoming api calls + path: /BPNL000000000000/management + # -- authentication key, must be attached to each 'X-Api-Key' request header + authKey: + # -- control api, used for internal control calls. can be added to the internal ingress, but should probably not control: - port: 9999 - path: /BPNL000000000000/api/dataplane/control + # -- port for incoming api calls + port: 8083 + # -- path for incoming api calls + path: /BPNL000000000000/control + # -- ids api, used for inter connector communication and must be internet facing + protocol: + # -- port for incoming api calls + port: 8084 + # -- path for incoming api calls + path: /BPNL000000000000/api/v1/dsp + # -- metrics api, used for application metrics, must not be internet facing metrics: + # -- port for incoming api calls port: 9090 + # -- path for incoming api calls path: /BPNL000000000000/metrics - ingresses: - - enabled: true - hostname: "materialpass.beta.demo.catena-x.net" - endpoints: - - default - - public - - control - - metrics - className: "nginx" - tls: - # -- Enables TLS on the ingress resource - enabled: true - # -- If present overwrites the default secret name - secretName: "tls-secret" - opentelemetry: - properties: |- - otel.javaagent.enabled=false - otel.javaagent.debug=false - env: - JAVA_TOOL_OPTIONS: "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=1044" - EDC_DATAPLANE_TOKEN_VALIDATION_ENDPOINT: http://materialpass-edc-provider-controlplane:8182/BPNL000000000000/validation/token + # -- observability api with unsecured access, must not be internet facing + observability: + # -- port for incoming API calls + port: 8085 + # -- observability api, provides /health /readiness and /liveness endpoints + path: /BPNL000000000000/observability + # -- allow or disallow insecure access, i.e. access without authentication + insecure: true + businessPartnerValidation: + log: + agreementValidation: true + service: + # -- [Service type](https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types) to expose the running application on a set of Pods as a network service. + type: ClusterIP + annotations: {} + # -- additional labels for the pod + podLabels: {} + # -- additional annotations for the pod + podAnnotations: {} + # -- The [pod security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod) defines privilege and access control settings for a Pod within the deployment + podSecurityContext: + seccompProfile: + # -- Restrict a Container's Syscalls with seccomp + type: RuntimeDefault + # -- Runs all processes within a pod with a special uid + runAsUser: 10001 + # -- Processes within a pod will belong to this guid + runAsGroup: 10001 + # -- The owner for volumes and any files created within volumes will belong to this guid + fsGroup: 10001 + # The [container security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container) defines privilege and access control settings for a Container within a pod + securityContext: + capabilities: + # -- Specifies which capabilities to drop to reduce syscall attack surface + drop: + - ALL + # -- Specifies which capabilities to add to issue specialized syscalls + add: [] + # -- Whether the root filesystem is mounted in read-only mode + readOnlyRootFilesystem: true + # -- Controls [Privilege Escalation](https://kubernetes.io/docs/concepts/security/pod-security-policy/#privilege-escalation) enabling setuid binaries changing the effective user ID + allowPrivilegeEscalation: false + # -- Requires the container to run without root privileges + runAsNonRoot: true + # -- The container's process will run with the specified uid + runAsUser: 10001 + # Extra environment variables that will be pass onto deployment pods + env: {} + # ENV_NAME: value + + # "valueFrom" environment variable references that will be added to deployment pods. Name is templated. + # ref: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.19/#envvarsource-v1-core + envValueFrom: {} + # ENV_NAME: + # configMapKeyRef: + # name: configmap-name + # key: value_key + # secretKeyRef: + # name: secret-name + # key: value_key + + # [Kubernetes Secret Resource](https://kubernetes.io/docs/concepts/configuration/secret/) names to load environment variables from + envSecretNames: [] + # - first-secret + # - second-secret - EDC_VAULT_HASHICORP_URL: - EDC_VAULT_HASHICORP_API_SECRET_PATH: - EDC_VAULT_HASHICORP_TOKEN: - EDC_OAUTH_TOKEN_URL: https://daps.beta.demo.catena-x.net/token - EDC_OAUTH_PROVIDER_JWKS_URL: https://daps.beta.demo.catena-x.net/.well-known/jwks.json - EDC_OAUTH_PROVIDER_AUDIENCE: idsc:IDS_CONNECTORS_ALL - EDC_VAULT_HASHICORP_HEALTH_CHECK_STANDBY_OK: "true" + # [Kubernetes ConfigMap Resource](https://kubernetes.io/docs/concepts/configuration/configmap/) names to load environment variables from + envConfigMapNames: [] + # - first-config-map + # - second-config-map -controlplane: - enabled: true - fullnameOverride: "materialpass-edc-provider-controlplane" - image: - repository: ghcr.io/catenax-ng/product-edc/edc-controlplane-postgresql-hashicorp-vault - tag: 0.1.6 - pullPolicy: IfNotPresent - edc: + ## Ingress declaration to expose the network service. + ingresses: + ## Public / Internet facing Ingress + - enabled: true + # -- The hostname to be used to precisely map incoming traffic onto the underlying network service + hostname: "materialpass.beta.demo.catena-x.net" + # -- Additional ingress annotations to add + annotations: {} + # -- EDC endpoints exposed by this ingress resource + endpoints: + - default + - management + - control + - protocol + - metrics + - observability + # -- Defines the [ingress class](https://kubernetes.io/docs/concepts/services-networking/ingress/#ingress-class) to use + className: "nginx" + # -- TLS [tls class](https://kubernetes.io/docs/concepts/services-networking/ingress/#tls) applied to the ingress resource + tls: + # -- Enables TLS on the ingress resource + enabled: true + # -- If present overwrites the default secret name + secretName: "tls-secret" + ## Adds [cert-manager](https://cert-manager.io/docs/) annotations to the ingress resource + certManager: + # -- If preset enables certificate generation via cert-manager namespace scoped issuer + issuer: "" + # -- If preset enables certificate generation via cert-manager cluster-wide issuer + clusterIssuer: "" + ## Private / Intranet facing Ingress + - enabled: false + # -- The hostname to be used to precisely map incoming traffic onto the underlying network service + hostname: "edc-control.intranet" + # -- Additional ingress annotations to add + annotations: {} + # -- EDC endpoints exposed by this ingress resource + endpoints: + - management + - control + # -- Defines the [ingress class](https://kubernetes.io/docs/concepts/services-networking/ingress/#ingress-class) to use + className: "nginx" + # -- TLS [tls class](https://kubernetes.io/docs/concepts/services-networking/ingress/#tls) applied to the ingress resource + tls: + # -- Enables TLS on the ingress resource + enabled: true + # -- If present overwrites the default secret name + secretName: "tls-secret" + ## Adds [cert-manager](https://cert-manager.io/docs/) annotations to the ingress resource + certManager: + # -- If preset enables certificate generation via cert-manager namespace scoped issuer + issuer: "" + # -- If preset enables certificate generation via cert-manager cluster-wide issuer + clusterIssuer: "" + # -- declare where to mount [volumes](https://kubernetes.io/docs/concepts/storage/volumes/) into the container + volumeMounts: [] + # -- [volume](https://kubernetes.io/docs/concepts/storage/volumes/) directories + volumes: [] + # -- [resource management](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) for the container + resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + replicaCount: 1 + autoscaling: + # -- Enables [horizontal pod autoscaling](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/) + enabled: false + # -- Minimal replicas if resource consumption falls below resource threshholds + minReplicas: 1 + # -- Maximum replicas if resource consumption exceeds resource threshholds + maxReplicas: 100 + # -- targetAverageUtilization of cpu provided to a pod + targetCPUUtilizationPercentage: 80 + # -- targetAverageUtilization of memory provided to a pod + targetMemoryUtilizationPercentage: 80 + # -- configuration of the [Open Telemetry Agent](https://opentelemetry.io/docs/instrumentation/java/automatic/agent-config/) to collect and expose metrics + opentelemetry: |- + otel.javaagent.enabled=false + otel.javaagent.debug=false + # -- configuration of the [Java Util Logging Facade](https://docs.oracle.com/javase/7/docs/technotes/guides/logging/overview.html) + logging: |- + .level=INFO + org.eclipse.edc.level=ALL + handlers=java.util.logging.ConsoleHandler + java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter + java.util.logging.ConsoleHandler.level=ALL + java.util.logging.SimpleFormatter.format=[%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS] [%4$-7s] %5$s%6$s%n + # [node selector](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector) to constrain pods to nodes + nodeSelector: {} + # [tolerations](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) to configure preferred nodes + tolerations: [] + # [affinity](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity) to configure which nodes the pods can be scheduled on + affinity: {} + url: + # -- Explicitly declared url for reaching the ids api (e.g. if ingresses not used) + ids: "" + dataplane: + enabled: true + image: + # -- Which derivate of the data plane to use. when left empty the deployment will select the correct image automatically + repository: "tractusx/edc-dataplane-hashicorp-vault" + # -- [Kubernetes image pull policy](https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy) to use + pullPolicy: IfNotPresent + # -- Overrides the image tag whose default is the chart appVersion + tag: "0.4.1" + initContainers: [] + debug: + enabled: false + port: 1044 + suspendOnStart: false + livenessProbe: + # -- Whether to enable kubernetes [liveness-probe](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) + enabled: true + # -- seconds to wait before performing the first liveness check + initialDelaySeconds: 30 + # -- this fields specifies that kubernetes should perform a liveness check every 10 seconds + periodSeconds: 10 + # -- number of seconds after which the probe times out + timeoutSeconds: 5 + # -- when a probe fails kubernetes will try 6 times before giving up + failureThreshold: 6 + # -- number of consecutive successes for the probe to be considered successful after having failed + successThreshold: 1 + readinessProbe: + # -- Whether to enable kubernetes [readiness-probes](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) + enabled: true + # -- seconds to wait before performing the first readiness check + initialDelaySeconds: 30 + # -- this fields specifies that kubernetes should perform a liveness check every 10 seconds + periodSeconds: 10 + # -- number of seconds after which the probe times out + timeoutSeconds: 5 + # -- when a probe fails kubernetes will try 6 times before giving up + failureThreshold: 6 + # -- number of consecutive successes for the probe to be considered successful after having failed + successThreshold: 1 + service: + # -- [Service type](https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types) to expose the running application on a set of Pods as a network service. + type: ClusterIP + port: 80 endpoints: default: port: 8080 - path: /BPNL000000000000/controlplane/api - data: - port: 8181 - path: /BPNL000000000000/data - validation: - port: 8182 - path: /BPNL000000000000/validation + path: /BPNL000000000000/api + public: + port: 8081 + path: /BPNL000000000000/api/public control: - port: 9999 - path: /BPNL000000000000/api/controlplane/control - ids: - port: 8282 - path: /BPNL000000000000/api/v1/ids + port: 8083 + path: /BPNL000000000000/api/dataplane/control + proxy: + port: 8186 + path: /BPNL000000000000/proxy + observability: + # -- port for incoming API calls + port: 8085 + # -- observability api, provides /health /readiness and /liveness endpoints + path: /BPNL000000000000/observability + # -- allow or disallow insecure access, i.e. access without authentication + insecure: true metrics: port: 9090 - path: /BPNL000000000000/controlplane/metrics - ingresses: - - enabled: true - hostname: "materialpass.beta.demo.catena-x.net" - endpoints: - - default - - data - - validation - - control - - ids - - metrics - className: "nginx" - tls: - # -- Enables TLS on the ingress resource - enabled: true - # -- If present overwrites the default secret name - secretName: "tls-secret" - opentelemetry: - properties: |- - otel.javaagent.enabled=false - otel.javaagent.debug=false - envSecretName: "provider-controlplane-secret" - env: - JAVA_TOOL_OPTIONS: "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=1044" - EDC_DATASOURCE_ASSET_NAME: asset - EDC_DATASOURCE_ASSET_USER: *psqlUsername - EDC_DATASOURCE_ASSET_URL: &psqlJdbcUrl "jdbc:postgresql://provider-postgresql:5432/edc" - EDC_DATASOURCE_CONTRACTDEFINITION_NAME: contractdefinition - EDC_DATASOURCE_CONTRACTDEFINITION_USER: *psqlUsername - EDC_DATASOURCE_CONTRACTDEFINITION_URL: *psqlJdbcUrl - EDC_DATASOURCE_CONTRACTNEGOTIATION_NAME: contractnegotiation - EDC_DATASOURCE_CONTRACTNEGOTIATION_USER: *psqlUsername - EDC_DATASOURCE_CONTRACTNEGOTIATION_URL: *psqlJdbcUrl - EDC_DATASOURCE_POLICY_NAME: policy - EDC_DATASOURCE_POLICY_USER: *psqlUsername - EDC_DATASOURCE_POLICY_URL: *psqlJdbcUrl - EDC_DATASOURCE_TRANSFERPROCESS_NAME: transferprocess - EDC_DATASOURCE_TRANSFERPROCESS_USER: *psqlUsername - EDC_DATASOURCE_TRANSFERPROCESS_URL: *psqlJdbcUrl - EDC_API_AUTH_KEY: - EDC_VAULT_HASHICORP_URL: - EDC_VAULT_HASHICORP_API_SECRET_PATH: - EDC_VAULT_HASHICORP_TOKEN: - EDC_VAULT_HASHICORP_HEALTH_CHECK_STANDBY_OK: "true" + path: /BPNL000000000000/metrics + aws: + endpointOverride: "" + accessKeyId: "" + secretAccessKey: "" + # -- additional labels for the pod + podLabels: {} + # -- additional annotations for the pod + podAnnotations: {} + # -- The [pod security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod) defines privilege and access control settings for a Pod within the deployment + podSecurityContext: + seccompProfile: + # -- Restrict a Container's Syscalls with seccomp + type: RuntimeDefault + # -- Runs all processes within a pod with a special uid + runAsUser: 10001 + # -- Processes within a pod will belong to this guid + runAsGroup: 10001 + # -- The owner for volumes and any files created within volumes will belong to this guid + fsGroup: 10001 + # The [container security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container) defines privilege and access control settings for a Container within a pod + securityContext: + capabilities: + # -- Specifies which capabilities to drop to reduce syscall attack surface + drop: + - ALL + # -- Specifies which capabilities to add to issue specialized syscalls + add: [] + # -- Whether the root filesystem is mounted in read-only mode + readOnlyRootFilesystem: true + # -- Controls [Privilege Escalation](https://kubernetes.io/docs/concepts/security/pod-security-policy/#privilege-escalation) enabling setuid binaries changing the effective user ID + allowPrivilegeEscalation: false + # -- Requires the container to run without root privileges + runAsNonRoot: true + # -- The container's process will run with the specified uid + runAsUser: 10001 + # Extra environment variables that will be pass onto deployment pods + env: {} + # ENV_NAME: value - - EDC_DATAPLANE_SELECTOR_PROVIDERPLANE_URL: http://materialpass-edc-provider-dataplane:9999/BPNL000000000000/api/dataplane/control - EDC_DATAPLANE_SELECTOR_PROVIDERPLANE_SOURCETYPES : HttpData - EDC_DATAPLANE_SELECTOR_PROVIDERPLANE_DESTINATIONTYPES: HttpProxy - EDC_DATAPLANE_SELECTOR_PROVIDERPLANE_PROPERTIES: >- - { - "publicApiUrl": "http://materialpass-edc-provider-dataplane:8185/BPNL000000000000/api/public" - } - - configuration: - properties: |- - #edc.api.auth.key= - # edc.atomikos.checkpoint.interval= - # edc.atomikos.directory= - # edc.atomikos.logging= - # edc.atomikos.threaded2pc= - # edc.atomikos.timeout= - # edc.aws.access.key= - # edc.aws.provision.retry.retries.max= - # edc.aws.provision.role.duration.session.max= - # edc.aws.secret.access.key= - # edc.blobstore.endpoint= - # edc.controlplane.validation-endpoint= - # edc.core.retry.backoff.max= - # edc.core.retry.backoff.min= - # edc.core.retry.retries.max= - # edc.core.system.health.check.liveness-period= - # edc.core.system.health.check.readiness-period= - # edc.core.system.health.check.startup-period= - # edc.core.system.health.check.threadpool-size= - # edc.dataplane.queue.capacity= - # edc.dataplane.wait= - # edc.dataplane.workers= - edc.datasource.asset.name=asset - edc.datasource.asset.user= - edc.datasource.asset.url=jdbc:postgresql://provider-postgresql:5432/edc - - edc.datasource.contractdefinition.name=contractdefinition - edc.datasource.contractdefinition.user= - edc.datasource.contractdefinition.url=jdbc:postgresql://provider-postgresql:5432/edc + # "valueFrom" environment variable references that will be added to deployment pods. Name is templated. + # ref: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.19/#envvarsource-v1-core + envValueFrom: {} + # ENV_NAME: + # configMapKeyRef: + # name: configmap-name + # key: value_key + # secretKeyRef: + # name: secret-name + # key: value_key - edc.datasource.contractnegotiation.name=contractnegotiation - edc.datasource.contractnegotiation.user= - edc.datasource.contractnegotiation.url=jdbc:postgresql://provider-postgresql:5432/edc + # [Kubernetes Secret Resource](https://kubernetes.io/docs/concepts/configuration/secret/) names to load environment variables from + envSecretNames: [] + # - first-secret + # - second-secret - edc.datasource.policy.name=policy - edc.datasource.policy.user= - edc.datasource.policy.url=jdbc:postgresql://provider-postgresql:5432/edc + # [Kubernetes ConfigMap Resource](https://kubernetes.io/docs/concepts/configuration/configmap/) names to load environment variables from + envConfigMapNames: [] + # - first-config-map + # - second-config-map - edc.datasource.transferprocess.name=transferprocess - edc.datasource.transferprocess.user= - edc.datasource.transferprocess.url=jdbc:postgresql://provider-postgresql:5432/edc + ## Ingress declaration to expose the network service. + ingresses: + ## Public / Internet facing Ingress + - enabled: true + # -- The hostname to be used to precisely map incoming traffic onto the underlying network service + hostname: "materialpass.beta.demo.catena-x.net" + # -- Additional ingress annotations to add + annotations: {} + # -- EDC endpoints exposed by this ingress resource + endpoints: + - public + # -- Defines the [ingress class](https://kubernetes.io/docs/concepts/services-networking/ingress/#ingress-class) to use + className: "nginx" + # -- TLS [tls class](https://kubernetes.io/docs/concepts/services-networking/ingress/#tls) applied to the ingress resource + tls: + # -- Enables TLS on the ingress resource + enabled: true + # -- If present overwrites the default secret name + secretName: "tls-secret" + ## Adds [cert-manager](https://cert-manager.io/docs/) annotations to the ingress resource + certManager: + # -- If preset enables certificate generation via cert-manager namespace scoped issuer + issuer: "" + # -- If preset enables certificate generation via cert-manager cluster-wide issuer + clusterIssuer: "" + # -- declare where to mount [volumes](https://kubernetes.io/docs/concepts/storage/volumes/) into the container + volumeMounts: [] + # -- [volume](https://kubernetes.io/docs/concepts/storage/volumes/) directories + volumes: [] + # -- [resource management](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) for the container + resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + replicaCount: 1 + autoscaling: + # -- Enables [horizontal pod autoscaling](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/) + enabled: false + # -- Minimal replicas if resource consumption falls below resource threshholds + minReplicas: 1 + # -- Maximum replicas if resource consumption exceeds resource threshholds + maxReplicas: 100 + # -- targetAverageUtilization of cpu provided to a pod + targetCPUUtilizationPercentage: 80 + # -- targetAverageUtilization of memory provided to a pod + targetMemoryUtilizationPercentage: 80 + # -- configuration of the [Open Telemetry Agent](https://opentelemetry.io/docs/instrumentation/java/automatic/agent-config/) to collect and expose metrics + opentelemetry: |- + otel.javaagent.enabled=false + otel.javaagent.debug=false + # -- configuration of the [Java Util Logging Facade](https://docs.oracle.com/javase/7/docs/technotes/guides/logging/overview.html) + logging: |- + .level=INFO + org.eclipse.edc.level=ALL + handlers=java.util.logging.ConsoleHandler + java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter + java.util.logging.ConsoleHandler.level=ALL + java.util.logging.SimpleFormatter.format=[%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS] [%4$-7s] %5$s%6$s%n + # [node selector](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector) to constrain pods to nodes + nodeSelector: {} + # [tolerations](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) to configure preferred nodes + tolerations: [] + # [affinity](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity) to configure which nodes the pods can be scheduled on + affinity: {} + url: + # -- Explicitly declared url for reaching the public api (e.g. if ingresses not used) + public: "" + postgresql: + jdbcUrl: "jdbc:postgresql://postgresqlprovider:5432/edc" + fullnameOverride: "postgresql" + username: + password: + auth: + database: "edc" + username: + password: - # edc.datasource.default.pool.maxIdleConnections= - # edc.datasource.default.pool.maxTotalConnections= - # edc.datasource.default.pool.minIdleConnections= - # edc.datasource.default.pool.testConnectionOnBorrow= - # edc.datasource.default.pool.testConnectionOnCreate= - # edc.datasource.default.pool.testConnectionOnReturn= - # edc.datasource.default.pool.testConnectionWhileIdle= - # edc.datasource.default.pool.testQuery= - edc.datasource.default.url=jdbc:postgresql://provider-postgresql:5432/edc - edc.datasource.default.user= - edc.datasource.default.password= + vault: + fullnameOverride: "vault" + injector: + enabled: false + server: + dev: + enabled: true + devRootToken: "root" + # Must be the same certificate that is configured in section 'daps' + postStart: # must be set externally! + hashicorp: + url: + token: + timeout: 30 + healthCheck: + enabled: true + standbyOk: true + paths: + secret: + health: /v1/sys/health + secretNames: + transferProxyTokenSignerPrivateKey: ids-daps_key + transferProxyTokenSignerPublicKey: ids-daps_crt + transferProxyTokenEncryptionAesKey: edc-encryption-key + dapsPrivateKey: ids-daps_key + dapsPublicKey: ids-daps_crt - edc.data.encryption.algorithm=NONE - edc.data.encryption.keys.alias=edc-encryption-key - # edc.dataplane.selector.httpproxy.url=http://materialpass-edc-provider-dataplane:9999/BPNL000000000000/api/dataplane/control + daps: + fullnameOverride: "daps" + url: "https://daps.beta.demo.catena-x.net" + clientId: + paths: + jwks: /.well-known/jwks.json + token: /token + connectors: + - id: + name: edcconector + attributes: + referringConnector: "https://materialpass.beta.demo.catena-x.net/consumer/" + certificate: - # edc.dpf.selector.url= - # edc.events.topic.endpoint= - # edc.events.topic.name= - # edc.fs.config= - # edc.hostname= - # edc.identity.did.url= - # edc.ids.catalog.id= - # edc.ids.curator= - edc.ids.description="Provider Control Plane" - edc.ids.endpoint=https://materialpass.beta.demo.catena-x.net/BPNL000000000000/api/v1/ids - edc.ids.endpoint.audience=https://materialpass.beta.demo.catena-x.net/BPNL000000000000/api/v1/ids/data + backendService: + httpProxyTokenReceiverUrl: "https://materialpass.beta.demo.catena-x.net/endpoint" - # localhost configuration - # edc.ids.endpoint=http://materialpass-edc-provider-controlplane:8282/BPNL000000000000/api/v1/ids - # edc.ids.endpoint.audience=http://materialpass-edc-provider-controlplane:8282/BPNL000000000000/api/v1/ids/data - # localhost configuration + serviceAccount: + # Specifies whether a service account should be created + create: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + # -- Existing image pull secret bound to the service account to use to [obtain the container image from private registries](https://kubernetes.io/docs/concepts/containers/images/#using-a-private-registry) + imagePullSecrets: [] + + idsdaps: + connectors: + - certificate: - # edc.ids.id= - # edc.ids.maintainer= - # edc.ids.security.profile= - # edc.ids.title= - # edc.ids.validation.referringconnector= - # edc.ion.crawler.did-type= - # edc.ion.crawler.interval-minutes= - # edc.ion.crawler.ion.url= - # edc.metrics.enabled= - # edc.metrics.executor.enabled= - # edc.metrics.jersey.enabled= - # edc.metrics.jetty.enabled= - # edc.metrics.okhttp.enabled= - # edc.metrics.system.enabled= - # edc.negotiation.provider.state-machine.batch-size= - # edc.negotiation.provider.state-machine.batch-size= - edc.oauth.client.id= - edc.oauth.private.key.alias=ids-daps_key - edc.oauth.provider.audience=idsc:IDS_CONNECTORS_ALL - # edc.oauth.provider.jwks.refresh= - edc.oauth.provider.jwks.url=https://daps.beta.demo.catena-x.net/.well-known/jwks.json - edc.oauth.public.key.alias=ids-daps_crt - edc.oauth.token.url=https://daps.beta.demo.catena-x.net/token - # edc.oauth.validation.nbf.leeway= - # edc.receiver.http.auth-code= - # edc.receiver.http.auth-key= - edc.receiver.http.endpoint=http://materialpass-edc-provider-backend - edc.transfer.proxy.endpoint=http://materialpass-edc-provider-dataplane:8185/BPNL000000000000/api/public - # edc.transfer.proxy.token.validity.seconds= - edc.transfer.proxy.token.signer.privatekey.alias=ids-daps_key - edc.transfer.proxy.token.verifier.publickey.alias=ids-daps_crt - # edc.transfer.functions.check.endpoint= - # edc.transfer.functions.enabled.protocols= - # edc.transfer.functions.transfer.endpoint= - # edc.transfer-process-store.database.name= - # edc.transfer.state-machine.batch-size= - # edc.vault= - # edc.vault.certificate= - # edc.vault.clientid= - # edc.vault.clientsecret= - # edc.vault.name= - # edc.vault.tenantid= - edc.vault.hashicorp.url= - edc.vault.hashicorp.token= - edc.vault.hashicorp.api.secret.path= - edc.vault.hashicorp.health.check.standby.ok=true - # edc.vault.hashicorp.timeout.seconds= - # edc.webdid.doh.url= - # edc.web.rest.cors.enabled= - # edc.web.rest.cors.headers= - # edc.web.rest.cors.methods= - # edc.web.rest.cors.origins= - ids.webhook.address=https://materialpass.beta.demo.catena-x.net - # ids.webhook.address=http://materialpass-edc-provider-controlplane:8282 +postgresql: + jdbcUrl: "jdbc:postgresql://postgresqlprovider:5432/edc" + fullnameOverride: "postgresqlprovider" + primary: + persistence: + enabled: true + readReplicas: + persistence: + enabled: true + auth: + database: "edc" + username: + password: diff --git a/deployment/helm/edc-provider/values-int.yaml b/deployment/helm/edc-provider/values-int.yaml index b15ee92e9..e3e77162f 100644 --- a/deployment/helm/edc-provider/values-int.yaml +++ b/deployment/helm/edc-provider/values-int.yaml @@ -1,307 +1,579 @@ -################################################################################# -# Catena-X - Product Passport Consumer Frontend # -# Copyright (c) 2022, 2023 BASF SE, BMW AG, Henkel AG & Co. KGaA +# Copyright (c) 2023 ZF Friedrichshafen AG +# Copyright (c) 2023 Mercedes-Benz Tech Innovation GmbH +# Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +# Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation # -# See the NOTICE file(s) distributed with this work for additional -# information regarding copyright ownership. +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. # -# This program and the accompanying materials are made available under the -# terms of the Apache License, Version 2.0 which is available at -# https://www.apache.org/licenses/LICENSE-2.0. +# This program and the accompanying materials are made available under the +# terms of the Apache License, Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 # -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -# either express or implied. See the -# License for the specific language govern in permissions and limitations -# under the License. +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. # -# SPDX-License-Identifier: Apache-2.0 -################################################################################## +# SPDX-License-Identifier: Apache-2.0 +# + --- -providerbackendapplication: - enabled: true - fullnameOverride: "materialpass-edc-provider-backend" - service: - type: NodePort - frontend: - port: 80 - backend: - port: 8081 -postgres: - enabled: true - fullnameOverride: "provider-postgresql" - auth: - password: - username: &psqlUsername - database: "edc" - persistence: - enabled: true +tractusx-connector: + install: + daps: false + postgresql: false + vault: false + fullnameOverride: "dpp-edc-provider" + nameOverride: "" + # -- Existing image pull secret to use to [obtain the container image from private registries](https://kubernetes.io/docs/concepts/containers/images/#using-a-private-registry) + imagePullSecrets: [] + customLabels: {} -dataplane: - enabled: true - fullnameOverride: "materialpass-edc-provider-dataplane" - image: - repository: ghcr.io/catenax-ng/product-edc/edc-dataplane-hashicorp-vault - tag: 0.1.6 - pullPolicy: IfNotPresent - envSecretName: "provider-dataplane-secret" - edc: + + participant: + id: &bpnNumber "" + + controlplane: + enabled: true + image: + # -- Which derivate of the control plane to use. when left empty the deployment will select the correct image automatically + repository: "tractusx/edc-controlplane-postgresql-hashicorp-vault" + # -- [Kubernetes image pull policy](https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy) to use + pullPolicy: IfNotPresent + # -- Overrides the image tag whose default is the chart appVersion + tag: "0.4.1" + initContainers: [] + debug: + enabled: false + port: 1044 + suspendOnStart: false + internationalDataSpaces: + id: TXDC + description: Tractus-X Eclipse IDS Data Space Connector + title: "" + maintainer: "" + curator: "" + catalogId: TXDC-Catalog + livenessProbe: + # -- Whether to enable kubernetes [liveness-probe](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) + enabled: true + # -- seconds to wait before performing the first liveness check + initialDelaySeconds: 30 + # -- this fields specifies that kubernetes should perform a liveness check every 10 seconds + periodSeconds: 10 + # -- number of seconds after which the probe times out + timeoutSeconds: 5 + # -- when a probe fails kubernetes will try 6 times before giving up + failureThreshold: 6 + # -- number of consecutive successes for the probe to be considered successful after having failed + successThreshold: 1 + readinessProbe: + # -- Whether to enable kubernetes [readiness-probes](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) + enabled: true + # -- seconds to wait before performing the first readiness check + initialDelaySeconds: 30 + # -- this fields specifies that kubernetes should perform a readiness check every 10 seconds + periodSeconds: 10 + # -- number of seconds after which the probe times out + timeoutSeconds: 5 + # -- when a probe fails kubernetes will try 6 times before giving up + failureThreshold: 6 + # -- number of consecutive successes for the probe to be considered successful after having failed + successThreshold: 1 + # -- endpoints of the control plane endpoints: + # -- default api for health checks, should not be added to any ingress default: + # -- port for incoming api calls port: 8080 + # -- path for incoming api calls path: /BPNL000000000000/api - public: - port: 8185 - path: /BPNL000000000000/api/public + # -- data management api, used by internal users, can be added to an ingress and must not be internet facing + management: + # -- port for incoming api calls + port: 8081 + # -- path for incoming api calls + path: /BPNL000000000000/management + # -- authentication key, must be attached to each 'X-Api-Key' request header + authKey: + # -- control api, used for internal control calls. can be added to the internal ingress, but should probably not control: - port: 9999 - path: /BPNL000000000000/api/dataplane/control + # -- port for incoming api calls + port: 8083 + # -- path for incoming api calls + path: /BPNL000000000000/control + # -- ids api, used for inter connector communication and must be internet facing + protocol: + # -- port for incoming api calls + port: 8084 + # -- path for incoming api calls + path: /BPNL000000000000/api/v1/dsp + # -- metrics api, used for application metrics, must not be internet facing metrics: + # -- port for incoming api calls port: 9090 + # -- path for incoming api calls path: /BPNL000000000000/metrics - ingresses: - - enabled: true - hostname: "materialpass.int.demo.catena-x.net" - endpoints: - - default - - public - - control - - metrics - className: "nginx" - tls: - # -- Enables TLS on the ingress resource - enabled: true - # -- If present overwrites the default secret name - secretName: "tls-secret" - opentelemetry: - properties: |- - otel.javaagent.enabled=false - otel.javaagent.debug=false - env: - JAVA_TOOL_OPTIONS: "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=1044" - EDC_DATAPLANE_TOKEN_VALIDATION_ENDPOINT: http://materialpass-edc-provider-controlplane:8182/BPNL000000000000/validation/token + # -- observability api with unsecured access, must not be internet facing + observability: + # -- port for incoming API calls + port: 8085 + # -- observability api, provides /health /readiness and /liveness endpoints + path: /BPNL000000000000/observability + # -- allow or disallow insecure access, i.e. access without authentication + insecure: true + businessPartnerValidation: + log: + agreementValidation: true + service: + # -- [Service type](https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types) to expose the running application on a set of Pods as a network service. + type: ClusterIP + annotations: {} + # -- additional labels for the pod + podLabels: {} + # -- additional annotations for the pod + podAnnotations: {} + # -- The [pod security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod) defines privilege and access control settings for a Pod within the deployment + podSecurityContext: + seccompProfile: + # -- Restrict a Container's Syscalls with seccomp + type: RuntimeDefault + # -- Runs all processes within a pod with a special uid + runAsUser: 10001 + # -- Processes within a pod will belong to this guid + runAsGroup: 10001 + # -- The owner for volumes and any files created within volumes will belong to this guid + fsGroup: 10001 + # The [container security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container) defines privilege and access control settings for a Container within a pod + securityContext: + capabilities: + # -- Specifies which capabilities to drop to reduce syscall attack surface + drop: + - ALL + # -- Specifies which capabilities to add to issue specialized syscalls + add: [] + # -- Whether the root filesystem is mounted in read-only mode + readOnlyRootFilesystem: true + # -- Controls [Privilege Escalation](https://kubernetes.io/docs/concepts/security/pod-security-policy/#privilege-escalation) enabling setuid binaries changing the effective user ID + allowPrivilegeEscalation: false + # -- Requires the container to run without root privileges + runAsNonRoot: true + # -- The container's process will run with the specified uid + runAsUser: 10001 + # Extra environment variables that will be pass onto deployment pods + env: {} + # ENV_NAME: value + + # "valueFrom" environment variable references that will be added to deployment pods. Name is templated. + # ref: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.19/#envvarsource-v1-core + envValueFrom: {} + # ENV_NAME: + # configMapKeyRef: + # name: configmap-name + # key: value_key + # secretKeyRef: + # name: secret-name + # key: value_key + + # [Kubernetes Secret Resource](https://kubernetes.io/docs/concepts/configuration/secret/) names to load environment variables from + envSecretNames: [] + # - first-secret + # - second-secret - EDC_VAULT_HASHICORP_URL: - EDC_VAULT_HASHICORP_API_SECRET_PATH: - EDC_VAULT_HASHICORP_TOKEN: - EDC_OAUTH_TOKEN_URL: https://daps1.int.demo.catena-x.net/token - EDC_OAUTH_PROVIDER_JWKS_URL: https://daps1.int.demo.catena-x.net/.well-known/jwks.json - EDC_OAUTH_PROVIDER_AUDIENCE: idsc:IDS_CONNECTORS_ALL - EDC_VAULT_HASHICORP_HEALTH_CHECK_STANDBY_OK: "true" + # [Kubernetes ConfigMap Resource](https://kubernetes.io/docs/concepts/configuration/configmap/) names to load environment variables from + envConfigMapNames: [] + # - first-config-map + # - second-config-map -controlplane: - enabled: true - fullnameOverride: "materialpass-edc-provider-controlplane" - image: - repository: ghcr.io/catenax-ng/product-edc/edc-controlplane-postgresql-hashicorp-vault - tag: 0.1.6 - pullPolicy: IfNotPresent - edc: + ## Ingress declaration to expose the network service. + ingresses: + ## Public / Internet facing Ingress + - enabled: true + # -- The hostname to be used to precisely map incoming traffic onto the underlying network service + hostname: "materialpass.int.demo.catena-x.net" + # -- Additional ingress annotations to add + annotations: {} + # -- EDC endpoints exposed by this ingress resource + endpoints: + - default + - management + - control + - protocol + - metrics + - observability + # -- Defines the [ingress class](https://kubernetes.io/docs/concepts/services-networking/ingress/#ingress-class) to use + className: "nginx" + # -- TLS [tls class](https://kubernetes.io/docs/concepts/services-networking/ingress/#tls) applied to the ingress resource + tls: + # -- Enables TLS on the ingress resource + enabled: true + # -- If present overwrites the default secret name + secretName: "tls-secret" + ## Adds [cert-manager](https://cert-manager.io/docs/) annotations to the ingress resource + certManager: + # -- If preset enables certificate generation via cert-manager namespace scoped issuer + issuer: "" + # -- If preset enables certificate generation via cert-manager cluster-wide issuer + clusterIssuer: "" + ## Private / Intranet facing Ingress + - enabled: false + # -- The hostname to be used to precisely map incoming traffic onto the underlying network service + hostname: "edc-control.intranet" + # -- Additional ingress annotations to add + annotations: {} + # -- EDC endpoints exposed by this ingress resource + endpoints: + - management + - control + # -- Defines the [ingress class](https://kubernetes.io/docs/concepts/services-networking/ingress/#ingress-class) to use + className: "nginx" + # -- TLS [tls class](https://kubernetes.io/docs/concepts/services-networking/ingress/#tls) applied to the ingress resource + tls: + # -- Enables TLS on the ingress resource + enabled: true + # -- If present overwrites the default secret name + secretName: "tls-secret" + ## Adds [cert-manager](https://cert-manager.io/docs/) annotations to the ingress resource + certManager: + # -- If preset enables certificate generation via cert-manager namespace scoped issuer + issuer: "" + # -- If preset enables certificate generation via cert-manager cluster-wide issuer + clusterIssuer: "" + # -- declare where to mount [volumes](https://kubernetes.io/docs/concepts/storage/volumes/) into the container + volumeMounts: [] + # -- [volume](https://kubernetes.io/docs/concepts/storage/volumes/) directories + volumes: [] + # -- [resource management](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) for the container + resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + replicaCount: 1 + autoscaling: + # -- Enables [horizontal pod autoscaling](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/) + enabled: false + # -- Minimal replicas if resource consumption falls below resource threshholds + minReplicas: 1 + # -- Maximum replicas if resource consumption exceeds resource threshholds + maxReplicas: 100 + # -- targetAverageUtilization of cpu provided to a pod + targetCPUUtilizationPercentage: 80 + # -- targetAverageUtilization of memory provided to a pod + targetMemoryUtilizationPercentage: 80 + # -- configuration of the [Open Telemetry Agent](https://opentelemetry.io/docs/instrumentation/java/automatic/agent-config/) to collect and expose metrics + opentelemetry: |- + otel.javaagent.enabled=false + otel.javaagent.debug=false + # -- configuration of the [Java Util Logging Facade](https://docs.oracle.com/javase/7/docs/technotes/guides/logging/overview.html) + logging: |- + .level=INFO + org.eclipse.edc.level=ALL + handlers=java.util.logging.ConsoleHandler + java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter + java.util.logging.ConsoleHandler.level=ALL + java.util.logging.SimpleFormatter.format=[%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS] [%4$-7s] %5$s%6$s%n + # [node selector](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector) to constrain pods to nodes + nodeSelector: {} + # [tolerations](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) to configure preferred nodes + tolerations: [] + # [affinity](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity) to configure which nodes the pods can be scheduled on + affinity: {} + url: + # -- Explicitly declared url for reaching the ids api (e.g. if ingresses not used) + ids: "" + dataplane: + enabled: true + image: + # -- Which derivate of the data plane to use. when left empty the deployment will select the correct image automatically + repository: "tractusx/edc-dataplane-hashicorp-vault" + # -- [Kubernetes image pull policy](https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy) to use + pullPolicy: IfNotPresent + # -- Overrides the image tag whose default is the chart appVersion + tag: "0.4.1" + initContainers: [] + debug: + enabled: false + port: 1044 + suspendOnStart: false + livenessProbe: + # -- Whether to enable kubernetes [liveness-probe](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) + enabled: true + # -- seconds to wait before performing the first liveness check + initialDelaySeconds: 30 + # -- this fields specifies that kubernetes should perform a liveness check every 10 seconds + periodSeconds: 10 + # -- number of seconds after which the probe times out + timeoutSeconds: 5 + # -- when a probe fails kubernetes will try 6 times before giving up + failureThreshold: 6 + # -- number of consecutive successes for the probe to be considered successful after having failed + successThreshold: 1 + readinessProbe: + # -- Whether to enable kubernetes [readiness-probes](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) + enabled: true + # -- seconds to wait before performing the first readiness check + initialDelaySeconds: 30 + # -- this fields specifies that kubernetes should perform a liveness check every 10 seconds + periodSeconds: 10 + # -- number of seconds after which the probe times out + timeoutSeconds: 5 + # -- when a probe fails kubernetes will try 6 times before giving up + failureThreshold: 6 + # -- number of consecutive successes for the probe to be considered successful after having failed + successThreshold: 1 + service: + # -- [Service type](https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types) to expose the running application on a set of Pods as a network service. + type: ClusterIP + port: 80 endpoints: default: port: 8080 - path: /BPNL000000000000/controlplane/api - data: - port: 8181 - path: /BPNL000000000000/data - validation: - port: 8182 - path: /BPNL000000000000/validation + path: /BPNL000000000000/api + public: + port: 8081 + path: /BPNL000000000000/api/public control: - port: 9999 - path: /BPNL000000000000/api/controlplane/control - ids: - port: 8282 - path: /BPNL000000000000/api/v1/ids + port: 8083 + path: /BPNL000000000000/api/dataplane/control + proxy: + port: 8186 + path: /BPNL000000000000/proxy + observability: + # -- port for incoming API calls + port: 8085 + # -- observability api, provides /health /readiness and /liveness endpoints + path: /BPNL000000000000/observability + # -- allow or disallow insecure access, i.e. access without authentication + insecure: true metrics: port: 9090 - path: /BPNL000000000000/controlplane/metrics - ingresses: - - enabled: true - hostname: "materialpass.int.demo.catena-x.net" - endpoints: - - default - - data - - validation - - control - - ids - - metrics - className: "nginx" - tls: - # -- Enables TLS on the ingress resource - enabled: true - # -- If present overwrites the default secret name - secretName: "tls-secret" - opentelemetry: - properties: |- - otel.javaagent.enabled=false - otel.javaagent.debug=false - envSecretName: "provider-controlplane-secret" - env: - JAVA_TOOL_OPTIONS: "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=1044" - EDC_DATASOURCE_ASSET_NAME: asset - EDC_DATASOURCE_ASSET_USER: *psqlUsername - EDC_DATASOURCE_ASSET_URL: &psqlJdbcUrl "jdbc:postgresql://provider-postgresql:5432/edc" - EDC_DATASOURCE_CONTRACTDEFINITION_NAME: contractdefinition - EDC_DATASOURCE_CONTRACTDEFINITION_USER: *psqlUsername - EDC_DATASOURCE_CONTRACTDEFINITION_URL: *psqlJdbcUrl - EDC_DATASOURCE_CONTRACTNEGOTIATION_NAME: contractnegotiation - EDC_DATASOURCE_CONTRACTNEGOTIATION_USER: *psqlUsername - EDC_DATASOURCE_CONTRACTNEGOTIATION_URL: *psqlJdbcUrl - EDC_DATASOURCE_POLICY_NAME: policy - EDC_DATASOURCE_POLICY_USER: *psqlUsername - EDC_DATASOURCE_POLICY_URL: *psqlJdbcUrl - EDC_DATASOURCE_TRANSFERPROCESS_NAME: transferprocess - EDC_DATASOURCE_TRANSFERPROCESS_USER: *psqlUsername - EDC_DATASOURCE_TRANSFERPROCESS_URL: *psqlJdbcUrl - EDC_API_AUTH_KEY: - EDC_VAULT_HASHICORP_URL: - EDC_VAULT_HASHICORP_API_SECRET_PATH: - EDC_VAULT_HASHICORP_TOKEN: - EDC_VAULT_HASHICORP_HEALTH_CHECK_STANDBY_OK: "true" + path: /BPNL000000000000/metrics + aws: + endpointOverride: "" + accessKeyId: "" + secretAccessKey: "" + # -- additional labels for the pod + podLabels: {} + # -- additional annotations for the pod + podAnnotations: {} + # -- The [pod security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod) defines privilege and access control settings for a Pod within the deployment + podSecurityContext: + seccompProfile: + # -- Restrict a Container's Syscalls with seccomp + type: RuntimeDefault + # -- Runs all processes within a pod with a special uid + runAsUser: 10001 + # -- Processes within a pod will belong to this guid + runAsGroup: 10001 + # -- The owner for volumes and any files created within volumes will belong to this guid + fsGroup: 10001 + # The [container security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container) defines privilege and access control settings for a Container within a pod + securityContext: + capabilities: + # -- Specifies which capabilities to drop to reduce syscall attack surface + drop: + - ALL + # -- Specifies which capabilities to add to issue specialized syscalls + add: [] + # -- Whether the root filesystem is mounted in read-only mode + readOnlyRootFilesystem: true + # -- Controls [Privilege Escalation](https://kubernetes.io/docs/concepts/security/pod-security-policy/#privilege-escalation) enabling setuid binaries changing the effective user ID + allowPrivilegeEscalation: false + # -- Requires the container to run without root privileges + runAsNonRoot: true + # -- The container's process will run with the specified uid + runAsUser: 10001 + # Extra environment variables that will be pass onto deployment pods + env: {} + # ENV_NAME: value - - EDC_DATAPLANE_SELECTOR_PROVIDERPLANE_URL: http://materialpass-edc-provider-dataplane:9999/BPNL000000000000/api/dataplane/control - EDC_DATAPLANE_SELECTOR_PROVIDERPLANE_SOURCETYPES : HttpData - EDC_DATAPLANE_SELECTOR_PROVIDERPLANE_DESTINATIONTYPES: HttpProxy - EDC_DATAPLANE_SELECTOR_PROVIDERPLANE_PROPERTIES: >- - { - "publicApiUrl": "http://materialpass-edc-provider-dataplane:8185/BPNL000000000000/api/public" - } - - configuration: - properties: |- - #edc.api.auth.key= - # edc.atomikos.checkpoint.interval= - # edc.atomikos.directory= - # edc.atomikos.logging= - # edc.atomikos.threaded2pc= - # edc.atomikos.timeout= - # edc.aws.access.key= - # edc.aws.provision.retry.retries.max= - # edc.aws.provision.role.duration.session.max= - # edc.aws.secret.access.key= - # edc.blobstore.endpoint= - # edc.controlplane.validation-endpoint= - # edc.core.retry.backoff.max= - # edc.core.retry.backoff.min= - # edc.core.retry.retries.max= - # edc.core.system.health.check.liveness-period= - # edc.core.system.health.check.readiness-period= - # edc.core.system.health.check.startup-period= - # edc.core.system.health.check.threadpool-size= - # edc.dataplane.queue.capacity= - # edc.dataplane.wait= - # edc.dataplane.workers= - edc.datasource.asset.name=asset - edc.datasource.asset.user= - edc.datasource.asset.url=jdbc:postgresql://provider-postgresql:5432/edc - - edc.datasource.contractdefinition.name=contractdefinition - edc.datasource.contractdefinition.user= - edc.datasource.contractdefinition.url=jdbc:postgresql://provider-postgresql:5432/edc + # "valueFrom" environment variable references that will be added to deployment pods. Name is templated. + # ref: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.19/#envvarsource-v1-core + envValueFrom: {} + # ENV_NAME: + # configMapKeyRef: + # name: configmap-name + # key: value_key + # secretKeyRef: + # name: secret-name + # key: value_key - edc.datasource.contractnegotiation.name=contractnegotiation - edc.datasource.contractnegotiation.user= - edc.datasource.contractnegotiation.url=jdbc:postgresql://provider-postgresql:5432/edc + # [Kubernetes Secret Resource](https://kubernetes.io/docs/concepts/configuration/secret/) names to load environment variables from + envSecretNames: [] + # - first-secret + # - second-secret - edc.datasource.policy.name=policy - edc.datasource.policy.user= - edc.datasource.policy.url=jdbc:postgresql://provider-postgresql:5432/edc + # [Kubernetes ConfigMap Resource](https://kubernetes.io/docs/concepts/configuration/configmap/) names to load environment variables from + envConfigMapNames: [] + # - first-config-map + # - second-config-map - edc.datasource.transferprocess.name=transferprocess - edc.datasource.transferprocess.user= - edc.datasource.transferprocess.url=jdbc:postgresql://provider-postgresql:5432/edc + ## Ingress declaration to expose the network service. + ingresses: + ## Public / Internet facing Ingress + - enabled: true + # -- The hostname to be used to precisely map incoming traffic onto the underlying network service + hostname: "materialpass.int.demo.catena-x.net" + # -- Additional ingress annotations to add + annotations: {} + # -- EDC endpoints exposed by this ingress resource + endpoints: + - public + # -- Defines the [ingress class](https://kubernetes.io/docs/concepts/services-networking/ingress/#ingress-class) to use + className: "nginx" + # -- TLS [tls class](https://kubernetes.io/docs/concepts/services-networking/ingress/#tls) applied to the ingress resource + tls: + # -- Enables TLS on the ingress resource + enabled: true + # -- If present overwrites the default secret name + secretName: "tls-secret" + ## Adds [cert-manager](https://cert-manager.io/docs/) annotations to the ingress resource + certManager: + # -- If preset enables certificate generation via cert-manager namespace scoped issuer + issuer: "" + # -- If preset enables certificate generation via cert-manager cluster-wide issuer + clusterIssuer: "" + # -- declare where to mount [volumes](https://kubernetes.io/docs/concepts/storage/volumes/) into the container + volumeMounts: [] + # -- [volume](https://kubernetes.io/docs/concepts/storage/volumes/) directories + volumes: [] + # -- [resource management](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) for the container + resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + replicaCount: 1 + autoscaling: + # -- Enables [horizontal pod autoscaling](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/) + enabled: false + # -- Minimal replicas if resource consumption falls below resource threshholds + minReplicas: 1 + # -- Maximum replicas if resource consumption exceeds resource threshholds + maxReplicas: 100 + # -- targetAverageUtilization of cpu provided to a pod + targetCPUUtilizationPercentage: 80 + # -- targetAverageUtilization of memory provided to a pod + targetMemoryUtilizationPercentage: 80 + # -- configuration of the [Open Telemetry Agent](https://opentelemetry.io/docs/instrumentation/java/automatic/agent-config/) to collect and expose metrics + opentelemetry: |- + otel.javaagent.enabled=false + otel.javaagent.debug=false + # -- configuration of the [Java Util Logging Facade](https://docs.oracle.com/javase/7/docs/technotes/guides/logging/overview.html) + logging: |- + .level=INFO + org.eclipse.edc.level=ALL + handlers=java.util.logging.ConsoleHandler + java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter + java.util.logging.ConsoleHandler.level=ALL + java.util.logging.SimpleFormatter.format=[%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS] [%4$-7s] %5$s%6$s%n + # [node selector](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector) to constrain pods to nodes + nodeSelector: {} + # [tolerations](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) to configure preferred nodes + tolerations: [] + # [affinity](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity) to configure which nodes the pods can be scheduled on + affinity: {} + url: + # -- Explicitly declared url for reaching the public api (e.g. if ingresses not used) + public: "" + postgresql: + jdbcUrl: "jdbc:postgresql://postgresqlprovider:5432/edc" + fullnameOverride: "postgresql" + username: + password: + auth: + database: "edc" + username: + password: - # edc.datasource.default.pool.maxIdleConnections= - # edc.datasource.default.pool.maxTotalConnections= - # edc.datasource.default.pool.minIdleConnections= - # edc.datasource.default.pool.testConnectionOnBorrow= - # edc.datasource.default.pool.testConnectionOnCreate= - # edc.datasource.default.pool.testConnectionOnReturn= - # edc.datasource.default.pool.testConnectionWhileIdle= - # edc.datasource.default.pool.testQuery= - edc.datasource.default.url=jdbc:postgresql://provider-postgresql:5432/edc - edc.datasource.default.user= - edc.datasource.default.password= + vault: + fullnameOverride: "vault" + injector: + enabled: false + server: + dev: + enabled: true + devRootToken: "root" + # Must be the same certificate that is configured in section 'daps' + postStart: # must be set externally! + hashicorp: + url: + token: + timeout: 30 + healthCheck: + enabled: true + standbyOk: true + paths: + secret: + health: /v1/sys/health + secretNames: + transferProxyTokenSignerPrivateKey: ids-daps_key + transferProxyTokenSignerPublicKey: ids-daps_crt + transferProxyTokenEncryptionAesKey: edc-encryption-key + dapsPrivateKey: ids-daps_key + dapsPublicKey: ids-daps_crt - edc.data.encryption.algorithm=NONE - edc.data.encryption.keys.alias=edc-encryption-key - # edc.dataplane.selector.httpproxy.url=http://materialpass-edc-provider-dataplane:9999/BPNL000000000000/api/dataplane/control + daps: + fullnameOverride: "daps" + url: "https://daps1.int.demo.catena-x.net" + clientId: + paths: + jwks: /.well-known/jwks.json + token: /token + connectors: + - id: + name: edcconector + attributes: + referringConnector: "https://materialpass.int.demo.catena-x.net/consumer/" + certificate: - # edc.dpf.selector.url= - # edc.events.topic.endpoint= - # edc.events.topic.name= - # edc.fs.config= - # edc.hostname= - # edc.identity.did.url= - # edc.ids.catalog.id= - # edc.ids.curator= - edc.ids.description="Provider Control Plane" - edc.ids.endpoint=https://materialpass.int.demo.catena-x.net/BPNL000000000000/api/v1/ids - edc.ids.endpoint.audience=https://materialpass.int.demo.catena-x.net/BPNL000000000000/api/v1/ids/data + backendService: + httpProxyTokenReceiverUrl: "https://materialpass.int.demo.catena-x.net/endpoint" - # localhost configuration - # edc.ids.endpoint=http://materialpass-edc-provider-controlplane:8282/BPNL000000000000/api/v1/ids - # edc.ids.endpoint.audience=http://materialpass-edc-provider-controlplane:8282/BPNL000000000000/api/v1/ids/data - # localhost configuration + serviceAccount: + # Specifies whether a service account should be created + create: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + # -- Existing image pull secret bound to the service account to use to [obtain the container image from private registries](https://kubernetes.io/docs/concepts/containers/images/#using-a-private-registry) + imagePullSecrets: [] + + idsdaps: + connectors: + - certificate: - # edc.ids.id= - # edc.ids.maintainer= - # edc.ids.security.profile= - # edc.ids.title= - # edc.ids.validation.referringconnector= - # edc.ion.crawler.did-type= - # edc.ion.crawler.interval-minutes= - # edc.ion.crawler.ion.url= - # edc.metrics.enabled= - # edc.metrics.executor.enabled= - # edc.metrics.jersey.enabled= - # edc.metrics.jetty.enabled= - # edc.metrics.okhttp.enabled= - # edc.metrics.system.enabled= - # edc.negotiation.provider.state-machine.batch-size= - # edc.negotiation.provider.state-machine.batch-size= - edc.oauth.client.id= - edc.oauth.private.key.alias=ids-daps_key - edc.oauth.provider.audience=idsc:IDS_CONNECTORS_ALL - # edc.oauth.provider.jwks.refresh= - edc.oauth.provider.jwks.url=https://daps1.int.demo.catena-x.net/.well-known/jwks.json - edc.oauth.public.key.alias=ids-daps_crt - edc.oauth.token.url=https://daps1.int.demo.catena-x.net/token - # edc.oauth.validation.nbf.leeway= - # edc.receiver.http.auth-code= - # edc.receiver.http.auth-key= - edc.receiver.http.endpoint=http://materialpass-edc-provider-backend - edc.transfer.proxy.endpoint=http://materialpass-edc-provider-dataplane:8185/BPNL000000000000/api/public - # edc.transfer.proxy.token.validity.seconds= - edc.transfer.proxy.token.signer.privatekey.alias=ids-daps_key - edc.transfer.proxy.token.verifier.publickey.alias=ids-daps_crt - # edc.transfer.functions.check.endpoint= - # edc.transfer.functions.enabled.protocols= - # edc.transfer.functions.transfer.endpoint= - # edc.transfer-process-store.database.name= - # edc.transfer.state-machine.batch-size= - # edc.vault= - # edc.vault.certificate= - # edc.vault.clientid= - # edc.vault.clientsecret= - # edc.vault.name= - # edc.vault.tenantid= - edc.vault.hashicorp.url= - edc.vault.hashicorp.token= - edc.vault.hashicorp.api.secret.path= - edc.vault.hashicorp.health.check.standby.ok=true - # edc.vault.hashicorp.timeout.seconds= - # edc.webdid.doh.url= - # edc.web.rest.cors.enabled= - # edc.web.rest.cors.headers= - # edc.web.rest.cors.methods= - # edc.web.rest.cors.origins= - ids.webhook.address=https://materialpass.int.demo.catena-x.net - # ids.webhook.address=http://materialpass-edc-provider-controlplane:8282 +postgresql: + jdbcUrl: "jdbc:postgresql://postgresqlprovider:5432/edc" + fullnameOverride: "postgresqlprovider" + primary: + persistence: + enabled: true + readReplicas: + persistence: + enabled: true + auth: + database: "edc" + username: + password: diff --git a/deployment/helm/edc-provider/values.yaml b/deployment/helm/edc-provider/values.yaml new file mode 100644 index 000000000..3cd551429 --- /dev/null +++ b/deployment/helm/edc-provider/values.yaml @@ -0,0 +1,580 @@ +# +# Copyright (c) 2023 ZF Friedrichshafen AG +# Copyright (c) 2023 Mercedes-Benz Tech Innovation GmbH +# Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +# Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License, Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +# SPDX-License-Identifier: Apache-2.0 +# + + +--- + + +tractusx-connector: + install: + daps: false + postgresql: false + vault: false + fullnameOverride: "dpp-edc-provider" + nameOverride: "" + # -- Existing image pull secret to use to [obtain the container image from private registries](https://kubernetes.io/docs/concepts/containers/images/#using-a-private-registry) + imagePullSecrets: [] + customLabels: {} + + + participant: + id: &bpnNumber "" + + controlplane: + enabled: true + image: + # -- Which derivate of the control plane to use. when left empty the deployment will select the correct image automatically + repository: "tractusx/edc-controlplane-postgresql-hashicorp-vault" + # -- [Kubernetes image pull policy](https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy) to use + pullPolicy: IfNotPresent + # -- Overrides the image tag whose default is the chart appVersion + tag: "0.4.1" + initContainers: [] + debug: + enabled: false + port: 1044 + suspendOnStart: false + internationalDataSpaces: + id: TXDC + description: Tractus-X Eclipse IDS Data Space Connector + title: "" + maintainer: "" + curator: "" + catalogId: TXDC-Catalog + livenessProbe: + # -- Whether to enable kubernetes [liveness-probe](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) + enabled: true + # -- seconds to wait before performing the first liveness check + initialDelaySeconds: 30 + # -- this fields specifies that kubernetes should perform a liveness check every 10 seconds + periodSeconds: 10 + # -- number of seconds after which the probe times out + timeoutSeconds: 5 + # -- when a probe fails kubernetes will try 6 times before giving up + failureThreshold: 6 + # -- number of consecutive successes for the probe to be considered successful after having failed + successThreshold: 1 + readinessProbe: + # -- Whether to enable kubernetes [readiness-probes](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) + enabled: true + # -- seconds to wait before performing the first readiness check + initialDelaySeconds: 30 + # -- this fields specifies that kubernetes should perform a readiness check every 10 seconds + periodSeconds: 10 + # -- number of seconds after which the probe times out + timeoutSeconds: 5 + # -- when a probe fails kubernetes will try 6 times before giving up + failureThreshold: 6 + # -- number of consecutive successes for the probe to be considered successful after having failed + successThreshold: 1 + # -- endpoints of the control plane + endpoints: + # -- default api for health checks, should not be added to any ingress + default: + # -- port for incoming api calls + port: 8080 + # -- path for incoming api calls + path: /BPNL000000000000/api + # -- data management api, used by internal users, can be added to an ingress and must not be internet facing + management: + # -- port for incoming api calls + port: 8081 + # -- path for incoming api calls + path: /BPNL000000000000/management + # -- authentication key, must be attached to each 'X-Api-Key' request header + authKey: + # -- control api, used for internal control calls. can be added to the internal ingress, but should probably not + control: + # -- port for incoming api calls + port: 8083 + # -- path for incoming api calls + path: /BPNL000000000000/control + # -- ids api, used for inter connector communication and must be internet facing + protocol: + # -- port for incoming api calls + port: 8084 + # -- path for incoming api calls + path: /BPNL000000000000/api/v1/dsp + # -- metrics api, used for application metrics, must not be internet facing + metrics: + # -- port for incoming api calls + port: 9090 + # -- path for incoming api calls + path: /BPNL000000000000/metrics + # -- observability api with unsecured access, must not be internet facing + observability: + # -- port for incoming API calls + port: 8085 + # -- observability api, provides /health /readiness and /liveness endpoints + path: /BPNL000000000000/observability + # -- allow or disallow insecure access, i.e. access without authentication + insecure: true + businessPartnerValidation: + log: + agreementValidation: true + service: + # -- [Service type](https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types) to expose the running application on a set of Pods as a network service. + type: ClusterIP + annotations: {} + # -- additional labels for the pod + podLabels: {} + # -- additional annotations for the pod + podAnnotations: {} + # -- The [pod security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod) defines privilege and access control settings for a Pod within the deployment + podSecurityContext: + seccompProfile: + # -- Restrict a Container's Syscalls with seccomp + type: RuntimeDefault + # -- Runs all processes within a pod with a special uid + runAsUser: 10001 + # -- Processes within a pod will belong to this guid + runAsGroup: 10001 + # -- The owner for volumes and any files created within volumes will belong to this guid + fsGroup: 10001 + # The [container security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container) defines privilege and access control settings for a Container within a pod + securityContext: + capabilities: + # -- Specifies which capabilities to drop to reduce syscall attack surface + drop: + - ALL + # -- Specifies which capabilities to add to issue specialized syscalls + add: [] + # -- Whether the root filesystem is mounted in read-only mode + readOnlyRootFilesystem: true + # -- Controls [Privilege Escalation](https://kubernetes.io/docs/concepts/security/pod-security-policy/#privilege-escalation) enabling setuid binaries changing the effective user ID + allowPrivilegeEscalation: false + # -- Requires the container to run without root privileges + runAsNonRoot: true + # -- The container's process will run with the specified uid + runAsUser: 10001 + # Extra environment variables that will be pass onto deployment pods + env: {} + # ENV_NAME: value + + # "valueFrom" environment variable references that will be added to deployment pods. Name is templated. + # ref: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.19/#envvarsource-v1-core + envValueFrom: {} + # ENV_NAME: + # configMapKeyRef: + # name: configmap-name + # key: value_key + # secretKeyRef: + # name: secret-name + # key: value_key + + # [Kubernetes Secret Resource](https://kubernetes.io/docs/concepts/configuration/secret/) names to load environment variables from + envSecretNames: [] + # - first-secret + # - second-secret + + # [Kubernetes ConfigMap Resource](https://kubernetes.io/docs/concepts/configuration/configmap/) names to load environment variables from + envConfigMapNames: [] + # - first-config-map + # - second-config-map + + ## Ingress declaration to expose the network service. + ingresses: + ## Public / Internet facing Ingress + - enabled: true + # -- The hostname to be used to precisely map incoming traffic onto the underlying network service + hostname: "materialpass.dev.demo.catena-x.net" + # -- Additional ingress annotations to add + annotations: {} + # -- EDC endpoints exposed by this ingress resource + endpoints: + - default + - management + - control + - protocol + - metrics + - observability + # -- Defines the [ingress class](https://kubernetes.io/docs/concepts/services-networking/ingress/#ingress-class) to use + className: "nginx" + # -- TLS [tls class](https://kubernetes.io/docs/concepts/services-networking/ingress/#tls) applied to the ingress resource + tls: + # -- Enables TLS on the ingress resource + enabled: true + # -- If present overwrites the default secret name + secretName: "tls-secret" + ## Adds [cert-manager](https://cert-manager.io/docs/) annotations to the ingress resource + certManager: + # -- If preset enables certificate generation via cert-manager namespace scoped issuer + issuer: "" + # -- If preset enables certificate generation via cert-manager cluster-wide issuer + clusterIssuer: "" + ## Private / Intranet facing Ingress + - enabled: false + # -- The hostname to be used to precisely map incoming traffic onto the underlying network service + hostname: "edc-control.intranet" + # -- Additional ingress annotations to add + annotations: {} + # -- EDC endpoints exposed by this ingress resource + endpoints: + - management + - control + # -- Defines the [ingress class](https://kubernetes.io/docs/concepts/services-networking/ingress/#ingress-class) to use + className: "nginx" + # -- TLS [tls class](https://kubernetes.io/docs/concepts/services-networking/ingress/#tls) applied to the ingress resource + tls: + # -- Enables TLS on the ingress resource + enabled: true + # -- If present overwrites the default secret name + secretName: "tls-secret" + ## Adds [cert-manager](https://cert-manager.io/docs/) annotations to the ingress resource + certManager: + # -- If preset enables certificate generation via cert-manager namespace scoped issuer + issuer: "" + # -- If preset enables certificate generation via cert-manager cluster-wide issuer + clusterIssuer: "" + # -- declare where to mount [volumes](https://kubernetes.io/docs/concepts/storage/volumes/) into the container + volumeMounts: [] + # -- [volume](https://kubernetes.io/docs/concepts/storage/volumes/) directories + volumes: [] + # -- [resource management](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) for the container + resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + replicaCount: 1 + autoscaling: + # -- Enables [horizontal pod autoscaling](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/) + enabled: false + # -- Minimal replicas if resource consumption falls below resource threshholds + minReplicas: 1 + # -- Maximum replicas if resource consumption exceeds resource threshholds + maxReplicas: 100 + # -- targetAverageUtilization of cpu provided to a pod + targetCPUUtilizationPercentage: 80 + # -- targetAverageUtilization of memory provided to a pod + targetMemoryUtilizationPercentage: 80 + # -- configuration of the [Open Telemetry Agent](https://opentelemetry.io/docs/instrumentation/java/automatic/agent-config/) to collect and expose metrics + opentelemetry: |- + otel.javaagent.enabled=false + otel.javaagent.debug=false + # -- configuration of the [Java Util Logging Facade](https://docs.oracle.com/javase/7/docs/technotes/guides/logging/overview.html) + logging: |- + .level=INFO + org.eclipse.edc.level=ALL + handlers=java.util.logging.ConsoleHandler + java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter + java.util.logging.ConsoleHandler.level=ALL + java.util.logging.SimpleFormatter.format=[%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS] [%4$-7s] %5$s%6$s%n + # [node selector](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector) to constrain pods to nodes + nodeSelector: {} + # [tolerations](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) to configure preferred nodes + tolerations: [] + # [affinity](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity) to configure which nodes the pods can be scheduled on + affinity: {} + url: + # -- Explicitly declared url for reaching the ids api (e.g. if ingresses not used) + ids: "" + dataplane: + enabled: true + image: + # -- Which derivate of the data plane to use. when left empty the deployment will select the correct image automatically + repository: "tractusx/edc-dataplane-hashicorp-vault" + # -- [Kubernetes image pull policy](https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy) to use + pullPolicy: IfNotPresent + # -- Overrides the image tag whose default is the chart appVersion + tag: "0.4.1" + initContainers: [] + debug: + enabled: false + port: 1044 + suspendOnStart: false + livenessProbe: + # -- Whether to enable kubernetes [liveness-probe](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) + enabled: true + # -- seconds to wait before performing the first liveness check + initialDelaySeconds: 30 + # -- this fields specifies that kubernetes should perform a liveness check every 10 seconds + periodSeconds: 10 + # -- number of seconds after which the probe times out + timeoutSeconds: 5 + # -- when a probe fails kubernetes will try 6 times before giving up + failureThreshold: 6 + # -- number of consecutive successes for the probe to be considered successful after having failed + successThreshold: 1 + readinessProbe: + # -- Whether to enable kubernetes [readiness-probes](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) + enabled: true + # -- seconds to wait before performing the first readiness check + initialDelaySeconds: 30 + # -- this fields specifies that kubernetes should perform a liveness check every 10 seconds + periodSeconds: 10 + # -- number of seconds after which the probe times out + timeoutSeconds: 5 + # -- when a probe fails kubernetes will try 6 times before giving up + failureThreshold: 6 + # -- number of consecutive successes for the probe to be considered successful after having failed + successThreshold: 1 + service: + # -- [Service type](https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types) to expose the running application on a set of Pods as a network service. + type: ClusterIP + port: 80 + endpoints: + default: + port: 8080 + path: /BPNL000000000000/api + public: + port: 8081 + path: /BPNL000000000000/api/public + control: + port: 8083 + path: /BPNL000000000000/api/dataplane/control + proxy: + port: 8186 + path: /BPNL000000000000/proxy + observability: + # -- port for incoming API calls + port: 8085 + # -- observability api, provides /health /readiness and /liveness endpoints + path: /BPNL000000000000/observability + # -- allow or disallow insecure access, i.e. access without authentication + insecure: true + metrics: + port: 9090 + path: /BPNL000000000000/metrics + aws: + endpointOverride: "" + accessKeyId: "" + secretAccessKey: "" + # -- additional labels for the pod + podLabels: {} + # -- additional annotations for the pod + podAnnotations: {} + # -- The [pod security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod) defines privilege and access control settings for a Pod within the deployment + podSecurityContext: + seccompProfile: + # -- Restrict a Container's Syscalls with seccomp + type: RuntimeDefault + # -- Runs all processes within a pod with a special uid + runAsUser: 10001 + # -- Processes within a pod will belong to this guid + runAsGroup: 10001 + # -- The owner for volumes and any files created within volumes will belong to this guid + fsGroup: 10001 + # The [container security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container) defines privilege and access control settings for a Container within a pod + securityContext: + capabilities: + # -- Specifies which capabilities to drop to reduce syscall attack surface + drop: + - ALL + # -- Specifies which capabilities to add to issue specialized syscalls + add: [] + # -- Whether the root filesystem is mounted in read-only mode + readOnlyRootFilesystem: true + # -- Controls [Privilege Escalation](https://kubernetes.io/docs/concepts/security/pod-security-policy/#privilege-escalation) enabling setuid binaries changing the effective user ID + allowPrivilegeEscalation: false + # -- Requires the container to run without root privileges + runAsNonRoot: true + # -- The container's process will run with the specified uid + runAsUser: 10001 + # Extra environment variables that will be pass onto deployment pods + env: {} + # ENV_NAME: value + + # "valueFrom" environment variable references that will be added to deployment pods. Name is templated. + # ref: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.19/#envvarsource-v1-core + envValueFrom: {} + # ENV_NAME: + # configMapKeyRef: + # name: configmap-name + # key: value_key + # secretKeyRef: + # name: secret-name + # key: value_key + + # [Kubernetes Secret Resource](https://kubernetes.io/docs/concepts/configuration/secret/) names to load environment variables from + envSecretNames: [] + # - first-secret + # - second-secret + + # [Kubernetes ConfigMap Resource](https://kubernetes.io/docs/concepts/configuration/configmap/) names to load environment variables from + envConfigMapNames: [] + # - first-config-map + # - second-config-map + + ## Ingress declaration to expose the network service. + ingresses: + ## Public / Internet facing Ingress + - enabled: true + # -- The hostname to be used to precisely map incoming traffic onto the underlying network service + hostname: "materialpass.dev.demo.catena-x.net" + # -- Additional ingress annotations to add + annotations: {} + # -- EDC endpoints exposed by this ingress resource + endpoints: + - public + # -- Defines the [ingress class](https://kubernetes.io/docs/concepts/services-networking/ingress/#ingress-class) to use + className: "nginx" + # -- TLS [tls class](https://kubernetes.io/docs/concepts/services-networking/ingress/#tls) applied to the ingress resource + tls: + # -- Enables TLS on the ingress resource + enabled: true + # -- If present overwrites the default secret name + secretName: "tls-secret" + ## Adds [cert-manager](https://cert-manager.io/docs/) annotations to the ingress resource + certManager: + # -- If preset enables certificate generation via cert-manager namespace scoped issuer + issuer: "" + # -- If preset enables certificate generation via cert-manager cluster-wide issuer + clusterIssuer: "" + # -- declare where to mount [volumes](https://kubernetes.io/docs/concepts/storage/volumes/) into the container + volumeMounts: [] + # -- [volume](https://kubernetes.io/docs/concepts/storage/volumes/) directories + volumes: [] + # -- [resource management](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) for the container + resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + replicaCount: 1 + autoscaling: + # -- Enables [horizontal pod autoscaling](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/) + enabled: false + # -- Minimal replicas if resource consumption falls below resource threshholds + minReplicas: 1 + # -- Maximum replicas if resource consumption exceeds resource threshholds + maxReplicas: 100 + # -- targetAverageUtilization of cpu provided to a pod + targetCPUUtilizationPercentage: 80 + # -- targetAverageUtilization of memory provided to a pod + targetMemoryUtilizationPercentage: 80 + # -- configuration of the [Open Telemetry Agent](https://opentelemetry.io/docs/instrumentation/java/automatic/agent-config/) to collect and expose metrics + opentelemetry: |- + otel.javaagent.enabled=false + otel.javaagent.debug=false + # -- configuration of the [Java Util Logging Facade](https://docs.oracle.com/javase/7/docs/technotes/guides/logging/overview.html) + logging: |- + .level=INFO + org.eclipse.edc.level=ALL + handlers=java.util.logging.ConsoleHandler + java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter + java.util.logging.ConsoleHandler.level=ALL + java.util.logging.SimpleFormatter.format=[%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS] [%4$-7s] %5$s%6$s%n + # [node selector](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector) to constrain pods to nodes + nodeSelector: {} + # [tolerations](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) to configure preferred nodes + tolerations: [] + # [affinity](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity) to configure which nodes the pods can be scheduled on + affinity: {} + url: + # -- Explicitly declared url for reaching the public api (e.g. if ingresses not used) + public: "" + + postgresql: + jdbcUrl: "jdbc:postgresql://postgresqlprovider:5432/edc" + fullnameOverride: "postgresql" + username: + password: + auth: + database: "edc" + username: + password: + + vault: + fullnameOverride: "vault" + injector: + enabled: false + server: + dev: + enabled: true + devRootToken: "root" + # Must be the same certificate that is configured in section 'daps' + postStart: # must be set externally! + hashicorp: + url: + token: + timeout: 30 + healthCheck: + enabled: true + standbyOk: true + paths: + secret: + health: /v1/sys/health + secretNames: + transferProxyTokenSignerPrivateKey: daps-key-dev + transferProxyTokenSignerPublicKey: daps-crt-dev + transferProxyTokenEncryptionAesKey: edc-encryption-key + dapsPrivateKey: daps-key-dev + dapsPublicKey: daps-crt-dev + + daps: + fullnameOverride: "daps" + url: "https://daps1.int.demo.catena-x.net" + clientId: + paths: + jwks: /.well-known/jwks.json + token: /token + connectors: + - id: + name: edcconector + attributes: + referringConnector: "https://materialpass.dev.demo.catena-x.net/consumer/" + certificate: + + backendService: + httpProxyTokenReceiverUrl: "https://materialpass.dev.demo.catena-x.net/endpoint" + + serviceAccount: + # Specifies whether a service account should be created + create: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + # -- Existing image pull secret bound to the service account to use to [obtain the container image from private registries](https://kubernetes.io/docs/concepts/containers/images/#using-a-private-registry) + imagePullSecrets: [] + + idsdaps: + connectors: + - certificate: + +postgresql: + jdbcUrl: "jdbc:postgresql://postgresqlprovider:5432/edc" + fullnameOverride: "postgresqlprovider" + primary: + persistence: + enabled: true + readReplicas: + persistence: + enabled: true + auth: + database: "edc" + username: + password: \ No newline at end of file diff --git a/docs/RELEASE_USER.md b/docs/RELEASE_USER.md index c640e3a99..952ddd29e 100644 --- a/docs/RELEASE_USER.md +++ b/docs/RELEASE_USER.md @@ -23,6 +23,46 @@ # Release Notes Digital Product Pass Application User friendly relase notes without especific technical details. +**xxxx xx xxxx (Version 1.0.0)** +*xx.xx.xxxx* + +### Added + +#### Made backend asynchronous. +By creating a asynchronous backend we are improving the control that the user has over the contract negotiation. +Now the user can decline, cancel and sign the contract requests and visualize the status of the negotiation. +Now the backend is also negotiating faster with the EDC `v0.4.1` so that is quicker and optimized + + +#### Added file system negotiation logs. +Each process stores in the container file system (non persistent) the contract negotiation files as well the information for the transfer process. + +### Security Improvements + +#### Added a new layer of security in the contract negotiation +Allow only the user to sign, decline or cancel the contract negotiation by using a session token generated uniquely in the backend and asigned to the user. +That means that only the user can access its own data. And the backend will make sure that everything is correct otherwise no action is taken. + +#### Added cryptography to the passport transfer process +As defined in the documentation of the EDC the passport must be store in the backend until the user requests for its retrieval. +We are now encrypting the passport when it arrives from the EDC consumer data plane and we alse asure that the user will be the only one that can decrypt it. Once the user requests the passport it is destroyed and no longer available. + + + + +### Updated + +#### Update the postman colections and the infrastructure related topics +Now is easier to configure the provider backend for the version `v0.4.1` of the EDC. + + + + +#### Removed cx-backend-service support +The backend application fully substituted the cx-backend-service by unwrapping the token and storing the information encrypted (an improvement in comparation with the cx-backend-service) +The API that should be used is `/endpoint` + + **June 20 2023 (Version 0.9.0)** *20.06.2023* @@ -55,7 +95,6 @@ Now the frontend is able to load all the application without giving 502 errors. #### Updated version from Vite Library The vite library version was updated to version `4.1.5` to fix a vulnerability. - **May 18 2023 (Version 0.8.0)** *18.05.2023* diff --git a/package-lock.json b/package-lock.json index c8fb9f3f5..28767830c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "productpass-consumer-ui", - "version": "0.9.0", + "version": "1.0.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "productpass-consumer-ui", - "version": "0.9.0", + "version": "1.0.0", "dependencies": { "@mdi/font": "5.9.55", "@popperjs/core": "^2.11.2", diff --git a/package.json b/package.json index 7bc33ad74..a8525cdde 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "productpass-consumer-ui", - "version": "0.9.0", + "version": "1.0.0", "private": true, "scripts": { "serve": "vite --host localhost", From 7007616e88a383bb07043855086f7e1ef49e9644 Mon Sep 17 00:00:00 2001 From: Mathias Brunkow Moser Date: Tue, 27 Jun 2023 11:41:42 +0200 Subject: [PATCH 28/35] fix: updated username in frontend docker file --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 39f993df5..f716346a3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -57,8 +57,8 @@ RUN chmod +x /entrypoint.sh # Install bash for env variables inject script RUN apk update && apk add --no-cache bash # Make nginx owner of /usr/share/nginx/html/ and change to nginx user -RUN chown -R 101:101 /usr/share/nginx/html/ -USER 101 +RUN chown -R 1001:1001 /usr/share/nginx/html/ +USER 1001 EXPOSE 8080 From 3a28a73c0f40cda5deb5301b01b446cb53f118a1 Mon Sep 17 00:00:00 2001 From: Mathias Brunkow Moser Date: Tue, 27 Jun 2023 14:35:33 +0200 Subject: [PATCH 29/35] fix: fixed the helm charts --- charts/digital-product-pass/values-beta.yaml | 124 ++++++++-------- charts/digital-product-pass/values-dev.yaml | 124 ++++++++-------- charts/digital-product-pass/values-int.yaml | 140 +++++++++---------- 3 files changed, 194 insertions(+), 194 deletions(-) diff --git a/charts/digital-product-pass/values-beta.yaml b/charts/digital-product-pass/values-beta.yaml index 96419c933..bf921896f 100644 --- a/charts/digital-product-pass/values-beta.yaml +++ b/charts/digital-product-pass/values-beta.yaml @@ -83,74 +83,74 @@ backend: application: yml: |- - spring: - name: 'Catena-X Product Passport Consumer Backend' - main: - allow-bean-definition-overriding: true - devtools: - add-properties: false - jackson: - serialization: - indent_output: true + spring: + name: 'Catena-X Product Passport Consumer Backend' + main: + allow-bean-definition-overriding: true + devtools: + add-properties: false + jackson: + serialization: + indent_output: true - logging: - level: - root: INFO - utils: INFO + logging: + level: + root: INFO + utils: INFO - configuration: - maxRetries: 5 + configuration: + maxRetries: 5 - keycloak: - realm: CX-Central - resource: Cl13-CX-Battery - tokenUri: 'https://centralidp.beta.demo.catena-x.net/auth/realms/CX-Central/protocol/openid-connect/token' - userInfoUri: 'https://centralidp.beta.demo.catena-x.net/auth/realms/CX-Central/protocol/openid-connect/userinfo' + keycloak: + realm: CX-Central + resource: Cl13-CX-Battery + tokenUri: 'https://centralidp.beta.demo.catena-x.net/auth/realms/CX-Central/protocol/openid-connect/token' + userInfoUri: 'https://centralidp.beta.demo.catena-x.net/auth/realms/CX-Central/protocol/openid-connect/userinfo' - edc: - endpoint: 'https://materialpass.beta.demo.catena-x.net/consumer' - management: '/management/v2' - catalog: '/catalog/request' - negotiation: '/contractnegotiations' - transfer: '/transferprocesses' - receiverEndpoint: 'https://materialpass.beta.demo.catena-x.net/endpoint' + edc: + endpoint: 'https://materialpass.beta.demo.catena-x.net/consumer' + management: '/management/v2' + catalog: '/catalog/request' + negotiation: '/contractnegotiations' + transfer: '/transferprocesses' + receiverEndpoint: 'https://materialpass.beta.demo.catena-x.net/endpoint' - process: - store: true - dir: 'process' - indent: true - signKey: '' + process: + store: true + dir: 'process' + indent: true + signKey: '' - endpoints: - registryUrl: 'https://semantics.beta.demo.catena-x.net' + endpoints: + registryUrl: 'https://semantics.beta.demo.catena-x.net' - passport: - dataTransfer: - encrypt: true - indent: true - dir: "data/transfer" - versions: - - 'v3.0.1' + passport: + dataTransfer: + encrypt: true + indent: true + dir: "data/transfer" + versions: + - 'v3.0.1' - vault: - type: 'local' - file: 'vault.token.yml' - pathSep: "." - prettyPrint: true - indent: 2 - defaultValue: '' - attributes: - - "client.id" - - "client.secret" - - "edc.apiKey" - - "edc.participantId" + vault: + type: 'local' + file: 'vault.token.yml' + pathSep: "." + prettyPrint: true + indent: 2 + defaultValue: '' + attributes: + - "client.id" + - "client.secret" + - "edc.apiKey" + - "edc.participantId" - server: - error: - include-message: ALWAYS - include-binding-errors: ALWAYS - include-stacktrace: ON_PARAM - include-exception: false - port: 8888 - tomcat: - max-connections: 10000 \ No newline at end of file + server: + error: + include-message: ALWAYS + include-binding-errors: ALWAYS + include-stacktrace: ON_PARAM + include-exception: false + port: 8888 + tomcat: + max-connections: 10000 \ No newline at end of file diff --git a/charts/digital-product-pass/values-dev.yaml b/charts/digital-product-pass/values-dev.yaml index dd11ede33..63de7d4a2 100644 --- a/charts/digital-product-pass/values-dev.yaml +++ b/charts/digital-product-pass/values-dev.yaml @@ -83,74 +83,74 @@ backend: application: yml: |- - spring: - name: 'Catena-X Product Passport Consumer Backend' - main: - allow-bean-definition-overriding: true - devtools: - add-properties: false - jackson: - serialization: - indent_output: true + spring: + name: 'Catena-X Product Passport Consumer Backend' + main: + allow-bean-definition-overriding: true + devtools: + add-properties: false + jackson: + serialization: + indent_output: true - logging: - level: - root: INFO - utils: INFO + logging: + level: + root: INFO + utils: INFO - configuration: - maxRetries: 5 + configuration: + maxRetries: 5 - keycloak: - realm: CX-Central - resource: Cl13-CX-Battery - tokenUri: 'https://centralidp.dev.demo.catena-x.net/auth/realms/CX-Central/protocol/openid-connect/token' - userInfoUri: 'https://centralidp.dev.demo.catena-x.net/auth/realms/CX-Central/protocol/openid-connect/userinfo' + keycloak: + realm: CX-Central + resource: Cl13-CX-Battery + tokenUri: 'https://centralidp.dev.demo.catena-x.net/auth/realms/CX-Central/protocol/openid-connect/token' + userInfoUri: 'https://centralidp.dev.demo.catena-x.net/auth/realms/CX-Central/protocol/openid-connect/userinfo' - edc: - endpoint: 'https://materialpass.dev.demo.catena-x.net/consumer' - management: '/management/v2' - catalog: '/catalog/request' - negotiation: '/contractnegotiations' - transfer: '/transferprocesses' - receiverEndpoint: 'https://materialpass.dev.demo.catena-x.net/endpoint' + edc: + endpoint: 'https://materialpass.dev.demo.catena-x.net/consumer' + management: '/management/v2' + catalog: '/catalog/request' + negotiation: '/contractnegotiations' + transfer: '/transferprocesses' + receiverEndpoint: 'https://materialpass.dev.demo.catena-x.net/endpoint' - process: - store: true - dir: 'process' - indent: true - signKey: '' + process: + store: true + dir: 'process' + indent: true + signKey: '' - endpoints: - registryUrl: 'https://semantics.dev.demo.catena-x.net' + endpoints: + registryUrl: 'https://semantics.dev.demo.catena-x.net' - passport: - dataTransfer: - encrypt: true - indent: true - dir: "data/transfer" - versions: - - 'v3.0.1' + passport: + dataTransfer: + encrypt: true + indent: true + dir: "data/transfer" + versions: + - 'v3.0.1' - vault: - type: 'local' - file: 'vault.token.yml' - pathSep: "." - prettyPrint: true - indent: 2 - defaultValue: '' - attributes: - - "client.id" - - "client.secret" - - "edc.apiKey" - - "edc.participantId" + vault: + type: 'local' + file: 'vault.token.yml' + pathSep: "." + prettyPrint: true + indent: 2 + defaultValue: '' + attributes: + - "client.id" + - "client.secret" + - "edc.apiKey" + - "edc.participantId" - server: - error: - include-message: ALWAYS - include-binding-errors: ALWAYS - include-stacktrace: ON_PARAM - include-exception: false - port: 8888 - tomcat: - max-connections: 10000 \ No newline at end of file + server: + error: + include-message: ALWAYS + include-binding-errors: ALWAYS + include-stacktrace: ON_PARAM + include-exception: false + port: 8888 + tomcat: + max-connections: 10000 \ No newline at end of file diff --git a/charts/digital-product-pass/values-int.yaml b/charts/digital-product-pass/values-int.yaml index 4a53a8098..85e480f0a 100644 --- a/charts/digital-product-pass/values-int.yaml +++ b/charts/digital-product-pass/values-int.yaml @@ -83,76 +83,76 @@ backend: application: yml: |- - spring: - name: 'Catena-X Product Passport Consumer Backend' - main: - allow-bean-definition-overriding: true - devtools: - add-properties: false - jackson: - serialization: - indent_output: true - - logging: - level: - root: INFO - utils: INFO - - configuration: - maxRetries: 5 - - keycloak: - realm: CX-Central - resource: Cl13-CX-Battery - tokenUri: 'https://centralidp.int.demo.catena-x.net/auth/realms/CX-Central/protocol/openid-connect/token' - userInfoUri: 'https://centralidp.int.demo.catena-x.net/auth/realms/CX-Central/protocol/openid-connect/userinfo' - - edc: - endpoint: 'https://materialpass.int.demo.catena-x.net/consumer' - management: '/management/v2' - catalog: '/catalog/request' - negotiation: '/contractnegotiations' - transfer: '/transferprocesses' - receiverEndpoint: 'https://materialpass.int.demo.catena-x.net/endpoint' - - process: - store: true - dir: 'process' - indent: true - signKey: '' - - endpoints: - registryUrl: 'https://semantics.int.demo.catena-x.net' - - passport: - dataTransfer: - encrypt: true + spring: + name: 'Catena-X Product Passport Consumer Backend' + main: + allow-bean-definition-overriding: true + devtools: + add-properties: false + jackson: + serialization: + indent_output: true + + logging: + level: + root: INFO + utils: INFO + + configuration: + maxRetries: 5 + + keycloak: + realm: CX-Central + resource: Cl13-CX-Battery + tokenUri: 'https://centralidp.int.demo.catena-x.net/auth/realms/CX-Central/protocol/openid-connect/token' + userInfoUri: 'https://centralidp.int.demo.catena-x.net/auth/realms/CX-Central/protocol/openid-connect/userinfo' + + edc: + endpoint: 'https://materialpass.int.demo.catena-x.net/consumer' + management: '/management/v2' + catalog: '/catalog/request' + negotiation: '/contractnegotiations' + transfer: '/transferprocesses' + receiverEndpoint: 'https://materialpass.int.demo.catena-x.net/endpoint' + + process: + store: true + dir: 'process' indent: true - dir: "data/transfer" - versions: - - 'v3.0.1' - - vault: - type: 'local' - file: 'vault.token.yml' - pathSep: "." - prettyPrint: true - indent: 2 - defaultValue: '' - attributes: - - "client.id" - - "client.secret" - - "edc.apiKey" - - "edc.participantId" - - server: - error: - include-message: ALWAYS - include-binding-errors: ALWAYS - include-stacktrace: ON_PARAM - include-exception: false - port: 8888 - tomcat: - max-connections: 10000 + signKey: '' + + endpoints: + registryUrl: 'https://semantics.int.demo.catena-x.net' + + passport: + dataTransfer: + encrypt: true + indent: true + dir: "data/transfer" + versions: + - 'v3.0.1' + + vault: + type: 'local' + file: 'vault.token.yml' + pathSep: "." + prettyPrint: true + indent: 2 + defaultValue: '' + attributes: + - "client.id" + - "client.secret" + - "edc.apiKey" + - "edc.participantId" + + server: + error: + include-message: ALWAYS + include-binding-errors: ALWAYS + include-stacktrace: ON_PARAM + include-exception: false + port: 8888 + tomcat: + max-connections: 10000 From 78e5d719a7446bc3f8b8814d7ce985a1cb31420f Mon Sep 17 00:00:00 2001 From: Mathias Brunkow Moser Date: Tue, 27 Jun 2023 14:57:05 +0200 Subject: [PATCH 30/35] fix: updated nginx file --- .nginx/nginx.conf | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/.nginx/nginx.conf b/.nginx/nginx.conf index a1cde5050..cd2afe297 100644 --- a/.nginx/nginx.conf +++ b/.nginx/nginx.conf @@ -20,12 +20,11 @@ # SPDX-License-Identifier: Apache-2.0 ################################################################################## - server { - listen 8080; - listen [::]:8080; - root /usr/share/nginx/html; - location / { - index index.html - try_files $uri /index.html; - } - } \ No newline at end of file +server { + listen 8080; + listen [::]:8080; + root /usr/share/nginx/html; + location / { + try_files $uri /index.html; + } +} \ No newline at end of file From f42e0d1e3a7b2127f8e1cc90960cd4764a5d609c Mon Sep 17 00:00:00 2001 From: Mathias Brunkow Moser Date: Tue, 27 Jun 2023 19:09:30 +0200 Subject: [PATCH 31/35] feat: added filter in catalog asset retrieval --- .../services/DataTransferService.java | 150 +++++++++++------- 1 file changed, 90 insertions(+), 60 deletions(-) diff --git a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/services/DataTransferService.java b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/services/DataTransferService.java index ed8bc0b0e..1b5322430 100644 --- a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/services/DataTransferService.java +++ b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/services/DataTransferService.java @@ -33,6 +33,8 @@ import org.eclipse.tractusx.productpass.models.manager.History; import org.eclipse.tractusx.productpass.models.manager.Status; import org.eclipse.tractusx.productpass.models.negotiation.*; +import org.eclipse.tractusx.productpass.models.negotiation.Properties; +import org.eclipse.tractusx.productpass.models.negotiation.Set; import org.eclipse.tractusx.productpass.models.passports.PassportV3; import org.eclipse.tractusx.productpass.models.service.BaseService; import org.springframework.beans.factory.annotation.Autowired; @@ -46,15 +48,12 @@ import java.nio.file.Paths; import java.time.Duration; import java.time.Instant; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; +import java.util.*; @Service public class DataTransferService extends BaseService { - private final HttpUtil httpUtil; private final JsonUtil jsonUtil; @@ -83,7 +82,7 @@ public DataTransferService(Environment env, HttpUtil httpUtil, JsonUtil jsonUtil this.checkEmptyVariables(List.of("apiKey")); // Add API Key as optional for initialization } - public void init(VaultService vaultService, Environment env){ + public void init(VaultService vaultService, Environment env) { this.apiKey = (String) vaultService.getLocalSecret("edc.apiKey"); this.bpnNumber = (String) vaultService.getLocalSecret("edc.participantId"); this.edcEndpoint = env.getProperty("configuration.edc.endpoint", ""); @@ -126,19 +125,37 @@ public Dataset getContractOfferByAssetId(String assetId, String providerUrl) thr * This method receives the assetId and looks up for targets with the same name. */ try { - Catalog catalog = this.getContractOfferCatalog(providerUrl); - Map offers = catalog.loadContractOffersMapByAssetId(); - if (!offers.containsKey(assetId)) { + Catalog catalog = this.getContractOfferCatalog(providerUrl, assetId); + Object offers = catalog.getContractOffers(); + if(offers == null){ + return null; + } + if(catalog.getContractOffers() instanceof LinkedHashMap){ + return (Dataset) jsonUtil.bindObject(offers, Dataset.class); + } + + List contractOffers = (List) jsonUtil.bindObject(offers, List.class); + if(contractOffers.size() == 0){ return null; } - Integer index = offers.get(assetId); - return catalog.getContractOffers().get(index); + int i = 0; + Map contractOffersMap = new HashMap<>(); + for(Dataset offer: contractOffers){ + contractOffersMap.put(offer.getAssetId(),i); + i++; + } + if(!contractOffersMap.containsKey(assetId)) + { + return null; + } + Integer index = contractOffersMap.get(assetId); + return contractOffers.get(index); } catch (Exception e) { throw new ControllerException(this.getClass().getName(), e, "It was not possible to get Contract Offer for assetId [" + assetId + "]"); } } - public class NegotiateContract implements Runnable{ + public class NegotiateContract implements Runnable { private NegotiationRequest negotiationRequest; private ProcessDataModel dataModel; private Dataset dataset; @@ -156,7 +173,7 @@ public class NegotiateContract implements Runnable{ private String processId; - public NegotiateContract(ProcessDataModel dataModel, String processId, Dataset dataset, Status status){ + public NegotiateContract(ProcessDataModel dataModel, String processId, Dataset dataset, Status status) { this.dataModel = dataModel; this.processId = processId; this.dataset = dataset; @@ -164,7 +181,7 @@ public NegotiateContract(ProcessDataModel dataModel, String processId, Dataset d this.negotiationRequest = this.buildRequest(dataset, status); } - public NegotiationRequest buildRequest(Dataset dataset, Status status){ + public NegotiationRequest buildRequest(Dataset dataset, Status status) { Offer contractOffer = this.buildOffer(dataset); return new NegotiationRequest( jsonUtil.toJsonNode(Map.of("odrl", "http://www.w3.org/ns/odrl/2/")), @@ -174,7 +191,7 @@ public NegotiationRequest buildRequest(Dataset dataset, Status status){ ); } - public TransferRequest buildTransferRequest(Dataset dataset, Status status, Negotiation negotiation){ + public TransferRequest buildTransferRequest(Dataset dataset, Status status, Negotiation negotiation) { try { Offer contractOffer = this.buildOffer(dataset); String receiverEndpoint = env.getProperty("configuration.edc.receiverEndpoint") + "/" + this.processId; // Send process Id to identification the session. @@ -199,10 +216,11 @@ public TransferRequest buildTransferRequest(Dataset dataset, Status status, Nego "dataspace-protocol-http", transferType ); - }catch (Exception e){ + } catch (Exception e) { throw new ServiceException(this.getClass().getName(), e, "Failed to build the transfer request!"); } } + @Override public void run() { // NEGOTIATIONGIH PROCESS @@ -211,15 +229,15 @@ public void run() { this.negotiationResponse = this.requestNegotiation(this.negotiationRequest); processManager.saveNegotiationRequest(processId, negotiationRequest, negotiationResponse); this.negotiation = this.getNegotiationData(negotiationResponse); - if(this.negotiation == null){ + if (this.negotiation == null) { return; } processManager.saveNegotiation(this.processId, this.negotiation); String state = this.negotiation.getState(); if (!(state.equals("CONFIRMED") || state.equals("FINALIZED"))) { - throw new ServiceException(this.getClass().getName(), "Contract Negotiation Process Failed ["+this.negotiation.getId()+"]"); + throw new ServiceException(this.getClass().getName(), "Contract Negotiation Process Failed [" + this.negotiation.getId() + "]"); } - }catch (Exception e){ + } catch (Exception e) { processManager.setStatus(this.processId, "negotiation-failed", new History( this.processId, "FAILED" @@ -228,27 +246,28 @@ public void run() { throw new ServiceException(this.getClass().getName(), e, "Failed to do the contract negotiation!"); } - if(this.dataModel.getState(processId).equals("TERMINATED")){ + if (this.dataModel.getState(processId).equals("TERMINATED")) { LogUtil.printMessage("Terminated process " + processId + "stopped transfer!"); return; - }; + } + ; this.dataModel.setState(processId, "NEGOTIATED"); - LogUtil.printStatus("[PROCESS "+ this.processId+"] Negotiation Finished with status ["+negotiation.getState()+"]!"); + LogUtil.printStatus("[PROCESS " + this.processId + "] Negotiation Finished with status [" + negotiation.getState() + "]!"); // TRANSFER PROCESS - try{ + try { this.transferRequest = buildTransferRequest(this.dataset, this.status, this.negotiation); processManager.saveTransferRequest(this.processId, transferRequest, new IdResponse(processId, null)); this.tranferResponse = this.requestTransfer(transferRequest); processManager.saveTransferRequest(this.processId, transferRequest, this.tranferResponse); this.transfer = this.getTransferData(this.tranferResponse); - if(this.transfer == null){ + if (this.transfer == null) { return; } processManager.saveTransfer(this.processId, transfer); if (!transfer.getState().equals("COMPLETED")) { - throw new ServiceException(this.getClass().getName(), "Transfer Process Failed ["+this.tranferResponse.getId()+"]"); + throw new ServiceException(this.getClass().getName(), "Transfer Process Failed [" + this.tranferResponse.getId() + "]"); } - }catch (Exception e){ + } catch (Exception e) { processManager.setStatus(processId, "transfer-failed", new History( processId, "FAILED" @@ -257,14 +276,15 @@ public void run() { throw new ServiceException(this.getClass().getName(), e, "Failed to do the contract transfer"); } this.dataModel.setState(processId, "COMPLETED"); - LogUtil.printStatus("[PROCESS "+ this.processId+"] Negotiation and Transfer Completed!"); + LogUtil.printStatus("[PROCESS " + this.processId + "] Negotiation and Transfer Completed!"); } + public Negotiation getNegotiationData(IdResponse negotiationResponse) { Negotiation negotiation = null; try { negotiation = seeNegotiation(negotiationResponse.getId(), this.processId, this.dataModel); } catch (Exception e) { - throw new ServiceException(this.getClass().getName(), e, "Failed to get the negotiation ["+negotiationResponse.getId()+"]"); + throw new ServiceException(this.getClass().getName(), e, "Failed to get the negotiation [" + negotiationResponse.getId() + "]"); } return negotiation; } @@ -274,37 +294,38 @@ public IdResponse requestNegotiation(NegotiationRequest negotiationRequest) { try { negotiationResponse = doContractNegotiation(negotiationRequest); } catch (Exception e) { - throw new ServiceException(this.getClass().getName(), e, "Failed to start the negotiation for offer ["+negotiationRequest.getOffer().getOfferId()+"]"); + throw new ServiceException(this.getClass().getName(), e, "Failed to start the negotiation for offer [" + negotiationRequest.getOffer().getOfferId() + "]"); } if (negotiationResponse.getId() == null) { - throw new ServiceException(this.getClass().getName(), "The ID from the Offer is null ["+negotiationRequest.getOffer().getOfferId()+"]"); + throw new ServiceException(this.getClass().getName(), "The ID from the Offer is null [" + negotiationRequest.getOffer().getOfferId() + "]"); } - LogUtil.printMessage("[PROCESS "+ this.processId+"] Negotiation Requested ["+negotiationResponse.getId()+"]"); + LogUtil.printMessage("[PROCESS " + this.processId + "] Negotiation Requested [" + negotiationResponse.getId() + "]"); return negotiationResponse; } + public IdResponse requestTransfer(TransferRequest transferRequest) { IdResponse transferResponse = null; try { transferResponse = initiateTransfer(transferRequest); } catch (Exception e) { - throw new ServiceException(this.getClass().getName(), e, "Failed to start the transfer for contract ["+transferRequest.getContractId()+"]"); + throw new ServiceException(this.getClass().getName(), e, "Failed to start the transfer for contract [" + transferRequest.getContractId() + "]"); } if (transferResponse.getId() == null) { - throw new ServiceException(this.getClass().getName(), "The ID from the transfer is null for contract ["+transferRequest.getContractId()+"]"); + throw new ServiceException(this.getClass().getName(), "The ID from the transfer is null for contract [" + transferRequest.getContractId() + "]"); } - LogUtil.printStatus("[PROCESS "+ this.processId+"] Transfer Requested ["+transferResponse.getId()+"]"); + LogUtil.printStatus("[PROCESS " + this.processId + "] Transfer Requested [" + transferResponse.getId() + "]"); return transferResponse; } - public Transfer getTransferData(IdResponse transferData){ + public Transfer getTransferData(IdResponse transferData) { /*[8]=========================================*/ // Check for transfer updates and the status Transfer transfer = null; try { transfer = seeTransfer(transferData.getId(), this.processId, this.dataModel); } catch (Exception e) { - throw new ServiceException(this.getClass().getName(), e, "Failed to get the negotiation ["+transferData.getId()+"]"); + throw new ServiceException(this.getClass().getName(), e, "Failed to get the negotiation [" + transferData.getId() + "]"); } return transfer; } @@ -321,7 +342,7 @@ public void setDataset(Dataset dataset) { this.dataset = dataset; } - public Offer buildOffer(Dataset dataset){ + public Offer buildOffer(Dataset dataset) { Set policyCopy = (Set) jsonUtil.bindObject(dataset.getPolicy(), Set.class); policyCopy.setId(null); return new Offer( @@ -416,16 +437,23 @@ public void setTranferResponse(IdResponse tranferResponse) { } } - public Catalog getContractOfferCatalog(String providerUrl) { + public Catalog getContractOfferCatalog(String providerUrl, String assetId) { try { this.checkEmptyVariables(); String url = CatenaXUtil.buildManagementEndpoint(env, this.catalogPath); // Simple catalog request query with no limitation. + CatalogRequest.QuerySpec querySpec = new CatalogRequest.QuerySpec(); + CatalogRequest.QuerySpec.FilterExpression filterExpression = new CatalogRequest.QuerySpec.FilterExpression( + "https://w3id.org/edc/v0.0.1/ns/id", + "=", + assetId + ); // Filter by asset id + querySpec.setFilterExpression(List.of(filterExpression)); Object body = new CatalogRequest( - jsonUtil.newJsonNode(), - providerUrl, - new CatalogRequest.QuerySpec() + jsonUtil.newJsonNode(), + providerUrl, + querySpec ); HttpHeaders headers = httpUtil.getHeaders(); @@ -440,10 +468,11 @@ public Catalog getContractOfferCatalog(String providerUrl) { "It was not possible to retrieve the catalog!"); } } + public IdResponse doContractNegotiation(NegotiationRequest negotiationRequest) { try { this.checkEmptyVariables(); - LogUtil.printDebug("["+negotiationRequest.getOffer().getOfferId()+"] ===== [INITIALIZING CONTRACT NEGOTIATION] ==========================================="); + LogUtil.printDebug("[" + negotiationRequest.getOffer().getOfferId() + "] ===== [INITIALIZING CONTRACT NEGOTIATION] ==========================================="); String url = CatenaXUtil.buildManagementEndpoint(env, this.negotiationPath); HttpHeaders headers = httpUtil.getHeaders(); headers.add("Content-Type", "application/json"); @@ -457,6 +486,7 @@ public IdResponse doContractNegotiation(NegotiationRequest negotiationRequest) { "It was not possible to retrieve the contract negotiation!"); } } + public IdResponse doContractNegotiations(Offer contractOffer, String providerUrl) { try { this.checkEmptyVariables(); @@ -490,34 +520,34 @@ public Negotiation seeNegotiation(String id, String processId, ProcessDataModel boolean sw = true; Instant start = Instant.now(); Instant end = start; - LogUtil.printDebug("["+id+"] ===== [STARTING CHECKING STATUS FOR CONTRACT NEGOTIATION] ==========================================="); + LogUtil.printDebug("[" + id + "] ===== [STARTING CHECKING STATUS FOR CONTRACT NEGOTIATION] ==========================================="); while (sw) { ResponseEntity response = httpUtil.doGet(url, JsonNode.class, headers, params, false, false); body = (JsonNode) response.getBody(); - if(body == null){ + if (body == null) { sw = false; throw new ServiceException(this.getClass().getName() + "." + "getNegotiations", "No response received from url [" + url + "]!"); } if (!body.has("edc:state") || body.get("edc:state") == null) { - LogUtil.printDebug("["+id+"] ===== [ERROR CONTRACT NEGOTIATION] ==========================================="); + LogUtil.printDebug("[" + id + "] ===== [ERROR CONTRACT NEGOTIATION] ==========================================="); throw new ServiceException(this.getClass().getName() + "." + "getNegotiations", "It was not possible to do contract negotiations!"); } String state = body.get("edc:state").asText(); - if (state.equals("CONFIRMED") || state.equals("ERROR") || state.equals("FINALIZED") || state.equals("TERMINATED") || state.equals("TERMINATING")) { + if (state.equals("CONFIRMED") || state.equals("ERROR") || state.equals("FINALIZED") || state.equals("TERMINATED") || state.equals("TERMINATING")) { sw = false; - LogUtil.printDebug("["+id+"] ===== [FINISHED CONTRACT NEGOTIATION] ==========================================="); + LogUtil.printDebug("[" + id + "] ===== [FINISHED CONTRACT NEGOTIATION] ==========================================="); } if (!state.equals(actualState)) { actualState = state; // Update current state end = Instant.now(); Duration timeElapsed = Duration.between(start, end); - LogUtil.printDebug("["+id+"] The contract negotiation status changed: [" + state + "] - TIME->[" + timeElapsed + "]s"); + LogUtil.printDebug("[" + id + "] The contract negotiation status changed: [" + state + "] - TIME->[" + timeElapsed + "]s"); start = Instant.now(); } - if(dataModel.getState(processId).equals("TERMINATED")){ - LogUtil.printStatus("["+id+"] The negotiation was cancelled"); + if (dataModel.getState(processId).equals("TERMINATED")) { + LogUtil.printStatus("[" + id + "] The negotiation was cancelled"); return null; } } @@ -559,39 +589,39 @@ public Transfer seeTransfer(String id, String processId, ProcessDataModel dataMo headers.add("Content-Type", "application/json"); headers.add("X-Api-Key", this.apiKey); Map params = httpUtil.getParams(); - JsonNode body = null; + JsonNode body = null; String actualState = ""; boolean sw = true; Instant start = Instant.now(); Instant end = start; - LogUtil.printDebug("["+id+"] ===== [STARTING CONTRACT TRANSFER] ==========================================="); + LogUtil.printDebug("[" + id + "] ===== [STARTING CONTRACT TRANSFER] ==========================================="); while (sw) { ResponseEntity response = httpUtil.doGet(path, JsonNode.class, headers, params, false, false); body = (JsonNode) response.getBody(); - if(body == null){ + if (body == null) { sw = false; throw new ServiceException(this.getClass().getName() + "." + "getNegotiations", "No response received from url [" + path + "]!"); } if (!body.has("edc:state") || body.get("edc:state") == null) { - LogUtil.printDebug("["+id+"] ===== [ERROR CONTRACT TRANSFER]==========================================="); + LogUtil.printDebug("[" + id + "] ===== [ERROR CONTRACT TRANSFER]==========================================="); throw new ServiceException(this.getClass().getName() + "." + "getTransfer", "It was not possible to do the transfer process!"); } String state = body.get("edc:state").asText(); - if (state.equals("COMPLETED") || state.equals("ERROR") || state.equals("FINALIZED") || state.equals("VERIFIED") || state.equals("TERMINATED") || state.equals("TERMINATING")) { - LogUtil.printDebug("["+id+"] ===== [FINISHED CONTRACT TRANSFER] ["+id+"]==========================================="); + if (state.equals("COMPLETED") || state.equals("ERROR") || state.equals("FINALIZED") || state.equals("VERIFIED") || state.equals("TERMINATED") || state.equals("TERMINATING")) { + LogUtil.printDebug("[" + id + "] ===== [FINISHED CONTRACT TRANSFER] [" + id + "]==========================================="); sw = false; } if (!state.equals(actualState)) { actualState = state; // Update current state end = Instant.now(); Duration timeElapsed = Duration.between(start, end); - LogUtil.printDebug("["+id+"] The data transfer status changed: [" + state + "] - TIME->[" + timeElapsed + "]s"); + LogUtil.printDebug("[" + id + "] The data transfer status changed: [" + state + "] - TIME->[" + timeElapsed + "]s"); start = Instant.now(); } - if(dataModel.getState(processId).equals("TERMINATED")){ - LogUtil.printStatus("["+id+"] The transfer was cancelled"); + if (dataModel.getState(processId).equals("TERMINATED")) { + LogUtil.printStatus("[" + id + "] The transfer was cancelled"); return null; } } @@ -615,7 +645,7 @@ public PassportV3 getPassportV3(String transferProcessId, String endpoint) { ResponseEntity response = null; try { response = httpUtil.doGet(endpoint, String.class, headers, params, false, false); - }catch (Exception e){ + } catch (Exception e) { throw new ServiceException(this.getClass().getName() + ".getPassportV3", "It was not possible to get passport with id " + transferProcessId); } String responseBody = (String) response.getBody(); @@ -623,7 +653,7 @@ public PassportV3 getPassportV3(String transferProcessId, String endpoint) { } catch (Exception e) { throw new ServiceException(this.getClass().getName() + "." + "getPassportV3", e, - "It was not possible to retrieve the getPassport V1 for transferProcessId ["+transferProcessId+"]!"); + "It was not possible to retrieve the getPassport V1 for transferProcessId [" + transferProcessId + "]!"); } } From b46dfb61893a3ce29505cd75ff7e3aad9964c337 Mon Sep 17 00:00:00 2001 From: Mathias Brunkow Moser Date: Tue, 27 Jun 2023 19:13:48 +0200 Subject: [PATCH 32/35] feat: updated catalog model --- .../models/negotiation/Catalog.java | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/Catalog.java b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/Catalog.java index 399da837b..bceda66f7 100644 --- a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/Catalog.java +++ b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/Catalog.java @@ -28,6 +28,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.JsonNode; +import javax.xml.crypto.Data; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -36,7 +37,7 @@ public class Catalog extends DidDocument { @JsonProperty("dcat:dataset") - List contractOffers; + Object contractOffers; @JsonProperty("dcat:service") DataService service; @@ -50,7 +51,7 @@ public class Catalog extends DidDocument { @JsonIgnore protected Map contractOffersMap = new HashMap<>(); - public Catalog(String id, String type, List contractOffers, DataService service, String participantId, JsonNode context) { + public Catalog(String id, String type, Object contractOffers, DataService service, String participantId, JsonNode context) { super(id, type); this.contractOffers = contractOffers; this.service = service; @@ -66,22 +67,14 @@ public Catalog() { } - public List getContractOffers() { + public Object getContractOffers() { return contractOffers; } - public void setContractOffers(List contractOffers) { + public void setContractOffer(Object contractOffers) { this.contractOffers = contractOffers; } - public Map loadContractOffersMapByAssetId(){ - int i = 0; - for(Dataset contractOffer: this.contractOffers){ - this.contractOffersMap.put(contractOffer.getAssetId(),i); - i++; - } - return this.contractOffersMap; - } public Map getContractOffersMap() { return contractOffersMap; } @@ -90,6 +83,7 @@ public void setContractOffersMap(Map contractOffersMap) { this.contractOffersMap = contractOffersMap; } + public DataService getService() { return service; } From a8c97c788f0cc234d3c9c8138b2769a582edd54e Mon Sep 17 00:00:00 2001 From: Mathias Brunkow Moser Date: Tue, 27 Jun 2023 19:18:23 +0200 Subject: [PATCH 33/35] chore: updated postman collection with newest payload --- .../v3.0.1/Digital-Product-Pass-v1.0.0.postman_collection.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/postman/v3.0.1/Digital-Product-Pass-v1.0.0.postman_collection.json b/postman/v3.0.1/Digital-Product-Pass-v1.0.0.postman_collection.json index 136f8fec7..4207ff9d2 100644 --- a/postman/v3.0.1/Digital-Product-Pass-v1.0.0.postman_collection.json +++ b/postman/v3.0.1/Digital-Product-Pass-v1.0.0.postman_collection.json @@ -649,7 +649,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"@context\": {},\r\n \"protocol\": \"dataspace-protocol-http\",\r\n \"providerUrl\": \"https://materialpass.dev.demo.catena-x.net/BPNL000000000000/api/v1/dsp\",\r\n \"querySpec\": {}\r\n}" + "raw": "{\r\n \"@context\": {\r\n \"@vocab\": \"https://w3id.org/edc/v0.0.1/ns/\"\r\n },\r\n \"protocol\": \"dataspace-protocol-http\",\r\n \"providerUrl\": \"https://materialpass.dev.demo.catena-x.net/BPNL000000000000/api/v1/dsp\",\r\n \"querySpec\": {\r\n \"filterExpression\": [\r\n {\r\n \"operandLeft\": \"https://w3id.org/edc/v0.0.1/ns/id\",\r\n \"operator\": \"=\",\r\n \"operandRight\": \"365e6fbe-bb34-11ec-8422-0242ac120002-61125dc3-5e6f-4f4b-838d-447432b97918\"\r\n }\r\n ]\r\n }\r\n}" }, "url": { "raw": "{{Server}}/consumer/management/v2/catalog/request", From 28fa525b7975bc13cf07afa70312dd7b4f365492 Mon Sep 17 00:00:00 2001 From: Mathias Brunkow Moser Date: Wed, 28 Jun 2023 14:29:56 +0200 Subject: [PATCH 34/35] feat: added exception in veracode workflow, for not interupting the workflow --- .github/workflows/veracode-pipeline.yml | 28 ++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/.github/workflows/veracode-pipeline.yml b/.github/workflows/veracode-pipeline.yml index 99348a428..2e51abb85 100644 --- a/.github/workflows/veracode-pipeline.yml +++ b/.github/workflows/veracode-pipeline.yml @@ -33,9 +33,35 @@ on: permissions: contents: read +env: + VID: '${{ secrets.VERACODE_API_ID || secrets.ORG_VERACODE_API_ID }}' + VKEY: '${{ secrets.VERACODE_API_KEY || secrets.ORG_VERACODE_API_KEY }}' + + jobs: + check-secrets: + runs-on: ubuntu-latest + outputs: + secrets-available: ${{ steps.secrets-exists.outputs.available }} + steps: + - name: Check for Secrets availability + id: secrets-exists + shell: bash + ## Check if the secrets are available in the environment + ## Check if the secrets are available in the environment + run: | + if [ "${{ env.VID }}" != '' ] && [ "${{ env.VKEY }}" != '' ]; then + echo "available=true" >> $GITHUB_OUTPUT; + echo "Secrets are available at this environment!" + else + echo "available=false" >> $GITHUB_OUTPUT; + echo "No secrets are available at this environment!" + fi + # This workflow contains a job to build and submit pipeline scan, you will need to customize the build process accordingly and make sure the artifact you build is used as the file input to the pipeline scan file parameter build-and-pipeline-scan: + needs: [ check-secrets ] + if: needs.check-secrets.outputs.secrets-available == 'true' ## Require that the secrets are available permissions: contents: read security-events: write @@ -66,7 +92,7 @@ jobs: with: java-version: 8 distribution: 'temurin' - - run: java -Dpipeline.debug=true -jar pipeline-scan.jar -p "Product-Passport-Consumer-App" --veracode_api_id "${{ secrets.VERACODE_API_ID || secrets.ORG_VERACODE_API_ID }}" --veracode_api_key "${{ secrets.VERACODE_API_KEY || secrets.ORG_VERACODE_API_KEY }}" --fail_on_severity="Very High, High" --file veracode-scan-target.zip + - run: java -Dpipeline.debug=true -jar pipeline-scan.jar -p "Product-Passport-Consumer-App" --veracode_api_id "${{ env.VID }}" --veracode_api_key "${{ env.VKEY }}" --fail_on_severity="Very High, High" --file veracode-scan-target.zip continue-on-error: true - name: Convert pipeline scan output to SARIF format id: convert From c7b9e84997b1f227c7fbaf8f16bd65a8ed43d3c3 Mon Sep 17 00:00:00 2001 From: Mathias Brunkow Moser Date: Wed, 28 Jun 2023 17:17:33 +0200 Subject: [PATCH 35/35] fix: added missing component --- consumer-backend/productpass/pom.xml | 2 +- consumer-backend/productpass/readme.md | 2 +- .../models/negotiation/CatalogRequest.java | 58 +++++++++++++++++++ 3 files changed, 60 insertions(+), 2 deletions(-) diff --git a/consumer-backend/productpass/pom.xml b/consumer-backend/productpass/pom.xml index 57dbc46a3..7e5119f44 100644 --- a/consumer-backend/productpass/pom.xml +++ b/consumer-backend/productpass/pom.xml @@ -33,7 +33,7 @@ org.eclipse.tractusx productpass - 0.8.0-SNAPSHOT + 1.0.0-SNAPSHOT jar Catena-X Digital Product Passport Backend Product Passport Consumer Backend System for Product Passport Consumer Frontend Application diff --git a/consumer-backend/productpass/readme.md b/consumer-backend/productpass/readme.md index b35102b2a..e4c4febad 100644 --- a/consumer-backend/productpass/readme.md +++ b/consumer-backend/productpass/readme.md @@ -23,7 +23,7 @@

  Digital Product Pass Backend

-

Version: 0.8.0-SNAPSHOT

+

Version: 1.0.0-SNAPSHOT


diff --git a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/CatalogRequest.java b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/CatalogRequest.java index 7406875e6..be1f539a5 100644 --- a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/CatalogRequest.java +++ b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/CatalogRequest.java @@ -29,6 +29,8 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.JsonNode; +import java.util.List; + @JsonInclude(JsonInclude.Include.NON_NULL) public class CatalogRequest { @JsonProperty("@context") @@ -92,6 +94,11 @@ public void setQuerySpec(QuerySpec querySpec) { @JsonInclude(JsonInclude.Include.NON_NULL) public static class QuerySpec { + + @JsonProperty("filterExpression") + List filterExpression; + + @JsonProperty("offset") Integer offset; @@ -116,6 +123,57 @@ public QuerySpec(Integer offset, Integer limit, String filter, Range range, Stri public QuerySpec() { } + public List getFilterExpression() { + return filterExpression; + } + + public void setFilterExpression(List filterExpression) { + this.filterExpression = filterExpression; + } + @JsonInclude(JsonInclude.Include.NON_NULL) + public static class FilterExpression{ + @JsonProperty("operandLeft") + String operandLeft; + + @JsonProperty("operator") + String operator; + + @JsonProperty("operandRight") + String operandRight; + + public FilterExpression(String operandLeft, String operator, String operandRight) { + this.operandLeft = operandLeft; + this.operator = operator; + this.operandRight = operandRight; + } + + public FilterExpression() { + } + + public String getOperandLeft() { + return operandLeft; + } + + public void setOperandLeft(String operandLeft) { + this.operandLeft = operandLeft; + } + + public String getOperator() { + return operator; + } + + public void setOperator(String operator) { + this.operator = operator; + } + + public String getOperandRight() { + return operandRight; + } + + public void setOperandRight(String operandRight) { + this.operandRight = operandRight; + } + } @JsonInclude(JsonInclude.Include.NON_NULL) public static class Range { @JsonProperty("from")