Skip to content

Commit

Permalink
Merge pull request #296 from catenax-ng/main
Browse files Browse the repository at this point in the history
BpnEntity
  • Loading branch information
ds-mwesener authored Sep 26, 2023
2 parents 6e38a89 + 4ddb473 commit 77f5d20
Show file tree
Hide file tree
Showing 50 changed files with 509 additions and 553 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,20 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- New test data for as planned assets aswell as JustInSequence and TractionBatteryCode
- Toggle for parts and other parts to switch views asPlanned/asBuilt
- LocalStorage to be used for saving view setting
- archunit tests as preparation for good quality architecture checks
- safety and security doc including roles matrix

### Changed
- added sorting for /api/investigations received and created endpoints
- added sorting for /api/alerts received and created endpoints
- integration tests uses flyway now rather than hibernate schema auto creation
- irs helm updated from 6.5.0 to 6.6.1
- BpnEntity now contains BpnEdcMappingEntity fields


### Removed
- Old edc code not necessary anymore
- BpnEdcMappingEntity removed with related repository

## [7.0.0 - 18.09.2023]
### Added
Expand Down
61 changes: 61 additions & 0 deletions docs/src/docs/arc42/cross-cutting/safety-security.adoc
Original file line number Diff line number Diff line change
@@ -1 +1,62 @@
= Safety and security concepts

== Authentication / Authorization

=== Trace-X API

The Trace-X is secured using OAuth2.0 / Open ID Connect.
Every request to the Trace-X API requires a valid bearer token.
JWT token should also contain two claims:

- 'bpn' which is equal to the configuration value from `API_ALLOWED_BPN` property
- 'resource_access' with the specific key for C-X environments.
The list of values will be converted to roles by Trace-X.
Currently, Trace-X API handles three roles: **'User'** and **'Supervisor'** and **'Admin'.**

The behavior is shown in the table below.

==== Rights and Roles Matrix of Trace-X

|===
| Category | Action | User | Supervisor | Admin
| View | View Dashboard | x | x | x
| | View Parts | x | x | x
| | View Other parts | x | x | x
| | View Quality investigations | x | x | x
| | View Quality alerts | x | x | x
| | View Administration | | | x

| Investigation | Create | x | x |
| | Send | | x |
| | Read | x | x | x
| | Update | x | x |
| | Delete All | | x |
| | Delete Own | (x) | x |

| Alert | Create | x | x |
| | Send | | x |
| | Read | x | x | x
| | Update | x | x |
| | Delete All | | x |
| | Delete Own | (x) | x |

| Administration Panel | Access "BPN EDC config panel" | | | x
| | Access "Registry lookup Panel" | | | x

|===

Legend: x = full access to all resources, (x) = access to the resources he owns

=== Trace-X as EDC client

The Trace-X accesses the Catena-X network via the EDC consumer connector.
This component requires authentication via a Verifiable Credential (VC), which is provided to the EDC via the Managed Identity Wallet.

The VC identifies and authenticates the EDC and is used to acquire access permissions for the data transferred via EDC.

== Credentials

Credentials must never be stored in Git!



Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
appTabAsPanel
mat-stretch-tabs="false"
mat-align-tabs="start"
class="other-parts-mat-tab-group"
>
<mat-tab >
<ng-template mat-tab-label>
Expand Down Expand Up @@ -59,6 +60,7 @@
appTabAsPanel
mat-stretch-tabs="false"
mat-align-tabs="start"
class="other-parts-mat-tab-group"
>
<mat-tab>
<ng-template mat-tab-label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

.other-parts-container {
@apply flex flex-col;
height: 65vh;
height: 68vh;
}

.app-bom-lifecycle-activator-container {
Expand Down Expand Up @@ -53,4 +53,8 @@
max-height: 58vh;
}

