Skip to content

Commit b60ea8c

Browse files
authored
Merge pull request #1279 from eclipse-tractusx/chore/#1108-data-sovereignty_rework
Chore/#1108 data sovereignty rework
2 parents fe4ea09 + cad227d commit b60ea8c

16 files changed

+347
-230
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ _**For better traceability add the corresponding GitHub issue number in each cha
2828
- XXXX added workflow to import testdata
2929

3030
### Changed
31+
- #1108 Rework of data sov documentation
3132
- #1070 Correct semantic model in dev/README.md
3233
- #1070 Update documentation artefacts according to TRG 1 - Documentation
3334
- #1070 Convert png to svg according to TRG 1.04 - Diagrams as code / Editable static files

docs/concept/#638-contractagreement-admin-view/get-all-contracts-sequenceflow.puml

Lines changed: 0 additions & 50 deletions
This file was deleted.

docs/concept/#638-contractagreement-admin-view/get-all-contracts-sequenceflow.svg

Lines changed: 1 addition & 48 deletions
Loading
Lines changed: 46 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,54 @@
11
@startuml
22
title
3-
==GET api/contracts/{tx-assetId}
3+
== Request ContractResponse (Contract Agreements)
44
end title
55

66
autonumber "<B>[00]"
7-
8-
participant "Trace-X Frontend" as FE order 0
9-
participant "Trace-X Backend" as BE order 1
10-
participant "Trace-X Database" as DB order 2
11-
participant "EDC" as TXEDC order 3
12-
13-
FE -> BE: GET api/contracts/{tx-assetId}
14-
15-
activate BE
16-
BE -> DB: Take contractAgreementId for tx-assetId
17-
activate DB
18-
autonumber stop
19-
DB --> BE: contractAgreementId
20-
autonumber resume
21-
deactivate DB
22-
23-
BE -> TXEDC: GET tx-edc/management/v2/contractagreements/{contractAgreementId}
24-
activate TXEDC
25-
autonumber stop
26-
TXEDC --> BE: JSON response
27-
autonumber resume
28-
deactivate TXEDC
29-
BE -> BE: Extract contractSigningDate, policy
30-
activate BE
7+
skinparam monochrome true
8+
skinparam shadowing false
9+
skinparam defaultFontName "Architects daughter"
10+
skinparam linetype ortho
11+
12+
participant "Trace-X \n Frontend" as FE order 0
13+
participant "Trace-X \n Backend" as BE order 1
14+
participant "Trace-X \n Database" as DB order 2
15+
participant "EDC \n ManagementAPI" as TXEDC order 3
16+
17+
FE -> BE: Request for ContractResponse
18+
note left
19+
GET /contracts by filterExpression
20+
end note
21+
22+
loop for each contract agreement
23+
activate BE
24+
BE -> DB: Query contractAgreementId for assetId
25+
activate DB
26+
DB --> BE: result contractAgreementId
27+
deactivate DB
28+
29+
BE -> TXEDC: GET contractagreements
30+
note left
31+
GET edc/management/v2/contractagreements/{contractAgreementId}
32+
end note
33+
activate TXEDC
34+
TXEDC --> BE: return contract agreements
35+
deactivate TXEDC
36+
BE -> BE: Extract contractSigningDate, policy
37+
activate BE
38+
deactivate BE
39+
40+
BE -> TXEDC: GET edc/management/v2/contractagreements/{contractAgreementId}/negotiation
41+
activate TXEDC
42+
TXEDC --> BE: Gets a contract negotiation with the given contract agreement ID
43+
deactivate TXEDC
44+
BE -> BE: Extract id, counterPartyAddress, state
45+
activate BE
46+
BE -> BE : Create ContractResponse
47+
deactivate BE
48+
49+
end loop
50+
51+
BE --> FE: List of ContractResponses for filterExpression
3152
deactivate BE
32-
33-
BE -> TXEDC: GET tx-edc/management/v2/contractagreements/{contractAgreementId}/negotiation
34-
activate TXEDC
35-
autonumber stop
36-
TXEDC --> BE: JSON response
37-
autonumber resume
38-
deactivate TXEDC
39-
BE -> BE: Extract id, counterPartyAddress, state
40-
activate BE
41-
deactivate BE
42-
4353
autonumber stop
44-
BE --> FE: JSON response
45-
deactivate BE
46-
4754
@enduml

docs/src/docs/arc42/runtime-view/data-sovereignty/policy-management.adoc

Lines changed: 69 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,17 @@ However, to be sure that data is shared only with companies that match one's req
1010
The policies used for sending and receiving notifications and parts have an identical data format, so they can be used for each process interchangeably.
1111
The processes itself are different and will be explained here:
1212

