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

[feat|fix] : SDE frontend : Hotfix 3.2 with pcf - rel:2.3.0 #38

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
ee2cf25
constants moved to respective file
ajithsimons Sep 6, 2023
3f20bf9
A1SDS-2631 - PCF frontend implementation
ajithsimons Sep 6, 2023
9c64b0f
image
adityagajbhiye9 Sep 6, 2023
8d10acc
Update Dockerfile
adityagajbhiye9 Sep 6, 2023
746ad74
jar file updated
ajithsimons Sep 6, 2023
be0dd9b
A1SDS-2637 - Download Files code optimisations
ajithsimons Sep 7, 2023
a82cf77
download error fix
ajithsimons Sep 7, 2023
21f1763
A1SDS-2637 - rtk convertion for download csv code
ajithsimons Sep 7, 2023
fa243df
Update Dockerfile
adityagajbhiye9 Sep 7, 2023
ac720bc
Mutation name changes
ajithsimons Sep 8, 2023
deeab74
Update Dockerfile
adityagajbhiye9 Sep 8, 2023
f9d6073
Page layout adjustments
ajithsimons Sep 8, 2023
62fad6d
Arc 42 updated with PCF.
AjayRaturi123 Sep 11, 2023
7280fbd
A1SDS-2632, A1SDS-2641 setup and model view creation
ajithsimons Sep 11, 2023
f18f304
A1SDS-2632, A1SDS-2629 - implementation
ajithsimons Sep 12, 2023
7a36bfc
permissions updated, sidebar design fixes
ajithsimons Sep 12, 2023
83bf3e9
A1SDS-2641 : Download option added, code enhancements
ajithsimons Sep 13, 2023
a03fe3d
bug fixes
ajithsimons Sep 13, 2023
bb1ae11
error details table improvements
ajithsimons Sep 14, 2023
236630d
A1SDS-2661 : table row size change bug fix
ajithsimons Sep 14, 2023
7a14dd6
check blob size before download data
ajithsimons Sep 14, 2023
4b2f7fd
Merge branch 'DST_PIP10_ITR3' into FE_Documentation
adityagajbhiye9 Sep 18, 2023
cc60d7b
Merge pull request #109 from catenax-ng/FE_Documentation
adityagajbhiye9 Sep 18, 2023
07d6e45
download functions moved to axios for better error handling
ajithsimons Sep 19, 2023
0382836
Update Dockerfile
adityagajbhiye9 Sep 19, 2023
daffb01
pipeline modification test
ajithsimons Sep 19, 2023
85fb8bc
pipeline optimisations
ajithsimons Sep 19, 2023
2801706
build pipeline changes test
ajithsimons Sep 19, 2023
41302b8
bug fix
ajithsimons Sep 19, 2023
62b6bae
npm install duplicates removed from pipelines
ajithsimons Sep 20, 2023
4aec25e
Minor bug fix
ajithsimons Sep 22, 2023
dd41e41
Download feature removed
ajithsimons Oct 18, 2023
cc1e254
Update sdebuild.yml
sachinargade123 Oct 18, 2023
4c51467
Update Dockerfile
sachinargade123 Oct 18, 2023
33754dc
permissions updated
ajithsimons Oct 19, 2023
910b9ce
Update sdebuild.yml
sachinargade123 Oct 23, 2023
c25c1e1
Arc42 Updated.
AjayRaturi123 Nov 10, 2023
423331f
Arc42 Updated Newly.
AjayRaturi123 Nov 10, 2023
cd39977
[SDE-Frontend]Rel-2.3.0 Bug fixes and permission updated.
adityagajbhiye9 Nov 21, 2023
431d741
Veracode issue fixes
ajithsimons Nov 21, 2023
4de9ceb
unused file removal
ajithsimons Nov 21, 2023
e7b0bdd
changelog updated
ajithsimons Nov 21, 2023
8ddeb3b
lint error fixes
ajithsimons Nov 21, 2023
c2a6c5d
Dependencies file updated
ajithsimons Nov 22, 2023
214a094
dependencies license details updated
ajithsimons Nov 22, 2023
96ebdf2
license header added for html missing html file
ajithsimons Nov 23, 2023
035aa21
Docker notice added
adityagajbhiye9 Nov 23, 2023
63d654e
Updated docker Image
adityagajbhiye9 Nov 23, 2023
cb7e604
Update Dockerfile
adityagajbhiye9 Nov 23, 2023
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
8 changes: 1 addition & 7 deletions .github/workflows/dockerbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,9 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Install Dependencies
run: npm install

