Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc | sde documentation 24.05 #171

Merged
merged 20 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
26894ce
refactor code for stable release
sachinargade123 May 10, 2024
fb326a4
update change log file
sachinargade123 May 10, 2024
132cb60
update submodel information
sachinargade123 May 10, 2024
0e1ec3f
fix jar security issue
sachinargade123 May 10, 2024
9a5d775
Commenting app build and test step in docker file
sachinargade123 May 13, 2024
7898c86
Merge branch 'refactor_for-stable_code_2405' into security_issue_fix_…
sachinargade123 May 13, 2024
f640217
Update change log and dependency file
sachinargade123 May 13, 2024
acb149f
Update change log and dependency file
sachinargade123 May 13, 2024
6b0f7bb
fixed dependabot bumb mutiple issue
sachinargade123 May 13, 2024
cb50dc2
- Documents updated
ChetanT-System May 13, 2024
4592182
chore Depedanbot issues fixed
adityagajbhiye9 May 13, 2024
515d936
Merge branch 'security_issue_fix_2405' of https://github.com/catenax-…
adityagajbhiye9 May 13, 2024
4290686
- changelog updated
ChetanT-System May 13, 2024
715743f
- dependencies file updated
ChetanT-System May 13, 2024
7284441
Merge branch 'security_issue_fix_2405' into cx_documentation_24.05
sachinargade123 May 13, 2024
fb669ec
Fix code Ql note
sachinargade123 May 13, 2024
154424b
Merge branch 'eclipse-tractusx:main' into security_issue_fix_2405
sachinargade123 May 13, 2024
e398a6f
Merge branch 'eclipse-tractusx:main' into cx_documentation_24.05
sachinargade123 May 13, 2024
386b0e6
update DEPENDENCIES file
sachinargade123 May 13, 2024
151599c
Merge branch 'security_issue_fix_2405' into cx_documentation_24.05
sachinargade123 May 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,18 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Refactor code for pcf, dt access API, EDC 7.
- Dt access api use in digital twin processing.
- Added test cases for PCF and policy controller.
- Refactor code to make stable release
- Documentation updated

