From cfc065c408534ef7eefd3652f82fd1a10b0ae867 Mon Sep 17 00:00:00 2001 From: jhartmann Date: Fri, 24 May 2024 15:07:23 +0200 Subject: [PATCH 1/3] fix(edc-client): Add property "submodel-postfix" to be prefixed for submodel call --- CHANGELOG.md | 5 +++++ .../templates/configmap-spring-app-config.yaml | 1 + charts/item-relationship-service/values.yaml | 1 + irs-api/src/main/resources/application.yml | 1 + .../test/java/org/eclipse/tractusx/irs/WiremockSupport.java | 5 ++++- .../eclipse/tractusx/irs/edc/client/EdcConfiguration.java | 1 + .../eclipse/tractusx/irs/edc/client/EdcSubmodelFacade.java | 4 +++- 7 files changed, 16 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ea097c104..87e97f1883 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,11 @@ _**For better traceability add the corresponding GitHub issue number in each cha ## [Unreleased] +### Fixed + +- Fixed submodel request path by introducing configuration property `irs-edc-client.submodel.submodel-suffix` which will + be appended to the href URL. + ## [5.1.3] - 2024-05-17 ### Fixed diff --git a/charts/item-relationship-service/templates/configmap-spring-app-config.yaml b/charts/item-relationship-service/templates/configmap-spring-app-config.yaml index 1fbb9c2e46..92b09f6f6b 100644 --- a/charts/item-relationship-service/templates/configmap-spring-app-config.yaml +++ b/charts/item-relationship-service/templates/configmap-spring-app-config.yaml @@ -115,6 +115,7 @@ data: submodel: request-ttl: {{ tpl .Values.edc.submodel.request.ttl . | default "PT10M" | quote }} urn-prefix: {{ tpl (.Values.edc.submodel.urnprefix | default "/urn") . | quote }} + submodel-suffix: {{ tpl (.Values.edc.submodel.suffix | default "/$value") . | quote }} catalog: acceptedPolicies: diff --git a/charts/item-relationship-service/values.yaml b/charts/item-relationship-service/values.yaml index 4646065ffe..4d828a8670 100644 --- a/charts/item-relationship-service/values.yaml +++ b/charts/item-relationship-service/values.yaml @@ -185,6 +185,7 @@ edc: request: ttl: PT10M # Requests to dataplane will time out after this duration (see https://en.wikipedia.org/wiki/ISO_8601#Durations) urnprefix: /urn + suffix: /$value catalog: # IRS will only negotiate contracts for offers with a policy as defined in the allowedNames list. # If a requested asset does not provide one of these policies, a tombstone will be created and this node will not be processed. diff --git a/irs-api/src/main/resources/application.yml b/irs-api/src/main/resources/application.yml index 870775f826..93b9a76f7a 100644 --- a/irs-api/src/main/resources/application.yml +++ b/irs-api/src/main/resources/application.yml @@ -148,6 +148,7 @@ irs-edc-client: submodel: request-ttl: ${EDC_SUBMODEL_REQUEST_TTL:PT10M} # How long to wait for an async EDC submodel retrieval to finish, ISO 8601 Duration urn-prefix: ${EDC_SUBMODEL_URN_PREFIX:/urn} # A prefix used to identify URNs correctly in the submodel endpoint address + submodel-suffix: "/$value" timeout: read: PT90S # HTTP read timeout for the submodel client connect: PT90S # HTTP connect timeout for the submodel client diff --git a/irs-api/src/test/java/org/eclipse/tractusx/irs/WiremockSupport.java b/irs-api/src/test/java/org/eclipse/tractusx/irs/WiremockSupport.java index 47ce8f4fa1..00b0000a76 100644 --- a/irs-api/src/test/java/org/eclipse/tractusx/irs/WiremockSupport.java +++ b/irs-api/src/test/java/org/eclipse/tractusx/irs/WiremockSupport.java @@ -55,6 +55,9 @@ import org.eclipse.tractusx.irs.testing.wiremock.SubmodelFacadeWiremockSupport; public class WiremockSupport { + + public static final String SUBMODEL_SUFFIX = "/\\$value"; + public static EndpointDataReference createEndpointDataReference(final String contractAgreementId) { final EDRAuthCode edrAuthCode = EDRAuthCode.builder() .cid(contractAgreementId) @@ -126,7 +129,7 @@ static void verifyNegotiationCalls(final int times) { } static void successfulDataRequests(final String assetId, final String fileName) { - stubFor(get(urlPathMatching(DtrWiremockSupport.DATAPLANE_PUBLIC_PATH + "/" + assetId)).willReturn( + stubFor(get(urlPathMatching(DtrWiremockSupport.DATAPLANE_PUBLIC_PATH + "/" + assetId+ SUBMODEL_SUFFIX)).willReturn( responseWithStatus(200).withBodyFile(fileName))); } diff --git a/irs-edc-client/src/main/java/org/eclipse/tractusx/irs/edc/client/EdcConfiguration.java b/irs-edc-client/src/main/java/org/eclipse/tractusx/irs/edc/client/EdcConfiguration.java index a5dc23d0ff..68c1b5f46e 100644 --- a/irs-edc-client/src/main/java/org/eclipse/tractusx/irs/edc/client/EdcConfiguration.java +++ b/irs-edc-client/src/main/java/org/eclipse/tractusx/irs/edc/client/EdcConfiguration.java @@ -105,6 +105,7 @@ public static class SubmodelConfig { private Duration requestTtl; private String urnPrefix; + private String submodelSuffix; } } diff --git a/irs-edc-client/src/main/java/org/eclipse/tractusx/irs/edc/client/EdcSubmodelFacade.java b/irs-edc-client/src/main/java/org/eclipse/tractusx/irs/edc/client/EdcSubmodelFacade.java index 8913c52127..8a97831019 100644 --- a/irs-edc-client/src/main/java/org/eclipse/tractusx/irs/edc/client/EdcSubmodelFacade.java +++ b/irs-edc-client/src/main/java/org/eclipse/tractusx/irs/edc/client/EdcSubmodelFacade.java @@ -56,7 +56,9 @@ public class EdcSubmodelFacade { public SubmodelDescriptor getSubmodelPayload(final String connectorEndpoint, final String submodelDataplaneUrl, final String assetId, final String bpn) throws EdcClientException { try { - return client.getSubmodelPayload(connectorEndpoint, submodelDataplaneUrl, assetId, bpn) + final String fullSubmodelDataplaneUrl = submodelDataplaneUrl + config.getSubmodel().getSubmodelSuffix(); + log.debug("Requesting Submodel for URL: '{}'", fullSubmodelDataplaneUrl); + return client.getSubmodelPayload(connectorEndpoint, fullSubmodelDataplaneUrl, assetId, bpn) .get(config.getAsyncTimeoutMillis(), TimeUnit.MILLISECONDS); } catch (InterruptedException e) { log.debug("InterruptedException occurred.", e); From 392b9fdcc30d31f6fa6cd27c54b2f493adb2a330 Mon Sep 17 00:00:00 2001 From: jhartmann Date: Fri, 24 May 2024 15:10:51 +0200 Subject: [PATCH 2/3] fix(edc-client): Add property "submodel-postfix" to be prefixed for submodel call --- charts/item-relationship-service/CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/charts/item-relationship-service/CHANGELOG.md b/charts/item-relationship-service/CHANGELOG.md index 6b31eaa411..a445f38c60 100644 --- a/charts/item-relationship-service/CHANGELOG.md +++ b/charts/item-relationship-service/CHANGELOG.md @@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added +- Added configuration property `edc.submodel.suffix`. + ## [7.1.3] - 2024-05-17 ### Changed From 3259c914bca7f8bc28958b909bec49ceba3c3109 Mon Sep 17 00:00:00 2001 From: jhartmann Date: Mon, 27 May 2024 16:26:59 +0200 Subject: [PATCH 3/3] chore(docs): prepare hotfix release 5.1.4 --- CHANGELOG.md | 6 +++++- charts/item-relationship-service/CHANGELOG.md | 7 +++++++ charts/item-relationship-service/Chart.yaml | 4 ++-- docs/src/api/irs-api.yaml | 2 +- .../main/java/org/eclipse/tractusx/irs/IrsApplication.java | 2 +- 5 files changed, 16 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 87e97f1883..fffb26cdfc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,9 @@ _**For better traceability add the corresponding GitHub issue number in each cha ## [Unreleased] + +## [5.1.4] - 2024-05-27 + ### Fixed - Fixed submodel request path by introducing configuration property `irs-edc-client.submodel.submodel-suffix` which will @@ -671,7 +674,8 @@ _**For better traceability add the corresponding GitHub issue number in each cha - **Select Aspects you need** You are able to select the needed aspects for which you want to collect the correct endpoint information. -[Unreleased]: https://github.com/eclipse-tractusx/item-relationship-service/compare/5.1.3...HEAD +[Unreleased]: https://github.com/eclipse-tractusx/item-relationship-service/compare/5.1.4...HEAD +[5.1.4]: https://github.com/eclipse-tractusx/item-relationship-service/compare/5.1.3...5.1.4 [5.1.3]: https://github.com/eclipse-tractusx/item-relationship-service/compare/5.1.2...5.1.3 [5.1.2]: https://github.com/eclipse-tractusx/item-relationship-service/compare/5.1.1...5.1.2 [5.1.1]: https://github.com/eclipse-tractusx/item-relationship-service/compare/5.1.0...5.1.1 diff --git a/charts/item-relationship-service/CHANGELOG.md b/charts/item-relationship-service/CHANGELOG.md index a445f38c60..3392764545 100644 --- a/charts/item-relationship-service/CHANGELOG.md +++ b/charts/item-relationship-service/CHANGELOG.md @@ -6,9 +6,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] + +## [7.1.4] - 2024-05-27 + ### Added - Added configuration property `edc.submodel.suffix`. +### Changed + +- Update IRS version to 5.1.4 + ## [7.1.3] - 2024-05-17 ### Changed diff --git a/charts/item-relationship-service/Chart.yaml b/charts/item-relationship-service/Chart.yaml index b505b6030b..5eb5360ab9 100644 --- a/charts/item-relationship-service/Chart.yaml +++ b/charts/item-relationship-service/Chart.yaml @@ -35,12 +35,12 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 7.1.3 +version: 7.1.4 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "5.1.3" +appVersion: "5.1.4" dependencies: - name: common repository: https://charts.bitnami.com/bitnami diff --git a/docs/src/api/irs-api.yaml b/docs/src/api/irs-api.yaml index 9b352a415d..a9c9cdb401 100644 --- a/docs/src/api/irs-api.yaml +++ b/docs/src/api/irs-api.yaml @@ -3,7 +3,7 @@ info: description: The API of the Item Relationship Service (IRS) for retrieving item graphs along the value chain of CATENA-X partners. title: IRS API - version: 5.1.3 + version: 5.1.4 servers: - url: http://localhost:8080 security: diff --git a/irs-api/src/main/java/org/eclipse/tractusx/irs/IrsApplication.java b/irs-api/src/main/java/org/eclipse/tractusx/irs/IrsApplication.java index 852835ad63..e37f31b068 100644 --- a/irs-api/src/main/java/org/eclipse/tractusx/irs/IrsApplication.java +++ b/irs-api/src/main/java/org/eclipse/tractusx/irs/IrsApplication.java @@ -59,7 +59,7 @@ public class IrsApplication { /** * The IRS API version. */ - public static final String API_VERSION = "5.1.3"; + public static final String API_VERSION = "5.1.4"; /** * The URL prefix for IRS API URLs.