- name: Add content to Legal Notice
run: npm run build:legal-notice

- name: Build
run: npm run build

# Create SemVer or ref tags dependent of trigger event
- name: Docker meta
id: meta
Expand All @@ -81,7 +75,7 @@ jobs:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}

- name: Build and push
- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: .
Expand Down
44 changes: 7 additions & 37 deletions .github/workflows/trivy-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,57 +31,27 @@ on:
# Trigger manually

jobs:
analyze-config:
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Run Trivy vulnerability scanner in repo mode
uses: aquasecurity/trivy-action@master
with:
scan-type: "config"
exit-code: "1"
hide-progress: false
format: "sarif"
output: "trivy-results1.sarif"
severity: "CRITICAL,HIGH"

- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v2
if: always()
with:
sarif_file: "trivy-results1.sarif"

analyze-product-dft-frontend:
analyze-config:
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Run Trivy vulnerability scanner
if: always()
uses: aquasecurity/trivy-action@master
uses: aquasecurity/[email protected]
with:
# Path to Docker image
image-ref: "tractusx/managed-simple-data-exchanger-frontend:latest"
format: "sarif"
output: "trivy-results2.sarif"
exit-code: "1"
severity: "CRITICAL,HIGH"
output: "trivy-results.sarif"
vuln-type: "os,library"

- name: Upload Trivy scan results to GitHub Security tab
if: always()
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: "trivy-results2.sarif"
sarif_file: "trivy-results.sarif"


11 changes: 9 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@

New features, fixed bugs, known defects and other noteworthy changes to each release of the Simple Data Exchanger Frontend.

## [2.1.0] - 2023-08-30
## [2.3.0] - 2023-11-21
### Fixed
- Code optimisation.
- trivy workflow updated.
- version bump for chart release.

## [2.1.1] - 2023-08-30
### Fixed
- docker base image changed .

Expand Down Expand Up @@ -192,7 +198,8 @@ New features, fixed bugs, known defects and other noteworthy changes to each rel
- Compliance with Catena-X Guidelines
- Integration with Digital Twin registry service.

[unreleased]: https://github.com/eclipse-tractusx/managed-simple-data-exchanger-frontend/compare/v2.1.1...main
[unreleased]: https://github.com/eclipse-tractusx/managed-simple-data-exchanger-frontend/compare/v2.3.0...main
[2.3.0]: https://github.com/eclipse-tractusx/managed-simple-data-exchanger-frontend/compare/v2.1.1...v2.3.0
[2.1.1]: https://github.com/eclipse-tractusx/managed-simple-data-exchanger-frontend/compare/v2.1.0...v2.1.1
[2.1.0]: https://github.com/eclipse-tractusx/managed-simple-data-exchanger-frontend/compare/v2.0.10...v2.0.11
[2.0.11]: https://github.com/eclipse-tractusx/managed-simple-data-exchanger-frontend/compare/v2.0.10...v2.0.11
Expand Down
84 changes: 35 additions & 49 deletions DEPENDENCIES

Large diffs are not rendered by default.

27 changes: 27 additions & 0 deletions DOCKER_NOTICE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
## Notice for Docker image

This application provides container images for demonstration purposes.

DockerHub: https://hub.docker.com/r/tractusx/managed-simple-data-exchanger-frontend

Eclipse Tractus-X product(s) installed within the image:

- GitHub: https://github.com/eclipse-tractusx/managed-simple-data-exchanger-frontend
- Project home: https://projects.eclipse.org/projects/automotive.tractusx
- Dockerfile: https://github.com/eclipse-tractusx/managed-simple-data-exchanger-frontend/blob/main/Dockerfile
- Project license: [Apache License, Version 2.0] https://github.com/eclipse-tractusx/managed-simple-data-exchanger-backend/blob/main/LICENSE