### Fixed
- Remove garbage character from 'edc_request_template' path. Fixed [#147](https://github.com/eclipse-tractusx/managed-simple-data-exchanger-backend/issues/147).
- Dependabot bump version fix in pom.xml and DEPENDENCIES file update.
- Dockerfile image update. [#117](https://github.com/eclipse-tractusx/managed-simple-data-exchanger-backend/pull/117)

## [2.3.7] - 2024-05-09
### Fixed
- Rename edc_request_template directory.
- This is fixed for issue #147.

## [2.3.6] - 2024-03-06
### Fixed
Expand Down
173 changes: 87 additions & 86 deletions DEPENDENCIES

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,14 @@ Apart from both upload Batch upload is additional feature were added into DFT.
4. Create Asset in EDC Connector.
5. Stores the line in the database.

<b>For PartTypeInformation Upload:</b>

1. Maps the content of the line with an PartTypeInformation.
2. Generates the UUID if it does not contain a UUID.
3. Registers in DigitalTwins.
4. Create Asset in EDC Connector.
5. Stores the line in the database.

<b>For SingleLevelBoMAsPlanned Upload:</b>

1. Maps the content of the line with an SingleLevelBoMAsPlanned.
Expand All @@ -112,6 +120,14 @@ Apart from both upload Batch upload is additional feature were added into DFT.
4. Create Asset in EDC Connector.
5. Stores the line in the database.

<b>For Pcf Upload:</b>

1. Maps the content of the line with an Pcf.
2. checks if an PartAsPlanned Aspect exists so it can be related to that Aspect.
3. Registers in DigitalTwins.
4. Create Asset in EDC Connector.
5. Stores the line in the database.

The file .csv is loaded in memory, the content is saved and then, the file is removed from memory.


Expand Down
33 changes: 32 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Listed below are configuration keys needed to get the `sde-backend` up and runni
| discovery.clientSecret | X | default | discovery clientSecret |
| discovery.grantType | X | default | discovery grantType |
| partner.pool.hostname | X | default | partner pool hostname |
| partner.pool.authentication.url | X | default | partner pool authentication url |
| partner.pool.authentication.url | X | default | partner pool authentication url |
| partner.pool.clientId | X | default | partner pool clientId |
| partner.pool.clientSecret | X | default | partner pool clientSecret |
| partner.pool.grantType | X | default | partner pool grantType |
Expand All @@ -96,6 +96,12 @@ Listed below are configuration keys needed to get the `sde-backend` up and runni
| portal.backend.clientId | X | default | portal clientId |
| portal.backend.clientSecret | X | default | portal clientSecret |
| portal.backend.grantType | X | default | portal grantType |
| policy.hub.hostname | X | default | policy hub hostname |
| policy.hub.authentication.url | X | default | policy hub authentication url |
| policy.hub.clientId | X | default | policy hub clientId |
| policy.hub.clientSecret | X | default | policy hub clientSecret |
| policy.hub.grantType | X | default | policy hub grantType |


#### Example Configuration/application.properties

Expand Down Expand Up @@ -206,6 +212,11 @@ portal.backend.authentication.url=default
portal.backend.clientId=default
portal.backend.clientSecret=default
portal.backend.grantType=default
policy.hub.hostname=default
policy.hub.authentication.url=default
policy.hub.clientId=default
policy.hub.clientSecret=default
policy.hub.grantType=default
```

The above configuration we can use as for different deployment as specified here [InstallationGuide.md](InstallationGuide.md)
Expand All @@ -222,6 +233,7 @@ To find information about supported submodules and there version in SDE please v
* SingleLevelBoMAsBuilt
* Batch
* PartAsPlanned
* PartTypeInformation
* SingleLevelBoMAsPlanned
* PartSiteInformationAsPlanned
* SingleLevelUsageAsBuilt
Expand All @@ -231,6 +243,7 @@ To find information about supported submodules and there version in SDE please v
* SingleLevelBoMAsBuilt
* Batch
* PartAsPlanned
* PartTypeInformation
* SingleLevelBoMAsPlanned
* PartSiteInformationAsPlanned
* SingleLevelUsageAsBuilt
Expand All @@ -240,6 +253,7 @@ To find information about supported submodules and there version in SDE please v
* SingleLevelBoMAsBuilt
* Batch
* PartAsPlanned
* PartTypeInformation
* SingleLevelBoMAsPlanned
* PartSiteInformationAsPlanned
* SingleLevelUsageAsBuilt
Expand Down Expand Up @@ -288,6 +302,16 @@ To find information about supported submodules and there version in SDE please v
| **GET:- localhost:8080/api/contract-offers** |This API is used to get all contract offers | Refer Api Doc |Refer Api Doc|
| **GET:- localhost:8080/api/legal-entities** |This API is used to fetch legal entities (list of company's) for Process| Refer Api Doc |Refer Api Doc|
| **POST:- localhost:8080/api/connectors-discovery** |This API is used to fetch connectors information | Refer Api Doc |Refer Api Doc|
| **GET:- localhost:8080/api/policy-attributes** |This API is used to fetch policy attributes | Refer Api Doc |Refer Api Doc|
| **GET:- localhost:8080/api/policy-types** |This API is used to fetch type of policy attributes | Refer Api Doc |Refer Api Doc|
| **GET:- localhost:8080/api/policy-content** |This API is used to fetch policy content | Refer Api Doc |Refer Api Doc|
| **POST:- localhost:8080/api/policy-content** |This API is used to create policy content | Refer Api Doc |Refer Api Doc|
| **POST:- localhost:8080/api/policy** |This API is used to save policy | Refer Api Doc |Refer Api Doc|
| **PUT:- localhost:8080/api/policy/{uuid}** |This API is used to update policy | Refer Api Doc |Refer Api Doc|
| **GET:- localhost:8080/api/policy/{uuid}** |This API is used to get policy | Refer Api Doc |Refer Api Doc|
| **GET:- localhost:8080/api/policy/is-policy-name-valid** |This API is used to check policy name valid or not | Refer Api Doc |Refer Api Doc|
| **GET:- localhost:8080/api/policy** |This API is used to all policy | Refer Api Doc |Refer Api Doc|
| **DELETE:- localhost:8080/api/policy/{uuid}** |This API is used to delete policy | Refer Api Doc |Refer Api Doc|

## Detailed API specs available under:

Expand Down Expand Up @@ -326,10 +350,16 @@ https://<host-url>/backend/api/swagger-ui/index.html
| Tables | Description | Unique Id |
| ------ | ------ | ------ |
| **aspect** | Table used to Store Date About Serialized Part | **Primary Key**:UUID |
| **serialpart_v_300** | Table used to Store Date About Serialized Part | **Primary Key**:UUID |
| **aspect_relationship** |Data about the relationship of parts to its child-components. | **Primary Key**:parent_catenax_id, child_catenax_id |
| **single_level_bom_asbuilt_v_300** |Data about the relationship of parts to its child-components. | **Primary Key**:parent_catenax_id, child_catenax_id |
| **batch** |Table used to Store Date about Serialized Part. | **Primary Key**:UUID |
| **batch_v_300** |Table used to Store Date about Serialized Part. | **Primary Key**:UUID |
| **part_as_planned** |Table used to Store Date about Part As Planned. | **Primary Key**:UUID |
| **part_type_information** |Table used to Store Date about Part As Planned. | **Primary Key**:UUID |
| **pcf_aspect** |Table used to Store Date about Part As Planned. | **Primary Key**:UUID |
| **single_level_bom_as_planned** |Data about the relationship of part As Planned to its child-components. | **Primary Key**:parent_catenax_id, child_catenax_id |
| **single_level_bom_as_planned_v_300** |Data about the relationship of part As Planned to its child-components. | **Primary Key**:parent_catenax_id, child_catenax_id |
| **part_site_information_as_planned** |Table used to Store Date about Part Site Information As Planned. | **Primary Key**:UUID |
| **contract_negotiation_info** |Tables Contains Contract Negotiation Info and offerid | **Primary Key**: connector_id, offer_id |
| **failure_log** |Table Contains Data About Failure Entries | **Primary Key**:UUID |
Expand All @@ -339,6 +369,7 @@ https://<host-url>/backend/api/swagger-ui/index.html
| **sde_permission** |Table Contains list of permissions | **Primary Key**:sde_permission |
| **sde_role_permission_mapping** |Table Contains mapping of role with permissions | **Primary Key**:sde_role, sde_permission |
| **single_level_usage_as_built** |Data about the relationship of parts to its child-components. | **Primary Key**:parent_catenax_id, child_catenax_id |
| **single_level_usage_as_built_v_300** |Data about the relationship of parts to its child-components. | **Primary Key**:parent_catenax_id, child_catenax_id |

---
## flyway
Expand Down
9 changes: 6 additions & 3 deletions modules/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,18 @@ SDE backend splited into multiple services loosely-coupled Maven modules.
- modules/sde-external-services/digital-twins
- modules/sde-external-services/portal
- modules/sde-external-services/bpn-discovery
- modules/sde-external-services/policy-hub

- modules/sde-common
- modules/sde-core
- modules/sde-submodules/serial-part-typization

- modules/sde-submodules/serial-part
- modules/sde-submodules/single-level-bom-as-built
- modules/sde-submodules/batch
- modules/sde-submodules/assembly-part-relationship
- modules/sde-submodules/part-as-planned
- modules/sde-submodules/part-type-information
- modules/sde-submodules/part-site-information-as-planned
- modules/sde-submodules/single-level-usage-as-built
- modules/sde-submodules/single-level-bom-as-planned
- modules/sde-submodules/pcf
- modules/sde-usecases/traceability
- modules/pcf-exchange
3 changes: 2 additions & 1 deletion modules/pcf-exchange/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ https://eclipse-tractusx.github.io/docs-kits/category/pcf-exchange-kit
##### External service dependency :
- dDTR service.
- EDC Service.
- BPN Discovery.
- BPN Discovery.
- Portal Service.
1 change: 0 additions & 1 deletion modules/sde-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,6 @@
<artifactId>spring-security-test</artifactId>
<scope>test</scope>
</dependency>

</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,21 @@ public String storeFile(MultipartFile multipartFile) {
}

UUID uuid = UUID.randomUUID();

if (fileName.contains("..") || fileName.contains("/") || fileName.contains("\\")) {
throw new IllegalArgumentException("Invalid csv filename");
}

fileName = fileName.replace(
fileName.substring(0, fileName.lastIndexOf(".")),
uuid.toString()
);
Path targetLocation = this.fileStorageLocation.resolve(fileName);


if (!targetLocation.startsWith(this.fileStorageLocation + File.separator)) {
throw new IllegalArgumentException("Invalid csv filename");
}

Files.copy(stream, targetLocation, StandardCopyOption.REPLACE_EXISTING);
stream.close();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ public ObjectNode run(Integer rowNumber, ObjectNode objectNode, String processId
SubmoduleCommonColumnsConstant.SHELL_ID);
String subModelId = JsonObjectUtility.getValueFromJsonObjectAsString(objectNode,
SubmoduleCommonColumnsConstant.SUBMODULE_ID);
String uuid = JsonObjectUtility.getValueFromJsonObjectAsString(objectNode, getIdentifierOfModel());

String uuid = getDatabaseIdentifierValues(objectNode, getDatabaseIdentifierSpecsOfModel());

AssetEntryRequest assetEntryRequest = assetFactory.getAssetRequest(submodule,
getSubmodelShortDescriptionOfModel(), shellId, subModelId, getSubmoduleUriPathOfSubmodule(), uuid,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public List<String> getTableColomnHeader(Submodel schemaObj) {
tableColomnHeader.add(SubmoduleCommonColumnsConstant.PROCESS_ID);
tableColomnHeader.add(SubmoduleCommonColumnsConstant.DELETED);
tableColomnHeader.add(SubmoduleCommonColumnsConstant.UPDATED);
tableColomnHeader.add(SubmoduleCommonColumnsConstant.SHELL_ACCESS_RULE_IDS);
return tableColomnHeader;
}

Expand Down
6 changes: 5 additions & 1 deletion modules/sde-core/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,12 @@ logging.level.root=info
## Digital Twins
digital-twins.hostname=
digital-twins.authentication.url=
digital-twins.api=/api/v3.0
digital-twins.registry.uri=
digital-twins.registry.lookup.uri=
digital-twins.authentication.clientId=
digital-twins.authentication.clientSecret=
digital-twins.authentication.grantType=client_credentials
digital-twins.authentication.scope=

## EDC Provider
edc.hostname=
Expand All @@ -76,6 +78,8 @@ edc.apiKeyHeader=
edc.apiKey=
edc.dsp.endpointpath=/api/v1/dsp
edc.dataplane.endpointpath=/api/public
edc.managementpath.apiversion=/v2
edc.managementpath.apiversion.asset=/v3

## EDC Consumer
edc.consumer.hostname=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
{
"edc:operandLeft": "https://w3id.org/edc/v0.0.1/ns/type",
"edc:operator": "=",
"edc:operandRight": "data.core.digitalTwinRegistry"
"edc:operandRight": "${assetType}"
},
{
"edc:operandLeft": "https://w3id.org/edc/v0.0.1/ns/registry",
"edc:operandLeft": "https://w3id.org/edc/v0.0.1/ns/${registryType}",
"edc:operator": "=",
"edc:operandRight": "${digitalTwinRegistry}"
"edc:operandRight": "${baseUrl}"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"operandLeft": "https://w3id.org/edc/v0.0.1/ns/type",
"operator": "=",
"operandRight": "data.core.digitalTwinRegistry"
"operandRight": "${type}"
}
]
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/********************************************************************************
* Copyright (c) 2022, 2024 T-Systems International GmbH
* Copyright (c) 2022, 2024 Contributors to the Eclipse Foundation
* Copyright (c) 2022,2024 T-Systems International GmbH
* Copyright (c) 2022,2024 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
Expand All @@ -27,7 +27,9 @@
import static org.mockito.Mockito.when;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import org.eclipse.tractusx.sde.common.entities.Policies;
import org.eclipse.tractusx.sde.core.controller.ConsumerController;
Expand Down Expand Up @@ -66,7 +68,7 @@ class ConsumerControllerTest {
@Test
void testQueryOnDataOfferWithoutOfferModel() throws Exception {
when(consumerControlPanelService.queryOnDataOffers((String) any(), (String) any(), (String) any(), anyInt(),
anyInt())).thenReturn(new ArrayList<>());
anyInt())).thenReturn(new HashSet<>());
MockHttpServletRequestBuilder requestBuilder = MockMvcRequestBuilders.get("/query-data-offers")
.param("bpnNumber", "foo");

Expand All @@ -78,7 +80,7 @@ void testQueryOnDataOfferWithoutOfferModel() throws Exception {

@Test
void testQueryOnDataOffersWithOfferModel() throws Exception {
ArrayList<QueryDataOfferModel> queryDataOfferModelList = new ArrayList<>();
Set<QueryDataOfferModel> queryDataOfferModelList = new HashSet<>();
queryDataOfferModelList.add(QueryDataOfferModel.builder()
.assetId("foo")
.connectorId("test")
Expand Down
Loading
Loading