Skip to content

Commit

Permalink
Merge pull request #236 from catenax-ng/main
Browse files Browse the repository at this point in the history
New release 4.0.0
  • Loading branch information
ds-jhartmann authored Oct 27, 2023
2 parents f5ed12b + d1252b8 commit 23b7efb
Show file tree
Hide file tree
Showing 43 changed files with 10,535 additions and 3,785 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/tavern.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ on:
global-asset-id-asBuilt:
type: string
description: Global-asset-id to use for the asBuilt tests.
default: 'urn:uuid:43c92f57-6bc7-4486-9729-5c30d366ec66'
default: 'urn:uuid:6d505432-8b31-4966-9514-4b753372683f'
required: true
bpn-asBuilt:
type: string
description: BPN to use for the asBuilt global-asset-id.
default: 'BPNL00000003AYRE'
default: 'BPNL00000003AVTH'
required: true
execution-ticket:
type: string
Expand Down Expand Up @@ -68,8 +68,8 @@ jobs:
KEYCLOAK_CLIENT_SECRET: ${{ secrets.KEYCLOAK_OAUTH2_CLIENT_SECRET }}
GLOBAL_ASSET_ID_AS_PLANNED: ${{ github.event.inputs.global-asset-id-asPlanned || 'urn:uuid:0733946c-59c6-41ae-9570-cb43a6e4c79e' }}
BPN_AS_PLANNED: ${{ github.event.inputs.bpn-asPlanned || 'BPNL00000003AYRE' }}
GLOBAL_ASSET_ID_AS_BUILT: ${{ github.event.inputs.global-asset-id-asBuilt || 'urn:uuid:1b17682e-5e2a-4913-aa1b-7d59a072a3cb' }}
BPN_AS_BUILT: ${{ github.event.inputs.bpn-asBuilt || 'BPNL00000003AYRE' }}
GLOBAL_ASSET_ID_AS_BUILT: ${{ github.event.inputs.global-asset-id-asBuilt || 'urn:uuid:6d505432-8b31-4966-9514-4b753372683f' }}
BPN_AS_BUILT: ${{ github.event.inputs.bpn-asBuilt || 'BPNL00000003AVTH' }}
run: |
python -m pytest local/testing/api-tests/irs-api-tests.tavern.yaml --junitxml=tavern-results.xml
Expand Down
14 changes: 13 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,22 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [4.0.0] - 2023-10-27
### Added
- Introduced new API endpoint to register ESS Jobs in Batch - POST {{IRS_HOST}}/irs/ess/orders
- Added role "admin_irs" again

### Changed
- Deprecated query parameter 'jobStates' was removed from GET {{IRS_HOST}}/irs/jobs endpoint
- Moved OAuth2 JWT token claim to configuration. The fields can be configured with `oauth.resourceClaim`, `oauth.irsNamespace`, `oauth.roles`.
- ESS
- Added Tombstone to ESS investigation in case required aspect models "PartAsPlanned" or "PartSiteInformationAsPlanned" are missing
- Update dependencies to mitigate third party vulnerabilities

## [3.5.4] - 2023-10-25
### Changed
- removed role "admin_irs"

## [3.5.3] - 2023-10-09
### Fixed
Expand Down Expand Up @@ -391,7 +401,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### 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/3.5.3...HEAD
[Unreleased]: https://github.com/eclipse-tractusx/item-relationship-service/compare/4.0.0...HEAD
[4.0.0]: https://github.com/eclipse-tractusx/item-relationship-service/compare/3.5.4...4.0.0
[3.5.4]: https://github.com/eclipse-tractusx/item-relationship-service/compare/3.5.3...3.5.4
[3.5.3]: https://github.com/eclipse-tractusx/item-relationship-service/compare/3.5.2...3.5.3
[3.5.2]: https://github.com/eclipse-tractusx/item-relationship-service/compare/3.5.1...3.5.2
[3.5.1]: https://github.com/eclipse-tractusx/item-relationship-service/compare/3.5.0...3.5.1
Expand Down
194 changes: 99 additions & 95 deletions DEPENDENCIES

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions charts/irs-helm/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [6.9.0]
### Changed
- Update IRS version to 4.0.0

### Added
- Added configuration for IRS OAuth2 JWT token claim

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.8.1
version: 6.9.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: "3.5.4"
appVersion: "4.0.0"
dependencies:
- name: common
repository: https://charts.bitnami.com/bitnami
Expand Down
147 changes: 147 additions & 0 deletions docs/concept/Discovery-process-DTR.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
# \[TRI-1576\] \[CONCEPT\] Handling of assets provided by multiple Digital Twin Registries