**Used base image**
- [nginxinc/nginx-unprivileged:alpine3.18-perl]
- Dockerfile: [nginxinc/nginx-unprivileged:alpine](https://github.com/nginxinc/docker-nginx-unprivileged/blob/main/Dockerfile-alpine.template)
- GitHub project: [https://github.com/nginxinc/docker-nginx-unprivileged](https://github.com/nginxinc/docker-nginx-unprivileged)
- DockerHub: [https://hub.docker.com/r/nginxinc/nginx-unprivileged](https://hub.docker.com/r/nginxinc/nginx-unprivileged)

As with all Docker images, these likely also contain other software which may be under other licenses (such as Bash, etc from the base distribution, along with any direct or indirect dependencies of the primary software being contained).

As for any pre-built image usage, it is the image user's responsibility to ensure that any use of this image complies with any relevant licenses for all software contained within.

## License

Distributed under the Apache 2.0 License.
See [LICENSE](./LICENSE) for more information.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,13 @@ USER root
COPY ./conf /etc/nginx
# Static build
WORKDIR /usr/share/nginx/html
COPY LICENSE NOTICE.md DEPENDENCIES SECURITY.md ./
COPY --from=builder /app/build .
COPY ./env.sh .
RUN chown 101:101 /usr/share/nginx/html/
RUN chmod ug+rwx /usr/share/nginx/html/
EXPOSE 8080
USER 101

# Start Nginx server
CMD ["/bin/sh", "-c", "/usr/share/nginx/html/env.sh && nginx -g \"daemon off;\""]
2 changes: 1 addition & 1 deletion NOTICE.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ SPDX-License-Identifier: Apache-2.0
The project maintains the following source code repositories
in the GitHub organization https://github.com/eclipse-tractusx:

* https://github.com/eclipse-tractusx/dft-frontend
* https://github.com/eclipse-tractusx/managed-simple-data-exchanger-frontend


## Third-party Content
Expand Down
55 changes: 37 additions & 18 deletions docs/Arc42.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ In order to allow Data Providers and Data Consumers to easily participate in rel
- SDE is short for **S**imple **D**ata **E**xchanger.
- It is a standalone service which can be self-hosted.
- It enables companies to provide their data in the Catena-X network via an EDC.
- Data is uploaded via CSV-files/Manual Entry/Json format.
- Data is uploaded via CSV-files/Manual Entry/Recurring Upload.
- The SDE registers the data in the Digital Twin Registry and makes it accessible via an EDC.
- It is validate the CX network company BPN's to allow data as consumer.
- SDE also act as a Data Consumer.
Expand All @@ -52,9 +52,10 @@ In order to allow Data Providers and Data Consumers to easily participate in rel
#### **Essential Features**

- Compliance with Catena-X Guidelines.
- Parsing of CSV file/manual Entry for Parts and Relationships.
- Parsing of CSV file/Manual Entry/Recurring Upload for Parts and Relationships.
- Integration with Digital Twin registry.
- Utilization of EDC to provide data and consume data.
- Integration with simple policies management.
- Integration with Portal Service to validate BPN's Numbers as well as get the Connectors URL details of companies.
- Integration Keycloak authentication for security.
- Integration BPN Discovery service to support decentralized DTR.
Expand Down Expand Up @@ -125,25 +126,26 @@ The following table illustrates the stakeholders of SDE and their respective int

### **Technical Context**

| Name | Interface |
|------------------------------------------ |---------------- |
| EDC connector for external communication | EDC/IDS |
| Digital twin registry | HTTPs |
| Portal Service | HTTPs |
| BPN Discovery | HTTPs |
| File Upload (CSV) | HTTPs endpoint |
| Name | Interface |
|--------------------------------------------------------------------------|---------------- |
| EDC connector for external communication | EDC/IDS |
| Digital twin registry | HTTPs |
| Portal Service | HTTPs |
| BPN Discovery | HTTPs |
| File Upload (CSV/Manual Entry/Recurring-Upload) | HTTPs endpoint |

<br />

## **Solution Strategy**

| Quality Goal | Matching approaches in the solution |
|-------------------------------------- |------------------------------------------------------------------------------------- |
| Integration into Catena-X Network | Usage of Catena-X services like the Digital Twin Registry and EDC for data exchange |
| CSV input files with clear structure | Definition of a CSV file, which can be used for data upload |
| Lightweight service | |
| Docker Container | |
| Integrate EDC in deployment | |
| Quality Goal | Matching approaches in the solution |
|---------------------------------------|------------------------------------------------------------------------------------- |
| Integration into Catena-X Network | Usage of Catena-X services like the Digital Twin Registry and EDC for data exchange |
| CSV input files with clear structure | Definition of a CSV file, which can be used for data upload |
| Recurring-Upload | |
| Lightweight service | |
| Docker Container | |
| Integrate EDC in deployment | |

<br />
The SDE is divided into two components: Frontend and Backend. The frontend is very minimal with only the basic functionality.<br />
Expand Down Expand Up @@ -179,7 +181,9 @@ Its having 2 components:

SDE does not expose interfaces for other applications or components to call (i.e. no "external interfaces").

SDE does call interfaces of other components as by the picture above (i.e. of EDC, Digital Twin Registry, Portal).
SDE does call interfaces of other components as by the picture above (i.e. of EDC, Digital Twin Registry, Portal, BPN Discovery).

SDE Dose support Recurring/Scheduler upload..

There is a web interface between frontend and backend.<br /><br />

Expand All @@ -189,7 +193,7 @@ Detailed API specs available under:

[https://github.com/catenax-ng/tx-managed-simple-data-exchanger-backend/tree/main#restful-apis-of-dft-simple-data-exchanger](https://github.com/catenax-ng/tx-managed-simple-data-exchanger-backend/tree/main#restful-apis-of-dft-simple-data-exchanger)

Backend API Swagger-ui : [https://dft-api.int.demo.catena-x.net/api/swagger-ui/index.html](https://dft-api.int.demo.catena-x.net/api/swagger-ui/index.html)
Backend API Swagger-ui : [https://dft-api.int.demo.catena-x.net/backend/api/swagger-ui/index.html](https://dft-api.int.demo.catena-x.net/api/swagger-ui/index.html)

<br />

Expand Down Expand Up @@ -303,6 +307,21 @@ Backend API Swagger-ui : [https://dft-api.int.demo.catena-x.net/api/swagger-ui/i
| StoreSingleLevelUsageAsBuilt | Store the Single Level Usage As Built in the SDE database. | 5 |
<br />

#### **PCF - Product Carbon Footprint**
<br /><br /><img src="images/product_carbon_footprint.png" height="60%" width="60%" /><br /><br />

| Module | Description | Execution order |
|----------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------|
| CreatePCFAspect | Used when PCF upload is created on the frontend using the table or submit the <br>json request with the content.<br>It sets the row position and process id in each item. | 0 |
| MapToPCFAspect | Convert the string that came on the uploaded CSV file to PCFAspect dto.<br><br>It also validate the mandatory fields are fulfilled. | 1 |
| MapFromPCFAspectRequest | Convert from the PCFAspectRequest object to PCFAspect dto.<br><br>It also validate the mandatory fields are fulfilled. | 1 |
| GenerateUUId | Check if PCF have a non null and non blank Id. If not it will generate one UUID with the defined prefix "urn:uuid:". | 2 |
| DigitalTwinsPCFAspect | Do the interface in the Digital Twins registry.<br><br> - It will lookup for shells and if no shell is found it will create one;<br> - If a single shell exists for the given key it will use that shell;<br> - If multiple shell are found it will throw an exception;<br> - It will lookup for sub models. If no sub model is found it will create one; <br> - If a sub model is found it will set the PCF with that sub model id;<br><br>Please note that a shell can only have two sub models at the time being. | 3 |
| EDCPCFAspect | Do the interface in the Eclipse Data Connector (EDC)<br><br> - It will lookup for a previous registry;<br> - If no registry is found it will create an asset plus a default policy and contract definition; | 4 |
| BPNDiscovery | Push Key of Aspect asset into the BPN Discovery for DDTR lookup. | 5 |
| StorePCF | Store the PCF Aspect in the SDE database. | 6 |
<br />

### **Whitebox Overall System**

#### **App routing**
Expand Down
Binary file added docs/images/product_carbon_footprint.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading