├── .github ├── actions │ └── mxd-test-action │ │ └── action.yml ├── dependabot.yml └── workflows │ ├── publish-playground.yaml │ ├── run-end2end-tests.yml │ ├── run-tests.yaml │ ├── secrets-scan.yml │ ├── stale-bot.yml │ ├── triage-issue.yml │ ├── verify-playground.yml │ └── verify.yaml ├── .gitignore ├── .tractusx ├── CODEOWNERS ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── DEPENDENCIES ├── LICENSE ├── LICENSE_non-code ├── NOTICE.md ├── README.md ├── SECURITY.md ├── edc-policy-playground ├── .eslintrc.json ├── .gitignore ├── .prettierrc ├── README.md ├── angular.json ├── fixtures │ └── policies │ │ ├── bpn.json │ │ └── bpnGroup.json ├── package-lock.json ├── package.json ├── src │ ├── app │ │ ├── app.component.html │ │ ├── app.component.spec.ts │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ ├── components │ │ │ ├── editor │ │ │ │ ├── editor.component.html │ │ │ │ └── editor.component.ts │ │ │ ├── header │ │ │ │ ├── header.component.css │ │ │ │ ├── header.component.html │ │ │ │ └── header.component.ts │ │ │ └── policy-editor │ │ │ │ ├── policy-builder │ │ │ │ ├── constraint │ │ │ │ │ ├── atomic.constraint.component.html │ │ │ │ │ ├── atomic.constraint.component.ts │ │ │ │ │ ├── constraint.list.component.html │ │ │ │ │ ├── constraint.list.component.ts │ │ │ │ │ ├── value.expression.component.html │ │ │ │ │ └── value.expression.component.ts │ │ │ │ ├── permission │ │ │ │ │ ├── dialog │ │ │ │ │ │ ├── constraint-dialog │ │ │ │ │ │ │ ├── constraint-dialog.component.html │ │ │ │ │ │ │ └── constraint-dialog.component.ts │ │ │ │ │ │ └── logical-dialog │ │ │ │ │ │ │ ├── logical-dialog.component.html │ │ │ │ │ │ │ └── logical-dialog.component.ts │ │ │ │ │ ├── permission.component.html │ │ │ │ │ └── permission.component.ts │ │ │ │ ├── policy-builder.component.css │ │ │ │ ├── policy-builder.component.html │ │ │ │ └── policy-builder.component.ts │ │ │ │ ├── policy-editor.component.css │ │ │ │ ├── policy-editor.component.html │ │ │ │ └── policy-editor.component.ts │ │ ├── models │ │ │ └── policy.ts │ │ ├── services │ │ │ ├── constraints.ts │ │ │ ├── format.service.spec.ts │ │ │ ├── format.service.ts │ │ │ ├── format │ │ │ │ └── plain.ts │ │ │ └── policy.service.ts │ │ └── stores │ │ │ └── policy.store.ts │ ├── assets │ │ └── .gitkeep │ ├── favicon.ico │ ├── index.html │ ├── main.ts │ └── styles.css ├── tsconfig.app.json ├── tsconfig.json └── tsconfig.spec.json ├── icc-irs-challenges ├── README.md ├── ai-assistent-phase1.md ├── ai-assistent-phase2.md ├── ai-assistent-phase3.md ├── ai-assistent.md ├── index.html ├── irs-api-request-collection.json ├── irs-job-response-structure.json ├── job-schema.json ├── package-lock.json ├── package.json ├── proxy.js └── style.css ├── mxd-runtimes ├── README.md ├── build.gradle.kts ├── data-service-api │ ├── assets │ │ └── postman │ │ │ └── BackendService.postman_collection.json │ ├── build.gradle.kts │ └── src │ │ ├── main │ │ ├── docker │ │ │ └── Dockerfile │ │ ├── java │ │ │ └── org │ │ │ │ └── eclipse │ │ │ │ └── tractusx │ │ │ │ └── mxd │ │ │ │ └── dataservice │ │ │ │ ├── DataServiceExtension.java │ │ │ │ ├── api │ │ │ │ ├── DataServiceApi.java │ │ │ │ └── DataServiceApiController.java │ │ │ │ └── model │ │ │ │ └── DataRecord.java │ │ └── resources │ │ │ └── META-INF │ │ │ └── services │ │ │ └── org.eclipse.edc.spi.system.ServiceExtension │ │ └── test │ │ └── java │ │ └── org │ │ └── eclipse │ │ └── tractusx │ │ └── mxd │ │ └── dataservice │ │ └── api │ │ └── DataServiceApiControllerTest.java ├── e2e-test │ ├── build.gradle.kts │ └── src │ │ └── test │ │ ├── java │ │ └── org │ │ │ └── eclipse │ │ │ └── edc │ │ │ └── demo │ │ │ └── tests │ │ │ ├── issuance │ │ │ └── CredentialIssuanceEndToEndTest.java │ │ │ └── transfer │ │ │ └── TransferEndToEndTest.java │ │ └── resources │ │ ├── negotiation-request.json │ │ └── transfer-request.json ├── gradle.properties ├── gradle │ ├── catalogserver.versions.toml │ ├── libs.versions.toml │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── jwt-signer │ ├── build.gradle.kts │ └── src │ │ └── main │ │ └── java │ │ └── org │ │ └── eclipse │ │ └── tractusx │ │ └── edc │ │ └── mxd │ │ └── JwtSigner.java ├── settings.gradle.kts ├── tx-catalog-server │ ├── build.gradle.kts │ └── src │ │ └── main │ │ └── docker │ │ └── Dockerfile ├── tx-identityhub │ ├── build.gradle.kts │ └── src │ │ ├── main │ │ ├── docker │ │ │ └── Dockerfile │ │ ├── java │ │ │ └── org │ │ │ │ └── eclipse │ │ │ │ └── edc │ │ │ │ └── identityhub │ │ │ │ ├── demo │ │ │ │ ├── IdentityHubExtension.java │ │ │ │ └── TxScopeToCriterionTransformer.java │ │ │ │ └── seed │ │ │ │ └── SuperUserSeedExtension.java │ │ └── resources │ │ │ └── META-INF │ │ │ └── services │ │ │ └── org.eclipse.edc.spi.system.ServiceExtension │ │ └── test │ │ └── java │ │ └── org │ │ └── eclipse │ │ └── edc │ │ └── identityhub │ │ └── seed │ │ └── ParticipantContextSeedExtensionTest.java └── tx-issuerservice │ ├── build.gradle.kts │ └── src │ ├── main │ ├── docker │ │ └── Dockerfile │ ├── java │ │ └── org │ │ │ └── eclipse │ │ │ └── edc │ │ │ └── issuerservice │ │ │ ├── demo │ │ │ └── attestation │ │ │ │ ├── DemoAttestationSource.java │ │ │ │ ├── DemoAttestationSourceFactory.java │ │ │ │ ├── DemoAttestationsExtension.java │ │ │ │ └── DemoAttestatonSourceValidator.java │ │ │ └── seed │ │ │ └── SuperUserSeedExtension.java │ └── resources │ │ └── META-INF │ │ └── services │ │ └── org.eclipse.edc.spi.system.ServiceExtension │ └── test │ └── java │ └── org │ └── eclipse │ └── edc │ └── issuerservice │ └── seed │ └── ParticipantContextSeedExtensionTest.java ├── mxd ├── README.md ├── alice.tf ├── alice_variables.tf ├── assets │ ├── alice.dataexchangegov.jwt │ ├── alice.membership.jwt │ ├── alice_bucket.png │ ├── alice_bucket_content.png │ ├── bob-azure-container.png │ ├── bob.dataexchangegov.jwt │ ├── bob.membership.jwt │ ├── bob_bucket_content.png │ ├── bob_bucket_content_after_transfer.png │ ├── img.png │ ├── issuer.did.json │ ├── issuer.key.json │ ├── issuer.pub.json │ ├── nginx.conf │ ├── participants.json │ ├── scr_pgadmin1.png │ └── test-document.txt ├── bdrs.tf ├── bob.tf ├── bob_variables.tf ├── data-service-api.tf ├── docs │ ├── Access Policies Tutorial.md │ ├── Business Partner Group Policy Tutorial.md │ ├── CredentialIssuance.md │ ├── EDR Transfer Tutorial.md │ ├── File Transfer Azure to Azure.md │ ├── File Transfer Azure to S3.md │ ├── File Transfer S3 to Azure.md │ ├── File Transfer S3 to S3.md │ ├── MXD Remote Deployment.md │ └── Trudy Connector Tutorial.md ├── issuer-service.tf ├── issuer_nginx.tf ├── kind.config.yaml ├── main.tf ├── modules │ ├── azurite │ │ ├── main.tf │ │ ├── outputs.tf │ │ └── variables.tf │ ├── catalog-server │ │ ├── catalog-server.tf │ │ ├── ingress.tf │ │ ├── outputs.tf │ │ ├── services.tf │ │ └── variables.tf │ ├── connector │ │ ├── azurite-container.tf │ │ ├── ingress.tf │ │ ├── main.tf │ │ ├── outputs.tf │ │ ├── service.tf │ │ ├── values.yaml │ │ └── variables.tf │ ├── identity-hub │ │ ├── ingress.tf │ │ ├── main.tf │ │ ├── outputs.tf │ │ ├── services.tf │ │ └── variables.tf │ ├── issuerservice │ │ ├── TODO.txt │ │ ├── ingress.tf │ │ ├── main.tf │ │ ├── outputs.tf │ │ ├── services.tf │ │ └── variables.tf │ ├── minio │ │ ├── main.tf │ │ ├── nodeport.tf │ │ ├── output.tf │ │ ├── s3bucket_job.tf │ │ └── variables.tf │ ├── postgres │ │ ├── main.tf │ │ ├── outputs.tf │ │ └── variables.tf │ └── vault │ │ ├── variables.tf │ │ ├── vault-values.yaml │ │ └── vault.tf ├── outputs.tf ├── performance-tests │ ├── README.md │ ├── experiment_controller.sh │ ├── graphics │ │ ├── Initial_Counter.svg │ │ ├── Sources │ │ │ ├── Inital_Counter.drawio │ │ │ ├── Supplier_OEM.drawio │ │ │ ├── TestSetup.drawio │ │ │ └── Test_Deployment.drawio │ │ ├── Supplier_OEM.svg │ │ ├── TestSetup.svg │ │ └── Test_Deployment.svg │ ├── help.txt │ ├── mxd-performance-evaluation │ │ ├── measurement_interval.jmx │ │ ├── run_experiment.sh │ │ └── setup.jmx │ ├── performance-test.yaml │ ├── prometheus │ │ ├── clusterRole.yaml │ │ ├── config-map.yaml │ │ ├── prometheus-deployment.yaml │ │ ├── prometheus-ingress.yaml │ │ └── prometheus-service.yaml │ └── test-configurations │ │ └── small_experiment.properties ├── postgres-init.tf ├── postman │ ├── management_api_tests.json │ ├── mxd-management-apis.json │ └── mxd-seed.json ├── seed_data.tf ├── trudy.tfignore └── variables.tf ├── package-lock.json ├── pr_etiquette.md └── styleguide.md /.github/actions/mxd-test-action/action.yml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft 3 | # 4 | # See the NOTICE file(s) distributed with this work for additional 5 | # information regarding copyright ownership. 6 | # 7 | # This program and the accompanying materials are made available under the 8 | # terms of the Apache License, Version 2.0 which is available at 9 | # https://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | # SPDX-License-Identifier: Apache-2.0 18 | # 19 | --- 20 | name: "Run Tests" 21 | description: "Install newman and run test configured in postman collection." 22 | 23 | runs: 24 | using: "composite" 25 | steps: 26 | - name: Setup Node.js 27 | uses: actions/setup-node@v3 28 | with: 29 | node-version: 18 30 | 31 | - name: Install newman 32 | shell: bash 33 | run: npm install -g newman 34 | 35 | - name: Run Newman 36 | shell: bash 37 | run: newman run mxd/postman/management_api_tests.json 38 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft 3 | # 4 | # See the NOTICE file(s) distributed with this work for additional 5 | # information regarding copyright ownership. 6 | # 7 | # This program and the accompanying materials are made available under the 8 | # terms of the Apache License, Version 2.0 which is available at 9 | # https://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | # SPDX-License-Identifier: Apache-2.0 18 | # 19 | 20 | --- 21 | version: 2 22 | updates: 23 | # maintain dependencies for GitHub actions 24 | - package-ecosystem: "github-actions" 25 | directory: "/" 26 | schedule: 27 | interval: "weekly" # default = monday 28 | open-pull-requests-limit: 5 29 | labels: 30 | - "dependencies" 31 | - "github_actions" 32 | 33 | # maintain dependencies for Gradle 34 | - package-ecosystem: "gradle" # checks build.gradle(.kts) and settings.gradle(.kts) 35 | directory: "/" 36 | schedule: 37 | interval: "weekly" 38 | open-pull-requests-limit: 5 39 | labels: 40 | - "dependencies" 41 | - "java" 42 | ignore: 43 | - dependency-name: "org.eclipse.edc:edc-versions" 44 | 45 | - package-ecosystem: "terraform" 46 | directory: "/mxd" 47 | schedule: 48 | interval: "weekly" 49 | open-pull-requests-limit: 5 50 | labels: 51 | - "dependencies" 52 | - "terraform" 53 | 54 | - package-ecosystem: "npm" 55 | directory: "/edc-policy-playground" 56 | schedule: 57 | interval: "weekly" 58 | open-pull-requests-limit: 5 59 | labels: 60 | - "dependencies" 61 | - "npm" 62 | -------------------------------------------------------------------------------- /.github/workflows/publish-playground.yaml: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft 2 | # 3 | # See the NOTICE file(s) distributed with this work for additional 4 | # information regarding copyright ownership. 5 | # 6 | # This program and the accompanying materials are made available under the 7 | # terms of the Apache License, Version 2.0 which is available at 8 | # https://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | # License for the specific language governing permissions and limitations 14 | # under the License. 15 | # 16 | # SPDX-License-Identifier: Apache-2.0 17 | # 18 | 19 | --- 20 | name: Publish playground 21 | 22 | on: 23 | push: 24 | branches: [main] 25 | paths: 26 | - 'edc-policy-playground/**' 27 | 28 | jobs: 29 | build: 30 | runs-on: ubuntu-latest 31 | defaults: 32 | run: 33 | working-directory: edc-policy-playground 34 | permissions: 35 | contents: write 36 | pages: write 37 | steps: 38 | - uses: actions/checkout@v4 39 | - name: Use Node.js ${{ matrix.node-version }} 40 | uses: actions/setup-node@v4 41 | with: 42 | node-version: 18 43 | - name: npm ci, build and test 44 | run: | 45 | npm ci 46 | npm run build -- --base-href=/tutorial-resources/policy-playground/ 47 | 48 | - name: deploy to gh-pages 49 | uses: peaceiris/actions-gh-pages@v4 50 | with: 51 | github_token: ${{ secrets.GITHUB_TOKEN }} 52 | publish_dir: ./edc-policy-playground/dist 53 | keep_files: true 54 | -------------------------------------------------------------------------------- /.github/workflows/run-tests.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2024 SAP SE 3 | # 4 | # This program and the accompanying materials are made available under the 5 | # terms of the Apache License, Version 2.0 which is available at 6 | # https://www.apache.org/licenses/LICENSE-2.0 7 | # 8 | # SPDX-License-Identifier: Apache-2.0 9 | # 10 | # Contributors: 11 | # SAP SE - initial API and implementation 12 | 13 | --- 14 | name: "Run Tests" 15 | 16 | on: 17 | push: 18 | branches: 19 | - main 20 | 21 | pull_request: 22 | branches: 23 | - main 24 | paths: 25 | - 'mxd-runtimes/**' 26 | 27 | # Allows you to run this workflow manually from the Actions tab 28 | workflow_dispatch: 29 | 30 | concurrency: 31 | group: ${{ github.workflow }}-${{ github.ref }} 32 | cancel-in-progress: true 33 | 34 | jobs: 35 | 36 | Unit-Tests: 37 | runs-on: ubuntu-latest 38 | steps: 39 | - uses: actions/checkout@v4 40 | - uses: actions/setup-java@v4 41 | with: 42 | distribution: 'temurin' 43 | java-version: '21' 44 | 45 | - name: Run Unit Tests 46 | working-directory: mxd-runtimes 47 | run: ./gradlew :test 48 | 49 | API-Tests: 50 | runs-on: ubuntu-latest 51 | steps: 52 | - uses: actions/checkout@v4 53 | - uses: actions/setup-java@v4 54 | with: 55 | distribution: 'temurin' 56 | java-version: '21' 57 | 58 | - name: Run API Tests 59 | working-directory: mxd-runtimes 60 | run: ./gradlew -DincludeTags="ApiTest" :test 61 | 62 | Component-Tests: 63 | runs-on: ubuntu-latest 64 | steps: 65 | - uses: actions/checkout@v4 66 | - uses: actions/setup-java@v4 67 | with: 68 | distribution: 'temurin' 69 | java-version: '21' 70 | 71 | - name: Run API Tests 72 | working-directory: mxd-runtimes 73 | run: ./gradlew -DincludeTags="ComponentTest" :test 74 | -------------------------------------------------------------------------------- /.github/workflows/secrets-scan.yml: -------------------------------------------------------------------------------- 1 | ################################################################################# 2 | # Copyright (c) 2024 Contributors to the Eclipse Foundation 3 | # 4 | # See the NOTICE file(s) distributed with this work for additional 5 | # information regarding copyright ownership. 6 | # 7 | # This program and the accompanying materials are made available under the 8 | # terms of the Apache License, Version 2.0 which is available at 9 | # https://www.apache.org/licenses/LICENSE-2.0. 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | # SPDX-License-Identifier: Apache-2.0 18 | ################################################################################# 19 | 20 | 21 | name: "TruffleHog Secrets Scan" 22 | 23 | on: 24 | push: 25 | branches: [ main ] 26 | pull_request: 27 | schedule: 28 | - cron: "0 0 * * *" # Once a day 29 | 30 | permissions: 31 | actions: read 32 | contents: read 33 | security-events: write 34 | id-token: write 35 | issues: write 36 | 37 | jobs: 38 | ScanSecrets: 39 | name: Scan secrets 40 | runs-on: ubuntu-latest 41 | steps: 42 | - name: Checkout Repository 43 | uses: actions/checkout@v4 44 | with: 45 | fetch-depth: 0 # Ensure full clone for pull request workflows 46 | 47 | - name: TruffleHog OSS 48 | id: trufflehog 49 | uses: trufflesecurity/trufflehog@main 50 | continue-on-error: true 51 | with: 52 | path: ./ # Scan the entire repository 53 | base: "${{ github.event.repository.default_branch }}" # Set base branch for comparison (pull requests) 54 | extra_args: --filter-entropy=4 --results=verified,unknown --debug 55 | 56 | - name: Scan Results Status 57 | if: steps.trufflehog.outcome == 'failure' 58 | run: exit 1 # Set workflow run to failure if TruffleHog finds secrets -------------------------------------------------------------------------------- /.github/workflows/triage-issue.yml: -------------------------------------------------------------------------------- 1 | ################################################################################# 2 | # Copyright (c) 2025 Cofinity-X 3 | # 4 | # See the NOTICE file(s) distributed with this work for additional 5 | # information regarding copyright ownership. 6 | # 7 | # This program and the accompanying materials are made available under the 8 | # terms of the Apache License, Version 2.0 which is available at 9 | # https://www.apache.org/licenses/LICENSE-2.0. 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | # SPDX-License-Identifier: Apache-2.0 18 | ################################################################################# 19 | 20 | 21 | name: triage opened issue 22 | 23 | on: 24 | issues: 25 | types: 26 | - reopened 27 | - opened 28 | 29 | jobs: 30 | label-issue: 31 | runs-on: ubuntu-latest 32 | permissions: 33 | issues: write 34 | steps: 35 | - run: gh issue edit "$NUMBER" --add-label "$LABELS" 36 | env: 37 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} 38 | GH_REPO: ${{ github.repository }} 39 | NUMBER: ${{ github.event.issue.number }} 40 | LABELS: triage 41 | -------------------------------------------------------------------------------- /.github/workflows/verify-playground.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft 2 | # 3 | # See the NOTICE file(s) distributed with this work for additional 4 | # information regarding copyright ownership. 5 | # 6 | # This program and the accompanying materials are made available under the 7 | # terms of the Apache License, Version 2.0 which is available at 8 | # https://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | # License for the specific language governing permissions and limitations 14 | # under the License. 15 | # 16 | # SPDX-License-Identifier: Apache-2.0 17 | # 18 | 19 | --- 20 | name: Verify playground 21 | 22 | on: 23 | pull_request: 24 | branches: 25 | - main 26 | paths: 27 | - 'edc-policy-playground/**' 28 | push: 29 | branches: [main] 30 | paths: 31 | - 'edc-policy-playground/**' 32 | 33 | jobs: 34 | check-dependencies: 35 | runs-on: ubuntu-latest 36 | permissions: 37 | contents: write 38 | steps: 39 | - name: Checkout 40 | uses: actions/checkout@v4 41 | 42 | - name: Run dash 43 | id: run-dash 44 | uses: eclipse-tractusx/sig-infra/.github/actions/run-dash@main 45 | with: 46 | dash_input: "edc-policy-playground/package-lock.json" 47 | check-playground: 48 | runs-on: ubuntu-latest 49 | defaults: 50 | run: 51 | working-directory: edc-policy-playground 52 | steps: 53 | - uses: actions/checkout@v4 54 | - name: Use Node.js ${{ matrix.node-version }} 55 | uses: actions/setup-node@v4 56 | with: 57 | node-version: 18 58 | - name: Run npm ci 59 | run: npm ci 60 | 61 | - name: Run npm lint 62 | run: npm run lint 63 | 64 | - name: Run npm test 65 | run: npm test 66 | -------------------------------------------------------------------------------- /.github/workflows/verify.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft 3 | # 4 | # See the NOTICE file(s) distributed with this work for additional 5 | # information regarding copyright ownership. 6 | # 7 | # This program and the accompanying materials are made available under the 8 | # terms of the Apache License, Version 2.0 which is available at 9 | # https://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | # SPDX-License-Identifier: Apache-2.0 18 | # 19 | 20 | --- 21 | name: "Verify" 22 | 23 | on: 24 | push: 25 | branches: 26 | - main 27 | pull_request: 28 | branches: 29 | - main 30 | 31 | # Allows you to run this workflow manually from the Actions tab 32 | workflow_dispatch: 33 | 34 | concurrency: 35 | group: ${{ github.workflow }}-${{ github.ref }} 36 | cancel-in-progress: true 37 | 38 | jobs: 39 | verify-license-headers: 40 | runs-on: ubuntu-latest 41 | steps: 42 | - uses: actions/checkout@v4 43 | - name: "Check for files without a license header" 44 | run: |- 45 | # checks all java, yaml, kts and sql files for an Apache 2.0 license header 46 | cmd="grep -riL \"SPDX-License-Identifier: Apache-2.0\" --include=\*.{java,ts,html,css,yaml,yml,kts,sql,tf} --exclude-dir={.gradle,\*\openapi} ." 47 | violations=$(eval $cmd | wc -l) 48 | if [[ $violations -ne 0 ]] ; then 49 | echo "$violations files without license headers were found:"; 50 | eval $cmd; 51 | exit 1; 52 | fi 53 | 54 | validate-terraform-format: 55 | runs-on: ubuntu-latest 56 | steps: 57 | - uses: actions/checkout@v4 58 | 59 | - name: "Setup Terraform" 60 | uses: hashicorp/setup-terraform@v3 61 | 62 | - name: "Validate Terraform format" 63 | working-directory: mxd 64 | run: |- 65 | terraform fmt -check -recursive 66 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ### Terraform template 2 | # Local .terraform directories 3 | **/.terraform/* 4 | 5 | # .tfstate files 6 | *.tfstate 7 | *.tfstate.* 8 | 9 | # Crash log files 10 | crash.log 11 | crash.*.log 12 | 13 | # Exclude all .tfvars files, which are likely to contain sensitive data, such as 14 | # password, private keys, and other secrets. These should not be part of version 15 | # control as they are data points which are potentially sensitive and subject 16 | # to change depending on the environment. 17 | *.tfvars 18 | *.tfvars.json 19 | 20 | # Ignore override files as they are usually used to override resources locally and so 21 | # are not checked in 22 | override.tf 23 | override.tf.json 24 | *_override.tf 25 | *_override.tf.json 26 | 27 | # Include override files you do wish to add to version control using negated pattern 28 | # !example_override.tf 29 | 30 | # Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan 31 | # example: *tfplan* 32 | 33 | # Ignore CLI configuration files 34 | .terraformrc 35 | terraform.rc 36 | 37 | .gradle 38 | build 39 | out/ 40 | 41 | .idea/ 42 | mxd/.terraform.lock.hcl 43 | #Ignore Java Classes and Gradle Build Files 44 | .class.* 45 | mxd/backend-service/.gradle 46 | .lock 47 | .bin 48 | mxd/backend-service/build 49 | *.log 50 | /mxd-runtimes/jwt-signer/out/ 51 | /icc-irs-challenges/node_modules/ 52 | -------------------------------------------------------------------------------- /.tractusx: -------------------------------------------------------------------------------- 1 | ############################################################### 2 | # Copyright (c) 2023 Contributors to the Eclipse Foundation 3 | # 4 | # See the NOTICE file(s) distributed with this work for additional 5 | # information regarding copyright ownership. 6 | # 7 | # This program and the accompanying materials are made available under the 8 | # terms of the Apache License, Version 2.0 which is available at 9 | # https://www.apache.org/licenses/LICENSE-2.0. 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | # SPDX-License-Identifier: Apache-2.0 18 | ############################################################### 19 | product: "tutorial-resources" 20 | leadingRepository: "https://github.com/eclipse-tractusx/tutorial-resources" 21 | repoCategory: "support" 22 | repositories: 23 | - name: "tutorial-resources" 24 | usage: "Tractus-X Tutorial" 25 | url: "https://github.com/eclipse-tractusx/tutorial-resources" 26 | -------------------------------------------------------------------------------- /CODEOWNERS: -------------------------------------------------------------------------------- 1 | # This file provides an overview of responsibilities in this repository. 2 | 3 | # Please note that this file does not represent all contributions to the code. What persons and organizations 4 | # actually contributed to each file can be seen on GitHub and is documented in the license headers. 5 | 6 | # Linked persons with write permissions are automatically added as reviewers when a pull request is opened. 7 | 8 | # Each line is a file pattern followed by one or more contact persons. The last matching pattern has the most precedence. 9 | # For more details, read the following article on GitHub: https://help.github.com/articles/about-codeowners/. 10 | 11 | CONTRIBUTING.md @lgblaumeiser 12 | LICENSE @lgblaumeiser 13 | NOTICE.md @lgblaumeiser 14 | pr_etiquette.md @lgblaumeiser @ndr-brt @rafaelmag110 15 | SECURITY.md @lgblaumeiser @ndr-brt @rafaelmag110 16 | styleguide.md @lgblaumeiser @ndr-brt @rafaelmag110 17 | 18 | .github/ @ndr-brt @rafaelmag110 19 | 20 | /mxd/ @ndr-brt @rafaelmag110 21 | /mxd-runtimes/ @ndr-brt @rafaelmag110 22 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to Eclipse Tractus-X 2 | 3 | Thanks for your interest in this project. 4 | 5 | ## Project description 6 | 7 | The companies involved want to increase the automotive industry's 8 | competitiveness, improve efficiency through industry-specific cooperation and 9 | accelerate company processes through standardization and access to information 10 | and data. A special focus is also on SMEs, whose active participation is of 11 | central importance for the network's success. That is why Catena-X has been 12 | conceived from the outset as an open network with solutions ready for SMEs, 13 | where these companies will be able to participate quickly and with little IT 14 | infrastructure investment. Tractus-X is meant to be the PoC project of the 15 | Catena-X alliance focusing on parts traceability. 16 | 17 | * https://projects.eclipse.org/projects/automotive.tractusx 18 | 19 | ## Project licenses 20 | 21 | The Tractus-X project uses the following licenses: 22 | 23 | * Apache-2.0 for code 24 | * CC-BY-4.0 for non-code 25 | 26 | ## Terms of Use 27 | 28 | This repository is subject to the Terms of Use of the Eclipse Foundation 29 | 30 | * https://www.eclipse.org/legal/termsofuse.php 31 | 32 | ## Developer resources 33 | 34 | Information regarding source code management, builds, coding standards, and 35 | more. 36 | 37 | * https://projects.eclipse.org/projects/automotive.tractusx/developer 38 | 39 | Getting started: 40 | 41 | * https://eclipse-tractusx.github.io/docs/developer 42 | 43 | The project maintains the following source code repositories 44 | 45 | * https://github.com/eclipse-tractusx/tutorial-resources 46 | 47 | The project maintains the source code repositories in the following GitHub organization: 48 | 49 | * https://github.com/eclipse-tractusx/ 50 | 51 | ## Eclipse Development Process 52 | 53 | This Eclipse Foundation open project is governed by the Eclipse Foundation 54 | Development Process and operates under the terms of the Eclipse IP Policy. 55 | 56 | * https://eclipse.org/projects/dev_process 57 | * https://www.eclipse.org/org/documents/Eclipse_IP_Policy.pdf 58 | 59 | ## Eclipse Contributor Agreement 60 | 61 | In order to be able to contribute to Eclipse Foundation projects you must 62 | electronically sign the Eclipse Contributor Agreement (ECA). 63 | 64 | * http://www.eclipse.org/legal/ECA.php 65 | 66 | The ECA provides the Eclipse Foundation with a permanent record that you agree 67 | that each of your contributions will comply with the commitments documented in 68 | the Developer Certificate of Origin (DCO). Having an ECA on file associated with 69 | the email address matching the "Author" field of your contribution's Git commits 70 | fulfills the DCO's requirement that you sign-off on your contributions. 71 | 72 | For more information, please see the Eclipse Committer Handbook: 73 | https://www.eclipse.org/projects/handbook/#resources-commit 74 | 75 | ## Contact 76 | 77 | Contact the project developers via the project's "dev" list. 78 | 79 | * https://accounts.eclipse.org/mailing-list/tractusx-dev 80 | -------------------------------------------------------------------------------- /NOTICE.md: -------------------------------------------------------------------------------- 1 | # Notices for Eclipse Tractus-X 2 | 3 | This content is produced and maintained by the Eclipse Tractus-X project. 4 | 5 | * Project home: 6 | 7 | See the AUTHORS file(s) distributed with this work for additional information regarding authorship. 8 | 9 | ## Trademarks 10 | 11 | Eclipse Tractus-X is a trademark of the Eclipse Foundation. 12 | 13 | ## Copyright 14 | 15 | All content is the property of the respective authors or their employers. For 16 | more information regarding authorship of content, please consult the listed 17 | source code repository logs. 18 | 19 | ## Declared Project Licenses 20 | 21 | The Tractus-X project uses the following licenses: 22 | 23 | - Apache-2.0 for code 24 | - CC-BY-4.0 for non-code 25 | 26 | Apache-2.0: 27 | This program and the accompanying materials are made available under the terms of the Apache License, Version 2.0 which 28 | is available at https://www.apache.org/licenses/LICENSE-2.0. 29 | SPDX-License-Identifier: Apache-2.0 30 | 31 | CC-BY-4.0: 32 | The materials in this repository are made available under the terms of the Creative Commons Attribution 4.0 33 | International License, which is available at https://spdx.org/licenses/CC-BY-4.0.html. 34 | SPDX-License-Identifier: CC-BY-4.0 35 | 36 | ## Source Code 37 | 38 | The project maintains the following source code repositories 39 | in the GitHub organization : 40 | 41 | * 42 | 43 | ## Third-party Content 44 | 45 | This project leverages the following third party content. 46 | 47 | See DEPENDENCIES file. 48 | 49 | ## Cryptography 50 | 51 | Content may contain encryption software. The country in which you are currently 52 | may have restrictions on the import, possession, and use, and/or re-export to 53 | another country, of encryption software. BEFORE using any encryption software, 54 | please check the country's laws, regulations and policies concerning the import, 55 | possession, or use, and re-export of encryption software, to see if this is 56 | permitted. 57 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Tractus-X Tutorial 2 | 3 | ## 1. MXD 4 | 5 | Wanna deploy your own Tractus-X Connector? Or even your own dataspace? Go check out 6 | [this tutorial](mxd/README.md) to learn how! 7 | 8 | ## 2. EDC Policy Playground 9 | 10 | Wanna play with Tractus-X EDC Policies? Run locally the [Playground](edc-policy-playground/README.md) or 11 | go to the hosted version [here](https://eclipse-tractusx.github.io/tutorial-resources/policy-playground) 12 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | ## Reporting a Vulnerability 4 | 5 | Please report a found vulnerability here: 6 | -------------------------------------------------------------------------------- /edc-policy-playground/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "root": true, 3 | "ignorePatterns": ["projects/**/*", "src/index.html"], 4 | "plugins": ["prettier"], 5 | "rules": { 6 | "@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_" }], 7 | "prettier/prettier": "error" 8 | }, 9 | "overrides": [ 10 | { 11 | "files": ["*.ts"], 12 | "extends": [ 13 | "eslint:recommended", 14 | "plugin:@typescript-eslint/recommended", 15 | "plugin:@angular-eslint/recommended", 16 | "plugin:@angular-eslint/template/process-inline-templates" 17 | ], 18 | "rules": { 19 | "@angular-eslint/directive-selector": [ 20 | "error", 21 | { 22 | "type": "attribute", 23 | "prefix": "app", 24 | "style": "camelCase" 25 | } 26 | ], 27 | "@angular-eslint/component-selector": [ 28 | "error", 29 | { 30 | "type": "element", 31 | "prefix": "app", 32 | "style": "kebab-case" 33 | } 34 | ] 35 | } 36 | }, 37 | { 38 | "files": ["*.html"], 39 | "extends": ["plugin:@angular-eslint/template/recommended", "plugin:@angular-eslint/template/accessibility"], 40 | "rules": {} 41 | } 42 | ] 43 | } 44 | -------------------------------------------------------------------------------- /edc-policy-playground/.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # Compiled output 4 | dist 5 | tmp 6 | out-tsc 7 | bazel-out 8 | 9 | # Node 10 | node_modules 11 | npm-debug.log 12 | yarn-error.log 13 | 14 | # IDEs and editors 15 | .idea/ 16 | .project 17 | .classpath 18 | .c9/ 19 | *.launch 20 | .settings/ 21 | *.sublime-workspace 22 | 23 | # Visual Studio Code 24 | .vscode/* 25 | !.vscode/settings.json 26 | !.vscode/tasks.json 27 | !.vscode/launch.json 28 | !.vscode/extensions.json 29 | .history/* 30 | 31 | # Miscellaneous 32 | .angular/cache 33 | .sass-cache/ 34 | connect.lock 35 | coverage 36 | libpeerconnection.log 37 | testem.log 38 | typings 39 | 40 | # System files 41 | .DS_Store 42 | Thumbs.db 43 | -------------------------------------------------------------------------------- /edc-policy-playground/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "semi": true, 3 | "trailingComma": "all", 4 | "singleQuote": true, 5 | "printWidth": 120, 6 | "tabWidth": 2, 7 | "arrowParens": "avoid" 8 | } 9 | -------------------------------------------------------------------------------- /edc-policy-playground/README.md: -------------------------------------------------------------------------------- 1 | # EdcPolicyPlayground 2 | 3 | This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 16.1.6. 4 | 5 | ## Development server 6 | 7 | Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The application will automatically reload if you change any of the source files. 8 | 9 | ## Code scaffolding 10 | 11 | Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`. 12 | 13 | ## Build 14 | 15 | Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. 16 | 17 | ## Running unit tests 18 | 19 | Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). 20 | 21 | ## Running end-to-end tests 22 | 23 | Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities. 24 | 25 | ## Further help 26 | 27 | To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page. 28 | -------------------------------------------------------------------------------- /edc-policy-playground/fixtures/policies/bpn.json: -------------------------------------------------------------------------------- 1 | { 2 | "@context": [ 3 | "http://www.w3.org/ns/odrl.jsonld", 4 | "https://w3id.org/tractusx/edc/v0.0.1", 5 | { 6 | "@vocab": "https://w3id.org/edc/v0.0.1/ns/" 7 | } 8 | ], 9 | "@type": "PolicyDefinition", 10 | "@id": "{{POLICY_ID}}", 11 | "policy": { 12 | "@type": "Set", 13 | "permission": [ 14 | { 15 | "action": "use", 16 | "constraint": [ 17 | { 18 | "leftOperand": "BusinessPartnerNumber", 19 | "operator": "eq", 20 | "rightOperand": "" 21 | } 22 | ] 23 | } 24 | ] 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /edc-policy-playground/fixtures/policies/bpnGroup.json: -------------------------------------------------------------------------------- 1 | { 2 | "@context": [ 3 | "http://www.w3.org/ns/odrl.jsonld", 4 | "https://w3id.org/tractusx/edc/v0.0.1", 5 | { 6 | "@vocab": "https://w3id.org/edc/v0.0.1/ns/" 7 | } 8 | ], 9 | "@type": "PolicyDefinition", 10 | "@id": "{{POLICY_ID}}", 11 | "policy": { 12 | "@type": "Set", 13 | "permission": [ 14 | { 15 | "action": "use", 16 | "constraint": [ 17 | { 18 | "leftOperand": "BusinessPartnerGroup", 19 | "operator": "isPartOf", 20 | "rightOperand": "" 21 | } 22 | ] 23 | } 24 | ] 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /edc-policy-playground/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "edc-policy-playground", 3 | "version": "0.0.1", 4 | "scripts": { 5 | "ng": "ng", 6 | "start": "ng serve", 7 | "build": "ng build", 8 | "watch": "ng build --watch --configuration development", 9 | "test": "ng test --browsers=ChromeHeadless --watch=false", 10 | "format": "prettier --write \"src/**/*.{js,ts,json,md,css,scss,html}\"", 11 | "lint": "ng lint" 12 | }, 13 | "private": true, 14 | "dependencies": { 15 | "@angular/animations": "^18.0.6", 16 | "@angular/common": "^18.0.6", 17 | "@angular/core": "^18.0.6", 18 | "@angular/forms": "^18.0.6", 19 | "@angular/platform-browser": "^18.0.6", 20 | "@angular/platform-browser-dynamic": "^18.0.6", 21 | "@angular/router": "^18.0.6", 22 | "@angular/compiler": "^18.0.6", 23 | "@angular/material": "^18.0.6", 24 | "@codemirror/lang-json": "^6.0.1", 25 | "@codemirror/state": "^6.4.0", 26 | "codemirror": "^6.0.1", 27 | "rxjs": "~7.8.0", 28 | "tslib": "^2.6.3", 29 | "zone.js": "~0.14.7" 30 | }, 31 | "devDependencies": { 32 | "@angular-devkit/build-angular": "^18.0.7", 33 | "@angular-eslint/builder": "18.2.0", 34 | "@angular-eslint/eslint-plugin": "18.2.0", 35 | "@angular-eslint/eslint-plugin-template": "18.2.0", 36 | "@angular-eslint/schematics": "18.3.1", 37 | "@angular-eslint/template-parser": "18.2.0", 38 | "@angular/cli": "~18.0.7", 39 | "@angular/compiler-cli": "^18.0.6", 40 | "@types/jasmine": "~5.1.4", 41 | "@types/node": "^20.14.10", 42 | "@typescript-eslint/eslint-plugin": "7.15.0", 43 | "@typescript-eslint/parser": "7.18.0", 44 | "eslint": "^8.55.0", 45 | "eslint-plugin-prettier": "^5.2.1", 46 | "jasmine-core": "~5.3.0", 47 | "karma": "~6.4.0", 48 | "karma-chrome-launcher": "~3.2.0", 49 | "karma-coverage": "~2.2.0", 50 | "karma-jasmine": "~5.1.0", 51 | "karma-jasmine-html-reporter": "~2.1.0", 52 | "typescript": "~5.4.5" 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /edc-policy-playground/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /edc-policy-playground/src/app/app.component.spec.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 3 | * Copyright (c) 2023 Contributors to the Eclipse Foundation 4 | * 5 | * See the NOTICE file(s) distributed with this work for additional 6 | * information regarding copyright ownership. 7 | * 8 | * This program and the accompanying materials are made available under the 9 | * terms of the Apache License, Version 2.0 which is available at 10 | * https://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 14 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 15 | * License for the specific language governing permissions and limitations 16 | * under the License. 17 | * 18 | * SPDX-License-Identifier: Apache-2.0 19 | ******************************************************************************/ 20 | 21 | import { TestBed } from '@angular/core/testing'; 22 | import { AppComponent } from './app.component'; 23 | import { AppHeaderComponent } from './components/header/header.component'; 24 | import { PolicyEditorComponent } from './components/policy-editor/policy-editor.component'; 25 | import { PolicyService } from './services/policy.service'; 26 | import { FormatService } from './services/format.service'; 27 | import { PolicyConfigurationStore } from './stores/policy.store'; 28 | import { BrowserModule } from '@angular/platform-browser'; 29 | import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; 30 | 31 | describe('AppComponent', () => { 32 | beforeEach(() => 33 | TestBed.configureTestingModule({ 34 | declarations: [AppComponent], 35 | imports: [BrowserModule, BrowserAnimationsModule, AppHeaderComponent, PolicyEditorComponent], 36 | providers: [PolicyService, FormatService, PolicyConfigurationStore], 37 | }), 38 | ); 39 | 40 | it('should create the app', () => { 41 | const fixture = TestBed.createComponent(AppComponent); 42 | const app = fixture.componentInstance; 43 | expect(app).toBeTruthy(); 44 | }); 45 | 46 | it(`should have as title 'edc-policy-playground'`, () => { 47 | const fixture = TestBed.createComponent(AppComponent); 48 | const app = fixture.componentInstance; 49 | expect(app.title).toEqual('edc-policy-playground'); 50 | }); 51 | }); 52 | -------------------------------------------------------------------------------- /edc-policy-playground/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 3 | * Copyright (c) 2023 Contributors to the Eclipse Foundation 4 | * 5 | * See the NOTICE file(s) distributed with this work for additional 6 | * information regarding copyright ownership. 7 | * 8 | * This program and the accompanying materials are made available under the 9 | * terms of the Apache License, Version 2.0 which is available at 10 | * https://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 14 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 15 | * License for the specific language governing permissions and limitations 16 | * under the License. 17 | * 18 | * SPDX-License-Identifier: Apache-2.0 19 | ******************************************************************************/ 20 | 21 | import { Component } from '@angular/core'; 22 | 23 | @Component({ 24 | selector: 'app-root', 25 | templateUrl: './app.component.html', 26 | }) 27 | export class AppComponent { 28 | title = 'edc-policy-playground'; 29 | } 30 | -------------------------------------------------------------------------------- /edc-policy-playground/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 3 | * Copyright (c) 2023 Contributors to the Eclipse Foundation 4 | * 5 | * See the NOTICE file(s) distributed with this work for additional 6 | * information regarding copyright ownership. 7 | * 8 | * This program and the accompanying materials are made available under the 9 | * terms of the Apache License, Version 2.0 which is available at 10 | * https://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 14 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 15 | * License for the specific language governing permissions and limitations 16 | * under the License. 17 | * 18 | * SPDX-License-Identifier: Apache-2.0 19 | ******************************************************************************/ 20 | 21 | import { NgModule } from '@angular/core'; 22 | import { BrowserModule } from '@angular/platform-browser'; 23 | 24 | import { AppComponent } from './app.component'; 25 | import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; 26 | import { PolicyService } from './services/policy.service'; 27 | import { FormatService } from './services/format.service'; 28 | import { PolicyConfigurationStore } from './stores/policy.store'; 29 | import { AppHeaderComponent } from './components/header/header.component'; 30 | import { PolicyEditorComponent } from './components/policy-editor/policy-editor.component'; 31 | 32 | @NgModule({ 33 | declarations: [AppComponent], 34 | imports: [BrowserModule, BrowserAnimationsModule, AppHeaderComponent, PolicyEditorComponent], 35 | providers: [PolicyService, FormatService, PolicyConfigurationStore], 36 | bootstrap: [AppComponent], 37 | }) 38 | export class AppModule {} 39 | -------------------------------------------------------------------------------- /edc-policy-playground/src/app/components/editor/editor.component.html: -------------------------------------------------------------------------------- 1 | 20 | -------------------------------------------------------------------------------- /edc-policy-playground/src/app/components/editor/editor.component.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 3 | * Copyright (c) 2023 Contributors to the Eclipse Foundation 4 | * 5 | * See the NOTICE file(s) distributed with this work for additional 6 | * information regarding copyright ownership. 7 | * 8 | * This program and the accompanying materials are made available under the 9 | * terms of the Apache License, Version 2.0 which is available at 10 | * https://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 14 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 15 | * License for the specific language governing permissions and limitations 16 | * under the License. 17 | * 18 | * SPDX-License-Identifier: Apache-2.0 19 | ******************************************************************************/ 20 | 21 | import { AfterViewInit, Component, Output, ViewChild, ElementRef, ViewEncapsulation, Input } from '@angular/core'; 22 | import { EditorView, basicSetup } from 'codemirror'; 23 | import { json } from '@codemirror/lang-json'; 24 | import { EditorState } from '@codemirror/state'; 25 | 26 | @Component({ 27 | selector: 'app-editor', 28 | template: `
`, 29 | standalone: true, 30 | styles: [ 31 | ` 32 | .cm-editor { 33 | height: 100%; 34 | } 35 | .cm-scroller { 36 | overflow: auto; 37 | } 38 | 39 | .codemirrorhost { 40 | height: 100%; 41 | } 42 | `, 43 | ], 44 | encapsulation: ViewEncapsulation.None, 45 | }) 46 | export class EditorComponent implements AfterViewInit { 47 | @Output() editor!: EditorView; 48 | 49 | @Input() 50 | get text() { 51 | return this._text; 52 | } 53 | 54 | set text(text: string) { 55 | this._text = text; 56 | if (this.editor != null) { 57 | this.editor.dispatch({ 58 | changes: { 59 | from: 0, 60 | to: this.editor.state.doc.length, 61 | insert: text, 62 | }, 63 | }); 64 | } 65 | } 66 | 67 | private _text!: string; 68 | 69 | @ViewChild('codemirrorhost') 70 | codemirrorhost!: ElementRef; 71 | 72 | ngAfterViewInit(): void { 73 | this.editor = new EditorView({ 74 | doc: this.text, 75 | extensions: [basicSetup, json(), EditorState.readOnly.of(true)], 76 | parent: this.codemirrorhost.nativeElement, 77 | }); 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /edc-policy-playground/src/app/components/header/header.component.css: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 3 | * Copyright (c) 2023 Contributors to the Eclipse Foundation 4 | * 5 | * See the NOTICE file(s) distributed with this work for additional 6 | * information regarding copyright ownership. 7 | * 8 | * This program and the accompanying materials are made available under the 9 | * terms of the Apache License, Version 2.0 which is available at 10 | * https://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 14 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 15 | * License for the specific language governing permissions and limitations 16 | * under the License. 17 | * 18 | * SPDX-License-Identifier: Apache-2.0 19 | ******************************************************************************/ 20 | 21 | .header { 22 | box-shadow: 23 | 0 3px 5px -1px #0003, 24 | 0 6px 10px #00000024, 25 | 0 1px 18px #0000001f; 26 | } 27 | -------------------------------------------------------------------------------- /edc-policy-playground/src/app/components/header/header.component.html: -------------------------------------------------------------------------------- 1 | 20 | 21 | 22 | TractusX-EDC Policy Playouground 23 | 24 | -------------------------------------------------------------------------------- /edc-policy-playground/src/app/components/header/header.component.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 3 | * Copyright (c) 2023 Contributors to the Eclipse Foundation 4 | * 5 | * See the NOTICE file(s) distributed with this work for additional 6 | * information regarding copyright ownership. 7 | * 8 | * This program and the accompanying materials are made available under the 9 | * terms of the Apache License, Version 2.0 which is available at 10 | * https://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 14 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 15 | * License for the specific language governing permissions and limitations 16 | * under the License. 17 | * 18 | * SPDX-License-Identifier: Apache-2.0 19 | ******************************************************************************/ 20 | 21 | import { Component } from '@angular/core'; 22 | import { MatIconModule } from '@angular/material/icon'; 23 | import { MatButtonModule } from '@angular/material/button'; 24 | import { MatToolbarModule } from '@angular/material/toolbar'; 25 | 26 | import { PolicyEditorComponent } from '../policy-editor/policy-editor.component'; 27 | 28 | @Component({ 29 | selector: 'app-header', 30 | templateUrl: './header.component.html', 31 | styleUrls: ['./header.component.css'], 32 | standalone: true, 33 | imports: [MatToolbarModule, MatButtonModule, MatIconModule, PolicyEditorComponent], 34 | }) 35 | export class AppHeaderComponent {} 36 | -------------------------------------------------------------------------------- /edc-policy-playground/src/app/components/policy-editor/policy-builder/constraint/atomic.constraint.component.html: -------------------------------------------------------------------------------- 1 | 20 | 21 |
22 |
23 | 24 | Left Operand (value) 25 | 26 | 27 |
28 | 29 | Operator 30 | 31 | 32 | {{ operator }} 33 | 34 | 35 | 36 | 37 | Right Operand Kind 38 | 39 | 40 | {{ t }} 41 | 42 | 43 | 44 |
45 | 46 | Right Operand 47 | 48 | 49 | 50 | Right Operand 51 | 52 | 53 | 54 |
55 |
56 | -------------------------------------------------------------------------------- /edc-policy-playground/src/app/components/policy-editor/policy-builder/constraint/constraint.list.component.html: -------------------------------------------------------------------------------- 1 | 20 | 21 | 22 |
24 | Constraints 25 | 28 | 29 | 32 | 33 |
34 |
35 | 36 | 37 |
38 | {{ constraint.toString() }} 39 |
40 | 43 | 46 |
47 |
48 |
49 |
50 | -------------------------------------------------------------------------------- /edc-policy-playground/src/app/components/policy-editor/policy-builder/constraint/constraint.list.component.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 3 | * Copyright (c) 2023 Contributors to the Eclipse Foundation 4 | * 5 | * See the NOTICE file(s) distributed with this work for additional 6 | * information regarding copyright ownership. 7 | * 8 | * This program and the accompanying materials are made available under the 9 | * terms of the Apache License, Version 2.0 which is available at 10 | * https://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 14 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 15 | * License for the specific language governing permissions and limitations 16 | * under the License. 17 | * 18 | * SPDX-License-Identifier: Apache-2.0 19 | ******************************************************************************/ 20 | 21 | import { NgFor } from '@angular/common'; 22 | import { Component, EventEmitter, Input, Output } from '@angular/core'; 23 | import { MatButtonModule } from '@angular/material/button'; 24 | import { MatIconModule } from '@angular/material/icon'; 25 | import { MatListModule } from '@angular/material/list'; 26 | import { MatMenuModule } from '@angular/material/menu'; 27 | import { Constraint, ConstraintContainer, ConstraintTemplate } from 'src/app/models/policy'; 28 | 29 | @Component({ 30 | selector: 'app-constraint-list', 31 | templateUrl: './constraint.list.component.html', 32 | standalone: true, 33 | imports: [MatListModule, MatMenuModule, MatIconModule, NgFor, MatButtonModule], 34 | }) 35 | export class ConstraintListComponent { 36 | @Input() container!: ConstraintContainer; 37 | 38 | @Input() constraints: ConstraintTemplate[] = []; 39 | 40 | @Output() 41 | constraintRemove = new EventEmitter(); 42 | 43 | @Output() 44 | constraintAdd = new EventEmitter(); 45 | 46 | @Output() 47 | constraintEdit = new EventEmitter(); 48 | 49 | addConstraint(constraint: Constraint) { 50 | this.container.constraints.push(constraint); 51 | this.constraintAdd.emit(constraint); 52 | this.editConstraint(constraint); 53 | } 54 | 55 | removeConstraint(constraint: Constraint) { 56 | this.container.constraints = this.container.constraints.filter(item => item != constraint); 57 | this.constraintRemove.emit(constraint); 58 | } 59 | 60 | editConstraint(constraint: Constraint) { 61 | this.constraintEdit.emit(constraint); 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /edc-policy-playground/src/app/components/policy-editor/policy-builder/constraint/value.expression.component.html: -------------------------------------------------------------------------------- 1 | 20 | 21 |
22 | 23 | Right Operand Value 24 | 25 | 26 | 27 | 28 | Right Operand Value Type 29 | 30 | 31 |
32 | -------------------------------------------------------------------------------- /edc-policy-playground/src/app/components/policy-editor/policy-builder/constraint/value.expression.component.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 3 | * Copyright (c) 2023 Contributors to the Eclipse Foundation 4 | * 5 | * See the NOTICE file(s) distributed with this work for additional 6 | * information regarding copyright ownership. 7 | * 8 | * This program and the accompanying materials are made available under the 9 | * terms of the Apache License, Version 2.0 which is available at 10 | * https://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 14 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 15 | * License for the specific language governing permissions and limitations 16 | * under the License. 17 | * 18 | * SPDX-License-Identifier: Apache-2.0 19 | ******************************************************************************/ 20 | 21 | import { NgFor, NgIf, NgSwitch, NgSwitchCase } from '@angular/common'; 22 | import { Component, Input, OnInit } from '@angular/core'; 23 | import { FormsModule } from '@angular/forms'; 24 | import { MatButtonModule } from '@angular/material/button'; 25 | import { MatFormFieldModule } from '@angular/material/form-field'; 26 | import { MatIconModule } from '@angular/material/icon'; 27 | import { MatInputModule } from '@angular/material/input'; 28 | import { MatListModule } from '@angular/material/list'; 29 | import { MatMenuModule } from '@angular/material/menu'; 30 | import { MatSelectModule } from '@angular/material/select'; 31 | import { AtomicConstraint, Value, ValueKind } from 'src/app/models/policy'; 32 | 33 | @Component({ 34 | selector: 'app-value-expression', 35 | templateUrl: './value.expression.component.html', 36 | styleUrls: [], 37 | standalone: true, 38 | imports: [ 39 | MatListModule, 40 | MatMenuModule, 41 | MatIconModule, 42 | MatButtonModule, 43 | FormsModule, 44 | MatFormFieldModule, 45 | MatSelectModule, 46 | MatInputModule, 47 | NgFor, 48 | NgSwitch, 49 | NgSwitchCase, 50 | NgIf, 51 | ], 52 | }) 53 | export class ValueExpressionComponent implements OnInit { 54 | @Input() constraint!: AtomicConstraint; 55 | @Input() disabled = false; 56 | 57 | value!: Value; 58 | 59 | ngOnInit() { 60 | if (this.constraint.kind === ValueKind.Value) { 61 | if (this.constraint.rightOperand == null) { 62 | this.constraint.rightOperand = new Value(); 63 | } 64 | this.value = this.constraint.rightOperand; 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /edc-policy-playground/src/app/components/policy-editor/policy-builder/permission/dialog/constraint-dialog/constraint-dialog.component.html: -------------------------------------------------------------------------------- 1 | 20 | 21 |

Edit Constraint

22 |
23 |
24 | 25 |
26 |
27 |
28 | 29 | 30 |
31 | -------------------------------------------------------------------------------- /edc-policy-playground/src/app/components/policy-editor/policy-builder/permission/dialog/constraint-dialog/constraint-dialog.component.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 3 | * Copyright (c) 2023 Contributors to the Eclipse Foundation 4 | * 5 | * See the NOTICE file(s) distributed with this work for additional 6 | * information regarding copyright ownership. 7 | * 8 | * This program and the accompanying materials are made available under the 9 | * terms of the Apache License, Version 2.0 which is available at 10 | * https://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 14 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 15 | * License for the specific language governing permissions and limitations 16 | * under the License. 17 | * 18 | * SPDX-License-Identifier: Apache-2.0 19 | ******************************************************************************/ 20 | 21 | import { NgFor } from '@angular/common'; 22 | import { Component, Inject } from '@angular/core'; 23 | import { FormsModule } from '@angular/forms'; 24 | import { MatButtonModule } from '@angular/material/button'; 25 | import { MAT_DIALOG_DATA, MatDialogRef, MatDialogModule } from '@angular/material/dialog'; 26 | import { MatFormFieldModule } from '@angular/material/form-field'; 27 | import { MatInputModule } from '@angular/material/input'; 28 | import { MatSelectModule } from '@angular/material/select'; 29 | import { AtomicConstraint, Operator } from 'src/app/models/policy'; 30 | import { AtomicConstraintComponent } from '../../../constraint/atomic.constraint.component'; 31 | 32 | @Component({ 33 | selector: 'app-constraint-dialog', 34 | templateUrl: './constraint-dialog.component.html', 35 | standalone: true, 36 | imports: [ 37 | MatDialogModule, 38 | MatFormFieldModule, 39 | FormsModule, 40 | MatButtonModule, 41 | MatInputModule, 42 | MatSelectModule, 43 | NgFor, 44 | AtomicConstraintComponent, 45 | ], 46 | }) 47 | export class ConstraintDialogComponent { 48 | operators: string[]; 49 | constraint: AtomicConstraint; 50 | constructor( 51 | public dialogRef: MatDialogRef, 52 | @Inject(MAT_DIALOG_DATA) public data: AtomicConstraint, 53 | ) { 54 | this.constraint = data.clone(); 55 | 56 | this.operators = Object.values(Operator).filter(value => typeof value === 'string') as string[]; 57 | } 58 | 59 | cancel() { 60 | this.dialogRef.close(); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /edc-policy-playground/src/app/components/policy-editor/policy-builder/permission/dialog/logical-dialog/logical-dialog.component.html: -------------------------------------------------------------------------------- 1 | 20 | 21 |

Edit Logical Constraint

22 |
23 |
24 | 25 | Operator 26 | 27 | 28 | {{ operator }} 29 | 30 | 31 | 32 | 33 |
34 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 |
51 |
52 |
53 |
54 | 55 | 56 |
57 | -------------------------------------------------------------------------------- /edc-policy-playground/src/app/components/policy-editor/policy-builder/permission/permission.component.html: -------------------------------------------------------------------------------- 1 | 20 | 21 | 22 | 23 |
24 | 25 | Name 26 | 27 | 28 | 29 | Action 30 | 31 | 32 | {{ action }} 33 | 34 | 35 | 36 | 37 | 44 | 45 |
46 |
47 |
48 | -------------------------------------------------------------------------------- /edc-policy-playground/src/app/components/policy-editor/policy-builder/policy-builder.component.css: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 3 | * Copyright (c) 2023 Contributors to the Eclipse Foundation 4 | * 5 | * See the NOTICE file(s) distributed with this work for additional 6 | * information regarding copyright ownership. 7 | * 8 | * This program and the accompanying materials are made available under the 9 | * terms of the Apache License, Version 2.0 which is available at 10 | * https://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 14 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 15 | * License for the specific language governing permissions and limitations 16 | * under the License. 17 | * 18 | * SPDX-License-Identifier: Apache-2.0 19 | ******************************************************************************/ 20 | 21 | .policy-builder-container { 22 | display: flex; 23 | flex-direction: column; 24 | align-items: flex-start; 25 | } 26 | -------------------------------------------------------------------------------- /edc-policy-playground/src/app/components/policy-editor/policy-builder/policy-builder.component.html: -------------------------------------------------------------------------------- 1 | 20 | 21 |
22 |
23 | 24 | Policy Name 25 | 26 | 27 |
28 | 29 | 30 | 31 | Permission 32 | 33 | 34 |
35 | 42 | 47 | {{ permission.name }} 48 | 49 | 50 | 56 |
57 | 58 | 61 | 62 | 63 |
64 |
65 |
66 | -------------------------------------------------------------------------------- /edc-policy-playground/src/app/components/policy-editor/policy-editor.component.css: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 3 | * Copyright (c) 2023 Contributors to the Eclipse Foundation 4 | * 5 | * See the NOTICE file(s) distributed with this work for additional 6 | * information regarding copyright ownership. 7 | * 8 | * This program and the accompanying materials are made available under the 9 | * terms of the Apache License, Version 2.0 which is available at 10 | * https://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 14 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 15 | * License for the specific language governing permissions and limitations 16 | * under the License. 17 | * 18 | * SPDX-License-Identifier: Apache-2.0 19 | ******************************************************************************/ 20 | 21 | .policy-editor { 22 | height: 100%; 23 | width: 100%; 24 | } 25 | 26 | .policy-editor-card { 27 | height: 100%; 28 | width: 100%; 29 | } 30 | .policy-editor-container { 31 | width: 90%; 32 | margin: auto; 33 | margin-top: 20px; 34 | } 35 | 36 | .policy-card-container { 37 | height: 100%; 38 | border-radius: 4px; 39 | border: 1px solid rgba(0, 0, 0, 0.2); 40 | } 41 | 42 | .policy-split-container { 43 | column-gap: 5px; 44 | } 45 | -------------------------------------------------------------------------------- /edc-policy-playground/src/app/components/policy-editor/policy-editor.component.html: -------------------------------------------------------------------------------- 1 | 20 | 21 |
22 |
23 | 24 | Select policy 25 | 26 | 27 | {{ config.name }} 28 | 29 | 30 | 31 | 32 | 35 | 38 |
39 |
40 |
41 | 42 |
43 |
44 | 45 |
46 |
47 |
48 | -------------------------------------------------------------------------------- /edc-policy-playground/src/app/services/format.service.spec.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 3 | * Copyright (c) 2023 Contributors to the Eclipse Foundation 4 | * 5 | * See the NOTICE file(s) distributed with this work for additional 6 | * information regarding copyright ownership. 7 | * 8 | * This program and the accompanying materials are made available under the 9 | * terms of the Apache License, Version 2.0 which is available at 10 | * https://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 14 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 15 | * License for the specific language governing permissions and limitations 16 | * under the License. 17 | * 18 | * SPDX-License-Identifier: Apache-2.0 19 | ******************************************************************************/ 20 | 21 | import { OutputKind, PolicyConfiguration } from '../models/policy'; 22 | import { bpnGroupPolicy, bpnPolicy } from '../stores/policy.store'; 23 | import { FormatService } from './format.service'; 24 | import { PolicyService } from './policy.service'; 25 | import bpnJsonData from '../../../fixtures/policies/bpn.json'; 26 | import bpnGroupJsonData from '../../../fixtures/policies/bpnGroup.json'; 27 | 28 | describe('FormatService', () => { 29 | let formatService: FormatService; 30 | 31 | const toJsonLd = (policy: PolicyConfiguration, kind: OutputKind) => { 32 | const jsonLd = formatService.toJsonLd(policy, kind); 33 | return formatService.formatPolicy(jsonLd); 34 | }; 35 | beforeEach(() => { 36 | formatService = new FormatService(new PolicyService()); 37 | }); 38 | it('Should format the BPN Policy', () => { 39 | expect(toJsonLd(bpnPolicy(), OutputKind.Plain)).toEqual(formatService.formatPolicy(bpnJsonData)); 40 | }); 41 | 42 | it('Should format the BPN Group Policy', () => { 43 | expect(toJsonLd(bpnGroupPolicy(), OutputKind.Plain)).toEqual(formatService.formatPolicy(bpnGroupJsonData)); 44 | }); 45 | }); 46 | -------------------------------------------------------------------------------- /edc-policy-playground/src/app/services/format.service.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 3 | * Copyright (c) 2023 Contributors to the Eclipse Foundation 4 | * 5 | * See the NOTICE file(s) distributed with this work for additional 6 | * information regarding copyright ownership. 7 | * 8 | * This program and the accompanying materials are made available under the 9 | * terms of the Apache License, Version 2.0 which is available at 10 | * https://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 14 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 15 | * License for the specific language governing permissions and limitations 16 | * under the License. 17 | * 18 | * SPDX-License-Identifier: Apache-2.0 19 | ******************************************************************************/ 20 | 21 | import { Injectable } from '@angular/core'; 22 | import { OutputKind, PolicyConfiguration } from '../models/policy'; 23 | import { PlainFormatter } from './format/plain'; 24 | import { PolicyService } from './policy.service'; 25 | 26 | @Injectable({ providedIn: 'root' }) 27 | export class FormatService { 28 | formatters: Map = new Map(); 29 | constructor(public policyService: PolicyService) { 30 | this.formatters.set(OutputKind.Plain, new PlainFormatter(policyService)); 31 | } 32 | 33 | toJsonLd(policyConfig: PolicyConfiguration, format: OutputKind = OutputKind.Prefixed): object { 34 | const formatter = this.formatters.get(format); 35 | if (formatter != null) { 36 | return formatter.toJsonLd(policyConfig); 37 | } else { 38 | throw new Error('Formatter not found'); 39 | } 40 | } 41 | 42 | formatPolicy(policy: object) { 43 | return JSON.stringify(policy, null, 2); 44 | } 45 | } 46 | 47 | export interface JsonLdFormatter { 48 | toJsonLd(policyConfig: PolicyConfiguration): object; 49 | } 50 | -------------------------------------------------------------------------------- /edc-policy-playground/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-tractusx/tutorial-resources/1e14bba221624c0f2ec2e507dea1109859232465/edc-policy-playground/src/assets/.gitkeep -------------------------------------------------------------------------------- /edc-policy-playground/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-tractusx/tutorial-resources/1e14bba221624c0f2ec2e507dea1109859232465/edc-policy-playground/src/favicon.ico -------------------------------------------------------------------------------- /edc-policy-playground/src/index.html: -------------------------------------------------------------------------------- 1 | 20 | 21 | 22 | 23 | 24 | 25 | EdcPolicyPlayground 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /edc-policy-playground/src/main.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 3 | * Copyright (c) 2023 Contributors to the Eclipse Foundation 4 | * 5 | * See the NOTICE file(s) distributed with this work for additional 6 | * information regarding copyright ownership. 7 | * 8 | * This program and the accompanying materials are made available under the 9 | * terms of the Apache License, Version 2.0 which is available at 10 | * https://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 14 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 15 | * License for the specific language governing permissions and limitations 16 | * under the License. 17 | * 18 | * SPDX-License-Identifier: Apache-2.0 19 | ******************************************************************************/ 20 | 21 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 22 | 23 | import { AppModule } from './app/app.module'; 24 | 25 | platformBrowserDynamic() 26 | .bootstrapModule(AppModule) 27 | .catch(err => console.error(err)); 28 | -------------------------------------------------------------------------------- /edc-policy-playground/src/styles.css: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 3 | * Copyright (c) 2023 Contributors to the Eclipse Foundation 4 | * 5 | * See the NOTICE file(s) distributed with this work for additional 6 | * information regarding copyright ownership. 7 | * 8 | * This program and the accompanying materials are made available under the 9 | * terms of the Apache License, Version 2.0 which is available at 10 | * https://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 14 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 15 | * License for the specific language governing permissions and limitations 16 | * under the License. 17 | * 18 | * SPDX-License-Identifier: Apache-2.0 19 | ******************************************************************************/ 20 | 21 | /* You can add global styles to this file, and also import other style files */ 22 | 23 | html, 24 | body { 25 | height: 100%; 26 | } 27 | body { 28 | margin: 0; 29 | font-family: Roboto, 'Helvetica Neue', sans-serif; 30 | } 31 | 32 | .w-full { 33 | width: 100%; 34 | } 35 | 36 | .flex { 37 | display: flex; 38 | } 39 | 40 | .flex-row { 41 | flex-direction: row; 42 | } 43 | 44 | .flex-col { 45 | flex-direction: column; 46 | } 47 | 48 | .justify-between { 49 | justify-content: space-between; 50 | } 51 | 52 | .items-center { 53 | align-items: center; 54 | } 55 | .justify-stretch { 56 | justify-content: stretch; 57 | } 58 | .justify-center { 59 | justify-content: center; 60 | } 61 | .justify-right { 62 | justify-content: right; 63 | } 64 | 65 | .grow { 66 | flex-grow: 1; 67 | } 68 | 69 | .overflow-y-auto { 70 | overflow-y: auto; 71 | } 72 | 73 | .w-3\/5 { 74 | width: 60%; 75 | } 76 | .w-1\/5 { 77 | width: 20%; 78 | } 79 | .w-4\/5 { 80 | width: 80%; 81 | } 82 | .w-2\/5 { 83 | width: 40%; 84 | } 85 | .mt-2 { 86 | margin-top: 0.5rem; 87 | } 88 | 89 | .pt-2 { 90 | padding-top: 0.5rem; 91 | } 92 | 93 | .text-ellipsis { 94 | text-overflow: ellipsis; 95 | } 96 | 97 | .overflow-hidden { 98 | overflow: hidden; 99 | } 100 | 101 | .constraints-menu { 102 | max-height: 300px; 103 | overflow: scroll; 104 | } 105 | 106 | .gap-x-1 { 107 | column-gap: 4px; 108 | } 109 | -------------------------------------------------------------------------------- /edc-policy-playground/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "./out-tsc/app", 6 | "types": [] 7 | }, 8 | "files": [ 9 | "src/main.ts" 10 | ], 11 | "include": [ 12 | "src/**/*.d.ts" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /edc-policy-playground/tsconfig.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "compileOnSave": false, 4 | "compilerOptions": { 5 | "baseUrl": "./", 6 | "outDir": "./dist/out-tsc", 7 | "forceConsistentCasingInFileNames": true, 8 | "strict": true, 9 | "noImplicitOverride": true, 10 | "noPropertyAccessFromIndexSignature": true, 11 | "noImplicitReturns": true, 12 | "noFallthroughCasesInSwitch": true, 13 | "sourceMap": true, 14 | "declaration": false, 15 | "downlevelIteration": true, 16 | "experimentalDecorators": true, 17 | "moduleResolution": "node", 18 | "importHelpers": true, 19 | "target": "ES2022", 20 | "module": "ES2022", 21 | "useDefineForClassFields": false, 22 | "resolveJsonModule": true, 23 | "esModuleInterop": true, 24 | "lib": ["ES2022", "dom"] 25 | }, 26 | "angularCompilerOptions": { 27 | "enableI18nLegacyMessageIdFormat": false, 28 | "strictInjectionParameters": true, 29 | "strictInputAccessModifiers": true, 30 | "strictTemplates": true 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /edc-policy-playground/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "./out-tsc/spec", 6 | "types": [ 7 | "jasmine" 8 | ] 9 | }, 10 | "include": [ 11 | "src/**/*.spec.ts", 12 | "src/**/*.d.ts" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /icc-irs-challenges/README.md: -------------------------------------------------------------------------------- 1 | # Challenge: Industry Core Standard: Developing a Frontend for the IRS API using GenAI on Tractus-X Days 2 | 3 | ## Introduction 4 | This guide explains how to use the provided AI assistant and how to start the solution developed in the challenge. 5 | After completing all three phases, you should have a progressive frontend solution that: 6 | * Phase 1: Integrates with REST APIs provided by the Item-Relationship-Service 7 | * Phase 2: Visualizes part chains with relationships between digital twins in a network 8 | * Phase 3: Visualizes semantic data linked to digital twins. 9 | 10 | ## Table of Contents 11 | 12 | - [Introduction](#introduction) 13 | - [Prerequisites](#prerequisites) 14 | - [How to use the KI assistance](#how-to-use-the-ki-assistance) 15 | - [IRS-API-Request-Collection-Insomnia](#irs-api-request-collection) 16 | - [Example solution](#example-solution) 17 | - [Example ChatGPT History of Successful Workshop](#example-chatgpt-history-of-successful-workshop) 18 | - [Contact](#contact) 19 | 20 | ## Prerequisites 21 | 22 | 1. **Node.js and npm** installed on your system. (Download: [Node.js](https://nodejs.org/)) 23 | 2. **Proxy Server** configured as shown in the workshop (to avoid CORS issues). 24 | 3. The `X-API-KEY` securely provided by the workshop moderator. 25 | 4. The 'baseUrl' securely provided by the workshop moderator. 26 | 5. Select your favorite AI chatbot: 27 | 6. ChatGPT access (only premium): [ChatGPT](https://chatgpt.com/)) 28 | 7. Claude.ai [Claude.ai](https://claude.ai/new) access (free or premium) 29 | 30 | 31 | ## How to use the KI assistance 32 | 1. Copy/Paste [KI assistance](ki-guide.md) into your AI chatbot. 33 | 2. Start the KI assistant and follow the instructions. 34 | 35 | ## IRS Api Request Collection 36 | [Insomnia Request Collection](irs-api-request-collection.json) 37 | 38 | ## Execute challenge 39 | 1. Open your favorite IDE. 40 | 2. Follow instructions of [KI assistance](ki-guide.md) to set up progressive frontend. 41 | 3. Navigate to the directory where proxy server configuration `proxy.js` is located. 42 | 4. Ensure the `X-API-KEY` is replaced with the one shared securely by the moderator. 43 | 5. Ensure the API `baseUrl` is replaced with the one shared securely by the moderator. 44 | 6. Start the proxy server in terminal: 45 | ```bash 46 | node proxy.js 47 | 7. Run in another terminal: 48 | ```bash 49 | npm install 50 | 8. Open the 'index.html' in your favourite browser. 51 | 9. Register a IRS Job 52 | 10. Get the job details 53 | 11. Check results 54 | 55 | ## Contact 56 | 57 | For questions or further information, please feel free to reach out: 58 | 59 | - **Martin Kanal** 60 | [Martin.Kanal@doubleslash.de](mailto:Martin.Kanal@doubleslash.de) 61 | 62 | - **Jaro Hartmann** 63 | [Jaro.Hartmann@doubleslash.de](mailto:Jaro.Hartmann@doubleslash.de) 64 | 65 | - **Maximilian Wesener** 66 | [Maximilian.Wesener@doubleslash.de](mailto:Maximilian.Wesener@doubleslash.de) 67 | -------------------------------------------------------------------------------- /icc-irs-challenges/ai-assistent.md: -------------------------------------------------------------------------------- 1 | ## How to use the AI assistance 2 | 1. Copy/Paste the AI assistance for the phase you want to be supported into your favourite AI: 3 | 2. Phase 1: [AI assistance Phase 1](ai-assistent-phase1.md) 4 | 3. Phase 2: [AI assistance Phase 2](ai-assistent-phase2.md) 5 | 4. Phase 3: [AI assistance Phase 3](ai-assistent-phase3.md) 6 | -------------------------------------------------------------------------------- /icc-irs-challenges/irs-api-request-collection.json: -------------------------------------------------------------------------------- 1 | {"_type":"export","__export_format":4,"__export_date":"2024-11-26T08:54:23.250Z","__export_source":"insomnia.desktop.app:v2023.5.8","resources":[{"_id":"req_6ce29a0d3ff64a84b4759bc1973e01a7","parentId":"wrk_1dbf24bfa9354d569af5affcb1cc8dd0","modified":1732611221140,"created":1732609842184,"url":"{{ _.baseUrl }}/api/irs/jobs","name":"RegisterJob","description":"","method":"POST","body":{"mimeType":"application/json","text":"{\n\t\"aspects\": [\n\t\t\"urn:samm:io.catenax.serial_part:3.0.0#SerialPart\",\n\t\t\"urn:samm:io.catenax.just_in_sequence_part:3.0.0#JustInSequencePart\",\n\t\t\"urn:samm:io.catenax.batch:3.0.0#Batch\",\n\t\t\"urn:samm:io.catenax.single_level_bom_as_built:3.0.0#SingleLevelBomAsBuilt\"\n\t],\n\t\"key\": {\n\t\t\"globalAssetId\": \"{% prompt 'Global Asset ID', 'Please provide \\'Global-Asset-ID\\' or use default', _.GLOBAL_ASSET_ID, '', false, true %}\",\n\t\t\"bpn\": \"{% prompt 'bpn', '', _.BPN, '', false, true %}\"\n\t},\n\t\"collectAspects\": true,\n\t\"direction\": \"downward\"\n}"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json","id":"pair_6775889869a541af9c8d0d79b0b19f84"}],"authentication":{"type":"apikey","disabled":false,"key":"X-API-KEY","value":"","addTo":"header"},"metaSortKey":-1732609842184,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"wrk_1dbf24bfa9354d569af5affcb1cc8dd0","parentId":null,"modified":1732609829145,"created":1732609829145,"name":"Industry Core Standard: Developing a Frontend for the IRS API using GenAI","description":"","scope":"collection","_type":"workspace"},{"_id":"req_8122f01ac4d04f4cbc6a86ab0b5a312a","parentId":"wrk_1dbf24bfa9354d569af5affcb1cc8dd0","modified":1732611222974,"created":1732609901235,"url":"{{ _.baseUrl }}/api/irs/jobs/{% response 'body', 'req_6ce29a0d3ff64a84b4759bc1973e01a7', 'b64::JC5pZA==::46b', 'never', 60 %}","name":"GetJob","description":"","method":"GET","body":{},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json","id":"pair_f3eacf101a93476f808e159b624f528d"}],"authentication":{"type":"apikey","disabled":false,"key":"X-API-KEY","value":"","addTo":"header"},"metaSortKey":-1732609842084,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"env_50da278f0e84883df678a804ca35ba59c9148495","parentId":"wrk_1dbf24bfa9354d569af5affcb1cc8dd0","modified":1732610862656,"created":1732609829161,"name":"Base Environment","data":{"baseUrl":"https://irs-ic.a3fb75c369e540489a65.germanywestcentral.aksapp.io"},"dataPropertyOrder":{"&":["baseUrl"]},"color":null,"isPrivate":false,"metaSortKey":1732609829161,"_type":"environment"},{"_id":"jar_50da278f0e84883df678a804ca35ba59c9148495","parentId":"wrk_1dbf24bfa9354d569af5affcb1cc8dd0","modified":1732609829196,"created":1732609829196,"name":"Default Jar","cookies":[],"_type":"cookie_jar"}]} -------------------------------------------------------------------------------- /icc-irs-challenges/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "frontend_workshop", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "proxy.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "express": "^4.21.1", 14 | "http-proxy-middleware": "^3.0.3" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /icc-irs-challenges/proxy.js: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2024 Contributors to the Eclipse Foundation 3 | * 4 | * See the NOTICE file(s) distributed with this work for additional 5 | * information regarding copyright ownership. 6 | * 7 | * This program and the accompanying materials are made available under the 8 | * terms of the Apache License, Version 2.0 which is available at 9 | * https://www.apache.org/licenses/LICENSE-2.0. 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | * License for the specific language governing permissions and limitations 15 | * under the License. 16 | * 17 | * SPDX-License-Identifier: Apache-2.0 18 | ********************************************************************************/ 19 | const express = require('express'); 20 | const { createProxyMiddleware } = require('http-proxy-middleware'); 21 | 22 | const app = express(); 23 | // MOCK URL: https://irs-mock-ic.a3fb75c369e540489a65.germanywestcentral.aksapp.io 24 | // Proxy setup 25 | app.use('/api', createProxyMiddleware({ 26 | target: 'https://irs-ic.a3fb75c369e540489a65.germanywestcentral.aksapp.io', 27 | changeOrigin: true, 28 | pathRewrite: { '^/api': '' }, 29 | on: { 30 | proxyReq: (proxyReq, req, res) => { 31 | console.log('Proxy Request incoming for http://localhost:3000'); 32 | proxyReq.setHeader('X-API-KEY', 'EZzzwfWcwtMJGvqxivalUyMOQhjjTTvv'); 33 | } 34 | }, 35 | })); 36 | 37 | app.listen(3000, () => { 38 | console.log('Proxy server running at http://localhost:3000'); 39 | }); 40 | -------------------------------------------------------------------------------- /icc-irs-challenges/style.css: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2024 Contributors to the Eclipse Foundation 3 | * 4 | * See the NOTICE file(s) distributed with this work for additional 5 | * information regarding copyright ownership. 6 | * 7 | * This program and the accompanying materials are made available under the 8 | * terms of the Apache License, Version 2.0 which is available at 9 | * https://www.apache.org/licenses/LICENSE-2.0. 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | * License for the specific language governing permissions and limitations 15 | * under the License. 16 | * 17 | * SPDX-License-Identifier: Apache-2.0 18 | ********************************************************************************/ 19 | /* General Styles */ 20 | body { 21 | font-family: Arial, sans-serif; 22 | margin: 20px; 23 | padding: 0; 24 | background-color: #f9f9f9; 25 | color: #333; 26 | } 27 | 28 | body { 29 | font-family: 'Roboto', sans-serif; 30 | } 31 | #relationship-graph { 32 | border: 1px solid #ccc; 33 | margin-top: 20px; 34 | display: block; 35 | margin-left: auto; 36 | margin-right: auto; 37 | } 38 | 39 | 40 | body { 41 | display: flex; 42 | flex-direction: column; 43 | align-items: center; 44 | justify-content: center; 45 | height: 100vh; 46 | } 47 | 48 | 49 | /* Header */ 50 | h1 { 51 | text-align: center; 52 | color: #2c3e50; 53 | } 54 | 55 | /* Buttons */ 56 | button { 57 | padding: 10px 20px; 58 | margin: 10px; 59 | font-size: 16px; 60 | background-color: #3498db; 61 | color: white; 62 | border: none; 63 | border-radius: 5px; 64 | cursor: pointer; 65 | transition: background-color 0.3s; 66 | } 67 | 68 | button:hover { 69 | background-color: #2980b9; 70 | } 71 | 72 | button:disabled { 73 | background-color: #bdc3c7; 74 | cursor: not-allowed; 75 | } 76 | 77 | /* Output Box */ 78 | pre { 79 | background-color: #ecf0f1; 80 | padding: 15px; 81 | border-radius: 5px; 82 | font-size: 14px; 83 | line-height: 1.5; 84 | overflow-x: auto; 85 | } 86 | -------------------------------------------------------------------------------- /mxd-runtimes/README.md: -------------------------------------------------------------------------------- 1 | # Custom Tractus-X EDC (Eclipse Dataspace Connector) 2 | 3 | A customized [Tractus-X EDC](https://github.com/eclipse-tractusx/tractusx-edc) Build. 4 | 5 | ## Getting Started 6 | 7 | ### Build 8 | Build Tractus-X EDC together with its Container Images 9 | 10 | ```shell 11 | ./gradlew clean dockerize 12 | ``` 13 | -------------------------------------------------------------------------------- /mxd-runtimes/data-service-api/build.gradle.kts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Apache License, Version 2.0 which is available at 6 | * https://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * SPDX-License-Identifier: Apache-2.0 9 | * 10 | * Contributors: 11 | * Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation 12 | * 13 | */ 14 | 15 | 16 | 17 | plugins { 18 | id("java") 19 | `java-library` 20 | id("application") 21 | alias(libs.plugins.shadow) 22 | id(libs.plugins.swagger.get().pluginId) 23 | } 24 | 25 | group = "org.eclipse.tractusx.mxd.dataservice" 26 | version = "1.0.0" 27 | 28 | application { 29 | mainClass.set("org.eclipse.edc.boot.system.runtime.BaseRuntime") 30 | } 31 | 32 | dependencies { 33 | 34 | implementation(libs.edc.http) 35 | implementation(libs.edc.http.lib) 36 | implementation(libs.edc.boot) 37 | 38 | runtimeOnly(libs.edc.core.connector) 39 | runtimeOnly(libs.edc.api.observability) 40 | runtimeOnly(libs.edc.sql.transactionlocal) 41 | 42 | testImplementation(testFixtures(libs.edc.core.jersey)) 43 | testImplementation(libs.restAssured) 44 | testImplementation(libs.assertj) 45 | testImplementation(libs.edc.junit) 46 | 47 | } 48 | tasks.withType { 49 | mergeServiceFiles() 50 | archiveFileName.set("${project.name}.jar") 51 | } -------------------------------------------------------------------------------- /mxd-runtimes/data-service-api/src/main/docker/Dockerfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 3 | # 4 | # This program and the accompanying materials are made available under the 5 | # terms of the Apache License, Version 2.0 which is available at 6 | # https://www.apache.org/licenses/LICENSE-2.0 7 | # 8 | # SPDX-License-Identifier: Apache-2.0 9 | # 10 | # Contributors: 11 | # Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation 12 | # 13 | # 14 | 15 | FROM eclipse-temurin:22.0.1_8-jre-alpine 16 | ARG JAR 17 | ARG ADDITIONAL_FILES 18 | 19 | ARG APP_USER=docker 20 | ARG APP_UID=10100 21 | 22 | RUN addgroup --system "$APP_USER" 23 | 24 | RUN adduser \ 25 | --shell /sbin/nologin \ 26 | --disabled-password \ 27 | --gecos "" \ 28 | --ingroup "$APP_USER" \ 29 | --no-create-home \ 30 | --uid "$APP_UID" \ 31 | "$APP_USER" 32 | 33 | USER "$APP_USER" 34 | WORKDIR /app 35 | 36 | COPY ${JAR} data-service.jar 37 | 38 | # health check is handled by K8S 39 | HEALTHCHECK NONE 40 | 41 | CMD ["java", \ 42 | "-Djava.security.egd=file:/dev/urandom", \ 43 | "-jar", \ 44 | "data-service.jar"] 45 | -------------------------------------------------------------------------------- /mxd-runtimes/data-service-api/src/main/java/org/eclipse/tractusx/mxd/dataservice/model/DataRecord.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Apache License, Version 2.0 which is available at 6 | * https://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * SPDX-License-Identifier: Apache-2.0 9 | * 10 | * Contributors: 11 | * Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation 12 | * 13 | */ 14 | 15 | package org.eclipse.tractusx.mxd.dataservice.model; 16 | 17 | public record DataRecord(String id, String name, String description) { 18 | } 19 | -------------------------------------------------------------------------------- /mxd-runtimes/data-service-api/src/main/resources/META-INF/services/org.eclipse.edc.spi.system.ServiceExtension: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 3 | # 4 | # This program and the accompanying materials are made available under the 5 | # terms of the Apache License, Version 2.0 which is available at 6 | # https://www.apache.org/licenses/LICENSE-2.0 7 | # 8 | # SPDX-License-Identifier: Apache-2.0 9 | # 10 | # Contributors: 11 | # Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation 12 | # 13 | # 14 | 15 | org.eclipse.tractusx.mxd.dataservice.DataServiceExtension 16 | -------------------------------------------------------------------------------- /mxd-runtimes/e2e-test/build.gradle.kts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2024 Metaform Systems, Inc. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Apache License, Version 2.0 which is available at 6 | * https://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * SPDX-License-Identifier: Apache-2.0 9 | * 10 | * Contributors: 11 | * Metaform Systems, Inc. - initial API and implementation 12 | * 13 | */ 14 | 15 | plugins { 16 | `java-library` 17 | } 18 | 19 | dependencies { 20 | testImplementation(libs.edc.junit) 21 | testImplementation(libs.edc.spi.catalog) 22 | testImplementation(libs.edc.lib.transform) 23 | testImplementation(catalogLibs.core.fc) 24 | testImplementation(libs.edc.lib.jsonld) 25 | testImplementation(libs.edc.controlplane.transform) 26 | 27 | 28 | testImplementation(libs.jakarta.json.api) 29 | testImplementation(libs.jackson.datatype.jakarta.jsonp) 30 | testImplementation(libs.parsson) 31 | testImplementation(libs.restAssured) 32 | testImplementation(libs.awaitility) 33 | } 34 | -------------------------------------------------------------------------------- /mxd-runtimes/e2e-test/src/test/resources/negotiation-request.json: -------------------------------------------------------------------------------- 1 | { 2 | "@context": [ 3 | "https://w3id.org/edc/connector/management/v0.0.1", 4 | { 5 | "tx": "https://w3id.org/tractusx/v0.0.1/ns/" 6 | }, 7 | { 8 | "tx-auth": "https://w3id.org/tractusx/auth/" 9 | }, 10 | { 11 | "cx-policy": "https://w3id.org/catenax/policy/" 12 | } 13 | ], 14 | "@type": "ContractRequest", 15 | "counterPartyAddress": "{{PROVIDER_DSP_URL}}/api/v1/dsp", 16 | "counterPartyId": "{{PROVIDER_ID}}", 17 | "protocol": "dataspace-protocol-http", 18 | "policy": { 19 | "@id": "{{OFFER_ID}}", 20 | "@type": "Offer", 21 | "assigner": "{{PROVIDER_ID}}", 22 | "odrl:permission": { 23 | "odrl:action": { 24 | "@id": "odrl:use" 25 | }, 26 | "odrl:constraint": { 27 | "odrl:leftOperand": { 28 | "@id": "cx-policy:Membership" 29 | }, 30 | "odrl:operator": { 31 | "@id": "odrl:eq" 32 | }, 33 | "odrl:rightOperand": "active" 34 | } 35 | }, 36 | "odrl:prohibition": [], 37 | "odrl:obligation": [], 38 | "target": "asset-1" 39 | }, 40 | "callbackAddresses": [] 41 | } -------------------------------------------------------------------------------- /mxd-runtimes/e2e-test/src/test/resources/transfer-request.json: -------------------------------------------------------------------------------- 1 | { 2 | "@context": [ 3 | "https://w3id.org/edc/connector/management/v0.0.1", 4 | { 5 | "odrl": "http://www.w3.org/ns/odrl/2/" 6 | }, 7 | { 8 | "tx": "https://w3id.org/tractusx/v0.0.1/ns/" 9 | }, 10 | { 11 | "tx-auth": "https://w3id.org/tractusx/auth/" 12 | }, 13 | { 14 | "cx-policy": "https://w3id.org/catenax/policy/" 15 | } 16 | ], 17 | "@type": "TransferRequest", 18 | "assetId": "asset-1", 19 | "counterPartyAddress": "{{PROVIDER_DSP_URL}}/api/v1/dsp", 20 | "connectorId": "{{PROVIDER_ID}}", 21 | "contractId": "{{CONTRACT_ID}}", 22 | "dataDestination": { 23 | "type": "HttpProxy" 24 | }, 25 | "protocol": "dataspace-protocol-http", 26 | "transferType": "HttpData-PULL" 27 | } -------------------------------------------------------------------------------- /mxd-runtimes/gradle.properties: -------------------------------------------------------------------------------- 1 | ################################################################################# 2 | # 3 | # Copyright (c) 2024 SAP SE 4 | # 5 | # This program and the accompanying materials are made available under the 6 | # terms of the Apache License, Version 2.0 which is available at 7 | # https://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # SPDX-License-Identifier: Apache-2.0 10 | # 11 | # Contributors: 12 | # SAP SE - initial API and implementation 13 | # 14 | ################################################################################# 15 | 16 | group=org.eclipse.tractusx.edc 17 | version=0.8.0 18 | -------------------------------------------------------------------------------- /mxd-runtimes/gradle/catalogserver.versions.toml: -------------------------------------------------------------------------------- 1 | [metadata] 2 | format.version = "1.1" 3 | 4 | [versions] 5 | edc = "0.12.0" 6 | tractusx = "0.9.0" 7 | postgres = "42.7.3" 8 | 9 | [libraries] 10 | api-management = { module = "org.eclipse.edc:management-api", version.ref = "edc" } 11 | api-management-config = { module = "org.eclipse.edc:management-api-configuration", version.ref = "edc" } 12 | sts-remote-client = { module = "org.eclipse.edc:identity-trust-sts-remote-client", version.ref = "edc" } 13 | core-fc = { module = "org.eclipse.edc:federated-catalog-core", version.ref = "edc" } 14 | 15 | # BOM modules 16 | bom-catalog = { module = "org.eclipse.edc:federatedcatalog-dcp-bom", version.ref = "edc" } 17 | bom-catalog-sql = { module = "org.eclipse.edc:federatedcatalog-feature-sql-bom", version.ref = "edc" } 18 | 19 | # tx modules 20 | tx-bdrs-client = { module = "org.eclipse.tractusx.edc:bdrs-client", version.ref = "tractusx" } 21 | tx-dcp = { module = "org.eclipse.tractusx.edc:tx-dcp", version.ref = "tractusx" } 22 | tx-fc = { module = "org.eclipse.tractusx.edc:federated-catalog", version.ref = "tractusx" } 23 | tx-core-jsonld = { module = "org.eclipse.tractusx.edc:json-ld-core", version.ref = "tractusx" } 24 | 25 | # third party modules 26 | postgres = { module = "org.postgresql:postgresql", version.ref = "postgres" } 27 | -------------------------------------------------------------------------------- /mxd-runtimes/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-tractusx/tutorial-resources/1e14bba221624c0f2ec2e507dea1109859232465/mxd-runtimes/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /mxd-runtimes/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /mxd-runtimes/jwt-signer/build.gradle.kts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2024 SAP SE 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Apache License, Version 2.0 which is available at 6 | * https://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * SPDX-License-Identifier: Apache-2.0 9 | * 10 | * Contributors: 11 | * SAP SE - initial API and implementation 12 | * 13 | ********************************************************************************/ 14 | 15 | plugins { 16 | `java-library` 17 | id("application") 18 | alias(libs.plugins.shadow) 19 | } 20 | 21 | dependencies { 22 | 23 | implementation(libs.edc.spi.did) 24 | implementation(libs.edc.lib.crypto.ih) 25 | implementation(libs.edc.lib.keys.ih) 26 | implementation(libs.edc.junit) 27 | } 28 | 29 | tasks.withType { 30 | mergeServiceFiles() 31 | archiveFileName.set("${project.name}.jar") 32 | } 33 | 34 | application { 35 | mainClass.set("org.eclipse.tractusx.edc.mxd.JwtSigner") 36 | } 37 | -------------------------------------------------------------------------------- /mxd-runtimes/settings.gradle.kts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2024 SAP SE 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Apache License, Version 2.0 which is available at 6 | * https://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * SPDX-License-Identifier: Apache-2.0 9 | * 10 | * Contributors: 11 | * SAP SE - initial API and implementation 12 | * 13 | ********************************************************************************/ 14 | 15 | rootProject.name = "mxd-runtimes" 16 | 17 | pluginManagement { 18 | repositories { 19 | mavenLocal() 20 | maven { 21 | url = uri("https://oss.sonatype.org/content/repositories/snapshots/") 22 | } 23 | mavenCentral() 24 | gradlePluginPortal() 25 | } 26 | } 27 | 28 | dependencyResolutionManagement { 29 | repositories { 30 | mavenLocal() 31 | maven { 32 | url = uri("https://oss.sonatype.org/content/repositories/snapshots/") 33 | } 34 | mavenCentral() 35 | } 36 | // this version catalog is separate because it is supposed to be temporary. Once T-X provides a dedicated CatalogServer 37 | // runtime, it can be replaced with a dependency on that 38 | versionCatalogs { 39 | create("catalogLibs") { 40 | from(files("./gradle/catalogserver.versions.toml")) 41 | } 42 | } 43 | } 44 | 45 | include(":tx-identityhub") 46 | include(":tx-issuerservice") 47 | include(":tx-catalog-server") 48 | include(":data-service-api") 49 | include(":jwt-signer") 50 | include(":e2e-test") 51 | -------------------------------------------------------------------------------- /mxd-runtimes/tx-catalog-server/build.gradle.kts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Apache License, Version 2.0 which is available at 6 | * https://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * SPDX-License-Identifier: Apache-2.0 9 | * 10 | * Contributors: 11 | * Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation 12 | * 13 | */ 14 | 15 | plugins { 16 | `java-library` 17 | id("application") 18 | alias(libs.plugins.shadow) 19 | } 20 | 21 | dependencies { 22 | // management API - is not included in the FederatedCatalog BOM 23 | runtimeOnly(catalogLibs.api.management) 24 | runtimeOnly(catalogLibs.api.management.config) 25 | 26 | runtimeOnly(libs.edc.vault.hashicorp) 27 | runtimeOnly(catalogLibs.sts.remote.client) 28 | 29 | // official FC BOMs 30 | runtimeOnly(catalogLibs.bom.catalog) 31 | runtimeOnly(catalogLibs.bom.catalog.sql){ 32 | exclude("org.eclipse.edc", "target-node-directory-sql") //not needed, nodes are populated from a file 33 | } 34 | 35 | // libs from tx 36 | runtimeOnly(catalogLibs.tx.bdrs.client) // audience mapper 37 | runtimeOnly(catalogLibs.tx.core.jsonld) // locally cached context files 38 | runtimeOnly(catalogLibs.tx.dcp) // the default scope mapper 39 | runtimeOnly(catalogLibs.tx.fc) // file-based node directory 40 | 41 | runtimeOnly(libs.edc.did.core) // DidResolverRegistry, DidPublicKeyResolver 42 | runtimeOnly(libs.edc.did.web) // for registering the WebDidResolver 43 | } 44 | 45 | application { 46 | mainClass.set("org.eclipse.edc.boot.system.runtime.BaseRuntime") 47 | } 48 | 49 | tasks.withType { 50 | exclude("**/pom.properties", "**/pom.xml") 51 | mergeServiceFiles() 52 | archiveFileName.set("${project.name}.jar") 53 | } 54 | 55 | edcBuild { 56 | publish.set(false) 57 | } 58 | -------------------------------------------------------------------------------- /mxd-runtimes/tx-catalog-server/src/main/docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM eclipse-temurin:23_37-jre-alpine 2 | ARG JAR 3 | ARG OTEL_JAR 4 | ARG ADDITIONAL_FILES 5 | 6 | ARG APP_USER=docker 7 | ARG APP_UID=10100 8 | 9 | RUN addgroup --system "$APP_USER" 10 | 11 | RUN adduser \ 12 | --shell /sbin/nologin \ 13 | --disabled-password \ 14 | --gecos "" \ 15 | --ingroup "$APP_USER" \ 16 | --no-create-home \ 17 | --uid "$APP_UID" \ 18 | "$APP_USER" 19 | 20 | USER "$APP_USER" 21 | WORKDIR /app 22 | 23 | COPY ${JAR} catalog-server.jar 24 | COPY ${OTEL_JAR} opentelemetry-javaagent.jar 25 | COPY ${ADDITIONAL_FILES} ./ 26 | 27 | HEALTHCHECK NONE 28 | 29 | ENTRYPOINT ["java", \ 30 | "-javaagent:/app/opentelemetry-javaagent.jar", \ 31 | "-Dedc.fs.config=/app/configuration.properties", \ 32 | "-Dotel.javaagent.configuration-file=/app/opentelemetry.properties", \ 33 | "-Dotel.metrics.exporter=prometheus", \ 34 | "-Dotel.exporter.prometheus.port=9090", \ 35 | "-Djava.security.egd=file:/dev/urandom", \ 36 | "-jar", \ 37 | "catalog-server.jar"] 38 | -------------------------------------------------------------------------------- /mxd-runtimes/tx-identityhub/build.gradle.kts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Apache License, Version 2.0 which is available at 6 | * https://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * SPDX-License-Identifier: Apache-2.0 9 | * 10 | * Contributors: 11 | * Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation 12 | * 13 | */ 14 | 15 | plugins { 16 | `java-library` 17 | id("application") 18 | alias(libs.plugins.shadow) 19 | } 20 | 21 | dependencies { 22 | 23 | // used for the runtime 24 | runtimeOnly(libs.bom.ih) 25 | runtimeOnly(libs.bom.ih.sql) 26 | runtimeOnly(libs.edc.vault.hashicorp.ih) 27 | 28 | // used for custom extensions 29 | implementation(libs.edc.core.connector.ih) 30 | implementation(libs.edc.ih.spi) 31 | 32 | testImplementation(libs.edc.lib.crypto.ih) 33 | testImplementation(libs.edc.lib.keys.ih) 34 | testImplementation(libs.edc.junit) 35 | } 36 | 37 | tasks.withType { 38 | mergeServiceFiles() 39 | archiveFileName.set("${project.name}.jar") 40 | } 41 | 42 | application { 43 | mainClass.set("org.eclipse.edc.boot.system.runtime.BaseRuntime") 44 | } 45 | -------------------------------------------------------------------------------- /mxd-runtimes/tx-identityhub/src/main/docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM eclipse-temurin:23_37-jre-alpine 2 | ARG JAR 3 | ARG OTEL_JAR 4 | ARG ADDITIONAL_FILES 5 | 6 | ARG APP_USER=docker 7 | ARG APP_UID=10100 8 | 9 | RUN addgroup --system "$APP_USER" 10 | 11 | RUN adduser \ 12 | --shell /sbin/nologin \ 13 | --disabled-password \ 14 | --gecos "" \ 15 | --ingroup "$APP_USER" \ 16 | --no-create-home \ 17 | --uid "$APP_UID" \ 18 | "$APP_USER" 19 | 20 | USER "$APP_USER" 21 | WORKDIR /app 22 | 23 | COPY ${JAR} identityhub.jar 24 | COPY ${OTEL_JAR} opentelemetry-javaagent.jar 25 | COPY ${ADDITIONAL_FILES} ./ 26 | 27 | HEALTHCHECK NONE 28 | 29 | ENTRYPOINT ["java", \ 30 | "-javaagent:/app/opentelemetry-javaagent.jar", \ 31 | "-Dedc.fs.config=/app/configuration.properties", \ 32 | "-Dotel.javaagent.configuration-file=/app/opentelemetry.properties", \ 33 | "-Dotel.metrics.exporter=prometheus", \ 34 | "-Dotel.exporter.prometheus.port=9090", \ 35 | "-Djava.security.egd=file:/dev/urandom", \ 36 | "-jar", \ 37 | "identityhub.jar", \ 38 | "--log-level=debug"] 39 | -------------------------------------------------------------------------------- /mxd-runtimes/tx-identityhub/src/main/java/org/eclipse/edc/identityhub/demo/IdentityHubExtension.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Apache License, Version 2.0 which is available at 6 | * https://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * SPDX-License-Identifier: Apache-2.0 9 | * 10 | * Contributors: 11 | * Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation 12 | * 13 | */ 14 | 15 | package org.eclipse.edc.identityhub.demo; 16 | 17 | import org.eclipse.edc.identityhub.spi.transformation.ScopeToCriterionTransformer; 18 | import org.eclipse.edc.runtime.metamodel.annotation.Extension; 19 | import org.eclipse.edc.runtime.metamodel.annotation.Provider; 20 | import org.eclipse.edc.spi.system.ServiceExtension; 21 | 22 | 23 | @Extension("DCP Demo: Core Extension for IdentityHub") 24 | public class IdentityHubExtension implements ServiceExtension { 25 | 26 | @Provider 27 | public ScopeToCriterionTransformer createScopeTransformer() { 28 | return new TxScopeToCriterionTransformer(); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /mxd-runtimes/tx-identityhub/src/main/java/org/eclipse/edc/identityhub/demo/TxScopeToCriterionTransformer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Apache License, Version 2.0 which is available at 6 | * https://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * SPDX-License-Identifier: Apache-2.0 9 | * 10 | * Contributors: 11 | * Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation 12 | * 13 | */ 14 | 15 | package org.eclipse.edc.identityhub.demo; 16 | 17 | import org.eclipse.edc.identityhub.spi.transformation.ScopeToCriterionTransformer; 18 | import org.eclipse.edc.spi.query.Criterion; 19 | import org.eclipse.edc.spi.result.Result; 20 | 21 | import java.util.List; 22 | 23 | import static org.eclipse.edc.spi.result.Result.failure; 24 | import static org.eclipse.edc.spi.result.Result.success; 25 | 26 | /** 27 | * Implementation of {@link ScopeToCriterionTransformer} similar to the upstream one that maps tx scopes 28 | * to {@link Criterion} for querying the credentials (Just for testing) 29 | */ 30 | public class TxScopeToCriterionTransformer implements ScopeToCriterionTransformer { 31 | 32 | public static final String TYPE_OPERAND = "verifiableCredential.credential.type"; 33 | public static final String ALIAS_LITERAL = "org.eclipse.tractusx.vc.type"; 34 | public static final String CONTAINS_OPERATOR = "contains"; 35 | private static final String SCOPE_SEPARATOR = ":"; 36 | private final List allowedOperations = List.of("read", "*", "all"); 37 | 38 | @Override 39 | public Result transform(String scope) { 40 | var tokens = tokenize(scope); 41 | if (tokens.failed()) { 42 | return failure("Scope string cannot be converted: %s".formatted(tokens.getFailureDetail())); 43 | } 44 | var credentialType = tokens.getContent()[1]; 45 | return success(new Criterion(TYPE_OPERAND, CONTAINS_OPERATOR, credentialType)); 46 | } 47 | 48 | protected Result tokenize(String scope) { 49 | if (scope == null) return failure("Scope was null"); 50 | 51 | var tokens = scope.split(SCOPE_SEPARATOR); 52 | if (tokens.length != 3) { 53 | return failure("Scope string has invalid format."); 54 | } 55 | if (!ALIAS_LITERAL.equalsIgnoreCase(tokens[0])) { 56 | return failure("Scope alias MUST be %s but was %s".formatted(ALIAS_LITERAL, tokens[0])); 57 | } 58 | if (!allowedOperations.contains(tokens[2])) { 59 | return failure("Invalid scope operation: " + tokens[2]); 60 | } 61 | 62 | return success(tokens); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /mxd-runtimes/tx-identityhub/src/main/resources/META-INF/services/org.eclipse.edc.spi.system.ServiceExtension: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 3 | # 4 | # This program and the accompanying materials are made available under the 5 | # terms of the Apache License, Version 2.0 which is available at 6 | # https://www.apache.org/licenses/LICENSE-2.0 7 | # 8 | # SPDX-License-Identifier: Apache-2.0 9 | # 10 | # Contributors: 11 | # Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation 12 | # 13 | # 14 | 15 | org.eclipse.edc.identityhub.demo.IdentityHubExtension 16 | org.eclipse.edc.identityhub.seed.SuperUserSeedExtension -------------------------------------------------------------------------------- /mxd-runtimes/tx-issuerservice/build.gradle.kts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Apache License, Version 2.0 which is available at 6 | * https://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * SPDX-License-Identifier: Apache-2.0 9 | * 10 | * Contributors: 11 | * Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation 12 | * 13 | */ 14 | 15 | plugins { 16 | `java-library` 17 | id("application") 18 | alias(libs.plugins.shadow) 19 | } 20 | 21 | dependencies { 22 | 23 | // used for the runtime 24 | runtimeOnly(libs.bom.issuer) 25 | 26 | // DID and Participant Context API - they should eventually be provided by the BOM 27 | runtimeOnly(libs.edc.ih.api.did) 28 | runtimeOnly(libs.edc.ih.api.participants) 29 | 30 | // used for custom extensions 31 | implementation(libs.edc.ih.spi) 32 | implementation(libs.edc.spi.issuance) 33 | 34 | testImplementation(libs.edc.lib.crypto.ih) 35 | testImplementation(libs.edc.lib.keys.ih) 36 | testImplementation(libs.edc.junit) 37 | } 38 | 39 | tasks.withType { 40 | mergeServiceFiles() 41 | archiveFileName.set("${project.name}.jar") 42 | } 43 | 44 | application { 45 | mainClass.set("org.eclipse.edc.boot.system.runtime.BaseRuntime") 46 | } 47 | -------------------------------------------------------------------------------- /mxd-runtimes/tx-issuerservice/src/main/docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM eclipse-temurin:23_37-jre-alpine 2 | ARG JAR 3 | ARG OTEL_JAR 4 | ARG ADDITIONAL_FILES 5 | 6 | ARG APP_USER=docker 7 | ARG APP_UID=10100 8 | 9 | RUN addgroup --system "$APP_USER" 10 | 11 | RUN adduser \ 12 | --shell /sbin/nologin \ 13 | --disabled-password \ 14 | --gecos "" \ 15 | --ingroup "$APP_USER" \ 16 | --no-create-home \ 17 | --uid "$APP_UID" \ 18 | "$APP_USER" 19 | 20 | USER "$APP_USER" 21 | WORKDIR /app 22 | 23 | COPY ${JAR} issuerservice.jar 24 | COPY ${OTEL_JAR} opentelemetry-javaagent.jar 25 | COPY ${ADDITIONAL_FILES} ./ 26 | 27 | HEALTHCHECK NONE 28 | 29 | ENTRYPOINT ["java", \ 30 | "-javaagent:/app/opentelemetry-javaagent.jar", \ 31 | "-Dedc.fs.config=/app/configuration.properties", \ 32 | "-Dotel.javaagent.configuration-file=/app/opentelemetry.properties", \ 33 | "-Dotel.metrics.exporter=prometheus", \ 34 | "-Dotel.exporter.prometheus.port=9090", \ 35 | "-Djava.security.egd=file:/dev/urandom", \ 36 | "-jar", \ 37 | "issuerservice.jar", \ 38 | "--log-level=debug"] 39 | -------------------------------------------------------------------------------- /mxd-runtimes/tx-issuerservice/src/main/java/org/eclipse/edc/issuerservice/demo/attestation/DemoAttestationSource.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2025 Cofinity-X 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Apache License, Version 2.0 which is available at 6 | * https://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * SPDX-License-Identifier: Apache-2.0 9 | * 10 | * Contributors: 11 | * Cofinity-X - initial API and implementation 12 | * 13 | */ 14 | 15 | package org.eclipse.edc.issuerservice.demo.attestation; 16 | 17 | import java.util.Map; 18 | import java.util.UUID; 19 | 20 | import org.eclipse.edc.issuerservice.spi.issuance.attestation.AttestationContext; 21 | import org.eclipse.edc.issuerservice.spi.issuance.attestation.AttestationSource; 22 | import org.eclipse.edc.spi.result.Result; 23 | 24 | public class DemoAttestationSource implements AttestationSource { 25 | @Override 26 | public Result> execute(AttestationContext attestationContext) { 27 | var pid = attestationContext.participantId(); 28 | return Result.success( 29 | Map.of("onboarding", Map.of("signedDocuments", true), 30 | "participant", Map.of("name", pid), 31 | "credential", Map.of("id", UUID.randomUUID().toString()) 32 | )); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /mxd-runtimes/tx-issuerservice/src/main/java/org/eclipse/edc/issuerservice/demo/attestation/DemoAttestationSourceFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2025 Cofinity-X 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Apache License, Version 2.0 which is available at 6 | * https://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * SPDX-License-Identifier: Apache-2.0 9 | * 10 | * Contributors: 11 | * Cofinity-X - initial API and implementation 12 | * 13 | */ 14 | 15 | package org.eclipse.edc.issuerservice.demo.attestation; 16 | 17 | import org.eclipse.edc.issuerservice.spi.issuance.attestation.AttestationSource; 18 | import org.eclipse.edc.issuerservice.spi.issuance.attestation.AttestationSourceFactory; 19 | import org.eclipse.edc.issuerservice.spi.issuance.model.AttestationDefinition; 20 | 21 | public class DemoAttestationSourceFactory implements AttestationSourceFactory { 22 | @Override 23 | public AttestationSource createSource(AttestationDefinition definition) { 24 | return new DemoAttestationSource(); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /mxd-runtimes/tx-issuerservice/src/main/java/org/eclipse/edc/issuerservice/demo/attestation/DemoAttestationsExtension.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2025 Cofinity-X 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Apache License, Version 2.0 which is available at 6 | * https://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * SPDX-License-Identifier: Apache-2.0 9 | * 10 | * Contributors: 11 | * Cofinity-X - initial API and implementation 12 | * 13 | */ 14 | 15 | package org.eclipse.edc.issuerservice.demo.attestation; 16 | 17 | import org.eclipse.edc.issuerservice.spi.issuance.attestation.AttestationDefinitionValidatorRegistry; 18 | import org.eclipse.edc.issuerservice.spi.issuance.attestation.AttestationSourceFactoryRegistry; 19 | import org.eclipse.edc.runtime.metamodel.annotation.Extension; 20 | import org.eclipse.edc.runtime.metamodel.annotation.Inject; 21 | import org.eclipse.edc.spi.system.ServiceExtension; 22 | import org.eclipse.edc.spi.system.ServiceExtensionContext; 23 | 24 | 25 | @Extension(value = DemoAttestationsExtension.NAME) 26 | public class DemoAttestationsExtension implements ServiceExtension { 27 | 28 | public static final String NAME = "Demo Attestations Extension"; 29 | 30 | @Inject 31 | private AttestationSourceFactoryRegistry registry; 32 | 33 | @Inject 34 | private AttestationDefinitionValidatorRegistry validatorRegistry; 35 | 36 | @Override 37 | public String name() { 38 | return NAME; 39 | } 40 | 41 | @Override 42 | public void initialize(ServiceExtensionContext context) { 43 | registry.registerFactory("demo", new DemoAttestationSourceFactory()); 44 | validatorRegistry.registerValidator("demo", new DemoAttestatonSourceValidator()); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /mxd-runtimes/tx-issuerservice/src/main/java/org/eclipse/edc/issuerservice/demo/attestation/DemoAttestatonSourceValidator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2025 Cofinity-X 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Apache License, Version 2.0 which is available at 6 | * https://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * SPDX-License-Identifier: Apache-2.0 9 | * 10 | * Contributors: 11 | * Cofinity-X - initial API and implementation 12 | * 13 | */ 14 | 15 | package org.eclipse.edc.issuerservice.demo.attestation; 16 | 17 | import org.eclipse.edc.issuerservice.spi.issuance.model.AttestationDefinition; 18 | import org.eclipse.edc.validator.spi.ValidationResult; 19 | import org.eclipse.edc.validator.spi.Validator; 20 | 21 | public class DemoAttestatonSourceValidator implements Validator { 22 | @Override 23 | public ValidationResult validate(AttestationDefinition attestationDefinition) { 24 | return ValidationResult.success(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /mxd-runtimes/tx-issuerservice/src/main/resources/META-INF/services/org.eclipse.edc.spi.system.ServiceExtension: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 3 | # 4 | # This program and the accompanying materials are made available under the 5 | # terms of the Apache License, Version 2.0 which is available at 6 | # https://www.apache.org/licenses/LICENSE-2.0 7 | # 8 | # SPDX-License-Identifier: Apache-2.0 9 | # 10 | # Contributors: 11 | # Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation 12 | # 13 | # 14 | 15 | org.eclipse.edc.issuerservice.seed.SuperUserSeedExtension 16 | org.eclipse.edc.issuerservice.demo.attestation.DemoAttestationsExtension -------------------------------------------------------------------------------- /mxd/alice_variables.tf: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 3 | # 4 | # This program and the accompanying materials are made available under the 5 | # terms of the Apache License, Version 2.0 which is available at 6 | # https://www.apache.org/licenses/LICENSE-2.0 7 | # 8 | # SPDX-License-Identifier: Apache-2.0 9 | # 10 | # Contributors: 11 | # Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation 12 | # 13 | # 14 | 15 | variable "alice-bpn" { 16 | default = "BPNL000000000001" 17 | } 18 | 19 | variable "alice-humanReadableName" { 20 | default = "alice" 21 | } 22 | 23 | variable "alice-identityhub-host" { 24 | description = "Kubernetes service name of the IdentityHub" 25 | default = "alice-ih" 26 | } 27 | 28 | variable "alice-catalogserver-host" { 29 | description = "Kubernetes service name (=Host) for Alice's Catalog Server" 30 | default = "alice-cs" 31 | } 32 | 33 | variable "alice-did" { 34 | default = "did:web:alice-ih%3A7083:alice" 35 | } 36 | 37 | variable "alice-azure-account-name" { 38 | default = "aliceazureaccount" 39 | } 40 | 41 | variable "alice-azure-account-key" { 42 | default = "aliceazurekey" 43 | } 44 | 45 | variable "alice-azure-key-sas" { 46 | default = "sv=2023-01-03&ss=btqf&srt=sco&st=2023-11-23T13%3A17%3A09Z&se=2030-01-01T00%3A00%3A00Z&sp=rwdxftlacup&sig=uvPcqmLj7%2FMuadAKXMCA7SvWCnClQ9EA1b15OB0m1bc%3D" 47 | } 48 | 49 | variable "alice-ingress-host" { 50 | default = "localhost" 51 | } 52 | 53 | variable "alice-namespace" { 54 | type = string 55 | description = "Kubernetes namespace to use" 56 | default = "mxd" 57 | } -------------------------------------------------------------------------------- /mxd/assets/alice.dataexchangegov.jwt: -------------------------------------------------------------------------------- 1 | eyJraWQiOiJkaWQ6d2ViOmRhdGFzcGFjZS1pc3N1ZXIja2V5LTEiLCJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSJ9.eyJpc3MiOiJkaWQ6d2ViOmRhdGFzcGFjZS1pc3N1ZXIiLCJhdWQiOiJkaWQ6d2ViOmFsaWNlLWloJTNBNzA4MzphbGljZSIsInN1YiI6ImRpZDp3ZWI6YWxpY2UtaWglM0E3MDgzOmFsaWNlIiwidmMiOnsiQGNvbnRleHQiOlsiaHR0cHM6Ly93d3cudzMub3JnLzIwMTgvY3JlZGVudGlhbHMvdjEiLCJodHRwczovL3czaWQub3JnL2NhdGVuYXgvY3JlZGVudGlhbHMvdjEuMC4wIl0sImlkIjoiMWYzNmFmNTgtMGZjMC00YjI0LTliMWMtZTM3ZDU5NjY4MDg5IiwidHlwZSI6WyJWZXJpZmlhYmxlQ3JlZGVudGlhbCIsIkRhdGFFeGNoYW5nZUdvdmVybmFuY2VDcmVkZW50aWFsIl0sImlzc3VlciI6ImRpZDp3ZWI6Y29tLmV4YW1wbGUuaXNzdWVyIiwiaXNzdWFuY2VEYXRlIjoiMjAyMS0wNi0xNlQxODo1Njo1OVoiLCJleHBpcmF0aW9uRGF0ZSI6IjIwMjItMDYtMTZUMTg6NTY6NTlaIiwiY3JlZGVudGlhbFN1YmplY3QiOnsiaWQiOiJkaWQ6d2ViOmFsaWNlLWloJTNBNzA4MzphbGljZSIsImhvbGRlcklkZW50aWZpZXIiOiJCUE5MMDAwMDAwMDAwMDAxIiwiZ3JvdXAiOiJVc2VDYXNlRnJhbWV3b3JrIiwidXNlQ2FzZSI6IkRhdGFFeGNoYW5nZUdvdmVybmFuY2UiLCJjb250cmFjdFRlbXBsYXRlIjoiaHR0cHM6Ly9jYXRlbmEteC5uZXQvZW4vY2F0ZW5hLXgtaW50cm9kdWNlLWltcGxlbWVudC9nb3Zlcm5hbmNlLWZyYW1ld29yay1mb3ItZGF0YS1zcGFjZS1vcGVyYXRpb25zIiwiY29udHJhY3RWZXJzaW9uIjoiYS5iIn19LCJpYXQiOjE3MjcwOTQ0MTN9.0cl_nlm0V830O2aCbYgYZ5nJJ-n5UBIS2dZyE_R-qkbNdfNs-5q9rwh5IubcAQV4SAvE46WvJGV9yAK5qIMQBw -------------------------------------------------------------------------------- /mxd/assets/alice.membership.jwt: -------------------------------------------------------------------------------- 1 | eyJraWQiOiJkaWQ6d2ViOmRhdGFzcGFjZS1pc3N1ZXIja2V5LTEiLCJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSJ9.eyJpc3MiOiJkaWQ6d2ViOmRhdGFzcGFjZS1pc3N1ZXIiLCJhdWQiOiJkaWQ6d2ViOmFsaWNlLWloJTNBNzA4MzphbGljZSIsInN1YiI6ImRpZDp3ZWI6YWxpY2UtaWglM0E3MDgzOmFsaWNlIiwidmMiOnsiQGNvbnRleHQiOlsiaHR0cHM6Ly93d3cudzMub3JnLzIwMTgvY3JlZGVudGlhbHMvdjEiLCJodHRwczovL3czaWQub3JnL3NlY3VyaXR5L3N1aXRlcy9qd3MtMjAyMC92MSIsImh0dHBzOi8vd3d3LnczLm9yZy9ucy9kaWQvdjEiLHsibXhkLWNyZWRlbnRpYWxzIjoiaHR0cHM6Ly93M2lkLm9yZy9teGQvY3JlZGVudGlhbHMvIiwibWVtYmVyc2hpcCI6Im14ZC1jcmVkZW50aWFsczptZW1iZXJzaGlwIiwibWVtYmVyc2hpcFR5cGUiOiJteGQtY3JlZGVudGlhbHM6bWVtYmVyc2hpcFR5cGUiLCJ3ZWJzaXRlIjoibXhkLWNyZWRlbnRpYWxzOndlYnNpdGUiLCJjb250YWN0IjoibXhkLWNyZWRlbnRpYWxzOmNvbnRhY3QiLCJzaW5jZSI6Im14ZC1jcmVkZW50aWFsczpzaW5jZSJ9XSwiaWQiOiJodHRwOi8vb3JnLnlvdXJkYXRhc3BhY2UuY29tL2NyZWRlbnRpYWxzLzIzNDciLCJ0eXBlIjpbIlZlcmlmaWFibGVDcmVkZW50aWFsIiwiTWVtYmVyc2hpcENyZWRlbnRpYWwiXSwiaXNzdWVyIjoiZGlkOndlYjpkYXRhc3BhY2UtaXNzdWVyIiwiaXNzdWFuY2VEYXRlIjoiMjAyMy0wOC0xOFQwMDowMDowMFoiLCJjcmVkZW50aWFsU3ViamVjdCI6eyJpZCI6ImRpZDp3ZWI6YWxpY2UtaWglM0E3MDgzOmFsaWNlIiwiaG9sZGVySWRlbnRpZmllciI6IkJQTkwwMDAwMDAwMDAwMDEiLCJjb250cmFjdFRlbXBsYXRlIjoiaHR0cHM6Ly9wdWJsaWMuY2F0ZW5hLXgub3JnL2NvbnRyYWN0cy9NZW1iZXJzaGlwLnYxLnBkZiIsImNvbnRyYWN0VmVyc2lvbiI6IjEuMC4wIn19LCJpYXQiOjE3MjcwOTQ0MTN9.83zTmShU-9bXoIX_D1TSU0nfXQSrYoVDDHhv6IsUbt4dcVR4pZ3IHZ9If3M-0WSk3lbWiE2tRFGh_PLEyp5mBA -------------------------------------------------------------------------------- /mxd/assets/alice_bucket.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-tractusx/tutorial-resources/1e14bba221624c0f2ec2e507dea1109859232465/mxd/assets/alice_bucket.png -------------------------------------------------------------------------------- /mxd/assets/alice_bucket_content.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-tractusx/tutorial-resources/1e14bba221624c0f2ec2e507dea1109859232465/mxd/assets/alice_bucket_content.png -------------------------------------------------------------------------------- /mxd/assets/bob-azure-container.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-tractusx/tutorial-resources/1e14bba221624c0f2ec2e507dea1109859232465/mxd/assets/bob-azure-container.png -------------------------------------------------------------------------------- /mxd/assets/bob.dataexchangegov.jwt: -------------------------------------------------------------------------------- 1 | eyJraWQiOiJkaWQ6d2ViOmRhdGFzcGFjZS1pc3N1ZXIja2V5LTEiLCJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSJ9.eyJpc3MiOiJkaWQ6d2ViOmRhdGFzcGFjZS1pc3N1ZXIiLCJhdWQiOiJkaWQ6d2ViOmJvYi1paCUzQTcwODM6Ym9iIiwic3ViIjoiZGlkOndlYjpib2ItaWglM0E3MDgzOmJvYiIsInZjIjp7IkBjb250ZXh0IjpbImh0dHBzOi8vd3d3LnczLm9yZy8yMDE4L2NyZWRlbnRpYWxzL3YxIiwiaHR0cHM6Ly93M2lkLm9yZy9jYXRlbmF4L2NyZWRlbnRpYWxzL3YxLjAuMCJdLCJpZCI6IjFmMzZhZjU4LTBmYzAtNGIyNC05YjFjLWUzN2Q1OTY2ODA4OSIsInR5cGUiOlsiVmVyaWZpYWJsZUNyZWRlbnRpYWwiLCJEYXRhRXhjaGFuZ2VHb3Zlcm5hbmNlQ3JlZGVudGlhbCJdLCJpc3N1ZXIiOiJkaWQ6d2ViOmNvbS5leGFtcGxlLmlzc3VlciIsImlzc3VhbmNlRGF0ZSI6IjIwMjEtMDYtMTZUMTg6NTY6NTlaIiwiZXhwaXJhdGlvbkRhdGUiOiIyMDIyLTA2LTE2VDE4OjU2OjU5WiIsImNyZWRlbnRpYWxTdWJqZWN0Ijp7ImlkIjoiZGlkOndlYjpib2ItaWglM0E3MDgzOmJvYiIsImhvbGRlcklkZW50aWZpZXIiOiJCUE5MMDAwMDAwMDAwMDAyIiwiZ3JvdXAiOiJVc2VDYXNlRnJhbWV3b3JrIiwidXNlQ2FzZSI6IkRhdGFFeGNoYW5nZUdvdmVybmFuY2UiLCJjb250cmFjdFRlbXBsYXRlIjoiaHR0cHM6Ly9jYXRlbmEteC5uZXQvZW4vY2F0ZW5hLXgtaW50cm9kdWNlLWltcGxlbWVudC9nb3Zlcm5hbmNlLWZyYW1ld29yay1mb3ItZGF0YS1zcGFjZS1vcGVyYXRpb25zIiwiY29udHJhY3RWZXJzaW9uIjoiYS5iIn19LCJpYXQiOjE3MjcwOTQ0MTN9.kyx50sxO7c6cD8oOwrPibVmnRAXdFF2dRgGJ0Ch6J5Pjd7vDicb6xo-cPcG8rnm0rKiThhiHGg6I8f0_m82uCA -------------------------------------------------------------------------------- /mxd/assets/bob.membership.jwt: -------------------------------------------------------------------------------- 1 | eyJraWQiOiJkaWQ6d2ViOmRhdGFzcGFjZS1pc3N1ZXIja2V5LTEiLCJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSJ9.eyJpc3MiOiJkaWQ6d2ViOmRhdGFzcGFjZS1pc3N1ZXIiLCJhdWQiOiJkaWQ6d2ViOmJvYi1paCUzQTcwODM6Ym9iIiwic3ViIjoiZGlkOndlYjpib2ItaWglM0E3MDgzOmJvYiIsInZjIjp7IkBjb250ZXh0IjpbImh0dHBzOi8vd3d3LnczLm9yZy8yMDE4L2NyZWRlbnRpYWxzL3YxIiwiaHR0cHM6Ly93M2lkLm9yZy9zZWN1cml0eS9zdWl0ZXMvandzLTIwMjAvdjEiLCJodHRwczovL3d3dy53My5vcmcvbnMvZGlkL3YxIix7Im14ZC1jcmVkZW50aWFscyI6Imh0dHBzOi8vdzNpZC5vcmcvbXhkL2NyZWRlbnRpYWxzLyIsIm1lbWJlcnNoaXAiOiJteGQtY3JlZGVudGlhbHM6bWVtYmVyc2hpcCIsIm1lbWJlcnNoaXBUeXBlIjoibXhkLWNyZWRlbnRpYWxzOm1lbWJlcnNoaXBUeXBlIiwid2Vic2l0ZSI6Im14ZC1jcmVkZW50aWFsczp3ZWJzaXRlIiwiY29udGFjdCI6Im14ZC1jcmVkZW50aWFsczpjb250YWN0Iiwic2luY2UiOiJteGQtY3JlZGVudGlhbHM6c2luY2UifV0sImlkIjoiaHR0cDovL29yZy55b3VyZGF0YXNwYWNlLmNvbS9jcmVkZW50aWFscy8yMzQ3IiwidHlwZSI6WyJWZXJpZmlhYmxlQ3JlZGVudGlhbCIsIk1lbWJlcnNoaXBDcmVkZW50aWFsIl0sImlzc3VlciI6ImRpZDp3ZWI6ZGF0YXNwYWNlLWlzc3VlciIsImlzc3VhbmNlRGF0ZSI6IjIwMjMtMDgtMThUMDA6MDA6MDBaIiwiY3JlZGVudGlhbFN1YmplY3QiOnsiaWQiOiJkaWQ6d2ViOmJvYi1paCUzQTcwODM6Ym9iIiwiaG9sZGVySWRlbnRpZmllciI6IkJQTkwwMDAwMDAwMDAwMDIiLCJjb250cmFjdFRlbXBsYXRlIjoiaHR0cHM6Ly9wdWJsaWMuY2F0ZW5hLXgub3JnL2NvbnRyYWN0cy9NZW1iZXJzaGlwLnYxLnBkZiIsImNvbnRyYWN0VmVyc2lvbiI6IjEuMC4wIn19LCJpYXQiOjE3MjcwOTQ0MTN9.08ONkatxndfeR1vQtUZoYLnVbrs1SQf5IkqBoOsVy7DKO-9XcN4XgUU8kb45JpPch_EEMcbZ9ogGwzO4hDTOAA -------------------------------------------------------------------------------- /mxd/assets/bob_bucket_content.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-tractusx/tutorial-resources/1e14bba221624c0f2ec2e507dea1109859232465/mxd/assets/bob_bucket_content.png -------------------------------------------------------------------------------- /mxd/assets/bob_bucket_content_after_transfer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-tractusx/tutorial-resources/1e14bba221624c0f2ec2e507dea1109859232465/mxd/assets/bob_bucket_content_after_transfer.png -------------------------------------------------------------------------------- /mxd/assets/img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-tractusx/tutorial-resources/1e14bba221624c0f2ec2e507dea1109859232465/mxd/assets/img.png -------------------------------------------------------------------------------- /mxd/assets/issuer.did.json: -------------------------------------------------------------------------------- 1 | {"service":[],"verificationMethod":[{"id":"did:web:dataspace-issuer#key-1","type":"JsonWebKey2020","controller":"did:web:dataspace-issuer","publicKeyMultibase":null,"publicKeyJwk":{"kty":"OKP","crv":"Ed25519","kid":"did:web:dataspace-issuer#key-1","x":"N6z9LC9L_5D_W2nKaUUHMYklUDQVlF37AFKSifNtV2c"}}],"authentication":[],"id":"did:web:dataspace-issuer","@context":["https://w3id.org/did-resolution/v1"]} -------------------------------------------------------------------------------- /mxd/assets/issuer.key.json: -------------------------------------------------------------------------------- 1 | {"kty":"OKP","d":"G7sL7PM49U8nCucXJMN-S62l7xHX8Bi6biWoNvGD5XE","crv":"Ed25519","kid":"did:web:dataspace-issuer#key-1","x":"N6z9LC9L_5D_W2nKaUUHMYklUDQVlF37AFKSifNtV2c"} -------------------------------------------------------------------------------- /mxd/assets/issuer.pub.json: -------------------------------------------------------------------------------- 1 | {"kty":"OKP","crv":"Ed25519","kid":"did:web:dataspace-issuer#key-1","x":"N6z9LC9L_5D_W2nKaUUHMYklUDQVlF37AFKSifNtV2c"} -------------------------------------------------------------------------------- /mxd/assets/nginx.conf: -------------------------------------------------------------------------------- 1 | events { worker_connections 1024; } 2 | 3 | http { 4 | server { 5 | listen 80; 6 | root /var/www/; 7 | index index.html; 8 | } 9 | } -------------------------------------------------------------------------------- /mxd/assets/participants.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "bob", 4 | "id": "BPNL000000000002", 5 | "url": "http://bob-controlplane:8084/api/v1/dsp", 6 | "supportedProtocols": "dataspace-protocol-http" 7 | }, 8 | { 9 | "name": "alice", 10 | "id": "BPNL000000000001", 11 | "url": "http://alice-cs:8082/api/dsp", 12 | "supportedProtocols": "dataspace-protocol-http" 13 | } 14 | ] -------------------------------------------------------------------------------- /mxd/assets/scr_pgadmin1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-tractusx/tutorial-resources/1e14bba221624c0f2ec2e507dea1109859232465/mxd/assets/scr_pgadmin1.png -------------------------------------------------------------------------------- /mxd/assets/test-document.txt: -------------------------------------------------------------------------------- 1 | This is a test document. 2 | -------------------------------------------------------------------------------- /mxd/bdrs.tf: -------------------------------------------------------------------------------- 1 | ################################################################################# 2 | # 3 | # Copyright (c) 2024 SAP SE 4 | # 5 | # This program and the accompanying materials are made available under the 6 | # terms of the Apache License, Version 2.0 which is available at 7 | # https://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # SPDX-License-Identifier: Apache-2.0 10 | # 11 | # Contributors: 12 | # SAP SE - initial API and implementation 13 | # 14 | ################################################################################# 15 | 16 | resource "helm_release" "bdrs-server" { 17 | name = "bdrs-server" 18 | namespace = kubernetes_namespace.mxd-ns.metadata.0.name 19 | force_update = true 20 | dependency_update = true 21 | reuse_values = true 22 | cleanup_on_fail = true 23 | replace = true 24 | 25 | repository = "https://eclipse-tractusx.github.io/charts/dev" 26 | chart = "bdrs-server" 27 | version = "0.5.2" 28 | 29 | values = [ 30 | yamlencode({ 31 | server : { 32 | debug : { 33 | enabled : true 34 | port : 1046 35 | } 36 | trustedIssuers : ["did:web:dataspace-issuer"] 37 | env : { 38 | EDC_API_AUTH_KEY : "password" 39 | EDC_DATASOURCE_DIDENTRY_USER : local.databases.bdrs.database-username 40 | EDC_DATASOURCE_DIDENTRY_PASSWORD : local.databases.bdrs.database-password 41 | EDC_IAM_DID_WEB_USE_HTTPS : "false" 42 | } 43 | } 44 | postgresql : { 45 | jdbcUrl : "jdbc:postgresql://${local.bdrs-postgres.database-url}/${local.databases.bdrs.database-name}" 46 | } 47 | }) 48 | ] 49 | 50 | set { 51 | name = "install.postgresql" 52 | value = false 53 | } 54 | } 55 | 56 | locals { 57 | bdrs-service = "bdrs-server" 58 | bdrs-mgmt-port = 8081 59 | bdrs-directory-port = 8082 60 | bdrs-mgmt-url = "http://${local.bdrs-service}:${local.bdrs-mgmt-port}/api/management" 61 | bdrs-directory-url = "http://${local.bdrs-service}:${local.bdrs-directory-port}/api/directory" 62 | } 63 | -------------------------------------------------------------------------------- /mxd/bob.tf: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 3 | # 4 | # This program and the accompanying materials are made available under the 5 | # terms of the Apache License, Version 2.0 which is available at 6 | # https://www.apache.org/licenses/LICENSE-2.0 7 | # 8 | # SPDX-License-Identifier: Apache-2.0 9 | # 10 | # Contributors: 11 | # Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation 12 | # 13 | 14 | # Second connector 15 | module "bob-connector" { 16 | depends_on = [module.azurite] 17 | source = "./modules/connector" 18 | humanReadableName = var.bob-humanReadableName 19 | namespace = kubernetes_namespace.mxd-ns.metadata.0.name 20 | participantId = var.bob-bpn 21 | database-host = local.bob-postgres.database-host 22 | database-name = local.databases.bob.database-name 23 | database-credentials = { 24 | user = local.databases.bob.database-username 25 | password = local.databases.bob.database-password 26 | } 27 | dcp-config = { 28 | id = var.bob-did 29 | sts_token_url = "http://bob-ih:7084/api/sts/token" 30 | sts_client_id = var.bob-did 31 | sts_clientsecret_alias = "${var.bob-did}-sts-client-secret" 32 | } 33 | dataplane = { 34 | privatekey-alias = "${var.bob-did}#signing-key-1" 35 | publickey-alias = "${var.bob-did}#signing-key-1" 36 | } 37 | 38 | azure-account-name = var.bob-azure-account-name 39 | azure-account-key = local.bob-azure-key-base64 40 | azure-account-key-sas = var.bob-azure-key-sas 41 | azure-url = module.azurite.azurite-url 42 | ingress-host = var.bob-ingress-host 43 | minio-config = { 44 | username = module.bob-minio.minio-username 45 | password = module.bob-minio.minio-password 46 | url = module.bob-minio.minio-url 47 | } 48 | useSVE = var.useSVE 49 | } 50 | 51 | module "bob-identityhub" { 52 | depends_on = [module.bob-connector] // depends because of the vault 53 | source = "./modules/identity-hub" 54 | database = { 55 | user = local.databases.bob.database-username 56 | password = local.databases.bob.database-password 57 | url = "jdbc:postgresql://${local.bob-postgres.database-host}/${local.databases.bob.database-name}" 58 | } 59 | humanReadableName = var.bob-identityhub-host 60 | namespace = kubernetes_namespace.mxd-ns.metadata.0.name 61 | participantId = var.bob-did 62 | vault-url = "http://bob-vault:8200" 63 | url-path = var.bob-identityhub-host 64 | useSVE = var.useSVE 65 | } 66 | 67 | module "bob-minio" { 68 | source = "./modules/minio" 69 | humanReadableName = lower(var.bob-humanReadableName) 70 | minio-username = "bobawsclient" 71 | minio-password = "bobawssecret" 72 | } 73 | 74 | locals { 75 | bob-azure-key-base64 = base64encode(var.bob-azure-account-key) 76 | } -------------------------------------------------------------------------------- /mxd/bob_variables.tf: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 3 | # 4 | # This program and the accompanying materials are made available under the 5 | # terms of the Apache License, Version 2.0 which is available at 6 | # https://www.apache.org/licenses/LICENSE-2.0 7 | # 8 | # SPDX-License-Identifier: Apache-2.0 9 | # 10 | # Contributors: 11 | # Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation 12 | # 13 | # 14 | 15 | 16 | variable "bob-bpn" { 17 | default = "BPNL000000000002" 18 | } 19 | 20 | variable "bob-did" { 21 | default = "did:web:bob-ih%3A7083:bob" 22 | } 23 | 24 | 25 | variable "bob-azure-account-name" { 26 | default = "bobazureaccount" 27 | } 28 | 29 | variable "bob-azure-account-key" { 30 | default = "bobazurekey" 31 | } 32 | 33 | variable "bob-azure-key-sas" { 34 | default = "sv=2023-01-03&ss=btqf&srt=sco&st=2023-11-23T13%3A18%3A49Z&se=2030-01-01T00%3A00%3A00Z&sp=rwdftlacup&sig=Xki%2B2nHBT2V8oe%2BMmS%2BI%2FHzcAsTFCYWDv6t6zT%2FWXFM%3D" 35 | } 36 | 37 | variable "bob-ingress-host" { 38 | default = "localhost" 39 | } 40 | 41 | variable "bob-humanReadableName" { 42 | default = "bob" 43 | } 44 | 45 | variable "bob-identityhub-host" { 46 | description = "Kubernetes service name of the IdentityHub" 47 | default = "bob-ih" 48 | } 49 | 50 | variable "bob-catalogserver-host" { 51 | description = "Kubernetes service name (=Host) for Bob's Catalog Server" 52 | default = "bob-cs" 53 | } 54 | -------------------------------------------------------------------------------- /mxd/docs/MXD Remote Deployment.md: -------------------------------------------------------------------------------- 1 | # Deploying MXD on Remote Kubernetes Cluster 2 | 3 | We should be able to deploy MXD on a Kubernetes cluster deployed on a local machine / computer as per the steps defined in the [MXD README](../README.md#2-basic-dataspace-setup). 4 | But there are certain changes needed if we want to deploy it on a remote Kubernetes cluster. 5 | 6 | ## Provide Static IP for MIW / Keycloak 7 | MIW and Keycloak both require static IPs. 8 | Different Kubernetes clusters may have different allowed IP ranges. 9 | So, we can pass these IPs as Terraform variable while running `terraform apply`. 10 | ```shell 11 | terraform.exe apply -var miw-static-ip="10.96.81.225" -var keycloak-static-ip="10.96.103.90" 12 | ``` 13 | > These static IPs are randomly chosen among range of available IPs. 14 | 15 | ## Provide Ingress Host 16 | MXD uses ingress rules to route requests to different connectors (`Alice` & `Bob`). 17 | Ingress host defaults to `localhost` and hence ingress rules may not work when MXD is deployed on a remote cluster. 18 | So, to override ingress host for `Alice` and `Bob`, we can pass these as terraform variables. 19 | ```shell 20 | terraform.exe apply -var alice-ingress-host="alice-edc.ingress.example.com" -var bob-ingress-host="bob-edc.ingress.example.com" 21 | ``` 22 | > Please check [ingress configurations](../modules/connector/ingress.tf) for more details. 23 | -------------------------------------------------------------------------------- /mxd/issuer-service.tf: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2025 Cofinity-X 3 | # 4 | # This program and the accompanying materials are made available under the 5 | # terms of the Apache License, Version 2.0 which is available at 6 | # https://www.apache.org/licenses/LICENSE-2.0 7 | # 8 | # SPDX-License-Identifier: Apache-2.0 9 | # 10 | # Contributors: 11 | # Cofinity-X - initial API and implementation 12 | # 13 | 14 | module "dataspace-issuer" { 15 | source = "./modules/issuerservice" 16 | humanReadableName = "dataspace-issuer-service" 17 | participantId = "did:web:dataspace-issuer" // todo: change 18 | database = { 19 | user = "issuer" 20 | password = "issuer" 21 | url = "jdbc:postgresql://${module.dataspace-issuer-postgres.database-url}/issuer" 22 | } 23 | vault-url = "http://dataspace-issuer-vault:8200" 24 | vault-token = "root" 25 | namespace = kubernetes_namespace.mxd-ns.metadata.0.name 26 | useSVE = var.useSVE 27 | } 28 | 29 | module "dataspace-issuer-postgres" { 30 | depends_on = [kubernetes_config_map.issuer-initdb-config] 31 | source = "./modules/postgres" 32 | instance-name = "issuer" 33 | init-sql-configs = ["issuer-initdb-config"] 34 | namespace = kubernetes_namespace.mxd-ns.metadata.0.name 35 | } 36 | 37 | resource "kubernetes_config_map" "issuer-initdb-config" { 38 | metadata { 39 | name = "issuer-initdb-config" 40 | namespace = kubernetes_namespace.mxd-ns.metadata.0.name 41 | } 42 | data = { 43 | "issuer-initdb-config.sql" = <<-EOT 44 | CREATE USER issuer WITH ENCRYPTED PASSWORD 'issuer' SUPERUSER; 45 | CREATE DATABASE issuer; 46 | \c issuer issuer 47 | EOT 48 | } 49 | } 50 | 51 | module "consumer-vault" { 52 | source = "./modules/vault" 53 | humanReadableName = "dataspace-issuer-vault" 54 | namespace = kubernetes_namespace.mxd-ns.metadata.0.name 55 | vault-token = "root" 56 | } -------------------------------------------------------------------------------- /mxd/kind.config.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft 3 | # 4 | # See the NOTICE file(s) distributed with this work for additional 5 | # information regarding copyright ownership. 6 | # 7 | # This program and the accompanying materials are made available under the 8 | # terms of the Apache License, Version 2.0 which is available at 9 | # https://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | # SPDX-License-Identifier: Apache-2.0 18 | # 19 | 20 | --- 21 | kind: Cluster 22 | apiVersion: kind.x-k8s.io/v1alpha4 23 | nodes: 24 | - role: control-plane 25 | kubeadmConfigPatches: 26 | - | 27 | kind: InitConfiguration 28 | nodeRegistration: 29 | kubeletExtraArgs: 30 | node-labels: "ingress-ready=true" 31 | extraPortMappings: 32 | - containerPort: 80 33 | hostPort: 80 34 | protocol: TCP 35 | - containerPort: 443 36 | hostPort: 443 37 | protocol: TCP -------------------------------------------------------------------------------- /mxd/main.tf: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2023 Contributors to the Eclipse Foundation 3 | # 4 | # See the NOTICE file(s) distributed with this work for additional 5 | # information regarding copyright ownership. 6 | # 7 | # This program and the accompanying materials are made available under the 8 | # terms of the Apache License, Version 2.0 which is available at 9 | # https://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | # SPDX-License-Identifier: Apache-2.0 18 | # 19 | 20 | terraform { 21 | required_providers { 22 | helm = { 23 | source = "hashicorp/helm" 24 | } 25 | // for generating passwords, clientsecrets etc. 26 | random = { 27 | source = "hashicorp/random" 28 | } 29 | kubernetes = { 30 | source = "hashicorp/kubernetes" 31 | } 32 | } 33 | } 34 | 35 | provider "kubernetes" { 36 | config_path = "~/.kube/config" 37 | } 38 | 39 | provider "helm" { 40 | kubernetes { 41 | config_path = "~/.kube/config" 42 | } 43 | } 44 | 45 | module "azurite" { 46 | source = "./modules/azurite" 47 | namespace = kubernetes_namespace.mxd-ns.metadata.0.name 48 | azurite-accounts = "${var.alice-azure-account-name}:${local.alice-azure-key-base64};${var.bob-azure-account-name}:${local.bob-azure-key-base64};${var.trudy-azure-account-name}:${local.trudy-azure-key-base64};" 49 | } 50 | 51 | locals { 52 | trudy-azure-key-base64 = base64encode(var.trudy-azure-account-key) 53 | } 54 | 55 | resource "kubernetes_namespace" "mxd-ns" { 56 | metadata { 57 | name = var.namespace 58 | } 59 | } -------------------------------------------------------------------------------- /mxd/modules/azurite/main.tf: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2023 Contributors to the Eclipse Foundation 3 | # 4 | # See the NOTICE file(s) distributed with this work for additional 5 | # information regarding copyright ownership. 6 | # 7 | # This program and the accompanying materials are made available under the 8 | # terms of the Apache License, Version 2.0 which is available at 9 | # https://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | # SPDX-License-Identifier: Apache-2.0 18 | # 19 | 20 | resource "kubernetes_deployment" "azurite" { 21 | metadata { 22 | name = local.appName 23 | namespace = var.namespace 24 | labels = { 25 | App = local.appName 26 | } 27 | } 28 | 29 | spec { 30 | replicas = 1 31 | selector { 32 | match_labels = { 33 | App = local.appName 34 | } 35 | } 36 | template { 37 | metadata { 38 | labels = { 39 | App = local.appName 40 | } 41 | } 42 | spec { 43 | container { 44 | name = local.appName 45 | image = "mcr.microsoft.com/azure-storage/azurite" 46 | image_pull_policy = "Always" 47 | 48 | port { 49 | container_port = local.port 50 | name = "blob-port" 51 | } 52 | env_from { 53 | config_map_ref { 54 | name = kubernetes_config_map.azurite-config.metadata[0].name 55 | } 56 | } 57 | } 58 | } 59 | } 60 | } 61 | } 62 | 63 | resource "kubernetes_config_map" "azurite-config" { 64 | metadata { 65 | namespace = var.namespace 66 | name = "${local.appName}-config" 67 | } 68 | data = { 69 | AZURITE_ACCOUNTS = var.azurite-accounts 70 | } 71 | } 72 | 73 | resource "kubernetes_service" "azurite" { 74 | metadata { 75 | namespace = var.namespace 76 | name = local.appName 77 | } 78 | spec { 79 | selector = { 80 | App = kubernetes_deployment.azurite.spec.0.template.0.metadata[0].labels.App 81 | } 82 | port { 83 | name = "blob-port" 84 | port = local.port 85 | } 86 | } 87 | } 88 | 89 | locals { 90 | appName = "azurite" 91 | port = 10000 92 | } 93 | -------------------------------------------------------------------------------- /mxd/modules/azurite/outputs.tf: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2023 Contributors to the Eclipse Foundation 3 | # 4 | # See the NOTICE file(s) distributed with this work for additional 5 | # information regarding copyright ownership. 6 | # 7 | # This program and the accompanying materials are made available under the 8 | # terms of the Apache License, Version 2.0 which is available at 9 | # https://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | # SPDX-License-Identifier: Apache-2.0 18 | # 19 | 20 | 21 | output "azurite-port" { 22 | value = local.port 23 | } 24 | 25 | output "azurite-url" { 26 | value = "http://${local.appName}:${local.port}" 27 | } 28 | -------------------------------------------------------------------------------- /mxd/modules/azurite/variables.tf: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2023 Contributors to the Eclipse Foundation 3 | # 4 | # See the NOTICE file(s) distributed with this work for additional 5 | # information regarding copyright ownership. 6 | # 7 | # This program and the accompanying materials are made available under the 8 | # terms of the Apache License, Version 2.0 which is available at 9 | # https://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | # SPDX-License-Identifier: Apache-2.0 18 | # 19 | 20 | variable "namespace" { 21 | type = string 22 | description = "Kubernetes namespace to use" 23 | default = "mxd" 24 | } 25 | 26 | variable "azurite-accounts" { 27 | type = string 28 | description = "Azurite accounts to be created at startup" 29 | } 30 | -------------------------------------------------------------------------------- /mxd/modules/catalog-server/ingress.tf: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2023 Contributors to the Eclipse Foundation 3 | # 4 | # See the NOTICE file(s) distributed with this work for additional 5 | # information regarding copyright ownership. 6 | # 7 | # This program and the accompanying materials are made available under the 8 | # terms of the Apache License, Version 2.0 which is available at 9 | # https://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | # SPDX-License-Identifier: Apache-2.0 18 | # 19 | 20 | resource "kubernetes_ingress_v1" "api-ingress" { 21 | metadata { 22 | name = "${var.serviceName}-ingress" 23 | namespace = var.namespace 24 | annotations = { 25 | "nginx.ingress.kubernetes.io/rewrite-target" = "/$2" 26 | "nginx.ingress.kubernetes.io/use-regex" = "true" 27 | } 28 | } 29 | spec { 30 | ingress_class_name = "nginx" 31 | rule { 32 | host = "localhost" 33 | http { 34 | path { 35 | path = "/${var.serviceName}(/|$)(.*)" 36 | backend { 37 | service { 38 | name = kubernetes_service.catalog-server-service.metadata.0.name 39 | port { 40 | number = var.ports.management 41 | } 42 | } 43 | } 44 | } 45 | } 46 | } 47 | } 48 | } -------------------------------------------------------------------------------- /mxd/modules/catalog-server/outputs.tf: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 3 | # 4 | # See the NOTICE file(s) distributed with this work for additional 5 | # information regarding copyright ownership. 6 | # 7 | # This program and the accompanying materials are made available under the 8 | # terms of the Apache License, Version 2.0 which is available at 9 | # https://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | # SPDX-License-Identifier: Apache-2.0 18 | # 19 | 20 | output "management-endpoint" { 21 | value = "${kubernetes_service.catalog-server-service.metadata.0.name}:${var.ports.management}" 22 | } -------------------------------------------------------------------------------- /mxd/modules/catalog-server/services.tf: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2023 Contributors to the Eclipse Foundation 3 | # 4 | # See the NOTICE file(s) distributed with this work for additional 5 | # information regarding copyright ownership. 6 | # 7 | # This program and the accompanying materials are made available under the 8 | # terms of the Apache License, Version 2.0 which is available at 9 | # https://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | # SPDX-License-Identifier: Apache-2.0 18 | # 19 | 20 | resource "kubernetes_service" "catalog-server-service" { 21 | metadata { 22 | name = var.serviceName 23 | namespace = var.namespace 24 | } 25 | spec { 26 | type = "NodePort" 27 | selector = { 28 | App = kubernetes_deployment.catalog-server.spec.0.template.0.metadata[0].labels.App 29 | } 30 | port { 31 | name = "health" 32 | port = var.ports.web 33 | } 34 | port { 35 | name = "management" 36 | port = var.ports.management 37 | } 38 | port { 39 | name = "protocol" 40 | port = var.ports.protocol 41 | } 42 | port { 43 | name = "debug" 44 | port = var.ports.debug 45 | } 46 | } 47 | } -------------------------------------------------------------------------------- /mxd/modules/connector/azurite-container.tf: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2023 Contributors to the Eclipse Foundation 3 | # 4 | # See the NOTICE file(s) distributed with this work for additional 5 | # information regarding copyright ownership. 6 | # 7 | # This program and the accompanying materials are made available under the 8 | # terms of the Apache License, Version 2.0 which is available at 9 | # https://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | # SPDX-License-Identifier: Apache-2.0 18 | # 19 | 20 | resource "kubernetes_job" "azurite-init" { 21 | 22 | metadata { 23 | name = local.appName 24 | namespace = var.namespace 25 | } 26 | spec { 27 | // run only once 28 | completions = 1 29 | completion_mode = "NonIndexed" 30 | // clean up any job pods after 90 seconds, failed or succeeded 31 | ttl_seconds_after_finished = "90" 32 | template { 33 | metadata { 34 | name = local.appName 35 | } 36 | spec { 37 | container { 38 | name = local.appName 39 | image = "mcr.microsoft.com/azure-cli" 40 | command = ["sh", "-c"] 41 | args = ["${local.cmd-container-create} && ${local.cmd-file-upload}"] 42 | volume_mount { 43 | mount_path = local.file-mount-path 44 | name = "${local.appName}-document" 45 | } 46 | } 47 | volume { 48 | name = "${local.appName}-document" 49 | config_map { 50 | name = kubernetes_config_map.document.metadata.0.name 51 | } 52 | } 53 | // only restart when failed 54 | restart_policy = "OnFailure" 55 | } 56 | } 57 | } 58 | } 59 | 60 | resource "kubernetes_config_map" "document" { 61 | metadata { 62 | name = "${local.appName}-document" 63 | namespace = var.namespace 64 | } 65 | data = { 66 | (local.file-name) = file("./assets/${local.file-name}") 67 | } 68 | } 69 | 70 | locals { 71 | appName = "${var.humanReadableName}-azurite-init" 72 | container-name = "${var.humanReadableName}-container" 73 | file-name = "test-document.txt" 74 | file-mount-path = "/opt/documents" 75 | connection-string = "AccountName=${var.azure-account-name};AccountKey=${var.azure-account-key};DefaultEndpointsProtocol=http;BlobEndpoint=${var.azure-url}/${var.azure-account-name}" 76 | cmd-container-create = "az storage container create --verbose --debug --name ${local.container-name} --connection-string '${local.connection-string}'" 77 | cmd-file-upload = "az storage blob upload --verbose --debug --container-name ${local.container-name} --name ${var.humanReadableName}-${local.file-name} --file ${local.file-mount-path}/${local.file-name} --overwrite --connection-string '${local.connection-string}'" 78 | } 79 | -------------------------------------------------------------------------------- /mxd/modules/connector/outputs.tf: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2023 Contributors to the Eclipse Foundation 3 | # 4 | # See the NOTICE file(s) distributed with this work for additional 5 | # information regarding copyright ownership. 6 | # 7 | # This program and the accompanying materials are made available under the 8 | # terms of the Apache License, Version 2.0 which is available at 9 | # https://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | # SPDX-License-Identifier: Apache-2.0 18 | # 19 | 20 | output "database-name" { 21 | value = var.database-name 22 | } 23 | 24 | output "urls" { 25 | value = { 26 | management = local.management_url 27 | health = local.health_url 28 | proxy = local.proxy_url 29 | public = local.public_url 30 | } 31 | } 32 | 33 | output "node-ip" { 34 | value = kubernetes_service.controlplane-service.spec.0.cluster_ip 35 | } 36 | -------------------------------------------------------------------------------- /mxd/modules/connector/service.tf: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2023 Contributors to the Eclipse Foundation 3 | # 4 | # See the NOTICE file(s) distributed with this work for additional 5 | # information regarding copyright ownership. 6 | # 7 | # This program and the accompanying materials are made available under the 8 | # terms of the Apache License, Version 2.0 which is available at 9 | # https://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | # SPDX-License-Identifier: Apache-2.0 18 | # 19 | 20 | # technically, the Helm chart for the connector already brings a Kubernetes service, but there is no 21 | # (easy) way to get a hold of it from terraform, so lets just declare another one 22 | 23 | resource "kubernetes_service" "controlplane-service" { 24 | metadata { 25 | name = "${var.humanReadableName}-controlplane" 26 | namespace = var.namespace 27 | } 28 | spec { 29 | type = "NodePort" 30 | selector = { 31 | "app.kubernetes.io/instance" = "${var.humanReadableName}-controlplane" 32 | "app.kubernetes.io/name" = "tractusx-connector-controlplane" 33 | } 34 | port { 35 | name = "management" 36 | port = 8081 37 | } 38 | port { 39 | name = "health" 40 | port = 8080 41 | } 42 | port { 43 | name = "protocol" 44 | port = 8084 45 | } 46 | port { 47 | name = "debug" 48 | port = 1044 49 | } 50 | port { 51 | name = "catalog" 52 | port = 8085 53 | } 54 | } 55 | } -------------------------------------------------------------------------------- /mxd/modules/connector/values.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2023 Contributors to the Eclipse Foundation 3 | # 4 | # See the NOTICE file(s) distributed with this work for additional 5 | # information regarding copyright ownership. 6 | # 7 | # This program and the accompanying materials are made available under the 8 | # terms of the Apache License, Version 2.0 which is available at 9 | # https://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | # SPDX-License-Identifier: Apache-2.0 18 | # 19 | --- 20 | 21 | ################################ 22 | # EDC ControlPlane + DataPlane # 23 | ################################ 24 | participant: 25 | id: "test-participant" 26 | controlplane: 27 | debug: 28 | enabled: true 29 | port: 1044 30 | livenessProbe: 31 | enabled: true 32 | initialDelaySeconds: 5 33 | periodSeconds: 5 34 | readinessProbe: 35 | enabled: true 36 | initialDelaySeconds: 5 37 | periodSeconds: 5 38 | service: 39 | type: NodePort 40 | endpoints: 41 | management: 42 | authKey: password 43 | # uncomment the following lines if a custom tx-control-plane runtime images should be used. 44 | image: 45 | pullPolicy: Always 46 | 47 | securityContext: 48 | # avoids some errors in the log: cannot write temp files of large multipart requests when R/O 49 | readOnlyRootFilesystem: false 50 | dataplane: 51 | debug: 52 | enabled: true 53 | port: 1044 54 | livenessProbe: 55 | enabled: true 56 | initialDelaySeconds: 5 57 | periodSeconds: 5 58 | readinessProbe: 59 | enabled: true 60 | initialDelaySeconds: 5 61 | periodSeconds: 5 62 | image: 63 | pullPolicy: Always 64 | # repository: "edc-dataplane-hashicorp-vault" 65 | securityContext: 66 | # avoids some errors in the log: cannot write temp files of large multipart requests when R/O 67 | readOnlyRootFilesystem: false 68 | aws: 69 | endpointOverride: http://minio:9000 70 | secretAccessKey: qwerty123 71 | accessKeyId: qwerty123 72 | 73 | env: 74 | "EDC_API_AUTH_KEY" : "password" 75 | 76 | postgresql: 77 | # JDBC URL should be set from `main.tf` 78 | jdbcUrl: 79 | # jdbcUrl: jdbc:postgresql://{{ .Release.Name }}-postgresql:5432/edc 80 | auth: 81 | username: 82 | password: 83 | vault: 84 | hashicorp: 85 | url: http://{{ .Release.Name }}-vault:8200 86 | token: root 87 | secrets: 88 | backendService: 89 | httpProxyTokenReceiverUrl: "http://backend:8080" 90 | tests: 91 | hookDeletePolicy: before-hook-creation -------------------------------------------------------------------------------- /mxd/modules/identity-hub/ingress.tf: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2023 Contributors to the Eclipse Foundation 3 | # 4 | # See the NOTICE file(s) distributed with this work for additional 5 | # information regarding copyright ownership. 6 | # 7 | # This program and the accompanying materials are made available under the 8 | # terms of the Apache License, Version 2.0 which is available at 9 | # https://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | # SPDX-License-Identifier: Apache-2.0 18 | # 19 | 20 | resource "kubernetes_ingress_v1" "api-ingress" { 21 | metadata { 22 | name = "${var.humanReadableName}-ingress" 23 | namespace = var.namespace 24 | annotations = { 25 | "nginx.ingress.kubernetes.io/rewrite-target" = "/$2" 26 | "nginx.ingress.kubernetes.io/use-regex" = "true" 27 | } 28 | } 29 | spec { 30 | ingress_class_name = "nginx" 31 | rule { 32 | http { 33 | # ingress path for the IdentityHub Identity (=management) API 34 | path { 35 | path = "/${var.url-path}/cs(/|$)(.*)" 36 | backend { 37 | service { 38 | name = kubernetes_service.ih-service.metadata.0.name 39 | port { 40 | number = var.ports.ih-identity-api 41 | } 42 | } 43 | } 44 | } 45 | # ingress path for the STS Token API 46 | path { 47 | path = "/${var.url-path}/sts(/|$)(.*)" 48 | backend { 49 | service { 50 | name = kubernetes_service.ih-service.metadata.0.name 51 | port { 52 | number = var.ports.sts-api 53 | } 54 | } 55 | } 56 | } 57 | } 58 | } 59 | } 60 | } 61 | 62 | // the DID endpoint can not actually modify the URL, otherwise it'll mess up the DID resolution 63 | resource "kubernetes_ingress_v1" "did-ingress" { 64 | metadata { 65 | name = "${var.url-path}-did-server-ingress" 66 | namespace = var.namespace 67 | annotations = { 68 | "nginx.ingress.kubernetes.io/rewrite-target" = "/${var.url-path}/$2" 69 | } 70 | } 71 | 72 | spec { 73 | ingress_class_name = "nginx" 74 | rule { 75 | http { 76 | # ingress routes for the DID endpoint 77 | path { 78 | path = "/${var.url-path}(/|&)(.*)" 79 | backend { 80 | service { 81 | name = kubernetes_service.ih-service.metadata.0.name 82 | port { 83 | number = var.ports.ih-did 84 | } 85 | } 86 | } 87 | } 88 | } 89 | } 90 | } 91 | } -------------------------------------------------------------------------------- /mxd/modules/identity-hub/outputs.tf: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2023 Contributors to the Eclipse Foundation 3 | # 4 | # See the NOTICE file(s) distributed with this work for additional 5 | # information regarding copyright ownership. 6 | # 7 | # This program and the accompanying materials are made available under the 8 | # terms of the Apache License, Version 2.0 which is available at 9 | # https://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | # SPDX-License-Identifier: Apache-2.0 18 | # 19 | 20 | output "identity-hub-node-ip" { 21 | value = kubernetes_service.ih-service.spec.0.cluster_ip 22 | } 23 | 24 | 25 | output "ports" { 26 | value = var.ports 27 | } 28 | 29 | output "ih-superuser-apikey" { 30 | value = var.ih_superuser_apikey 31 | } 32 | 33 | output "sts-token-url" { 34 | value = "http://${kubernetes_service.ih-service.metadata.0.name}:${var.ports.sts-api}${var.sts-token-path}" 35 | } -------------------------------------------------------------------------------- /mxd/modules/identity-hub/services.tf: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2024 Metaform Systems, Inc. 3 | # 4 | # This program and the accompanying materials are made available under the 5 | # terms of the Apache License, Version 2.0 which is available at 6 | # https://www.apache.org/licenses/LICENSE-2.0 7 | # 8 | # SPDX-License-Identifier: Apache-2.0 9 | # 10 | # Contributors: 11 | # Metaform Systems, Inc. - initial API and implementation 12 | # 13 | 14 | resource "kubernetes_service" "ih-service" { 15 | metadata { 16 | name = var.humanReadableName 17 | namespace = var.namespace 18 | } 19 | spec { 20 | type = "NodePort" 21 | selector = { 22 | App = kubernetes_deployment.identityhub.spec.0.template.0.metadata[0].labels.App 23 | } 24 | # we need a stable IP, otherwise there will be a cycle with the issuer 25 | port { 26 | name = "credentials" 27 | port = var.ports.credentials-api 28 | } 29 | port { 30 | name = "debug" 31 | port = var.ports.debug 32 | } 33 | port { 34 | name = "identity" 35 | port = var.ports.ih-identity-api 36 | } 37 | port { 38 | name = "did" 39 | port = var.ports.ih-did 40 | } 41 | port { 42 | name = "sts" 43 | port = var.ports.sts-api 44 | } 45 | } 46 | } -------------------------------------------------------------------------------- /mxd/modules/issuerservice/TODO.txt: -------------------------------------------------------------------------------- 1 | until we have an official release of Tractus-X IssuerService we have to craft our own runtime here and deploy using 2 | raw Kubernetes resources. 3 | Once we have the official release, we can use the Helm chart. -------------------------------------------------------------------------------- /mxd/modules/issuerservice/ingress.tf: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2025 Cofinity-X 3 | # 4 | # This program and the accompanying materials are made available under the 5 | # terms of the Apache License, Version 2.0 which is available at 6 | # https://www.apache.org/licenses/LICENSE-2.0 7 | # 8 | # SPDX-License-Identifier: Apache-2.0 9 | # 10 | # Contributors: 11 | # Cofinity-X - initial API and implementation 12 | # 13 | 14 | resource "kubernetes_ingress_v1" "api-ingress" { 15 | metadata { 16 | name = "${var.humanReadableName}-ingress" 17 | namespace = var.namespace 18 | annotations = { 19 | "nginx.ingress.kubernetes.io/rewrite-target" = "/$2" 20 | "nginx.ingress.kubernetes.io/use-regex" = "true" 21 | } 22 | } 23 | spec { 24 | ingress_class_name = "nginx" 25 | rule { 26 | http { 27 | 28 | path { 29 | path = "/issuer/cs(/|$)(.*)" 30 | backend { 31 | service { 32 | name = kubernetes_service.issuerservice-service.metadata.0.name 33 | port { 34 | number = var.ports.identity 35 | } 36 | } 37 | } 38 | } 39 | 40 | path { 41 | path = "/issuer/ad(/|$)(.*)" 42 | backend { 43 | service { 44 | name = kubernetes_service.issuerservice-service.metadata.0.name 45 | port { 46 | number = var.ports.issueradmin 47 | } 48 | } 49 | } 50 | } 51 | } 52 | } 53 | } 54 | } 55 | 56 | // the DID endpoint can not actually modify the URL, otherwise it'll mess up the DID resolution 57 | resource "kubernetes_ingress_v1" "did-ingress" { 58 | metadata { 59 | name = "${var.humanReadableName}-did-ingress" 60 | namespace = var.namespace 61 | annotations = { 62 | "nginx.ingress.kubernetes.io/rewrite-target" = "/issuer/$2" 63 | } 64 | } 65 | 66 | spec { 67 | ingress_class_name = "nginx" 68 | rule { 69 | http { 70 | # ingress routes for the DID endpoint 71 | path { 72 | path = "/issuer(/|&)(.*)" 73 | backend { 74 | service { 75 | name = kubernetes_service.issuerservice-service.metadata.0.name 76 | port { 77 | number = var.ports.did 78 | } 79 | } 80 | } 81 | } 82 | } 83 | } 84 | } 85 | } -------------------------------------------------------------------------------- /mxd/modules/issuerservice/outputs.tf: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2025 Cofinity-X 3 | # 4 | # This program and the accompanying materials are made available under the 5 | # terms of the Apache License, Version 2.0 which is available at 6 | # https://www.apache.org/licenses/LICENSE-2.0 7 | # 8 | # SPDX-License-Identifier: Apache-2.0 9 | # 10 | # Contributors: 11 | # Cofinity-X - initial API and implementation 12 | 13 | 14 | output "endpoints" { 15 | value = { 16 | admin = "${kubernetes_service.issuerservice-service.metadata.0.name}:${var.ports.issueradmin}" 17 | identity = "${kubernetes_service.issuerservice-service.metadata.0.name}:${var.ports.identity}" 18 | } 19 | } -------------------------------------------------------------------------------- /mxd/modules/issuerservice/services.tf: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2025 Cofinity-X 3 | # 4 | # This program and the accompanying materials are made available under the 5 | # terms of the Apache License, Version 2.0 which is available at 6 | # https://www.apache.org/licenses/LICENSE-2.0 7 | # 8 | # SPDX-License-Identifier: Apache-2.0 9 | # 10 | # Contributors: 11 | # Cofinity-X - initial API and implementation 12 | # 13 | 14 | resource "kubernetes_service" "issuerservice-service" { 15 | metadata { 16 | name = var.humanReadableName 17 | namespace = var.namespace 18 | } 19 | spec { 20 | type = "NodePort" 21 | selector = { 22 | App = kubernetes_deployment.issuerservice.spec.0.template.0.metadata[0].labels.App 23 | } 24 | port { 25 | name = "web" 26 | port = var.ports.web 27 | } 28 | port { 29 | name = "sts" 30 | port = var.ports.sts 31 | } 32 | port { 33 | name = "debug" 34 | port = var.ports.debug 35 | } 36 | port { 37 | name = "issuance" 38 | port = var.ports.issuance 39 | } 40 | port { 41 | name = "issueradmin" 42 | port = var.ports.issueradmin 43 | } 44 | port { 45 | name = "identity" 46 | port = var.ports.identity 47 | } 48 | port { 49 | name = "did" 50 | port = var.ports.did 51 | } 52 | } 53 | } -------------------------------------------------------------------------------- /mxd/modules/issuerservice/variables.tf: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2025 Cofinity-X 3 | # 4 | # This program and the accompanying materials are made available under the 5 | # terms of the Apache License, Version 2.0 which is available at 6 | # https://www.apache.org/licenses/LICENSE-2.0 7 | # 8 | # SPDX-License-Identifier: Apache-2.0 9 | # 10 | # Contributors: 11 | # Cofinity-X - initial API and implementation 12 | # 13 | 14 | 15 | variable "humanReadableName" { 16 | type = string 17 | description = "Human readable name of the issuer, NOT the ID!!. Required." 18 | default = "issuerservice" 19 | } 20 | 21 | variable "participantId" { 22 | type = string 23 | description = "Participant ID of the issuer. Usually a DID" 24 | } 25 | 26 | variable "image" { 27 | type = string 28 | default = "tx-issuerservice:latest" 29 | } 30 | 31 | variable "namespace" { 32 | type = string 33 | } 34 | 35 | variable "ports" { 36 | type = object({ 37 | web = number 38 | sts = number 39 | issuance = number 40 | issueradmin = number 41 | version = number 42 | identity = number 43 | debug = number 44 | did = number 45 | }) 46 | default = { 47 | web = 10010 48 | sts = 10011 49 | issuance = 10012 50 | issueradmin = 10013 51 | version = 10014 52 | identity = 10015 53 | did = 10016 54 | debug = 1044 55 | } 56 | } 57 | 58 | variable "database" { 59 | type = object({ 60 | url = string 61 | user = string 62 | password = string 63 | }) 64 | } 65 | 66 | variable "useSVE" { 67 | type = bool 68 | description = "If true, the -XX:UseSVE=0 switch (Scalable Vector Extensions) will be appended to the JAVA_TOOL_OPTIONS. Can help on macOs on Apple Silicon processors" 69 | default = false 70 | } 71 | 72 | variable "vault-url" { 73 | description = "URL of the Hashicorp Vault" 74 | type = string 75 | } 76 | 77 | variable "vault-token" { 78 | default = "root" 79 | description = "This is the authentication token for the vault. DO NOT USE THIS IN PRODUCTION!" 80 | type = string 81 | } 82 | 83 | variable "superuser_apikey" { 84 | default = "c3VwZXItdXNlcg==.c3VwZXItc2VjcmV0LWtleQo=" 85 | description = "Management API Key for the Super-User. Defaults to 'base64(super-user).base64(super-secret-key)" 86 | type = string 87 | } 88 | -------------------------------------------------------------------------------- /mxd/modules/minio/main.tf: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2023 Contributors to the Eclipse Foundation 3 | # 4 | # See the NOTICE file(s) distributed with this work for additional 5 | # information regarding copyright ownership. 6 | # 7 | # This program and the accompanying materials are made available under the 8 | # terms of the Apache License, Version 2.0 which is available at 9 | # https://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | # SPDX-License-Identifier: Apache-2.0 18 | # 19 | 20 | resource "kubernetes_deployment" "minio" { 21 | metadata { 22 | name = "${var.humanReadableName}-minio" 23 | namespace = var.namespace 24 | labels = { 25 | app = "${var.humanReadableName}-minio" 26 | } 27 | } 28 | 29 | spec { 30 | selector { 31 | match_labels = { 32 | app = "${var.humanReadableName}-minio" 33 | } 34 | } 35 | strategy { 36 | type = "Recreate" 37 | } 38 | 39 | template { 40 | metadata { 41 | labels = { 42 | app = "${var.humanReadableName}-minio" 43 | } 44 | } 45 | 46 | spec { 47 | container { 48 | image = "minio/minio:RELEASE.2022-03-17T06-34-49Z" 49 | name = "minio" 50 | args = ["server", "/storage", "--console-address=:${var.minio-console-port}"] 51 | env { 52 | name = "MINIO_ROOT_USER" 53 | value = var.minio-username 54 | } 55 | env { 56 | name = "MINIO_ROOT_PASSWORD" 57 | value = var.minio-password 58 | } 59 | port { 60 | name = "api-port" 61 | container_port = var.minio-api-port 62 | } 63 | port { 64 | name = "console-port" 65 | container_port = var.minio-console-port 66 | } 67 | } 68 | } 69 | } 70 | } 71 | } 72 | 73 | locals { 74 | minio-ip = kubernetes_service.minio-service.metadata.0.name 75 | minio-port = kubernetes_service.minio-service.spec.0.port.0.port 76 | minio-url = "${local.minio-ip}:${local.minio-port}" 77 | } 78 | -------------------------------------------------------------------------------- /mxd/modules/minio/nodeport.tf: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2023 Contributors to the Eclipse Foundation 3 | # 4 | # See the NOTICE file(s) distributed with this work for additional 5 | # information regarding copyright ownership. 6 | # 7 | # This program and the accompanying materials are made available under the 8 | # terms of the Apache License, Version 2.0 which is available at 9 | # https://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | # SPDX-License-Identifier: Apache-2.0 18 | # 19 | 20 | resource "kubernetes_service" "minio-service" { 21 | metadata { 22 | name = "${var.humanReadableName}-minio" 23 | namespace = var.namespace 24 | } 25 | spec { 26 | type = "NodePort" 27 | selector = { 28 | app = "${var.humanReadableName}-minio" 29 | } 30 | port { 31 | name = "api-port" 32 | port = var.minio-api-port 33 | 34 | } 35 | port { 36 | name = "console-port" 37 | port = var.minio-console-port 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /mxd/modules/minio/output.tf: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2023 Contributors to the Eclipse Foundation 3 | # 4 | # See the NOTICE file(s) distributed with this work for additional 5 | # information regarding copyright ownership. 6 | # 7 | # This program and the accompanying materials are made available under the 8 | # terms of the Apache License, Version 2.0 which is available at 9 | # https://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | # SPDX-License-Identifier: Apache-2.0 18 | # 19 | 20 | output "minio-url" { 21 | value = local.minio-url 22 | } 23 | 24 | output "minio-username" { 25 | value = var.minio-username 26 | } 27 | 28 | output "minio-password" { 29 | value = var.minio-password 30 | } 31 | -------------------------------------------------------------------------------- /mxd/modules/minio/variables.tf: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2023 Contributors to the Eclipse Foundation 3 | # 4 | # See the NOTICE file(s) distributed with this work for additional 5 | # information regarding copyright ownership. 6 | # 7 | # This program and the accompanying materials are made available under the 8 | # terms of the Apache License, Version 2.0 which is available at 9 | # https://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | # SPDX-License-Identifier: Apache-2.0 18 | # 19 | 20 | variable "humanReadableName" { 21 | type = string 22 | description = "Human readable name of the connector, NOT the BPN!!. Required." 23 | } 24 | 25 | variable "minio-api-port" { 26 | default = 9000 27 | } 28 | 29 | variable "namespace" { 30 | type = string 31 | description = "Kubernetes namespace to use" 32 | default = "mxd" 33 | } 34 | 35 | variable "minio-console-port" { 36 | default = 9001 37 | } 38 | 39 | variable "minio-username" { 40 | type = string 41 | description = "minio-username" 42 | } 43 | 44 | variable "minio-password" { 45 | type = string 46 | description = "minio-password" 47 | } 48 | -------------------------------------------------------------------------------- /mxd/modules/postgres/outputs.tf: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2024 Contributors to the Eclipse Foundation 3 | # 4 | # See the NOTICE file(s) distributed with this work for additional 5 | # information regarding copyright ownership. 6 | # 7 | # This program and the accompanying materials are made available under the 8 | # terms of the Apache License, Version 2.0 which is available at 9 | # https://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | # SPDX-License-Identifier: Apache-2.0 18 | # 19 | 20 | output "instance-name" { 21 | value = var.instance-name 22 | } 23 | 24 | output "database-host" { 25 | value = local.db-ip 26 | } 27 | 28 | output "database-port" { 29 | value = var.database-port 30 | } 31 | 32 | output "database-url" { 33 | value = local.db-url 34 | } 35 | -------------------------------------------------------------------------------- /mxd/modules/postgres/variables.tf: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2024 Contributors to the Eclipse Foundation 3 | # 4 | # See the NOTICE file(s) distributed with this work for additional 5 | # information regarding copyright ownership. 6 | # 7 | # This program and the accompanying materials are made available under the 8 | # terms of the Apache License, Version 2.0 which is available at 9 | # https://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | # SPDX-License-Identifier: Apache-2.0 18 | # 19 | 20 | variable "instance-name" { 21 | description = "Name for the Postgres instance, must be unique for each postgres instances" 22 | default = "common" 23 | } 24 | 25 | variable "database-port" { 26 | default = 5432 27 | } 28 | 29 | variable "init-sql-configs" { 30 | description = "Name of config maps with init sql scripts" 31 | default = [] 32 | } 33 | 34 | variable "namespace" { 35 | type = string 36 | description = "Kubernetes namespace to use" 37 | default = "mxd" 38 | } -------------------------------------------------------------------------------- /mxd/modules/vault/variables.tf: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2024 Contributors to the Eclipse Foundation 3 | # 4 | # See the NOTICE file(s) distributed with this work for additional 5 | # information regarding copyright ownership. 6 | # 7 | # This program and the accompanying materials are made available under the 8 | # terms of the Apache License, Version 2.0 which is available at 9 | # https://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | # SPDX-License-Identifier: Apache-2.0 18 | # 19 | 20 | variable "humanReadableName" { 21 | type = string 22 | description = "Human readable name. Should not contain special characters" 23 | } 24 | 25 | variable "namespace" { 26 | type = string 27 | } 28 | 29 | variable "vault-token" { 30 | default = "root" 31 | description = "This is the authentication token for the vault. DO NOT USE THIS IN PRODUCTION!" 32 | type = string 33 | } -------------------------------------------------------------------------------- /mxd/modules/vault/vault-values.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2024 Metaform Systems, Inc. 3 | # 4 | # This program and the accompanying materials are made available under the 5 | # terms of the Apache License, Version 2.0 which is available at 6 | # https://www.apache.org/licenses/LICENSE-2.0 7 | # 8 | # SPDX-License-Identifier: Apache-2.0 9 | # 10 | # Contributors: 11 | # Metaform Systems, Inc. - initial API and implementation 12 | # 13 | 14 | server: 15 | postStart: 16 | hashicorp: 17 | timeout: 30 18 | healthCheck: 19 | enabled: true 20 | standbyOk: true 21 | paths: 22 | secret: /v1/secret 23 | -------------------------------------------------------------------------------- /mxd/modules/vault/vault.tf: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2024 Metaform Systems, Inc. 3 | # 4 | # This program and the accompanying materials are made available under the 5 | # terms of the Apache License, Version 2.0 which is available at 6 | # https://www.apache.org/licenses/LICENSE-2.0 7 | # 8 | # SPDX-License-Identifier: Apache-2.0 9 | # 10 | # Contributors: 11 | # Metaform Systems, Inc. - initial API and implementation 12 | # 13 | 14 | resource "helm_release" "vault" { 15 | name = var.humanReadableName 16 | namespace = var.namespace 17 | 18 | force_update = true 19 | dependency_update = true 20 | reuse_values = true 21 | cleanup_on_fail = true 22 | replace = true 23 | 24 | repository = "https://helm.releases.hashicorp.com" 25 | chart = "vault" 26 | 27 | set { 28 | name = "server.dev.devRootToken" 29 | value = var.vault-token 30 | } 31 | set { 32 | name = "server.dev.enabled" 33 | value = true 34 | } 35 | 36 | set { 37 | name = "injector.enabled" 38 | value = false 39 | } 40 | 41 | set { 42 | name = "hashicorp.token" 43 | value = var.vault-token 44 | } 45 | 46 | values = [ 47 | file("${path.module}/vault-values.yaml"), 48 | # yamlencode({ 49 | # "server" : { 50 | # "postStart" : [ 51 | # "sh", 52 | # "-c", 53 | # join(" && ", [ 54 | # "sleep 5", 55 | # "/bin/vault kv put secret/${var.aliases.sts-private-key} content=\"${tls_private_key.private_signing_key.private_key_pem}\"", 56 | # # "/bin/vault kv put secret/${local.public-key-alias} content=\"${tls_private_key.ecdsa.public_key_pem}\"" 57 | # ]) 58 | # ] 59 | # } 60 | # }), 61 | ] 62 | } -------------------------------------------------------------------------------- /mxd/outputs.tf: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2023 Contributors to the Eclipse Foundation 3 | # 4 | # See the NOTICE file(s) distributed with this work for additional 5 | # information regarding copyright ownership. 6 | # 7 | # This program and the accompanying materials are made available under the 8 | # terms of the Apache License, Version 2.0 which is available at 9 | # https://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | # SPDX-License-Identifier: Apache-2.0 18 | # 19 | 20 | output "bob-database-credentials" { 21 | value = local.bob-postgres 22 | } 23 | 24 | output "alice-database-credentials" { 25 | value = local.alice-postgres 26 | } 27 | 28 | output "bob-urls" { 29 | value = module.bob-connector.urls 30 | } 31 | 32 | output "alice-urls" { 33 | value = module.alice-connector.urls 34 | } 35 | 36 | # output "bob-node-ip" { 37 | # value = module.bob-connector.node-ip 38 | # } 39 | 40 | output "alice-node-ip" { 41 | value = module.alice-connector.node-ip 42 | } 43 | -------------------------------------------------------------------------------- /mxd/performance-tests/help.txt: -------------------------------------------------------------------------------- 1 | Help: 2 | -f Set the path to file/folder with experiment files (default: "test-configurations/small_experiment.properties") 3 | -t Set the Terraform directory (default: "parent folder") 4 | -d Enable debug mode (default: true) 5 | -x Test pod context (cluster used to host test pod) (default: kind-mxd) 6 | -y Environment context (cluster used to host full-blown MXD environment) (default: kind-mxd) 7 | -------------------------------------------------------------------------------- /mxd/performance-tests/mxd-performance-evaluation/run_experiment.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright (c) 2024 Contributors to the Eclipse Foundation 4 | # 5 | # See the NOTICE file(s) distributed with this work for additional 6 | # information regarding copyright ownership. 7 | # 8 | # This program and the accompanying materials are made available under the 9 | # terms of the Apache License, Version 2.0 which is available at 10 | # https://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 14 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 15 | # License for the specific language governing permissions and limitations 16 | # under the License. 17 | # 18 | # SPDX-License-Identifier: Apache-2.0 19 | # 20 | 21 | experiment_property="mount/custom_experiment.properties" 22 | 23 | if [ -z "$JMETER_HOME" ]; then 24 | echo "JMETER_HOME is not defined - please define it." 25 | exit 1 26 | fi 27 | echo "Jmeter found at path $JMETER_HOME" 28 | 29 | jmeter_binary="$JMETER_HOME/bin/jmeter" 30 | 31 | rm -rf output 32 | mkdir -p output/dashboard 33 | 34 | rm -rf output_slim 35 | mkdir -p output_slim/dashboard 36 | 37 | rm -rf output_jtl 38 | mkdir -p output_jtl 39 | 40 | echo "*** Property: $experiment_property Start ***" 41 | cat $experiment_property 42 | echo "*** Property: $experiment_property End ***" 43 | 44 | echo "*** Performance Test Start ***" 45 | if [ -z "$jmeter_script" ]; then 46 | echo "Executing all scripts in order" 47 | echo "Executing setup.jmx" 48 | $jmeter_binary -n -t mount/setup.jmx -l output_jtl/setup.jtl -q $experiment_property -j "output/setup_jmeter.log" 49 | echo "Executing measurement_interval.jmx" 50 | $jmeter_binary -n -t mount/measurement_interval.jmx -l output_jtl/measurement_interval.jtl -q $experiment_property \ 51 | -j "output/measurement_interval_jmeter.log" -e -o output/dashboard 52 | fi 53 | echo "*** Performance Test End ***" 54 | 55 | echo "Copying custom_experiment.properties to output folder with new name metadata.txt" 56 | cp $experiment_property output/metadata.txt 57 | echo "Creating tar file with output" 58 | tar -cf output.tar output 59 | 60 | echo "Copying custom_experiment.properties to output_slim folder with new name metadata.txt" 61 | cp $experiment_property output_slim/metadata.txt 62 | echo "Copying output/dashboard/statistics.json to output_slim/dashboard/statistics.json folder" 63 | cp output/dashboard/statistics.json output_slim/dashboard/statistics.json 64 | echo "Creating tar file with output" 65 | tar -cf output_slim.tar output_slim 66 | 67 | tar -czf output_jtl.tar.gz output_jtl 68 | 69 | echo "*** Test Completed..., Sleeping now ***" 70 | while true; do sleep 10000; done 71 | -------------------------------------------------------------------------------- /mxd/performance-tests/performance-test.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2024 Contributors to the Eclipse Foundation 3 | # 4 | # See the NOTICE file(s) distributed with this work for additional 5 | # information regarding copyright ownership. 6 | # 7 | # This program and the accompanying materials are made available under the 8 | # terms of the Apache License, Version 2.0 which is available at 9 | # https://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | # SPDX-License-Identifier: Apache-2.0 18 | # 19 | 20 | apiVersion: v1 21 | kind: Pod 22 | metadata: 23 | name: mxd-performance-test 24 | spec: 25 | containers: 26 | - name: mxd-performance-test 27 | image: justb4/jmeter:5.5 28 | command: [ "/bin/sh", "-c", "cd mxd-performance-evaluation && ./mount/run_experiment.sh" ] 29 | volumeMounts: 30 | - name: property-volume 31 | mountPath: /opt/apache-jmeter-5.5/mxd-performance-evaluation/mount 32 | 33 | volumes: 34 | - name: property-volume 35 | configMap: 36 | name: custom-property 37 | defaultMode: 0500 38 | 39 | restartPolicy: Never 40 | -------------------------------------------------------------------------------- /mxd/performance-tests/prometheus/clusterRole.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2024 Contributors to the Eclipse Foundation 3 | # 4 | # See the NOTICE file(s) distributed with this work for additional 5 | # information regarding copyright ownership. 6 | # 7 | # This program and the accompanying materials are made available under the 8 | # terms of the Apache License, Version 2.0 which is available at 9 | # https://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | # SPDX-License-Identifier: Apache-2.0 18 | # 19 | 20 | apiVersion: rbac.authorization.k8s.io/v1 21 | kind: ClusterRole 22 | metadata: 23 | name: prometheus 24 | rules: 25 | - apiGroups: [""] 26 | resources: 27 | - nodes 28 | - nodes/proxy 29 | - services 30 | - endpoints 31 | - pods 32 | verbs: ["get", "list", "watch"] 33 | - apiGroups: 34 | - extensions 35 | resources: 36 | - ingresses 37 | verbs: ["get", "list", "watch"] 38 | - nonResourceURLs: ["/metrics"] 39 | verbs: ["get"] 40 | --- 41 | apiVersion: rbac.authorization.k8s.io/v1 42 | kind: ClusterRoleBinding 43 | metadata: 44 | name: prometheus 45 | roleRef: 46 | apiGroup: rbac.authorization.k8s.io 47 | kind: ClusterRole 48 | name: prometheus 49 | subjects: 50 | - kind: ServiceAccount 51 | name: default 52 | namespace: monitoring 53 | -------------------------------------------------------------------------------- /mxd/performance-tests/prometheus/prometheus-deployment.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2024 Contributors to the Eclipse Foundation 3 | # 4 | # See the NOTICE file(s) distributed with this work for additional 5 | # information regarding copyright ownership. 6 | # 7 | # This program and the accompanying materials are made available under the 8 | # terms of the Apache License, Version 2.0 which is available at 9 | # https://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | # SPDX-License-Identifier: Apache-2.0 18 | # 19 | 20 | apiVersion: apps/v1 21 | kind: Deployment 22 | metadata: 23 | name: prometheus-deployment 24 | namespace: monitoring 25 | labels: 26 | app: prometheus-server 27 | spec: 28 | replicas: 1 29 | selector: 30 | matchLabels: 31 | app: prometheus-server 32 | template: 33 | metadata: 34 | labels: 35 | app: prometheus-server 36 | spec: 37 | containers: 38 | - name: prometheus 39 | image: prom/prometheus 40 | args: 41 | - "--config.file=/etc/prometheus/prometheus.yml" 42 | - "--storage.tsdb.path=/prometheus/" 43 | ports: 44 | - containerPort: 9090 45 | volumeMounts: 46 | - name: prometheus-config-volume 47 | mountPath: /etc/prometheus/ 48 | - name: prometheus-storage-volume 49 | mountPath: /prometheus/ 50 | volumes: 51 | - name: prometheus-config-volume 52 | configMap: 53 | defaultMode: 420 54 | name: prometheus-server-conf 55 | 56 | - name: prometheus-storage-volume 57 | emptyDir: {} 58 | -------------------------------------------------------------------------------- /mxd/performance-tests/prometheus/prometheus-service.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2024 Contributors to the Eclipse Foundation 3 | # 4 | # See the NOTICE file(s) distributed with this work for additional 5 | # information regarding copyright ownership. 6 | # 7 | # This program and the accompanying materials are made available under the 8 | # terms of the Apache License, Version 2.0 which is available at 9 | # https://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | # SPDX-License-Identifier: Apache-2.0 18 | # 19 | 20 | apiVersion: v1 21 | kind: Service 22 | metadata: 23 | name: prometheus-service 24 | namespace: monitoring 25 | annotations: 26 | prometheus.io/scrape: 'true' 27 | prometheus.io/port: '9090' 28 | 29 | spec: 30 | selector: 31 | app: prometheus-server 32 | type: NodePort 33 | ports: 34 | - port: 8080 35 | targetPort: 9090 36 | nodePort: 30000 37 | -------------------------------------------------------------------------------- /mxd/performance-tests/test-configurations/small_experiment.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2024 Contributors to the Eclipse Foundation 3 | # 4 | # See the NOTICE file(s) distributed with this work for additional 5 | # information regarding copyright ownership. 6 | # 7 | # This program and the accompanying materials are made available under the 8 | # terms of the Apache License, Version 2.0 which is available at 9 | # https://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | # SPDX-License-Identifier: Apache-2.0 18 | # 19 | 20 | # General Parameters 21 | 22 | EXPERIMENT_DURATION_SEC=1800 23 | EDC_NAMESPACE=https://w3id.org/edc/v0.0.1/ns/ 24 | BACKEND_SERVICE=https://requestbin.myworkato.com/1fwngcu1 25 | MAX_NEGOTIATION_POLL_COUNT=100 26 | MAX_TRANSFER_POLL_COUNT=100 27 | INTERVALS_PER_MINUTE=10 28 | 29 | # OEM Parameters 30 | 31 | OEM_ID=BPNL000000000001 32 | OEM_MANAGEMENT_URL=http://edc.ingress.mxd.edc-lpt.shoot.live.k8s-hana.ondemand.com/alice/management 33 | OEM_PROTOCOL_URL=http://alice-controlplane:8084/api/v1/dsp 34 | OEM_API_KEY=password 35 | 36 | OEM_PLANTS=1 37 | OEM_CARS_INITIAL=10000 38 | PARTS_PER_CAR=100 39 | CARS_PRODUCED_PER_INTERVALL=1 40 | 41 | # Supplier Parameters 42 | 43 | SUPPLIER_ID=BPNL000000000002 44 | SUPPLIER_MANAGEMENT_URL=http://edc.ingress.mxd.edc-lpt.shoot.live.k8s-hana.ondemand.com/bob/management 45 | SUPPLIER_PROTOCOL_URL=http://bob-controlplane:8084/api/v1/dsp 46 | SUPPLIER_API_KEY=password 47 | 48 | SUPPLIER_PLANTS=1 49 | SUPPLIER_PARTS_INITIAL=10000 50 | PARTS_PRODUCED_PER_INTERVALL=50 51 | SUPPLIER_FLEET_MANAGERS=1 52 | SUPPLIER_PARTS_PLANTS_COUNT=SUPPLIER_PARTS_PLANTS_COUNT 53 | SUPPLIER_FLEET_COUNT=SUPPLIER_FLEET_COUNT 54 | CARS_REQUESTED_PER_INTERVALL=1 55 | 56 | ADDITIONAL_CONTRACT_DEFINITIONS_SUPPLIER=0 57 | ADDITIONAL_CONTRACT_DEFINITIONS_OEM=0 58 | -------------------------------------------------------------------------------- /mxd/postgres-init.tf: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2024 Contributors to the Eclipse Foundation 3 | # 4 | # See the NOTICE file(s) distributed with this work for additional 5 | # information regarding copyright ownership. 6 | # 7 | # This program and the accompanying materials are made available under the 8 | # terms of the Apache License, Version 2.0 which is available at 9 | # https://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | # SPDX-License-Identifier: Apache-2.0 18 | # 19 | 20 | # Separate Postgres Instance for each components 21 | module "postgres" { 22 | depends_on = [kubernetes_config_map.postgres-initdb-config] 23 | source = "./modules/postgres" 24 | for_each = tomap(local.databases) 25 | instance-name = each.key 26 | database-port = var.postgres-port 27 | init-sql-configs = ["${each.key}-initdb-config"] 28 | } 29 | 30 | resource "kubernetes_config_map" "postgres-initdb-config" { 31 | for_each = tomap(local.databases) 32 | metadata { 33 | name = "${each.key}-initdb-config" 34 | namespace = kubernetes_namespace.mxd-ns.metadata.0.name 35 | } 36 | 37 | data = { 38 | 39 | "${each.key}-initdb-config.sql" = <<-EOT 40 | 41 | CREATE USER ${each.value.database-username} WITH ENCRYPTED PASSWORD '${each.value.database-password}'; 42 | CREATE DATABASE ${each.value.database-name}; 43 | GRANT ALL PRIVILEGES ON DATABASE ${each.value.database-name} TO ${each.value.database-username}; 44 | \c ${each.value.database-name} 45 | GRANT ALL ON SCHEMA public TO ${each.value.database-username}; 46 | EOT 47 | } 48 | } 49 | 50 | locals { 51 | bdrs-postgres = module.postgres["bdrs"] 52 | alice-postgres = module.postgres["alice"] 53 | bob-postgres = module.postgres["bob"] 54 | catalogserver-postgres = module.postgres["alice-catalogserver"] 55 | 56 | databases = { 57 | bdrs = { 58 | database-name = "bdrs", 59 | database-username = "bdrs" 60 | database-password = "bdrs" 61 | } 62 | 63 | alice = { 64 | database-name = "alice", 65 | database-username = "alice" 66 | database-password = "alice" 67 | } 68 | 69 | bob = { 70 | database-name = "bob", 71 | database-username = "bob" 72 | database-password = "bob" 73 | } 74 | 75 | alice-catalogserver = { 76 | database-name = "catalogserver" 77 | database-username = "catalogserver" 78 | database-password = "catalogserver" 79 | } 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /mxd/trudy.tfignore: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2023 Contributors to the Eclipse Foundation 3 | # 4 | # See the NOTICE file(s) distributed with this work for additional 5 | # information regarding copyright ownership. 6 | # 7 | # This program and the accompanying materials are made available under the 8 | # terms of the Apache License, Version 2.0 which is available at 9 | # https://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | # SPDX-License-Identifier: Apache-2.0 18 | # 19 | 20 | # Trudy connector 21 | module "trudy-connector" { 22 | depends_on = [module.azurite] 23 | source = "./modules/connector" 24 | humanReadableName = "trudy" 25 | participantId = var.trudy-bpn 26 | database-host = local.trudy-postgres.database-host 27 | database-name = local.databases.trudy.database-name 28 | database-credentials = { 29 | user = local.databases.trudy.database-username 30 | password = local.databases.trudy.database-password 31 | } 32 | ssi-config = { 33 | miw-url = "http://${kubernetes_service.miw.metadata.0.name}:${var.miw-api-port}" 34 | miw-authorityId = var.miw-bpn 35 | oauth-tokenUrl = "http://${kubernetes_service.keycloak.metadata.0.name}:${var.keycloak-port}/realms/miw_test/protocol/openid-connect/token" 36 | oauth-clientid = "trudy_private_client" 37 | oauth-secretalias = "client_secret_alias" 38 | oauth-clientsecret = "trudy_private_client" 39 | } 40 | azure-account-name = var.trudy-azure-account-name 41 | azure-account-key = local.trudy-azure-key-base64 42 | azure-account-key-sas = var.trudy-azure-key-sas 43 | azure-url = module.azurite.azurite-url 44 | minio-config = { 45 | minio-username = "trudyawsclient" 46 | minio-password = "trudyawssecret" 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /mxd/variables.tf: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2023 Contributors to the Eclipse Foundation 3 | # 4 | # See the NOTICE file(s) distributed with this work for additional 5 | # information regarding copyright ownership. 6 | # 7 | # This program and the accompanying materials are made available under the 8 | # terms of the Apache License, Version 2.0 which is available at 9 | # https://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | # SPDX-License-Identifier: Apache-2.0 18 | # 19 | 20 | # configuration values for the MIW+Keycloak Postgres db 21 | variable "postgres-port" { 22 | default = 5432 23 | } 24 | 25 | variable "namespace" { 26 | type = string 27 | description = "Kubernetes namespace to use" 28 | default = "mxd" 29 | } 30 | 31 | variable "trudy-bpn" { 32 | default = "BPNL000000000003" 33 | } 34 | 35 | 36 | variable "trudy-did" { 37 | default = "did:web:trudy-ih%3A7083:trudy" 38 | } 39 | 40 | variable "trudy-azure-account-name" { 41 | default = "trudyazureaccount" 42 | } 43 | 44 | variable "trudy-azure-account-key" { 45 | default = "trudyazurekey" 46 | } 47 | 48 | variable "trudy-azure-key-sas" { 49 | default = "st=2023-11-23T13%3A18%3A49Z&se=2030-01-01T13%3A18%3A49Z&sp=rwdlacupft&sv=2022-11-02&ss=qftb&srt=sco&sig=lOo5x2U04isnhBdlAZLj2nFk%2BphhiVeuzjv/XGJu3DM%3D" 50 | } 51 | 52 | variable "trudy-ingress-host" { 53 | default = "localhost" 54 | } 55 | 56 | variable "useSVE" { 57 | type = bool 58 | description = "If true, the -XX:UseSVE=0 switch (Scalable Vector Extensions) will be added to the JAVA_TOOL_OPTIONS. Can help on macOs on Apple Silicon processors" 59 | default = false 60 | } -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tx-tutorial-resources", 3 | "lockfileVersion": 3, 4 | "requires": true, 5 | "packages": {} 6 | } 7 | --------------------------------------------------------------------------------