## Glossary

| Abbreviation | Name |
|--------------|-----------------------------|
| EDC | Eclipse Dataspace Connector |
| DTR | Digital Twin Registry |
| DT | Digital Twin |


## Out of scope
This concept does not include the discovery process for EDC notifications. This will be done in a separate concept.

## Scenarios

IRS is not able to validate if a certain data offer is correct or outdated. IRS will take the first responding offer
which is available, all other requests are disregarded after that and the responses are ignored.

### EDC with multiple DTRs

IRS queries all DTRs for the globalAssetId and will take the first result it gets.
If none of the DTRs return a result, IRS will create a tombstone.

````mermaid
sequenceDiagram
IRS ->> Discovery Service: Get EDCs for BPN
Discovery Service ->> IRS: Return list of 1 EDC
IRS ->> EDC Provider: Query for DTR contract offer
EDC Provider ->> IRS: 2 DTR contract offers
par Query DTR 1
IRS ->> EDC Provider: Negotiate contract
IRS ->> DTR 1: Query for DT
DTR 1 ->> IRS: no DT
and Query DTR 2
IRS ->> EDC Provider: Negotiate contract
IRS ->> DTR 2: Query for DT
DTR 2 ->> IRS: DT
end
````

### Multiple EDCs with one DTR

IRS starts a contract negotiation for all registry contract offers in parallel and queries the DTRs for all successful
negotiations.
The first registry which responds with a DT will be the one used by IRS.

````mermaid
sequenceDiagram
IRS ->> Discovery Service: Get EDCs for BPN
Discovery Service ->> IRS: Return list of 3 EDCs
par Catalog Request to EDC 1
IRS ->> EDC Provider 1: Query for DTR contract offer
EDC Provider 1 ->> IRS: No offer
and Catalog Request to EDC 2
IRS ->> EDC Provider 2: Query for DTR contract offer
EDC Provider 2 ->> IRS: No offer
and Catalog Request to EDC 3
IRS ->> EDC Provider 3: Query for DTR contract offer
EDC Provider 3 ->> IRS: DTR contract offer
IRS -> EDC Provider 3: Negotiate contract
IRS ->> DTR: Query for DT
DTR ->> IRS: DT
end
````

### One EDC with one DTR

Only one EDC found for BPN and the catalog only contains one offer for the DTR.
IRS will use this registry and will create a tombstone if no DT could be found for the globalAssetId.

````mermaid
sequenceDiagram
IRS ->> Discovery Service: Get EDCs for BPN
Discovery Service ->> IRS: Return list of 1 EDC
IRS ->> EDC Provider 3: Query for DTR contract offer
EDC Provider 3 ->> IRS: DTR contract offer
IRS -> EDC Provider 3: Negotiate contract
IRS ->> DTR: Query for DT
DTR ->> IRS: DT
````

### Multiple EDCs with multiple DTRs

IRS starts a contract negotiation for all the registry offers.

````mermaid
sequenceDiagram
IRS ->> Discovery Service: Get EDCs for BPN
Discovery Service ->> IRS: Return list of 3 EDCs
par Catalog Request to EDC 1
IRS ->> EDC Provider 1: Query for DTR contract offer
EDC Provider 1 ->> IRS: No offer
and Catalog Request to EDC 2
IRS ->> EDC Provider 2: Query for DTR contract offer
EDC Provider 2 ->> IRS: DTR contract offer
IRS -> EDC Provider 2: Negotiate contract
IRS ->> DTR: Query for DT
DTR ->> IRS: DT
and Catalog Request to EDC 3
IRS ->> EDC Provider 3: Query for DTR contract offer
EDC Provider 3 ->> IRS: DTR contract offer
IRS -> EDC Provider 3: Negotiate contract
IRS ->> DTR: Query for DT
DTR ->> IRS: No DT
end
````

### Multiple EDCs with no DTRs

IRS starts a contract negotiation for all the registry offers and creates a tombstone since no DTR could be discovered.