.other-parts-mat-tab-group {
margin: 16px;
}


Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
<div class="parts-as-built-table-wrapper">
<ng-container *viewContainer="partsAsBuilt$ | async; main: mainTmp; error: errorTmp; loading: loaderTmp"></ng-container>
<ng-template #mainTmp let-parts="view">
<div class="large-text">{{"page.asBuiltParts" | i18n}}</div>
<!-- asBuilt Parts Table-->
<app-table class="parts-asBuilt-table"
[PartsPaginationData]="parts.data | formatPaginationSemanticDataModelToCamelCase"
Expand All @@ -42,7 +43,6 @@
(configChanged)="onAsBuiltTableConfigChange($event)"
(multiSelect)="currentSelectedItems$.next($event)"
(clickSelectAction)="isAlertOpen$.next(true)"
[tableHeader]="'page.asBuiltParts'"
[multiSortList]="tableAsBuiltSortList"
></app-table>
</ng-template>
Expand All @@ -52,6 +52,7 @@
<div class="parts-as-planned-table-wrapper">
<ng-container *viewContainer="partsAsPlanned$ | async; main: myTmp; error: errorTmp; loading: loaderTmp"></ng-container>
<ng-template #myTmp let-parts="view">
<div class="large-text">{{"page.asPlannedParts" | i18n}}</div>
<!-- asPlanned Parts Table-->
<app-table class="parts-asPlanned-table"
[PartsPaginationData]="parts.data | formatPaginationSemanticDataModelToCamelCase"
Expand All @@ -65,7 +66,6 @@
(configChanged)="onAsPlannedTableConfigChange($event)"
(multiSelect)="currentSelectedItems$.next($event)"
(clickSelectAction)="isAlertOpen$.next(true)"
[tableHeader]="'page.asPlannedParts'"
[multiSortList]="tableAsPlannedSortList"
></app-table>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,16 @@
}

.split-container-wrapper {
height: 65vh;
height: 68vh;
}

// TODO: fix bottom shadow of parts Table
.parts-as-built-table-wrapper {
max-height: 58vh;
margin: 16px;
}

.parts-as-planned-table-wrapper {
max-height: 58vh;
margin: 16px;
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
data-testid="table-component--test-id"
>
<!-- TODO: Make Header fixed to top when scrolling -->
<tr *matHeaderRowDef="tableConfig.displayedColumns" mat-header-row data-testid="table-component--head-row"></tr>
<tr *matHeaderRowDef="tableConfig.displayedColumns" mat-header-row data-testid="table-component--head-row" class="table--header--row"></tr>

<tr
*matRowDef="let row; columns: tableConfig.displayedColumns"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,10 @@ tr.error {
z-index: 1;
}

.table--header--row {
white-space: nowrap;
}

.table--header {
padding-bottom: 8px;
}
Expand Down
6 changes: 6 additions & 0 deletions tx-backend/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,12 @@ SPDX-License-Identifier: Apache-2.0
<version>${awaitility.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.tngtech.archunit</groupId>
<artifactId>archunit</artifactId>
<version>1.1.0</version>
<scope>test</scope>
</dependency>
</dependencies>

<pluginRepositories>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.eclipse.tractusx.traceability.assets.domain.base.BpnRepository;
import org.eclipse.tractusx.traceability.assets.domain.base.IrsRepository;
import org.eclipse.tractusx.traceability.assets.domain.base.model.AssetBase;
import org.eclipse.tractusx.traceability.assets.infrastructure.base.irs.config.IrsPolicyConfig;
Expand All @@ -37,6 +36,7 @@
import org.eclipse.tractusx.traceability.assets.infrastructure.base.irs.model.response.PolicyResponse;
import org.eclipse.tractusx.traceability.assets.infrastructure.base.irs.model.response.RegisterJobResponse;
import org.eclipse.tractusx.traceability.assets.infrastructure.base.model.IrsPolicy;
import org.eclipse.tractusx.traceability.bpn.domain.service.BpnRepository;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/

package org.eclipse.tractusx.traceability.bpn.mapping.domain.model;
package org.eclipse.tractusx.traceability.bpn.domain.model;

import io.swagger.annotations.ApiModelProperty;
import io.swagger.v3.oas.annotations.media.ArraySchema;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/

package org.eclipse.tractusx.traceability.bpn.mapping.domain.model;
package org.eclipse.tractusx.traceability.bpn.domain.model;

public class BpnEdcMappingException extends RuntimeException {
public class BpnNotFoundException extends RuntimeException {

public BpnEdcMappingException(String message) {
public BpnNotFoundException(String message) {
super(message);
}

Expand Down
Loading

0 comments on commit 77f5d20

Please sign in to comment.