13+
== Policy Types
14+
The EDC Connector MUST provide a possibility to restrict the access of a Data Asset to specific business partners by attribute(s), e.g., represented as a VC.
15+
The Connector MUST restrict the data usage to partners and purposes for a specific use case.
16+
17+
There are two policy types used.
18+
* Access
19+
* Usage
20+
21+
As specified by the https://github.com/International-Data-Spaces-Association/ids-specification[Dataspace Protocol], one Data Asset MUST refer to at least one Usage Policy, expressed in ODRL.
22+
For additional information refer to https://eclipse-tractusx.github.io/docs-kits/kits/Connector%20Kit/Adoption%20View/connector_kit_adoption_view[Connector KIT]
23+
1324
== Policies for sending and receiving parts
1425
[plantuml, target=data-sovereignty-publish-assets, format=svg]
1526
....
@@ -18,60 +29,88 @@ include::../../../../uml-diagrams/arc42/runtime-view/data-sovereignty/data-sover
1829

1930
[cols="1,5"]
2031
|===
21-
|1, 2
22-
|Policies can be created by administrators at any time in the administration section of Trace-X.
32+
|1
33+
|Policies can be created by User with role 'Admin' at any time in the administration section of Trace-X. The policy is created to later used for publishing assets in the current company context.
34+
35+
|2
36+
|Policies are stored in the PolicyStore which is a shared component used by Trace-X [A] app and IRS for storing usage and access policies.
2337

2438
|3
25-
|Parts can be imported at any time in the parts section of Trace-X. They will be stored locally at first.
39+
|Policy is created in the policy store.
2640

2741
|4
28-
|Before connected BPNs can access the imported parts, the parts must be published to the EDC and to the Digital Twin Registry (DTR).
42+
|User with role 'Admin' receives feedback that creation of policy was successful.
2943

30-
|5
31-
|The user must choose the policy that is used for contract negotiation of the selected parts.
32-
33-
|6
34-
|The policy is created in the EDC.
44+
|5, 6
45+
|User with role 'Admin' imports assets in Admin section of Trace-X [A]. Parts can be imported at any time in the parts section of Trace-X. They will be stored locally at first. https://github.com/eclipse-tractusx/traceability-foss/tree/main/tx-backend/testdata[Testdata for asset import]
3546

3647
|7
37-
|Each part is created as a shell in the DTR. This holds all the data of the part.
48+
|User with role 'Admin' selects assets in transient state in application.
3849

3950
|8
40-
|The created part is linked to the policy from the EDC. This is the last step of data provisioning. Trace-X A has done everything to ensure that companies that have a matching policy can access its published parts.
51+
|User with role 'Admin' is requested to define a policy for assets publishing.
4152

4253
|9
43-
|Trace-X B wants to synchronize parts and retrieve available ones from connected BPNs. In this case Trace-X A and Trace-X B have an established connection.
54+
|User with role 'Admin' selects policy under which assets are published. The user must choose the policy that is used for contract negotiation of the selected parts.
4455

45-
|10
46-
|For part synchronization the Item Relationship Service (IRS) is requested.
56+
|10, 11
57+
|Assets are created in the EDC. (POST /v3/assets)
4758

48-
|11
49-
|First the IRS must know the policies that are used by Trace-X B, so it requests them directly.
59+
|12,13
60+
|Trace-X [A] BE checks if PolicyDefinition for selected policy already exists.
5061

51-
|12
52-
|Trace-X B returns a list of the configured policies depending on the configuration done by the administrator in step 2.
62+
|14,15
63+
|In case PolicyDefinition does not exist. New PolicyDefinition is created in EDC [A]. The PolicyDefinition is created in the EDC.
5364

54-
|13
55-
|The IRS requests the catalog from Trace-X A. In the catalog, all policies of Trace-X A are stored.
65+
|16,17
66+
|The created part is linked in the PolicyDefinition from the EDC. This is the last step of data provisioning. Trace-X [A] has done everything to ensure that companies that have a matching policy can access its published parts.
5667

57-
|14
58-
|The EDC of Trace-X A provides the catalog.
68+
|18,19
69+
|Each part is created as a shell in the DTR. This holds all the data of the part. Before connected BPNs can access the imported parts, the parts must be published to the EDC and to the Digital Twin Registry (DTR).
5970

60-
|15
61-
|The IRS checks the catalog for the required policies and extracts them.
71+
|20,21
72+
|User with role 'Admin' in Trace-X [B] creates policy for consuming assets of Trace-X [A].
6273

63-
|16
74+
|22
75+
|Trace-X [B] wants to synchronize parts and retrieve available ones from connected BPNs. In this case Trace-X [A] and Trace-X [B] have an established connection.
76+
77+
|23,24
78+
|Trace-X [B] requests for globalAssetIds (unique identifier of digital twins (Asset Administration Shell)) in decentral Digital Twin registry.
79+
80+
|25
81+
|For part synchronization a synchronization job is started in the Item Relationship Service (IRS) .
82+
83+
|26,27
84+
|IRS requests for CatalogOffer for globalAssetsIds passed by Trace-X [A]
85+
86+
|28
87+
|IRS extracts policies from CatalogOffer
88+
89+
|29,30
90+
|IRS requests for policies defined for BPNL of Trace-X [A] in PolicyStore of Trace-X [B]
91+
92+
|31
6493
|Now that the IRS has all the relevant policies of both companies, it can start comparing the linked policy of each part to the policy list of Trace-X B. This works by comparing the included constraints logically. If no policy matches for a part, it will not be imported.
6594

66-
|17, 18
67-
|If the policy of the part matches with any policy of Trace-X A, a contract agreement is created for both Trace-X A and Trace-X B. It can be viewed in the administration section of Trace-X and documents the data exchange.
95+
|32,33,34
96+
|If the policy of the part matches with any policy of Trace-X A, a contract agreement is created for both Trace-X A and Trace-X B. It can be viewed in the administration section of Trace-X and documents the data exchange. Since the contractAgreementId will be mapped to an submodel of IRS. The contracts can be seen after IRS responded to Trace-X initial sync call with the submodels including the contractAgreementId.
6897

69-
|19
98+
|35
7099
|Now that the contract negotiation was successful, the data consumption process can take place for that part.
100+
101+
|36
102+
|In case policy does not match IRS created tombstone.
103+
104+
|37
105+
|IRS callbacks Trace-X [B] Instance after completing job processing. ContractAgreementId for asset is available in Trace-X passed in IRS JobResponse.
71106
|===
72107

73108
It's possible to publish parts with different policies. For this, the user must only publish a limited selection of parts for which he can select a policy. For the parts that must be published with different policies, the user can repeat the process.
74109

110+
111+
**Note**:
112+
For more detailed information concerning the functionality of IRS please refer to https://eclipse-tractusx.github.io/item-relationship-service/docs/[IRS documentation]
113+
75114
**[Work-in-progress]** The user may also choose parts that have already been published - they can be republished with a different policy. The process for this is identical to the regular publishing process.
76115

77116
== Policies for sending and receiving notifications
@@ -116,7 +155,7 @@ include::../../../../uml-diagrams/arc42/runtime-view/data-sovereignty/data-sover
116155
|If no policies match, an error will be returned to the user.
117156
|===
118157

119-
=== No policies when sending notifications
158+
=== No policies defined for Receiver BPNL when sending notifications
120159
[plantuml, target=data-sovereignty-notifications-policy-change, format=svg]
121160
....
122161
include::../../../../uml-diagrams/arc42/runtime-view/data-sovereignty/data-sovereignty-notifications-policy-change.puml[]
@@ -130,7 +169,7 @@ If no policies are configured for the receiving BPN and a notification is sent t
130169
include::../../../../uml-diagrams/arc42/runtime-view/data-sovereignty/data-sovereignty-notifications-policy-expired.puml[]
131170
....
132171

133-
Policies always have an expiration time. When a notification is sent and there are policies configured for the selected BPN with an expiration time in the past, Trace-X will throw an error. In that case, an administrator must either update the policy. Then the policy can be resent.
172+
Policies always have an expiration time defined by the 'validUntil' timestamp. When a notification is sent and there are policies configured for the selected BPN with an expiration time in the past, Trace-X will throw an error. In that case, an administrator must either update the policy. Then the policy can be resent.
134173

135174
=== Testing policies
136175
In order to test the functionality of policies, an administrator can create a policy with test constraints for connected BPNs. When sending notifications to that BPN, the process should be blocked.

docs/src/docs/arc42/runtime-view/data-sovereignty/return-asset-contracts.adoc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,8 @@ These contract agreement ids will be then requested on EDC side via POST (/manag
1616
The contract information is then returned by the endpoint as a pageable result.
1717

1818
If no asset ids are provided in the request, 50 contract agreement ids are handled by default.
19+
20+
21+
22+
23+

docs/src/uml-diagrams/arc42/runtime-view/data-provisioning/import-report-receive.puml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
@startuml
2+
autonumber "<B>[00]"
23
skinparam monochrome true
34
skinparam shadowing false
4-
autonumber "<b>[000]"
5+
skinparam defaultFontName "Architects daughter"
6+
skinparam linetype ortho
57

68
actor TraceXApiConsumer
79
activate TraceXApiConsumer

docs/src/uml-diagrams/arc42/runtime-view/data-provisioning/publish-assets-error.puml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
@startuml
2+
autonumber "<B>[00]"
23
skinparam monochrome true
34
skinparam shadowing false
4-
autonumber "<b>[000]"
5+
skinparam defaultFontName "Architects daughter"
6+
skinparam linetype ortho
57

68
actor TraceXApiConsumer
79
activate TraceXApiConsumer

docs/src/uml-diagrams/arc42/runtime-view/data-provisioning/publish-assets.puml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
@startuml
2+
autonumber "<B>[00]"
23
skinparam monochrome true
34
skinparam shadowing false
4-
autonumber "<b>[000]"
5+
skinparam defaultFontName "Architects daughter"
6+
skinparam linetype ortho
57

68
actor TraceXApiConsumer
79
activate TraceXApiConsumer

docs/src/uml-diagrams/arc42/runtime-view/data-provisioning/trace-x-data-import-interface-modul1-sequence.puml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
@startuml
2+
autonumber "<B>[00]"
3+
skinparam monochrome true
4+
skinparam shadowing false
5+
skinparam defaultFontName "Architects daughter"
6+
skinparam linetype ortho
7+
28
participant FE
39
participant BE
410
participant Database

0 commit comments

Comments
 (0)