From c4d49f6187006db2b52c615d5a3e67e08c953999 Mon Sep 17 00:00:00 2001 From: Enrico Risa Date: Wed, 31 May 2023 09:42:19 +0200 Subject: [PATCH] chore(deps): update EDC to 0.1.0 (#433) * chore(deps): update EDC to 0.1.0 * chore(deps): bump curl in alpine images --- .../src/main/docker/Dockerfile | 2 +- .../src/main/docker/Dockerfile | 2 +- .../src/main/docker/Dockerfile | 2 +- .../src/main/docker/Dockerfile | 2 +- .../src/main/docker/Dockerfile | 2 +- .../api/cp/adapter/dto/NegotiateEdrRequestDto.java | 8 ++++---- ...onObjectToNegotiateEdrRequestDtoTransformer.java | 6 +++--- ...RequestDtoToNegotiatedEdrRequestTransformer.java | 9 ++------- ...jectToNegotiateEdrRequestDtoTransformerTest.java | 5 ++--- ...uestDtoToNegotiateEdrRequestTransformerTest.java | 4 ++-- gradle.properties | 6 +++--- gradle/libs.versions.toml | 2 +- .../openapi/yaml/control-plane-adapter-api.yaml | 13 ++----------- 13 files changed, 24 insertions(+), 39 deletions(-) diff --git a/edc-controlplane/edc-controlplane-memory-hashicorp-vault/src/main/docker/Dockerfile b/edc-controlplane/edc-controlplane-memory-hashicorp-vault/src/main/docker/Dockerfile index 4ce6c1ef3..82e1dc8f7 100644 --- a/edc-controlplane/edc-controlplane-memory-hashicorp-vault/src/main/docker/Dockerfile +++ b/edc-controlplane/edc-controlplane-memory-hashicorp-vault/src/main/docker/Dockerfile @@ -25,7 +25,7 @@ ENV OTEL_AGENT_LOCATION "https://github.com/open-telemetry/opentelemetry-java-in HEALTHCHECK NONE -RUN apk update && apk add curl=8.1.1-r1 --no-cache +RUN apk update && apk add curl=8.1.2-r0 --no-cache RUN curl -L --proto "=https" -sSf ${OTEL_AGENT_LOCATION} --output /tmp/opentelemetry-javaagent.jar FROM eclipse-temurin:17.0.6_10-jre-alpine diff --git a/edc-controlplane/edc-controlplane-postgresql-azure-vault/src/main/docker/Dockerfile b/edc-controlplane/edc-controlplane-postgresql-azure-vault/src/main/docker/Dockerfile index 1f9b5bd4e..b4faaf422 100644 --- a/edc-controlplane/edc-controlplane-postgresql-azure-vault/src/main/docker/Dockerfile +++ b/edc-controlplane/edc-controlplane-postgresql-azure-vault/src/main/docker/Dockerfile @@ -24,7 +24,7 @@ ENV OTEL_AGENT_LOCATION "https://github.com/open-telemetry/opentelemetry-java-in HEALTHCHECK NONE -RUN apk update && apk add curl=8.1.1-r1 --no-cache +RUN apk update && apk add curl=8.1.2-r0 --no-cache RUN curl -L --proto "=https" -sSf ${OTEL_AGENT_LOCATION} --output /tmp/opentelemetry-javaagent.jar FROM eclipse-temurin:17.0.6_10-jre-alpine diff --git a/edc-controlplane/edc-controlplane-postgresql-hashicorp-vault/src/main/docker/Dockerfile b/edc-controlplane/edc-controlplane-postgresql-hashicorp-vault/src/main/docker/Dockerfile index 1f9b5bd4e..b4faaf422 100644 --- a/edc-controlplane/edc-controlplane-postgresql-hashicorp-vault/src/main/docker/Dockerfile +++ b/edc-controlplane/edc-controlplane-postgresql-hashicorp-vault/src/main/docker/Dockerfile @@ -24,7 +24,7 @@ ENV OTEL_AGENT_LOCATION "https://github.com/open-telemetry/opentelemetry-java-in HEALTHCHECK NONE -RUN apk update && apk add curl=8.1.1-r1 --no-cache +RUN apk update && apk add curl=8.1.2-r0 --no-cache RUN curl -L --proto "=https" -sSf ${OTEL_AGENT_LOCATION} --output /tmp/opentelemetry-javaagent.jar FROM eclipse-temurin:17.0.6_10-jre-alpine diff --git a/edc-dataplane/edc-dataplane-azure-vault/src/main/docker/Dockerfile b/edc-dataplane/edc-dataplane-azure-vault/src/main/docker/Dockerfile index 63957820e..32add3db5 100644 --- a/edc-dataplane/edc-dataplane-azure-vault/src/main/docker/Dockerfile +++ b/edc-dataplane/edc-dataplane-azure-vault/src/main/docker/Dockerfile @@ -24,7 +24,7 @@ ENV OTEL_AGENT_LOCATION "https://github.com/open-telemetry/opentelemetry-java-in HEALTHCHECK NONE -RUN apk update && apk add curl=8.1.1-r1 --no-cache +RUN apk update && apk add curl=8.1.2-r0 --no-cache RUN curl -L --proto "=https" -sSf ${OTEL_AGENT_LOCATION} --output /tmp/opentelemetry-javaagent.jar FROM eclipse-temurin:17.0.6_10-jre-alpine diff --git a/edc-dataplane/edc-dataplane-hashicorp-vault/src/main/docker/Dockerfile b/edc-dataplane/edc-dataplane-hashicorp-vault/src/main/docker/Dockerfile index 63957820e..32add3db5 100644 --- a/edc-dataplane/edc-dataplane-hashicorp-vault/src/main/docker/Dockerfile +++ b/edc-dataplane/edc-dataplane-hashicorp-vault/src/main/docker/Dockerfile @@ -24,7 +24,7 @@ ENV OTEL_AGENT_LOCATION "https://github.com/open-telemetry/opentelemetry-java-in HEALTHCHECK NONE -RUN apk update && apk add curl=8.1.1-r1 --no-cache +RUN apk update && apk add curl=8.1.2-r0 --no-cache RUN curl -L --proto "=https" -sSf ${OTEL_AGENT_LOCATION} --output /tmp/opentelemetry-javaagent.jar FROM eclipse-temurin:17.0.6_10-jre-alpine diff --git a/edc-extensions/control-plane-adapter-api/src/main/java/org/eclipse/tractusx/edc/api/cp/adapter/dto/NegotiateEdrRequestDto.java b/edc-extensions/control-plane-adapter-api/src/main/java/org/eclipse/tractusx/edc/api/cp/adapter/dto/NegotiateEdrRequestDto.java index d3523a31d..d37e618d4 100644 --- a/edc-extensions/control-plane-adapter-api/src/main/java/org/eclipse/tractusx/edc/api/cp/adapter/dto/NegotiateEdrRequestDto.java +++ b/edc-extensions/control-plane-adapter-api/src/main/java/org/eclipse/tractusx/edc/api/cp/adapter/dto/NegotiateEdrRequestDto.java @@ -16,8 +16,8 @@ import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotNull; -import org.eclipse.edc.api.model.CallbackAddressDto; import org.eclipse.edc.connector.api.management.contractnegotiation.model.ContractOfferDescription; +import org.eclipse.edc.spi.types.domain.callback.CallbackAddress; import java.util.ArrayList; import java.util.List; @@ -46,7 +46,7 @@ public class NegotiateEdrRequestDto { @NotNull(message = "offer cannot be null") private ContractOfferDescription offer; - private List callbackAddresses = new ArrayList<>(); + private List callbackAddresses = new ArrayList<>(); private NegotiateEdrRequestDto() { @@ -68,7 +68,7 @@ public String getProviderId() { return providerId; } - public List getCallbackAddresses() { + public List getCallbackAddresses() { return callbackAddresses; } @@ -112,7 +112,7 @@ public Builder providerId(String providerId) { return this; } - public Builder callbackAddresses(List callbackAddresses) { + public Builder callbackAddresses(List callbackAddresses) { dto.callbackAddresses = callbackAddresses; return this; } diff --git a/edc-extensions/control-plane-adapter-api/src/main/java/org/eclipse/tractusx/edc/api/cp/adapter/transform/JsonObjectToNegotiateEdrRequestDtoTransformer.java b/edc-extensions/control-plane-adapter-api/src/main/java/org/eclipse/tractusx/edc/api/cp/adapter/transform/JsonObjectToNegotiateEdrRequestDtoTransformer.java index 234684281..8479852c6 100644 --- a/edc-extensions/control-plane-adapter-api/src/main/java/org/eclipse/tractusx/edc/api/cp/adapter/transform/JsonObjectToNegotiateEdrRequestDtoTransformer.java +++ b/edc-extensions/control-plane-adapter-api/src/main/java/org/eclipse/tractusx/edc/api/cp/adapter/transform/JsonObjectToNegotiateEdrRequestDtoTransformer.java @@ -16,9 +16,9 @@ import jakarta.json.JsonObject; import jakarta.json.JsonValue; -import org.eclipse.edc.api.model.CallbackAddressDto; import org.eclipse.edc.connector.api.management.contractnegotiation.model.ContractOfferDescription; import org.eclipse.edc.jsonld.spi.transformer.AbstractJsonLdTransformer; +import org.eclipse.edc.spi.types.domain.callback.CallbackAddress; import org.eclipse.edc.transform.spi.TransformerContext; import org.eclipse.tractusx.edc.api.cp.adapter.dto.NegotiateEdrRequestDto; import org.jetbrains.annotations.NotNull; @@ -64,8 +64,8 @@ private void setProperties(String key, JsonValue value, NegotiateEdrRequestDto.B transformString(value, builder::providerId, context); break; case EDR_REQUEST_DTO_CALLBACK_ADDRESSES: - var addresses = new ArrayList(); - transformArrayOrObject(value, CallbackAddressDto.class, addresses::add, context); + var addresses = new ArrayList(); + transformArrayOrObject(value, CallbackAddress.class, addresses::add, context); builder.callbackAddresses(addresses); break; case EDR_REQUEST_DTO_OFFER: diff --git a/edc-extensions/control-plane-adapter-api/src/main/java/org/eclipse/tractusx/edc/api/cp/adapter/transform/NegotiateEdrRequestDtoToNegotiatedEdrRequestTransformer.java b/edc-extensions/control-plane-adapter-api/src/main/java/org/eclipse/tractusx/edc/api/cp/adapter/transform/NegotiateEdrRequestDtoToNegotiatedEdrRequestTransformer.java index 25878c0ed..675955af9 100644 --- a/edc-extensions/control-plane-adapter-api/src/main/java/org/eclipse/tractusx/edc/api/cp/adapter/transform/NegotiateEdrRequestDtoToNegotiatedEdrRequestTransformer.java +++ b/edc-extensions/control-plane-adapter-api/src/main/java/org/eclipse/tractusx/edc/api/cp/adapter/transform/NegotiateEdrRequestDtoToNegotiatedEdrRequestTransformer.java @@ -16,17 +16,14 @@ import org.eclipse.edc.api.transformer.DtoTransformer; import org.eclipse.edc.connector.contract.spi.types.offer.ContractOffer; -import org.eclipse.edc.spi.types.domain.callback.CallbackAddress; import org.eclipse.edc.transform.spi.TransformerContext; import org.eclipse.tractusx.edc.api.cp.adapter.dto.NegotiateEdrRequestDto; import org.eclipse.tractusx.edc.spi.cp.adapter.model.NegotiateEdrRequest; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.stream.Collectors; - public class NegotiateEdrRequestDtoToNegotiatedEdrRequestTransformer implements DtoTransformer { - + @Override public Class getInputType() { return NegotiateEdrRequestDto.class; @@ -39,8 +36,6 @@ public Class getOutputType() { @Override public @Nullable NegotiateEdrRequest transform(@NotNull NegotiateEdrRequestDto object, @NotNull TransformerContext context) { - var callbacks = object.getCallbackAddresses().stream().map(c -> context.transform(c, CallbackAddress.class)).collect(Collectors.toList()); - var contractOffer = ContractOffer.Builder.newInstance() .id(object.getOffer().getOfferId()) .assetId(object.getOffer().getAssetId()) @@ -53,7 +48,7 @@ public Class getOutputType() { .connectorAddress(object.getConnectorAddress()) .protocol(object.getProtocol()) .offer(contractOffer) - .callbackAddresses(callbacks) + .callbackAddresses(object.getCallbackAddresses()) .build(); } diff --git a/edc-extensions/control-plane-adapter-api/src/test/java/org/eclipse/tractusx/edc/api/cp/adapter/transform/JsonObjectToNegotiateEdrRequestDtoTransformerTest.java b/edc-extensions/control-plane-adapter-api/src/test/java/org/eclipse/tractusx/edc/api/cp/adapter/transform/JsonObjectToNegotiateEdrRequestDtoTransformerTest.java index 5c52ad494..8cb694632 100644 --- a/edc-extensions/control-plane-adapter-api/src/test/java/org/eclipse/tractusx/edc/api/cp/adapter/transform/JsonObjectToNegotiateEdrRequestDtoTransformerTest.java +++ b/edc-extensions/control-plane-adapter-api/src/test/java/org/eclipse/tractusx/edc/api/cp/adapter/transform/JsonObjectToNegotiateEdrRequestDtoTransformerTest.java @@ -18,7 +18,6 @@ import jakarta.json.JsonArrayBuilder; import jakarta.json.JsonObject; import jakarta.json.JsonValue; -import org.eclipse.edc.api.model.CallbackAddressDto; import org.eclipse.edc.connector.api.management.contractnegotiation.model.ContractOfferDescription; import org.eclipse.edc.connector.api.management.contractnegotiation.model.NegotiationInitiateRequestDto; import org.eclipse.edc.jsonld.TitaniumJsonLd; @@ -93,7 +92,7 @@ void transform() { .events(Set.of("foo", "bar")) .transactional(true) .build()); - when(context.transform(any(CallbackAddress.class), eq(CallbackAddressDto.class))).thenReturn(CallbackAddressDto.Builder.newInstance() + when(context.transform(any(CallbackAddress.class), eq(CallbackAddress.class))).thenReturn(CallbackAddress.Builder.newInstance() .uri("http://test.local") .events(Set.of("foo", "bar")) .transactional(true) @@ -121,7 +120,7 @@ void transform_reportErrors() { .build(); var dto = transformer.transform(jsonLd.expand(jsonObject).getContent(), context); - + assertThat(dto).isNotNull(); verify(context, times(1)).reportProblem(anyString()); } diff --git a/edc-extensions/control-plane-adapter-api/src/test/java/org/eclipse/tractusx/edc/api/cp/adapter/transform/NegotiateEdrRequestDtoToNegotiateEdrRequestTransformerTest.java b/edc-extensions/control-plane-adapter-api/src/test/java/org/eclipse/tractusx/edc/api/cp/adapter/transform/NegotiateEdrRequestDtoToNegotiateEdrRequestTransformerTest.java index f51ba1435..70656ad71 100644 --- a/edc-extensions/control-plane-adapter-api/src/test/java/org/eclipse/tractusx/edc/api/cp/adapter/transform/NegotiateEdrRequestDtoToNegotiateEdrRequestTransformerTest.java +++ b/edc-extensions/control-plane-adapter-api/src/test/java/org/eclipse/tractusx/edc/api/cp/adapter/transform/NegotiateEdrRequestDtoToNegotiateEdrRequestTransformerTest.java @@ -14,7 +14,7 @@ package org.eclipse.tractusx.edc.api.cp.adapter.transform; -import org.eclipse.edc.api.model.CallbackAddressDto; +import org.eclipse.edc.spi.types.domain.callback.CallbackAddress; import org.eclipse.edc.transform.spi.TransformerContext; import org.eclipse.tractusx.edc.api.cp.adapter.dto.NegotiateEdrRequestDto; import org.junit.jupiter.api.Test; @@ -39,7 +39,7 @@ void inputOutputType() { @Test void verify_transform() { - var callback = CallbackAddressDto.Builder.newInstance() + var callback = CallbackAddress.Builder.newInstance() .uri("local://test") .build(); var dto = NegotiateEdrRequestDto.Builder.newInstance() diff --git a/gradle.properties b/gradle.properties index 27222980b..c07b5d60f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,9 +1,9 @@ group=org.eclipse.tractusx.edc version=0.4.1-SNAPSHOT # configure the build: -annotationProcessorVersion=0.1.0-20230529-SNAPSHOT -edcGradlePluginsVersion=0.1.0-20230529-SNAPSHOT -metaModelVersion=0.1.0-20230529-SNAPSHOT +annotationProcessorVersion=0.1.0 +edcGradlePluginsVersion=0.1.0 +metaModelVersion=0.1.0 txScmConnection=scm:git:git@github.com:eclipse-tractusx/tractusx-edc.git txWebsiteUrl=https://github.com/eclipse-tractusx/tractusx-edc.git txScmUrl=https://github.com/eclipse-tractusx/tractusx-edc.git diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 6c76b131a..d077ec00b 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -2,7 +2,7 @@ format.version = "1.1" [versions] -edc = "0.1.0-20230529-SNAPSHOT" +edc = "0.1.0" postgres = "42.6.0" awaitility = "4.2.0" nimbus = "9.31" diff --git a/resources/openapi/yaml/control-plane-adapter-api.yaml b/resources/openapi/yaml/control-plane-adapter-api.yaml index 628b81559..2e35d60e0 100644 --- a/resources/openapi/yaml/control-plane-adapter-api.yaml +++ b/resources/openapi/yaml/control-plane-adapter-api.yaml @@ -150,16 +150,10 @@ components: type: type: string example: null - CallbackAddressDto: + CallbackAddress: type: object example: null properties: - '@context': - type: object - example: null - '@type': - type: string - example: null authCodeId: type: string example: null @@ -179,9 +173,6 @@ components: uri: type: string example: null - required: - - events - - uri Constraint: type: object discriminator: @@ -328,7 +319,7 @@ components: type: array example: null items: - $ref: '#/components/schemas/CallbackAddressDto' + $ref: '#/components/schemas/CallbackAddress' connectorAddress: type: string example: null