Skip to content

Commit

Permalink
Revert "feat: 69 feat bump version" (#95)
Browse files Browse the repository at this point in the history
Revert "feat: 69 feat bump version (#92)"

This reverts commit d69a699.
  • Loading branch information
mspiekermann authored Nov 11, 2024
1 parent d69a699 commit d4c3ec3
Show file tree
Hide file tree
Showing 8 changed files with 75 additions and 112 deletions.
2 changes: 0 additions & 2 deletions e2e-tests/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ plugins {

dependencies {
testImplementation(libs.edc.junit)
testImplementation(libs.edc.lib.transform)
testImplementation(libs.edc.transform.dpf.signaling)
testImplementation(testFixtures(libs.edc.testfixtures.managementapi))
testImplementation(libs.restAssured)
testImplementation(libs.awaitility)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,17 @@
package com.huawei.cloud.fixtures;

import com.fasterxml.jackson.annotation.JsonCreator;
import jakarta.json.JsonArray;
import org.eclipse.edc.connector.controlplane.test.system.utils.Participant;

import java.net.URI;
import java.time.Duration;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.atomic.AtomicReference;

import static io.restassured.http.ContentType.JSON;
import static org.awaitility.Awaitility.await;
import static org.eclipse.edc.boot.BootServicesExtension.PARTICIPANT_ID;
import static org.eclipse.edc.util.io.Ports.getFreePort;

Expand Down Expand Up @@ -55,7 +59,6 @@ public Map<String, String> controlPlaneConfiguration() {
put("web.http.public.port", String.valueOf(getFreePort()));
put("edc.dsp.callback.address", protocolEndpoint.getUrl().toString());
put("edc.connector.name", name);
put("edc.component.id", "connector-test");
put("edc.dataplane.token.validation.endpoint", "http://token-validation.com");
put("edc.dpf.selector.url", "http://does-this-matter.com");
put("edc.huawei.iam.endpoint", IAM_OTC_CLOUD_URL);
Expand All @@ -65,6 +68,25 @@ public Map<String, String> controlPlaneConfiguration() {
};
}

public JsonArray getPolicies() {

AtomicReference<JsonArray> array = new AtomicReference<>();
await().atMost(TIMEOUT).untilAsserted(() -> {
var response = managementEndpoint.baseRequest()
.contentType(JSON)
.when()
.post("/v2/policydefinitions/request")
.then()
.log().ifError()
.statusCode(200)
.extract().body().asString();

array.set(objectMapper.readValue(response, JsonArray.class));
});

return array.get();
}

public static final class Builder extends Participant.Builder<HuaweiParticipant, Builder> {

private Builder() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,17 @@

package com.huawei.cloud.tests;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.huawei.cloud.fixtures.HuaweiParticipant;
import com.huawei.cloud.obs.ObsBucketSchema;
import com.huawei.cloud.obs.TestFunctions;
import com.obs.services.ObsClient;
import io.restassured.http.ContentType;
import jakarta.json.Json;
import jakarta.json.JsonObject;
import org.eclipse.edc.connector.api.signaling.transform.from.JsonObjectFromDataFlowStartMessageTransformer;
import org.eclipse.edc.connector.api.signaling.transform.to.JsonObjectToDataFlowResponseMessageTransformer;
import org.eclipse.edc.jsonld.util.JacksonJsonLd;
import org.eclipse.edc.junit.annotations.EndToEndTest;
import org.eclipse.edc.junit.extensions.EdcClassRuntimesExtension;
import org.eclipse.edc.junit.extensions.EdcRuntimeExtension;
import org.eclipse.edc.spi.result.Failure;
import org.eclipse.edc.spi.types.domain.DataAddress;
import org.eclipse.edc.spi.types.domain.transfer.DataFlowStartMessage;
import org.eclipse.edc.spi.types.domain.transfer.FlowType;
import org.eclipse.edc.spi.types.domain.transfer.TransferType;
import org.eclipse.edc.transform.TypeTransformerRegistryImpl;
import org.eclipse.edc.transform.spi.TypeTransformerRegistry;
import org.eclipse.edc.transform.transformer.dspace.from.JsonObjectFromDataAddressDspaceTransformer;
import org.eclipse.edc.transform.transformer.dspace.to.JsonObjectToDataAddressDspaceTransformer;
import org.jetbrains.annotations.NotNull;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;
Expand All @@ -46,12 +33,9 @@
import org.testcontainers.junit.jupiter.Testcontainers;

import java.io.IOException;
import java.net.URI;
import java.nio.file.Files;
import java.time.Duration;
import java.util.Map;
import java.util.UUID;
import java.util.function.Function;

import static io.restassured.RestAssured.given;
import static org.assertj.core.api.Assertions.assertThat;
Expand All @@ -78,7 +62,6 @@ public class ObsTransferEndToEndTest {
private static final String CONSUMER_SK = "consumer-sk";
private static final String PROVIDER_AK = "provider-ak";
private static final String PROVIDER_SK = "provider-sk";

@RegisterExtension
static EdcClassRuntimesExtension runtimes = new EdcClassRuntimesExtension(
new EdcRuntimeExtension(
Expand Down Expand Up @@ -109,23 +92,13 @@ public class ObsTransferEndToEndTest {
private String consumerEndpoint;
private String providerEndpoint;

private final TypeTransformerRegistry registry = new TypeTransformerRegistryImpl();
private ObjectMapper mapper;

@BeforeEach
void setup() {
consumerEndpoint = "http://localhost:%s".formatted(consumerContainer.getMappedPort(MINIO_CONTAINER_PORT));
providerEndpoint = "http://localhost:%s".formatted(providerContainer.getMappedPort(MINIO_CONTAINER_PORT));

providerClient = TestFunctions.createClient(PROVIDER_AK, PROVIDER_SK, providerEndpoint);
consumerClient = TestFunctions.createClient(CONSUMER_AK, CONSUMER_SK, consumerEndpoint);

var builderFactory = Json.createBuilderFactory(Map.of());
mapper = JacksonJsonLd.createObjectMapper();
registry.register(new JsonObjectFromDataFlowStartMessageTransformer(builderFactory, mapper));
registry.register(new JsonObjectFromDataAddressDspaceTransformer(builderFactory, mapper));
registry.register(new JsonObjectToDataAddressDspaceTransformer());
registry.register(new JsonObjectToDataFlowResponseMessageTransformer());
}

@Test
Expand All @@ -141,14 +114,12 @@ void transfer_singleFile() throws IOException {
consumerClient.createBucket(destBucket);

var flowRequest = createFlowRequest(destBucket, consumerEndpoint, srcBucket, TESTFILE_NAME, providerEndpoint).build();
var url = PROVIDER.getControlEndpoint().getUrl().toString() + "/v1/dataflows";

var startMessage = registry.transform(flowRequest, JsonObject.class).orElseThrow(failTest());
var url = PROVIDER.getControlEndpoint().getUrl().toString() + "/transfer";

given().when()
.baseUri(url)
.contentType(ContentType.JSON)
.body(startMessage)
.body(flowRequest)
.post()
.then()
.statusCode(200)
Expand Down Expand Up @@ -177,22 +148,17 @@ void transfer_multipleFilesWithPrefix() throws IOException {
consumerClient.createBucket(destBucket);

var flowRequest = createFlowRequest(destBucket, consumerEndpoint, srcBucket, "file", providerEndpoint).build();
var url = PROVIDER.getControlEndpoint().getUrl().toString() + "/v1/dataflows";
var url = PROVIDER.getControlEndpoint().getUrl().toString() + "/transfer";


var startMessage = registry.transform(flowRequest, JsonObject.class).orElseThrow(failTest());

var response = given().when()
given().when()
.baseUri(url)
.contentType(ContentType.JSON)
.body(startMessage)
.body(flowRequest)
.post()
.then()
.statusCode(200)
.log().all(true);

System.out.println(response);

await().pollInterval(Duration.ofSeconds(2))
.atMost(Duration.ofSeconds(60))
.untilAsserted(() -> assertThat(consumerClient.listObjects(destBucket).getObjects())
Expand All @@ -204,23 +170,18 @@ void transfer_multipleFilesWithPrefix() throws IOException {
}

private DataFlowStartMessage.Builder createFlowRequest(String consumerBucket, String consumerEndpoint, String providerBucket, String providerObjectKey, String providerEndpoint) {
var id = UUID.randomUUID().toString();
return DataFlowStartMessage.Builder.newInstance()
.processId("processId-" + id)
.id("test-request")
.sourceDataAddress(DataAddress.Builder.newInstance()
.type(ObsBucketSchema.TYPE)
.keyName(TESTFILE_NAME)
.property(ObsBucketSchema.BUCKET_NAME, providerBucket)
.property(ObsBucketSchema.KEY_PREFIX, providerObjectKey)
.property(ObsBucketSchema.ACCESS_KEY_ID, PROVIDER_AK)
.property(ObsBucketSchema.SECRET_ACCESS_KEY, PROVIDER_SK)
.property(ObsBucketSchema.ENDPOINT, providerEndpoint)
.build())
.transferType(new TransferType(ObsBucketSchema.TYPE, FlowType.PUSH))
.participantId("participantId")
.assetId("assetId")
.callbackAddress(URI.create("http://localhost"))
.agreementId("agreementId")
.type(ObsBucketSchema.TYPE)
.keyName(TESTFILE_NAME)
.property(ObsBucketSchema.BUCKET_NAME, providerBucket)
.property(ObsBucketSchema.KEY_PREFIX, providerObjectKey)
.property(ObsBucketSchema.ACCESS_KEY_ID, PROVIDER_AK)
.property(ObsBucketSchema.SECRET_ACCESS_KEY, PROVIDER_SK)
.property(ObsBucketSchema.ENDPOINT, providerEndpoint)
.build()
)
.destinationDataAddress(DataAddress.Builder.newInstance()
.type(ObsBucketSchema.TYPE)
.keyName(TESTFILE_NAME)
Expand All @@ -229,12 +190,8 @@ private DataFlowStartMessage.Builder createFlowRequest(String consumerBucket, St
.property(ObsBucketSchema.SECRET_ACCESS_KEY, CONSUMER_SK)
.property(ObsBucketSchema.ENDPOINT, consumerEndpoint)
.build()
);
}

@NotNull
private Function<Failure, AssertionError> failTest() {
return f -> new AssertionError(f.getFailureDetail());
)
.processId("test-process-id").flowType(FlowType.PUSH);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,10 @@

package com.huawei.cloud.provision.obs;

import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder;
import org.eclipse.edc.connector.controlplane.transfer.spi.types.ResourceDefinition;

import java.util.Objects;

@JsonTypeName("dataspaceconnector:obsresourcedefinition")
@JsonDeserialize(builder = ObsResourceDefinition.Builder.class)
public class ObsResourceDefinition extends ResourceDefinition {

private String endpoint;
Expand All @@ -47,7 +42,6 @@ public Builder toBuilder() {
.endpoint(endpoint);
}

@JsonPOJOBuilder(withPrefix = "")
public static class Builder extends ResourceDefinition.Builder<ObsResourceDefinition, Builder> {

private Builder() {
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#

group=com.huawei.cloud
version=0.11.0-SNAPSHOT
version=0.8.2-SNAPSHOT
# configure the build:
# used for publishing artifacts and plugins
hcScmConnection=scm:git:[email protected]:huawei-dataspace-components/components.git
Expand Down
35 changes: 10 additions & 25 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@ format.version = "1.1"

[versions]
awaitility = "4.2.2"
bouncyCastle-jdk18on = "1.79"
edc = "0.11.0-SNAPSHOT"
bouncyCastle-jdk18on = "1.78.1"
edc = "0.8.2-SNAPSHOT"
failsafe = "3.3.2"
httpMockServer = "5.15.0"
jakarta-json = "2.0.1"
junit = "5.11.3"
mockito = "5.2.0"
nimbus = "9.45"
nimbus = "9.41.2"
restAssured = "5.4.0"
rsApi = "4.0.0"
testcontainers = "1.20.3"
testcontainers = "1.20.2"
huawei-obs = "3.24.9"
huawei-iam = "3.1.120"
huawei-dws = "8.5.0-200"
huawei-iam = "3.1.115"
huawei-dws = "8.3.1.200-200"

[libraries]

Expand All @@ -41,16 +41,16 @@ edc-core-catalog = { module = "org.eclipse.edc:catalog-core", version.ref = "edc
edc-core-jersey = { module = "org.eclipse.edc:jersey-core", version.ref = "edc" }
edc-core-jetty = { module = "org.eclipse.edc:jetty-core", version.ref = "edc" }
edc-core-jwt = { module = "org.eclipse.edc:jwt-core", version.ref = "edc" }
edc-core-token = { module = "org.eclipse.edc:token-core", version.ref = "edc" }
edc-dpf-framework = { module = "org.eclipse.edc:data-plane-framework", version.ref = "edc" }
edc-dpf-core = { module = "org.eclipse.edc:data-plane-core", version.ref = "edc" }
edc-dpf-transfer = { module = "org.eclipse.edc:transfer-data-plane-signaling", version.ref = "edc" }
edc-dpf-selector-core = { module = "org.eclipse.edc:data-plane-selector-core", version.ref = "edc" }
edc-dpf-selector-spi = { module = "org.eclipse.edc:data-plane-selector-spi", version.ref = "edc" }
edc-dpf-selector-api = { module = "org.eclipse.edc:data-plane-selector-api", version.ref = "edc" }
edc-dpf-client = { module = "org.eclipse.edc:data-plane-client", version.ref = "edc" }
edc-dpf-http = { module = "org.eclipse.edc:data-plane-http", version.ref = "edc" }
edc-dpf-http-oauth2 = { module = "org.eclipse.edc:data-plane-http-oauth2", version.ref = "edc" }
edc-dpf-iam = { module = "org.eclipse.edc:data-plane-iam", version.ref = "edc" }
edc-dpf-api = { module = "org.eclipse.edc:data-plane-control-api", version.ref = "edc" }
edc-dpf-util = { module = "org.eclipse.edc:data-plane-util", version.ref = "edc" }
edc-dpf-self-registration = { module = "org.eclipse.edc:data-plane-self-registration", version.ref = "edc" }
edc-ext-azure-cosmos-core = { module = "org.eclipse.edc:azure-cosmos-core", version.ref = "edc" }
Expand Down Expand Up @@ -92,26 +92,11 @@ edc-transfer-httppull-receiver = { module = "org.eclipse.edc:transfer-pull-http-
edc-transfer-httppull-receiver-dynamic = { module = "org.eclipse.edc:transfer-pull-http-dynamic-receiver", version.ref = "edc" }
edc-util = { module = "org.eclipse.edc:util", version.ref = "edc" }
edc-testfixtures-managementapi = { module = "org.eclipse.edc:management-api-test-fixtures", version.ref = "edc" }

edc-lib-util = { module = "org.eclipse.edc:util-lib", version.ref = "edc" }

# Control Plane implementations
edc-controlplane-callback-dispatcher-event = { module = "org.eclipse.edc:callback-event-dispatcher", version.ref = "edc" }
edc-controlplane-callback-dispatcher-http = { module = "org.eclipse.edc:callback-http-dispatcher", version.ref = "edc" }
edc-controlplane-edr-core-store = { module= "org.eclipse.edc:edr-store-core", version.ref = "edc" }

# Data-Plane Signaling
edc-dpf-signaling = { module = "org.eclipse.edc:transfer-data-plane-signaling", version.ref = "edc" }
edc-dpf-signaling-api = { module = "org.eclipse.edc:data-plane-signaling-api", version.ref = "edc" }
edc-dpf-public-api = { module = "org.eclipse.edc:data-plane-public-api-v2", version.ref = "edc" }


# edc-transform
edc-transform-dpf-signaling = { module = "org.eclipse.edc:data-plane-signaling-transform", version.ref = "edc" }

# edc-lib
edc-lib-util = { module = "org.eclipse.edc:util-lib", version.ref = "edc" }
edc-lib-transform = { module = "org.eclipse.edc:transform-lib", version.ref = "edc" }


# third-party deps
awaitility = { module = "org.awaitility:awaitility", version.ref = "awaitility" }
Expand All @@ -134,7 +119,7 @@ huawei-iam = { module = "com.huaweicloud.sdk:huaweicloud-sdk-iam", version.ref =
huawei-dws-jdbc = { module = "com.huaweicloud.dws:huaweicloud-dws-jdbc", version.ref = "huawei-dws" }

[bundles]
edc-dpf = ["edc.dpf-signaling","edc.dpf-signaling-api","edc.dpf-public-api", "edc.dpf-selector-core", "edc.spi-dataplane-selector"]
edc-dpf = ["edc.dpf-transfer", "edc.dpf-selector-core", "edc.spi-dataplane-selector"]

[plugins]
shadow = { id = "com.github.johnrengelman.shadow", version = "8.1.1" }
38 changes: 23 additions & 15 deletions launchers/e2e-test/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,35 @@ plugins {

dependencies {


runtimeOnly(project(":extensions:control-plane:provision-obs"))
runtimeOnly(project(":extensions:data-plane:data-plane-obs"))

runtimeOnly(libs.edc.core.connector)
runtimeOnly(libs.edc.core.dataplane)
runtimeOnly(libs.edc.control.api.configuration)
runtimeOnly(libs.edc.core.controlplane.apiclient)
runtimeOnly(libs.edc.dpf.iam)
runtimeOnly(libs.edc.dpf.public.api)
runtimeOnly(libs.edc.ext.http)
runtimeOnly(libs.edc.jsonld)
runtimeOnly(libs.edc.core.token)
runtimeOnly(libs.edc.core.controlplane)
runtimeOnly(libs.edc.core.dataplane)
runtimeOnly(libs.edc.core.connector)
runtimeOnly(libs.edc.config.filesystem)
runtimeOnly(libs.edc.auth.tokenbased)

runtimeOnly(libs.edc.api.management)
runtimeOnly(libs.edc.api.controlplane)
runtimeOnly(libs.edc.dpf.api)
runtimeOnly(libs.edc.dpf.selector.api)
runtimeOnly(libs.edc.api.management.config)
runtimeOnly(libs.edc.api.observability)
runtimeOnly(libs.edc.dsp)
runtimeOnly(libs.edc.spi.jwt)
runtimeOnly(libs.bundles.edc.dpf)
runtimeOnly(libs.edc.iam.mock)
runtimeOnly(libs.edc.api.management)
runtimeOnly(libs.edc.controlplane.edr.core.store)
runtimeOnly(libs.edc.ext.http)
runtimeOnly(libs.edc.controlplane.callback.dispatcher.event)
runtimeOnly(libs.edc.controlplane.callback.dispatcher.http)
runtimeOnly(libs.edc.core.controlplane.apiclient)
runtimeOnly(libs.edc.transfer.dataplane)
runtimeOnly(libs.edc.dpf.self.registration)
runtimeOnly(libs.bundles.edc.dpf)
runtimeOnly(libs.edc.api.controlplane)
runtimeOnly(libs.edc.control.api.configuration)

implementation(libs.edc.spi.core)
runtimeOnly(libs.edc.core.controlplane)
testImplementation(libs.edc.junit)
}

tasks.withType<com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar> {
Expand Down
Loading

0 comments on commit d4c3ec3

Please sign in to comment.