Skip to content

Commit

Permalink
Merge pull request #491 from catenax-ng/main
Browse files Browse the repository at this point in the history
Merge from CatenaX
  • Loading branch information
ds-jhartmann authored Mar 19, 2024
2 parents 3199806 + 42b0abd commit f12be7c
Show file tree
Hide file tree
Showing 41 changed files with 627 additions and 118 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/publish-swagger-hub.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: "Publish OpenAPI to Swaggerhub"

on:
workflow_call:
inputs:
version:
required: true
description: Version that will be published to Swaggerhub
type: string

jobs:
swagger-api:
runs-on: ubuntu-latest
env:
SWAGGERHUB_API_KEY: ${{ secrets.SWAGGERHUB_API_KEY }}
SWAGGERHUB_USER: ${{ secrets.SWAGGERHUB_USER }}
DOWNSTREAM_VERSION: ${{ inputs.version }}
steps:
- uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'

- name: Setup node
uses: actions/setup-node@v4

- name: Install Swagger CLI
run: |
npm i -g swaggerhub-cli
# create API, will fail if exists
- name: Create API
continue-on-error: true
run: |
swaggerhub api:create ${{ env.SWAGGERHUB_USER }}/item-relationship-service/${{ env.DOWNSTREAM_VERSION }} -f docs/src/api/irs-api.yaml --visibility=public --published=unpublish
# Post the API to SwaggerHub as "unpublished", because published APIs cannot be overwritten
- name: Publish API Specs to SwaggerHub
run: |
if [[ ${{ env.DOWNSTREAM_VERSION }} != *-SNAPSHOT ]]; then
echo "[INFO] - no snapshot, will set the API to 'published'";
swaggerhub api:update ${{ env.SWAGGERHUB_USER }}/item-relationship-service/${{ env.DOWNSTREAM_VERSION }} -f docs/src/api/irs-api.yaml --visibility=public --published=publish
swaggerhub api:setdefault ${{ env.SWAGGERHUB_USER }}/item-relationship-service/${{ env.DOWNSTREAM_VERSION }}
else
echo "[INFO] - snapshot, will set the API to 'unpublished'";
swaggerhub api:update ${{ env.SWAGGERHUB_USER }}/item-relationship-service/${{ env.DOWNSTREAM_VERSION }} -f docs/src/api/irs-api.yaml --visibility=public --published=unpublish
fi
11 changes: 11 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,17 @@ jobs:
needs:
- release
uses: ./.github/workflows/jira-publish-release.yaml
with:
version: ${{ github.ref_name }}
secrets: inherit

publish-to-swaggerhub:
name: "Publish OpenAPI spec to Swaggerhub"
permissions:
contents: read
needs:
- release
uses: ./.github/workflows/publish-swagger-hub.yml
with:
version: ${{ github.ref_name }}
secrets: inherit
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,8 @@ docs/src/diagram-replacer/package-lock.json
docs/src/diagram-replacer/package.json
docs/src/diagram-replacer/plantuml.jar

# Helm Chart Dependencies
/charts/irs-helm/Chart.lock
/charts/irs-helm/charts/


13 changes: 10 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
_**For better traceability add the corresponding GitHub issue number in each changelog entry, please.**_

## [Unreleased]
### Changed

