Skip to content

Commit

Permalink
Merge pull request eclipse-tractusx#403 from FraunhoferISST/chore/rem…
Browse files Browse the repository at this point in the history
…ove_edr_endpoint

Refactor: Remove EdrEndpointService and Controller
  • Loading branch information
tom-rm-meyer-ISST authored May 24, 2024
2 parents 7a17315 + 4a56397 commit 2a2461b
Show file tree
Hide file tree
Showing 16 changed files with 26 additions and 320 deletions.
29 changes: 17 additions & 12 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [v2.0.1](https://github.com/eclipse-tractusx/puris/releases/tag/2.0.1)

The following Changelog lists the changes. Please refer to the [documentation](docs/README.md) for configuration needs and understanding the concept changes.
The following Changelog lists the changes. Please refer to the [documentation](docs/README.md) for configuration needs
and understanding the concept changes.

The **need for configuration updates** is **marked bold**.

### Added

Frontend updates

* Added Footer

### Changed
Expand All @@ -26,23 +25,28 @@ Frontend updates
* Font update for Role switching elements in stocks and dashboard view
* Handled modal dialog behavior to always let failed validations prevent closing
* Modal Dialog Demand
* Day is marked as mandatory
* Reset data when reopening
* Day is marked as mandatory
* Reset data when reopening
* Catalog View
* Updated header itle + usage policy naming (previously Asset Action)
* Added table view
* increased responsiveness by loading animation
* Updated header itle + usage policy naming (previously Asset Action)
* Added table view
* increased responsiveness by loading animation
* Negotiation view
* Added table view + Subheader
* Added table view + Subheader
* Logout button now logs out again

Fixed constraints to exactly match on leftOperands during consumer side offer evaluation

### Removed

- EDR Endpoint as removed for edr api usage in appVersion 2.0.0

### Known Knowns

#### Security

The Backend is currently secured via API Key while the Frontend already uses an API-KEY. See [Admin Guide](./docs/admin/Admin_Guide.md) for further information.
The Backend is currently secured via API Key while the Frontend already uses an API-KEY.
See [Admin Guide](./docs/admin/Admin_Guide.md) for further information.

#### Upgradeability

Expand Down Expand Up @@ -211,14 +215,14 @@ Dashboard
- DropDown Headers / Field Headers not correctly placed. Other views / data entry / filter screens to be checked.
- Dashboard currently has larger fond than all other Page Headers -> please unify
- Create Demand - Day is mandatory and should require an asterix
- Create Demand - Upon entering data and closing, SOME (not all) entries are preserved (and so are warnings for
- Create Demand - Upon entering data and closing, SOME (not all) entries are preserved (and so are warnings for
mandatory fields) --> upon closing and re-opening information should be reset to default. (**block**)
- Similar for Create Delivery (here SOME entries are reset but warnings stay) (**block**)

Stocks

- Switch between Material Stocks and Product Stocks -> same layout adaption as for Dashboard suggested (see above)
- Like the functionality that by clicking on a stock, data gets entered for add/update -> user needs better guidance to
- Like the functionality that by clicking on a stock, data gets entered for add/update -> user needs better guidance to
do this (else error prone to enter one slightly different attribute and Add instead of update)
- Refresh -- update request has been sent successfully. -> more information regarding data transfer needed for user

Expand All @@ -232,6 +236,7 @@ Catalog
- Delay in loading results and first "No Catalog available..." shown and then load items

Negotiations

- Similar as Catalog
- Add filters for transparency (bpnl, state)

Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import lombok.extern.slf4j.Slf4j;
import okhttp3.*;
import org.eclipse.tractusx.puris.backend.common.edc.domain.model.SubmodelType;
import org.eclipse.tractusx.puris.backend.common.edc.logic.dto.EdrDto;
import org.eclipse.tractusx.puris.backend.common.edc.logic.util.EdcRequestBodyBuilder;
import org.eclipse.tractusx.puris.backend.common.util.PatternStore;
import org.eclipse.tractusx.puris.backend.common.util.VariablesService;
Expand Down Expand Up @@ -715,6 +714,9 @@ private SubmodelData fetchPartTypeSubmodelData(MaterialPartnerRelation mpr) {
private record SubmodelData(String assetId, String dspUrl, String href) {
}

private record EdrDto(String authKey, String authCode, String endpoint){
}

private SubmodelData fetchSubmodelData(MaterialPartnerRelation mpr, String semanticId, String manufacturerPartId, String manufacturerId) {
JsonNode submodelDescriptors = getAasSubmodelDescriptors(manufacturerPartId, manufacturerId, mpr, 1);
for (var submodelDescriptor : submodelDescriptors) {
Expand Down Expand Up @@ -911,10 +913,7 @@ private EdrDto getEdrForTransferProcessId(String transferProcessId, int retries)
}

/**
* terminate the transfer with reason "Transfer done."
* <p>
* Edr in {@link EndpointDataReferenceService} is not removed because it is removed automatically by a job after
* time period x.
* Terminate the transfer with reason "Transfer done.
*
* @param transferProcessId to terminate
*/
Expand Down Expand Up @@ -982,7 +981,7 @@ private boolean negotiateForSubmodel(MaterialPartnerRelation mpr, SubmodelType t
JsonNode targetCatalogEntry = null;
if (!catalogArray.isEmpty()) {
if (catalogArray.size() > 1) {
log.debug("Ambiguous catalog entries found! Will take the first with supported policy \n" + catalogArray.toPrettyString());
log.debug("Muliple contract offers found! Will take the first with supported policy \n" + catalogArray.toPrettyString());
}

for (JsonNode entry : catalogArray) {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
.authorizeHttpRequests(
// any request in spring context
(authorizeHttpRequests) -> authorizeHttpRequests
.requestMatchers("/stockView/**", "/partners/**", "/materials/**", "/materialpartnerrelations/**", "/item-stock/**", "/production/**", "/delivery/**", "/demand/**", "/planned-production/**", "/material-demand/**", "/delivery-information/**", "/edrendpoint/**", "/edc/**", "/parttypeinformation/**")
.requestMatchers("/stockView/**", "/partners/**", "/materials/**", "/materialpartnerrelations/**", "/item-stock/**", "/production/**", "/delivery/**", "/demand/**", "/planned-production/**", "/material-demand/**", "/delivery-information/**", "/edc/**", "/parttypeinformation/**")
.authenticated()
.requestMatchers("/swagger-ui/**", "/v3/api-docs/**", "/health/**").permitAll()
.dispatcherTypeMatchers(DispatcherType.ERROR).permitAll()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,6 @@ public class VariablesService {
*/
private String edrEndpoint;

@Value("${puris.edr.deletiontimer}")
/**
* The number of minutes before received authentication data
* in the context of a consumer pull is removed from memory
*/
private long edrTokenDeletionTimer;

@Value("${puris.baseurl}" + "catena/item-stock/request")
/**
* The url under which this application's request endpoint can
Expand Down
2 changes: 0 additions & 2 deletions backend/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@ server.port=${SERVER_PORT:8081}
puris.baseurl=${PURIS_BASEURL:http://customer-backend:8081/}

puris.demonstrator.role=${PURIS_DEMONSTRATOR_ROLE:customer}
puris.edr.deletiontimer=${PURIS_EDR_DELETIONTIMER:2}
puris.itemstocksubmodel.apiassetid=${PURIS_ITEMSTOCKSUBMODEL_APIASSETID:itemstocksubmodel-api-asset}
puris.productionsubmodel.apiassetid=${PURIS_PRODUCTIONSUBMODEL_APIASSETID:productionsubmodel-api-asset}
puris.demandsubmodel.apiassetid=${PURIS_DEMANDSUBMODEL_APIASSETID:demandsubmodel-api-asset}
puris.deliverysubmodel.apiassetid=${PURIS_DELIVERYSUBMODEL_APIASSETID:deliverysubmodel-api-asset}
puris.frameworkagreement.use=${PURIS_FRAMEWORKAGREEMENT_USE:false}
puris.frameworkagreement.credential=${PURIS_FRAMEWORKAGREEMENT_CREDENTIAL:Puris}
puris.frameworkagreement.version=${PURIS_FRAMEWORKAGREEMENT_VERSION:1.0}
puris.purpose.name=${PURIS_PURPOSE_NAME:cx.puris.base}
Expand Down
Loading

0 comments on commit 2a2461b

Please sign in to comment.