From ab42a0f38b7d18f50fc1e71497399de096788607 Mon Sep 17 00:00:00 2001 From: Enrico Risa Date: Mon, 20 May 2024 16:42:53 +0200 Subject: [PATCH] chore: updates edc to 0.7.0 --- .../templates/deployment-dataplane.yaml | 4 ++ .../values.yaml | 3 ++ .../templates/deployment-dataplane.yaml | 4 ++ charts/tractusx-connector/values.yaml | 3 ++ docs/migration/Version_0.5.x_0.7.x.md | 49 +++++++++++++++++++ .../edc-controlplane-base/build.gradle.kts | 1 + ...ctorConfigurationServiceExtensionTest.java | 15 +++--- .../edr/edr-api-v2/build.gradle.kts | 1 + .../tractusx/edc/api/edr/v2/EdrCacheApi.java | 5 +- .../AbstractIatpConsumerPullTest.java | 2 +- .../tokenrefresh/e2e/RuntimeConfig.java | 10 ++-- gradle/libs.versions.toml | 3 +- .../src/test/resources/tenants.properties | 4 ++ 13 files changed, 87 insertions(+), 17 deletions(-) diff --git a/charts/tractusx-connector-azure-vault/templates/deployment-dataplane.yaml b/charts/tractusx-connector-azure-vault/templates/deployment-dataplane.yaml index fbddb75bc..1f2619596 100644 --- a/charts/tractusx-connector-azure-vault/templates/deployment-dataplane.yaml +++ b/charts/tractusx-connector-azure-vault/templates/deployment-dataplane.yaml @@ -161,6 +161,10 @@ spec: value: {{ .Values.dataplane.endpoints.signaling.port | quote }} - name: "WEB_HTTP_SIGNALING_PATH" value: {{ .Values.dataplane.endpoints.signaling.path | quote }} + - name: "WEB_HTTP_CONTROL_PORT" + value: {{ .Values.dataplane.endpoints.control.port | quote }} + - name: "WEB_HTTP_CONTROL_PATH" + value: {{ .Values.dataplane.endpoints.control.path | quote }} - name: "WEB_HTTP_PUBLIC_PORT" value: {{ .Values.dataplane.endpoints.public.port | quote }} - name: "WEB_HTTP_PUBLIC_PATH" diff --git a/charts/tractusx-connector-azure-vault/values.yaml b/charts/tractusx-connector-azure-vault/values.yaml index 56c8bb9be..2e1adbbea 100644 --- a/charts/tractusx-connector-azure-vault/values.yaml +++ b/charts/tractusx-connector-azure-vault/values.yaml @@ -358,6 +358,9 @@ dataplane: signaling: port: 8083 path: /api/signaling + control: + port: 8084 + path: /api/control proxy: port: 8186 path: /proxy diff --git a/charts/tractusx-connector/templates/deployment-dataplane.yaml b/charts/tractusx-connector/templates/deployment-dataplane.yaml index 1b633269b..16f2b8059 100644 --- a/charts/tractusx-connector/templates/deployment-dataplane.yaml +++ b/charts/tractusx-connector/templates/deployment-dataplane.yaml @@ -161,6 +161,10 @@ spec: value: {{ .Values.dataplane.endpoints.signaling.port | quote }} - name: "WEB_HTTP_SIGNALING_PATH" value: {{ .Values.dataplane.endpoints.signaling.path | quote }} + - name: "WEB_HTTP_CONTROL_PORT" + value: {{ .Values.dataplane.endpoints.control.port | quote }} + - name: "WEB_HTTP_CONTROL_PATH" + value: {{ .Values.dataplane.endpoints.control.path | quote }} - name: "WEB_HTTP_PUBLIC_PORT" value: {{ .Values.dataplane.endpoints.public.port | quote }} - name: "WEB_HTTP_PUBLIC_PATH" diff --git a/charts/tractusx-connector/values.yaml b/charts/tractusx-connector/values.yaml index 2d434d70c..063e444ec 100644 --- a/charts/tractusx-connector/values.yaml +++ b/charts/tractusx-connector/values.yaml @@ -356,6 +356,9 @@ dataplane: signaling: port: 8083 path: /api/signaling + control: + port: 8084 + path: /api/control proxy: port: 8186 path: /proxy diff --git a/docs/migration/Version_0.5.x_0.7.x.md b/docs/migration/Version_0.5.x_0.7.x.md index 720ab185b..4586c30e1 100644 --- a/docs/migration/Version_0.5.x_0.7.x.md +++ b/docs/migration/Version_0.5.x_0.7.x.md @@ -236,11 +236,60 @@ this [test class](https://github.com/eclipse-tractusx/tractusx-edc/blob/main/edc ## 5. EDC Management API +### 5.0 Policies + +Due to [#4192](https://github.com/eclipse-edc/Connector/issues/4192) and [#4179](https://github.com/eclipse-edc/Connector/issues/4179) + +The `action` and the `leftOperand` field are now represented as `@id` instead of `value` in JSON-LD. + +`action` from: + +```json + { + "odrl:permission": { + "odrl:action": { + "odrl:type": "http://www.w3.org/ns/odrl/2/use" + } + } +} +``` +to: + +```json +{ + "odrl:action": { + "@id": "odrl:use" + } +} +``` + +`leftOperand` from: + +```json +{ + "odrl:leftOperand": "https://w3id.org/catenax/policy/FrameworkAgreement" +} +``` + +to: + +```json +{ + "odrl:leftOperand": { + "@id": "cx-policy:FrameworkAgreement" + } +} +``` + +This is reflected in the `Catalog` as well as in `PolicyDefinition` API. + ### 5.1 Catalog - `counterPartyId` is a **required** property for the catalog request in Tractus-X EDC. It's not enforced currently ( backward compatibility) but if not provided, the IATP flows won't work and thus the catalog request will fail. + + ### 5.2 Transfer Process - `transferType` is a needed property for the transfer request to be working in tx-edc. `transferTypes` are the diff --git a/edc-controlplane/edc-controlplane-base/build.gradle.kts b/edc-controlplane/edc-controlplane-base/build.gradle.kts index 915f73928..6febbd242 100644 --- a/edc-controlplane/edc-controlplane-base/build.gradle.kts +++ b/edc-controlplane/edc-controlplane-base/build.gradle.kts @@ -62,6 +62,7 @@ dependencies { runtimeOnly(libs.edc.api.management) runtimeOnly(libs.edc.api.controlplane) runtimeOnly(libs.edc.api.management.config) + runtimeOnly(libs.edc.api.core) runtimeOnly(libs.edc.api.observability) runtimeOnly(libs.edc.dsp) runtimeOnly(libs.edc.spi.jwt) diff --git a/edc-extensions/dataplane/dataplane-selector-configuration/src/test/java/org/eclipse/tractusx/edc/dataplane/selector/configuration/DataPlaneSelectorConfigurationServiceExtensionTest.java b/edc-extensions/dataplane/dataplane-selector-configuration/src/test/java/org/eclipse/tractusx/edc/dataplane/selector/configuration/DataPlaneSelectorConfigurationServiceExtensionTest.java index 549d23705..5d6efdd89 100644 --- a/edc-extensions/dataplane/dataplane-selector-configuration/src/test/java/org/eclipse/tractusx/edc/dataplane/selector/configuration/DataPlaneSelectorConfigurationServiceExtensionTest.java +++ b/edc-extensions/dataplane/dataplane-selector-configuration/src/test/java/org/eclipse/tractusx/edc/dataplane/selector/configuration/DataPlaneSelectorConfigurationServiceExtensionTest.java @@ -43,6 +43,7 @@ import static org.eclipse.tractusx.edc.dataplane.selector.configuration.DataPlaneSelectorConfigurationServiceExtension.PROPERTIES_SUFFIX; import static org.eclipse.tractusx.edc.dataplane.selector.configuration.DataPlaneSelectorConfigurationServiceExtension.PUBLIC_API_URL_PROPERTY; import static org.eclipse.tractusx.edc.dataplane.selector.configuration.DataPlaneSelectorConfigurationServiceExtension.SOURCE_TYPES_SUFFIX; +import static org.eclipse.tractusx.edc.dataplane.selector.configuration.DataPlaneSelectorConfigurationServiceExtension.TRANSFER_TYPES_SUFFIX; import static org.eclipse.tractusx.edc.dataplane.selector.configuration.DataPlaneSelectorConfigurationServiceExtension.URL_SUFFIX; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; @@ -57,16 +58,16 @@ class DataPlaneSelectorConfigurationServiceExtensionTest { private static final String S3_BUCKET = "s3-bucket"; private static final String BLOB_STORAGE = "blob-storage"; - private static final String LOCAL_FILE_SYSTEM = "local-file-system"; private static final String DATA_PLANE_INSTANCE_ID = "test-plane"; private static final String DATA_PLANE_INSTANCE_URL = "http://127.0.0.1:8080/test"; private static final String DATA_PLANE_INSTANCE_SOURCE_TYPES = "%s, %s".formatted(S3_BUCKET, BLOB_STORAGE); - private static final String DATA_PLANE_INSTANCE_DESTINATION_TYPES = LOCAL_FILE_SYSTEM; + private static final String DATA_PLANE_INSTANCE_TRANSFER_TYPES = "%s".formatted(S3_BUCKET); private static final String URL_KEY = "%s.%s".formatted(DATA_PLANE_INSTANCE_ID, URL_SUFFIX); private static final String SOURCE_TYPES_KEY = "%s.%s".formatted(DATA_PLANE_INSTANCE_ID, SOURCE_TYPES_SUFFIX); private static final String DESTINATION_TYPES_KEY = "%s.%s".formatted(DATA_PLANE_INSTANCE_ID, DESTINATION_TYPES_SUFFIX); + private static final String TRANSFER_TYPES_KEY = "%s.%s".formatted(DATA_PLANE_INSTANCE_ID, TRANSFER_TYPES_SUFFIX); private static final String PROPERTIES_KEY = "%s.%s".formatted(DATA_PLANE_INSTANCE_ID, PROPERTIES_SUFFIX); private final ServiceExtensionContext serviceExtensionContext = mock(); private final DataPlaneSelectorService dataPlaneSelectorService = mock(); @@ -106,12 +107,11 @@ void testInitialize() { .addInstance(argThat(dataPlaneInstance -> { var s3Source = DataAddress.Builder.newInstance().type(S3_BUCKET).build(); var blobSource = DataAddress.Builder.newInstance().type(BLOB_STORAGE).build(); - var fsSink = DataAddress.Builder.newInstance().type(LOCAL_FILE_SYSTEM).build(); return dataPlaneInstance.getId().equals(DATA_PLANE_INSTANCE_ID) && dataPlaneInstance.getUrl().toString().equals(DATA_PLANE_INSTANCE_URL) && - dataPlaneInstance.canHandle(s3Source, fsSink) && - dataPlaneInstance.canHandle(blobSource, fsSink); + dataPlaneInstance.canHandle(s3Source, S3_BUCKET) && + dataPlaneInstance.canHandle(blobSource, S3_BUCKET); })); } @@ -125,7 +125,7 @@ void testWarningOnPropertyMissing(String configKey, String configValue) { extension.initialize(serviceExtensionContext); // one warning config missing, one warning data plane instance skipped - verify(monitor, times(3)).warning(anyString()); + verify(monitor, times(2)).warning(anyString()); } @Test @@ -143,7 +143,8 @@ private Map getConfig() { { put(URL_KEY, DATA_PLANE_INSTANCE_URL); put(SOURCE_TYPES_KEY, DATA_PLANE_INSTANCE_SOURCE_TYPES); - put(DESTINATION_TYPES_KEY, DATA_PLANE_INSTANCE_DESTINATION_TYPES); + put(TRANSFER_TYPES_KEY, DATA_PLANE_INSTANCE_TRANSFER_TYPES); + put(DESTINATION_TYPES_KEY, S3_BUCKET); put(PROPERTIES_KEY, "{ \"%s\": \"%s\" }".formatted(PUBLIC_API_URL_PROPERTY, DATA_PLANE_INSTANCE_URL)); } }; diff --git a/edc-extensions/edr/edr-api-v2/build.gradle.kts b/edc-extensions/edr/edr-api-v2/build.gradle.kts index 4db499b1c..af362ab50 100644 --- a/edc-extensions/edr/edr-api-v2/build.gradle.kts +++ b/edc-extensions/edr/edr-api-v2/build.gradle.kts @@ -30,6 +30,7 @@ dependencies { implementation(project(":spi:tokenrefresh-spi")) implementation(libs.edc.api.management) + implementation(libs.edc.api.core) implementation(libs.edc.lib.validator) implementation(libs.edc.spi.edrstore) implementation(libs.jakarta.rsApi) diff --git a/edc-extensions/edr/edr-api-v2/src/main/java/org/eclipse/tractusx/edc/api/edr/v2/EdrCacheApi.java b/edc-extensions/edr/edr-api-v2/src/main/java/org/eclipse/tractusx/edc/api/edr/v2/EdrCacheApi.java index dd429b1ef..0a4783503 100644 --- a/edc-extensions/edr/edr-api-v2/src/main/java/org/eclipse/tractusx/edc/api/edr/v2/EdrCacheApi.java +++ b/edc-extensions/edr/edr-api-v2/src/main/java/org/eclipse/tractusx/edc/api/edr/v2/EdrCacheApi.java @@ -31,7 +31,6 @@ import jakarta.json.JsonArray; import jakarta.json.JsonObject; import org.eclipse.edc.api.model.ApiCoreSchema; -import org.eclipse.edc.connector.api.management.configuration.ManagementApiSchema; import org.eclipse.edc.connector.controlplane.api.management.contractnegotiation.ContractNegotiationApi; import org.eclipse.edc.edr.spi.types.EndpointDataReferenceEntry; import org.eclipse.edc.web.spi.ApiErrorDetail; @@ -71,7 +70,7 @@ public interface EdrCacheApi { }, responses = { @ApiResponse(responseCode = "200", description = "The data address", - content = @Content(schema = @Schema(implementation = ManagementApiSchema.DataAddressSchema.class))), + content = @Content(schema = @Schema(implementation = ApiCoreSchema.DataAddressSchema.class))), @ApiResponse(responseCode = "400", description = "Request was malformed, e.g. id was null", content = @Content(array = @ArraySchema(schema = @Schema(implementation = ApiCoreSchema.ApiErrorDetailSchema.class)))), @ApiResponse(responseCode = "404", description = "An EDR data address with the given transfer process ID does not exist", @@ -95,7 +94,7 @@ public interface EdrCacheApi { }, responses = { @ApiResponse(responseCode = "200", description = "The data address", - content = @Content(schema = @Schema(implementation = ManagementApiSchema.DataAddressSchema.class))), + content = @Content(schema = @Schema(implementation = ApiCoreSchema.DataAddressSchema.class))), @ApiResponse(responseCode = "400", description = "Request was malformed, e.g. id was null", content = @Content(array = @ArraySchema(schema = @Schema(implementation = ApiCoreSchema.ApiErrorDetailSchema.class)))), @ApiResponse(responseCode = "404", description = "An EDR data address with the given transfer process ID does not exist", diff --git a/edc-tests/edc-controlplane/iatp-tests/src/test/java/org/eclipse/tractusx/edc/tests/transfer/AbstractIatpConsumerPullTest.java b/edc-tests/edc-controlplane/iatp-tests/src/test/java/org/eclipse/tractusx/edc/tests/transfer/AbstractIatpConsumerPullTest.java index 0ec87e4a3..fa3da5a30 100644 --- a/edc-tests/edc-controlplane/iatp-tests/src/test/java/org/eclipse/tractusx/edc/tests/transfer/AbstractIatpConsumerPullTest.java +++ b/edc-tests/edc-controlplane/iatp-tests/src/test/java/org/eclipse/tractusx/edc/tests/transfer/AbstractIatpConsumerPullTest.java @@ -335,7 +335,7 @@ public Stream provideArguments(ExtensionContext extensionCo return Stream.of( Arguments.of(frameworkPolicy(Map.of(CX_POLICY_NS + "Membership", "active")), "MembershipCredential"), Arguments.of(frameworkPolicy(Map.of(CX_POLICY_NS + "FrameworkAgreement.pcf", "active")), "PCF Use Case (legacy notation)"), - Arguments.of(frameworkPolicy(Map.of(CX_POLICY_NS + "FrameworkAgreement", "pcf")), "PCF Use Case (new notation)"), + Arguments.of(frameworkPolicy(Map.of(CX_POLICY_NS + "FrameworkAgreement", "Pcf")), "PCF Use Case (new notation)"), Arguments.of(frameworkPolicy(Map.of(CX_POLICY_NS + "Dismantler", "active")), "Dismantler Credential"), Arguments.of(frameworkPolicy(Map.of(CX_POLICY_NS + "Dismantler.activityType", "vehicleDismantle")), "Dismantler Cred (activity type)"), Arguments.of(frameworkPolicy(CX_POLICY_NS + "Dismantler.allowedBrands", Operator.IS_ANY_OF, List.of("Moskvich", "Tatra")), "Dismantler allowedBrands (IS_ANY_OF, one intersects)"), diff --git a/edc-tests/edc-dataplane/edc-dataplane-tokenrefresh-tests/src/test/java/org/eclipse/tractusx/edc/dataplane/tokenrefresh/e2e/RuntimeConfig.java b/edc-tests/edc-dataplane/edc-dataplane-tokenrefresh-tests/src/test/java/org/eclipse/tractusx/edc/dataplane/tokenrefresh/e2e/RuntimeConfig.java index 1d4134ecd..57ed0daaf 100644 --- a/edc-tests/edc-dataplane/edc-dataplane-tokenrefresh-tests/src/test/java/org/eclipse/tractusx/edc/dataplane/tokenrefresh/e2e/RuntimeConfig.java +++ b/edc-tests/edc-dataplane/edc-dataplane-tokenrefresh-tests/src/test/java/org/eclipse/tractusx/edc/dataplane/tokenrefresh/e2e/RuntimeConfig.java @@ -35,7 +35,7 @@ public class RuntimeConfig { private final Endpoint publicApi = new Endpoint(URI.create("http://localhost:%d/public".formatted(getFreePort()))); - private final Endpoint signalingApi = new Endpoint(URI.create("http://localhost:%d/signaling".formatted(getFreePort()))); + private final Endpoint controlApi = new Endpoint(URI.create("http://localhost:%d/control".formatted(getFreePort()))); private final Endpoint refreshApi = publicApi; private final Endpoint defaultApi = new Endpoint(URI.create("http://localhost:%d/api".formatted(getFreePort()))); @@ -50,8 +50,8 @@ public Map baseConfig() { put("web.http.port", String.valueOf(defaultApi.url().getPort())); put("web.http.public.path", publicApi.url().getPath()); put("web.http.public.port", String.valueOf(publicApi.url().getPort())); - put("web.http.signaling.path", signalingApi.url().getPath()); - put("web.http.signaling.port", String.valueOf(signalingApi.url().getPort())); + put("web.http.control.path", controlApi.url().getPath()); + put("web.http.control.port", String.valueOf(controlApi.url().getPort())); put("edc.iam.issuer.id", "did:web:" + UUID.randomUUID()); put("edc.iam.sts.oauth.token.url", "http://sts.example.com/token"); put("edc.iam.sts.oauth.client.id", "test-clientid"); @@ -66,8 +66,8 @@ public Endpoint getPublicApi() { return publicApi; } - public Endpoint getSignalingApi() { - return signalingApi; + public Endpoint getControlApi() { + return controlApi; } public Endpoint getRefreshApi() { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 3804c2ea0..02cb950bc 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -2,7 +2,7 @@ format.version = "1.1" [versions] -edc = "0.6.4" +edc = "0.6.5-SNAPSHOT" apache-sshd = "2.12.1" assertj = "3.25.3" awaitility = "4.2.1" @@ -68,6 +68,7 @@ edc-controlplane-callback-staticendpoint = { module = "org.eclipse.edc:callback- edc-junit = { module = "org.eclipse.edc:junit", version.ref = "edc" } edc-api-management-config = { module = "org.eclipse.edc:management-api-configuration", version.ref = "edc" } edc-api-management = { module = "org.eclipse.edc:management-api", version.ref = "edc" } +edc-api-core = { module = "org.eclipse.edc:api-core", version.ref = "edc" } edc-api-management-test-fixtures = { module = "org.eclipse.edc:management-api-test-fixtures", version.ref = "edc" } edc-api-catalog = { module = "org.eclipse.edc:catalog-api", version.ref = "edc" } edc-api-observability = { module = "org.eclipse.edc:api-observability", version.ref = "edc" } diff --git a/samples/multi-tenancy/src/test/resources/tenants.properties b/samples/multi-tenancy/src/test/resources/tenants.properties index 4e072948a..5100eb12d 100644 --- a/samples/multi-tenancy/src/test/resources/tenants.properties +++ b/samples/multi-tenancy/src/test/resources/tenants.properties @@ -22,6 +22,8 @@ edc.tenants.one.web.http.port=18181 edc.tenants.one.web.http.path=/api edc.tenants.one.web.http.protocol.port=18282 edc.tenants.one.web.http.protocol.path=/protocol +edc.tenants.one.web.http.control.port=18283 +edc.tenants.one.web.http.control.path=/control edc.tenants.one.tx.edc.iam.iatp.bdrs.server.url=http://bdrs.test.com edc.tenants.one.edc.iam.issuer.id=did:web:tenant1 edc.tenants.two.edc.any=any @@ -29,5 +31,7 @@ edc.tenants.two.web.http.port=28181 edc.tenants.two.web.http.path=/api edc.tenants.two.web.http.protocol.port=28282 edc.tenants.two.web.http.protocol.path=/protocol +edc.tenants.two.web.http.control.port=28283 +edc.tenants.two.web.http.control.path=/control edc.tenants.two.tx.edc.iam.iatp.bdrs.server.url=http://bdrs.test.com edc.tenants.two.edc.iam.issuer.id=did:web:tenant2