- EdcPolicyDefinitionService, EdcContractDefinitionService and EdcAssetService return throw AlreadyExist exceptions when Conflict is returned from EDC
## [4.8.0] - 2024-03-18
### Changed
- Improved maintainability in EdcSubmodelClientImpl by reduced method visibility and better naming (in context of #448).
- EdcPolicyDefinitionService, EdcContractDefinitionService and EdcAssetService return throw AlreadyExist exceptions when Conflict is returned from
EDC
- Added AssetAdministrationShellDescriptor specificAssetIds support for externalSubjectId required for data provisioning
- Registering a job - aspects array is now accepting full urn of aspect model instead of name only, eg. 'urn:bamm:io.catenax.single_level_bom_as_built:2.0.0#SingleLevelBomAsBuilt' instead 'SingleLevelBomAsBuilt'. #439
- Changed the version of irs-registry-client from 1.6.0-SNAPSHOT to 1.6.0

## Fixed
- Fixed missing timeouts including configuration. #448

## [4.7.0] - 2024-03-04
### Added
- DigitalTwinRegistryCreateShellService in irs-registry-client for creating shells in DTR directly
Expand Down Expand Up @@ -574,7 +580,8 @@ _**For better traceability add the corresponding GitHub issue number in each cha
### Unresolved
- **Select Aspects you need** You are able to select the needed aspects for which you want to collect the correct endpoint information.

[Unreleased]: https://github.com/eclipse-tractusx/item-relationship-service/compare/4.7.0...HEAD
[Unreleased]: https://github.com/eclipse-tractusx/item-relationship-service/compare/4.8.0...HEAD
[4.8.0]: https://github.com/eclipse-tractusx/item-relationship-service/compare/4.7.0...4.8.0
[4.7.0]: https://github.com/eclipse-tractusx/item-relationship-service/compare/4.6.0...4.7.0
[4.6.0]: https://github.com/eclipse-tractusx/item-relationship-service/compare/4.5.2...4.6.0
[4.5.2]: https://github.com/eclipse-tractusx/item-relationship-service/compare/4.5.1...4.5.2
Expand Down
13 changes: 13 additions & 0 deletions COMPATIBILITY_MATRIX.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
# Compatibility matrix IRS

Full changelog of IRS: [changelog](CHANGELOG.md)
## [4.8.0] - 2024-03-18
| Dependency | Version | Helm | Comments |
|---------------------------|------------------------------|------------|-----------------|
| EDC | 0.5.3 | 0.5.3 | |
| EDC PostgresSQL | 15.1.0-debian-11-r12 | 12.1.6 | Optional |
| MIW | 0.1.0 | 0.1.0 | REST connection |
| Semantics Hub | 0.1.29 | v0.2.11-M1 | REST connection |
| DTR | 0.3.14-M1 | 0.3.22 | REST connection |
| Minio | RELEASE.2022-11-11T03-44-20Z | 5.0.1 | |
| SingleLevelBomAsBuilt | 2.0.0 | - | Model version |
| SingleLevelBomAsPlanned | 2.0.0 | - | Model version |
| SingleLevelBomAsSpecified | 1.0.0 | - | Model version |
| SingleLevelUsageAsBuilt | 2.0.0 | - | Model version |


## [4.7.0] - 2024-03-04
Expand Down
13 changes: 7 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,13 +176,14 @@ https://github.com/google/google-java-format/blob/master/README.md#intellij-jre-
- Check if the changelog entries for the release are complete.
- Add the corresponding GitHub issue numbers to each entry if missing.
3. Update [COMPATIBILITY_MATRIX.md](COMPATIBILITY_MATRIX.md).
4. Create pull request from [release preparation branch to main](https://github.com/eclipse-tractusx/item-relationship-service/compare/chore/prepare-release-x.x.x) and merge to main.
5. Create Git tag for the desired release version `git tag x.x.x`
4. Update IRS API version in IrsApplication class and irs-api.yaml
5. Create pull request from [release preparation branch to main](https://github.com/eclipse-tractusx/item-relationship-service/compare/chore/prepare-release-x.x.x) and merge to main.
6. Create Git tag for the desired release version `git tag x.x.x`
(note: the irs-helm tag will be created automatically by the GitHub workflow based on the version in the irs-helm changelog).
6. Push Git tag to repository `git push origin x.x.x` (this will trigger the GitHub release workflow).
7. Wait for release workflow to complete.
8. Merge the automatically opened PR by GitHub actions bot.
9. Notify about the release in IRS Matrix Chat using the following template:
7. Push Git tag to repository `git push origin x.x.x` (this will trigger the GitHub release workflow).
8. Wait for release workflow to complete.
9. Merge the automatically opened PR by GitHub actions bot.
10. Notify about the release in IRS Matrix Chat using the following template:

> **IRS Release x.x.x**
>
Expand Down
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,17 +91,22 @@ See [INSTALL](INSTALL.md).
The following subsection provides instructions for running the infrastructure on docker-compose and the application in
the IDE.

After the application is up and running the local IRS API is available at the following URLs:
Start the application with the commands in the subsection further below.
After everything is up and running the local IRS API is available at the following URLs:

- Swagger UI: http://localhost:8080/api/swagger-ui
- API docs: http://localhost:8080/api/api-docs
- API docs in yaml: http://localhost:8080/api/api-docs.yaml


#### Docker-compose + IDE

1. Start the necessary infrastructure by running `docker-compose up`
2. Start the application from your favorite IDE. For IntelliJ, a run configuration is available in the `.run` folder.
1. `cd local/deployment`
2. Start the necessary infrastructure by running `docker-compose up`
3. Start the application from your favorite IDE. For IntelliJ, a run configuration is available in the `.run` folder.

In case of problems connecting to MinIO check whether the MinIO console is accessible in your webbrowser
(see URL in the output of step 2). You might need to wait some time before MinIO is up and accepts connections.
If that does not help, execute `docker-compose down` and repeat from step 2.


## Usage
Expand Down
7 changes: 7 additions & 0 deletions charts/irs-helm/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [6.17.0] - 2024-03-18
### Added
- Added property `edc.controlplane.asyncTimeout` which allows to set a global time-to-live for all async requests over EDC

### Changed
- Update IRS version to 4.8.0

## [6.16.0] - 2024-03-04
### Added
- Added configuration property `edc.controlplane.endpoint.contractAgreements`
Expand Down
4 changes: 2 additions & 2 deletions charts/irs-helm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 6.16.0
version: 6.17.0
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "4.7.0"
appVersion: "4.8.0"
dependencies:
- name: common
repository: https://charts.bitnami.com/bitnami
Expand Down
1 change: 1 addition & 0 deletions charts/irs-helm/templates/configmap-spring-app-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ data:
irs-edc-client:
callback-url: {{ tpl (.Values.edc.callbackurl | default (printf "http://%s%s" .Release.Name "-irs-helm:8181/internal/endpoint-data-reference")) . | quote }}
asyncTimeout: {{ tpl .Values.edc.asyncTimeout . | default "PT10M" | quote }}
controlplane:
request-ttl: {{ .Values.edc.controlplane.request.ttl | default "PT10M" | quote }}
endpoint:
Expand Down
1 change: 1 addition & 0 deletions charts/irs-helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ edc:
header: "X-Api-Key" # Name of the EDC api key header field
secret: "" # <edc-api-key>
callbackurl:
asyncTimeout: PT10M # Timout for future.get requests as ISO 8601 Duration
submodel:
request:
ttl: PT10M # Requests to dataplane will time out after this duration (see https://en.wikipedia.org/wiki/ISO_8601#Durations)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# \[Concept\] \[#ID#\] Summary

| Key | Value |
|---------------|---------------------------------------------------------------------------------|
| Creation date | 14.03.2024 |
| Ticket Id | [#438](https://github.com/eclipse-tractusx/item-relationship-service/issues/438) |
| State | WIP |

## Table of Contents

1. [Overview](#overview)
2. [Summary](#summary)
4. [Assessment](#assessment)
9. [Glossary](#glossary)
10. [References](#references)

## Overview
The goal of this concept is to determine the impact on the IRS resulting from the new EDC extension "Policy Enforcement".
To this end, the API and the necessary changes to the IRS must be determined, documented and, if necessary, issues derived from them.

## Summary
Extension of reference implementation of Digital Twin Registry (DTR) in Catena-X for scalable access management to Asset Administration Shells (AAS) and adhering Submodel server(s).

## Assessment

- IRS uses the EDC for any request to the dDTR and Submodel Server

### Request Sequence (A) to API /lookup/shells

**(1.) Data request from consumer EDC to provider EDC (A1)**
The API /lookup/shells is used in IRS. IRS used the globalAssetId to filter for a specific asset. The BPNL is injected to DTR request header via the EDC and the credential stored in the MIW.
This will work as intended.
**specificAssetIds** is not used by the IRS for filter for AAS assets.

**(2.) API request by consumer EDC to DTR via provider EDC (A2)**
**(3.) DTR receives request and sends response to consumer EDC (A3)**
Communication only between the participants EDC and the DTR. The BPNL is injected into the request header of the dDTR by the EDC.

[x] No impact on IRS

### Request Sequence (B) to API /shell-descriptors/{aasIdentifier}

**(1.) Data request from consumer EDC to provider EDC (B1)**
**(2.) API request by consumer EDC to DTR via provider EDC (B2)**
**(3.) DTR receives request and sends response to consumer EDC (B3)**
Communication only between the participants EDC and the DTR. The BPNL is injected into the request header of the dDTR by the EDC.

[x] No impact on IRS

### Request Sequence (C) to Submodel Server

**(1.) Data request from consumer EDC to provider EDC (C1)**
**(2.) API request by consumer EDC to DTR for check on access (C2i)**
Communication only between the participants EDC and the DTR. The BPNL is injected into the request header of the dDTR by the EDC.

[x] No impact on IRS

### An additional API (outside the definition of the asset administration shells) is required to manage access rules.
Only required for data providers.

[x] No impact on IRS

### Impact:

Outlines the impact of the proposed solution, including the need for an EDC extension, additional APIs in the DTR, and the benefits to data providers utilizing this access management approach.
For the IRS as a data consumer there seem to be no impact and no changes required.

## Conclusion
No scalable access to attributes is required on the part of the irs. This is the responsibility of data providers such as bps. Trace-X. IRS uses the globalAssetIds to search for assets. For this reason, no dependency on the concept could be determined.
No impact on data consumers.

### AAS_Access_v3_Architecture

![AAS_Access_v3_Architecture.jpg](AAS_Access_v3_Architecture.jpg)

## Glossary

| Abbreviation | Name |
|--------------|---------------------------|
| CRUD | Create Read Update Delete |
| MIW | Managed Identity Wallet |
| AAS | Asset Adminstration Shell |

## References
- [Concept of CRUD API for Access management APIs](https://github.com/eclipse-tractusx/sldt-digital-twin-registry/issues/291)
- [Implementation for Access management to Digital Twins (via EDC extension)](https://github.com/eclipse-tractusx/sig-release/issues/417)
- [EDC-based Access Control for Asset Administration Shells and Submodel Server](https://github.com/eclipse-tractusx/sig-release/issues/417#issuecomment-1883058762)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit f12be7c

Please sign in to comment.