````mermaid
sequenceDiagram
IRS ->> Discovery Service: Get EDCs for BPN
Discovery Service ->> IRS: Return list of 3 EDCs
par Catalog Request to EDC 1
IRS ->> EDC Provider 1: Query for DTR contract offer
EDC Provider 1 ->> IRS: No offer
and Catalog Request to EDC 2
IRS ->> EDC Provider 2: Query for DTR contract offer
EDC Provider 2 ->> IRS: No offer
and Catalog Request to EDC 3
IRS ->> EDC Provider 3: Query for DTR contract offer
EDC Provider 3 ->> IRS: No offer
end
IRS ->> IRS: Tombstone
````

## Special Scenarios

### Same DT in multiple DTRs

IRS will use all registries to query for the globalAssetId and takes the first result which is returned.
If no DT could be found in any of the DTRs, IRS will create a tombstone.

### Multiple DTs (with the same globalAssetId) in one DTRs

IRS uses the /query endpoint of the DTR to get the DT id based on the globalAssetId. If more than one id is present for
a globalAssetId, IRS will use the first of the list.

````mermaid
sequenceDiagram
IRS ->> DTR: /query for globalAssetId
DTR ->> IRS: return list of two results
IRS ->> IRS: use first
````
3 changes: 2 additions & 1 deletion docs/src/api/irs-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2177,7 +2177,7 @@ components:
properties:
action:
type: string
example: ACCESS
example: USE
enum:
- ACCESS
- USE
Expand Down Expand Up @@ -2221,6 +2221,7 @@ components:
- BpdmRequest
- BpdmValidation
- UsagePolicyValidation
- EssValidation
retryCounter:
type: integer
format: int32
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
@startuml
skinparam monochrome true
skinparam shadowing false
skinparam defaultFontName "Architects daughter"
title "ESS Bottom-Up from Incident Level"


| OEM - IRS Incident Tier Level |
start
:Incident BPNS is identified;
:Get all AAS for from dDTR;
note left
Requesting all AAS from dDTR
end note
if(aas.isEmpty?) then (yes)
stop
endif

: Filter for asPlanned twins (aas);
note left
semanticId/
["type"="ExternalReference"]/
keys["type"="GlobalReference"]/
["value".contains("SingleLevelBomAsPlanned")]
SingleLevelBomAsPlanned (only downwards supported!!)
end note
if(twinsAsPlanned.isEmpty?) then (yes)
stop
endif

: Extract and collect globalAssetIds for own twins (AsPlanned);
: Request batch call for globalAssetIds
POST /ess/customers/investigations/orders;

: Filter for incident BPNS
in PartSiteInformationAsPlanned;

if(!twin.contains(incidentBpns)) then (no)
: skip twin;
else (yes)
: add twin;
endif

: ValidityPeriodChecker in own aas;
if(timestamp is in validity period) then (yes)
note left
PartAsPlanned.validityPeriod.validFrom
>= validityTimestamp
>= PartAsPlanned.validityPeriod.validTo
end note
: add twin;
else (no)
: skip twin;
endif


: Determining relationships one
tier level upwards;

: aggregateBPNLs Aggregate bpns numbers for each bpnl;
: increment hops count for each twin ;
stop

@enduml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
@startuml
skinparam monochrome true
skinparam shadowing false
skinparam defaultFontName "Architects daughter"

entity Customers {
businessPartnerNumberLegalEntity : string
}
entity CustomerParts{
globalAssetId : string
}
entity Sites{
businessPartnerNumberSite : string
}

Customers "0..*" - "1..*" CustomerParts

CustomerParts "0..*" - "1..*" Sites

@enduml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
@startuml
skinparam defaultFontName "Architects daughter"
skinparam monochrome true
skinparam shadowing false
skinparam spacing 100
skinparam linetype ortho
skinparam nodesep 250
skinparam ranksep 250


Incident_Tier3 : hop 0
Customer_Tier2 : hop 1
Customer_Tier1 : hop 2
OEM: hop 3

Incident_Tier3 :
Customer_Tier2 :
Customer_Tier1 :
OEM :
Incident_Tier3 :
Customer_Tier2 :
Customer_Tier1 :
OEM :
Incident_Tier3 :
Customer_Tier2 :
Customer_Tier1 :
OEM :


[*] -r-> Incident_Tier3
Incident_Tier3 -r-> Customer_Tier2 : increment hop++ (hop=0+1)
Customer_Tier2 -r-> Customer_Tier1 : increment hop++ (hop=1+1)
Customer_Tier1 -r-> OEM : increment hop++ (hop=2+1)


@enduml
Loading

0 comments on commit 23b7efb

Please sign in to comment.