Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build (upgrade) edc 0.8.2-SNAPSHOT version #48

Closed
wants to merge 32 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
0ded092
edc 0.8.2 upgrade changes
ahmetuyanikdev Aug 1, 2024
9b3a31a
edc 0.8.2 upgrade changes
ahmetuyanikdev Aug 5, 2024
493c235
edc 0.8.2 upgrade changes fixture change
ahmetuyanikdev Aug 6, 2024
dee97bc
edc 0.8.2 upgrade changes Otc request change
ahmetuyanikdev Aug 7, 2024
5765836
edc 0.8.2 upgrade changes Otc request change
ahmetuyanikdev Aug 8, 2024
3d6a88e
edc 0.8.2 upgrade changes Otc request change
ahmetuyanikdev Aug 8, 2024
1a00e3d
edc 0.8.2 upgrade test change
ahmetuyanikdev Aug 13, 2024
3c7a646
test change
ahmetuyanikdev Aug 13, 2024
a598a1b
edc 0.8.2 upgrade test change
ahmetuyanikdev Aug 13, 2024
a331f90
conf. fix
ahmetuyanikdev Aug 13, 2024
62c412d
test change
ahmetuyanikdev Aug 14, 2024
2dfc96b
test changes
Aug 14, 2024
50e8aee
test changes
Aug 15, 2024
f854e30
test changes
Aug 15, 2024
9deaea6
test changes
Aug 16, 2024
1e3f1e9
Merge branch 'main' into edc-upgrade-test
Aug 19, 2024
94587d3
provider push scenario
Aug 19, 2024
afca02c
fix checkstyle issues
Aug 20, 2024
421718a
build issue fix
ahmetuyanikdev Aug 21, 2024
7b701dc
build issue fix
ahmetuyanikdev Aug 21, 2024
816bdec
Merge branch 'eclipse-edc:main' into main
ahmetuyanikdev Aug 21, 2024
48d20c1
Merge branch 'main' into edc-upgrade-test
ahmetuyanikdev Aug 21, 2024
4db9d9f
Merge branch 'eclipse-edc:main' into main
ahmetuyanikdev Aug 22, 2024
3b29d72
Merge branch 'main' of https://github.com/ahmetuyanikdev/Technology-H…
ahmetuyanikdev Aug 22, 2024
f752e02
Merge branch 'main' into provider-push
ahmetuyanikdev Aug 22, 2024
68c9d1f
Merge branch 'eclipse-edc:main' into main
ahmetuyanikdev Sep 2, 2024
9b03aaa
removed unnecessary properties
ahmetuyanikdev Sep 2, 2024
f19c0c8
Merge branch 'main' into provider-push
ahmetuyanikdev Sep 2, 2024
98f39fb
refactored test case
ahmetuyanikdev Sep 3, 2024
922be8b
added transfer types
ahmetuyanikdev Sep 3, 2024
9f042e2
refactored testcase and moved delete inside try catch
ahmetuyanikdev Sep 3, 2024
d50a7eb
test assertion message fix
ahmetuyanikdev Sep 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 4 additions & 21 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,20 @@ plugins {

val hcScmUrl: String by project
val hcScmConnection: String by project
val annotationProcessorVersion: String by project
val metaModelVersion: String by project


buildscript {
dependencies {
val edcGradlePluginsVersion: String by project
classpath("org.eclipse.edc.edc-build:org.eclipse.edc.edc-build.gradle.plugin:${edcGradlePluginsVersion}")
val version: String by project
classpath("org.eclipse.edc.edc-build:org.eclipse.edc.edc-build.gradle.plugin:${version}")
}
}

allprojects {
apply(plugin = "org.eclipse.edc.edc-build")

// configure which version of the annotation processor to use. defaults to the same version as the plugin
configure<org.eclipse.edc.plugins.autodoc.AutodocExtension> {
processorVersion.set(annotationProcessorVersion)
outputDirectory.set(project.buildDir)
}

configure<org.eclipse.edc.plugins.edcbuild.extensions.BuildExtension> {
versions {
// override default dependency versions here
metaModel.set(metaModelVersion)
ahmetuyanikdev marked this conversation as resolved.
Show resolved Hide resolved
}

pom {
scmUrl.set(hcScmConnection)
scmConnection.set(hcScmConnection)
Expand All @@ -54,11 +44,4 @@ allprojects {
configDirectory.set(rootProject.file("resources"))
}

// EdcRuntimeExtension uses this to determine the runtime classpath of the module to run.
tasks.register("printClasspath") {
doLast {
println(sourceSets["main"].runtimeClasspath.asPath)
}
}

}
1 change: 1 addition & 0 deletions e2e-tests/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ dependencies {
testImplementation(libs.awaitility)
testImplementation(libs.awaitility)
testImplementation(libs.testcontainers.junit)
testImplementation(libs.edc.spi.dataplane)
testImplementation(testFixtures(project(":extensions:common:obs:obs-core")))
testCompileOnly(project(":extensions:data-plane:data-plane-obs"))
testCompileOnly(project(":launchers:e2e-test"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ public Map<String, String> controlPlaneConfiguration() {
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);
put("edc.transfer.proxy.token.verifier.publickey.alias", "publickey");
put("edc.transfer.proxy.token.signer.privatekey.alias", "privatekey");
}
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import org.eclipse.edc.junit.extensions.EdcRuntimeExtension;
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.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;
Expand Down Expand Up @@ -190,7 +191,7 @@ private DataFlowStartMessage.Builder createFlowRequest(String consumerBucket, St
.property(ObsBucketSchema.ENDPOINT, consumerEndpoint)
.build()
)
.processId("test-process-id");
.processId("test-process-id").flowType(FlowType.PUSH);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -17,30 +17,39 @@
import com.huawei.cloud.fixtures.HuaweiParticipant;
import com.huawei.cloud.obs.ObsBucketSchema;
import com.huawei.cloud.obs.ObsClientProvider;
import com.huawei.cloud.obs.ObsClientProviderImpl;
import com.huawei.cloud.obs.OtcTest;
import com.obs.services.ObsClient;
import com.obs.services.model.ObsObject;
import io.restassured.http.ContentType;
import jakarta.json.Json;
import jakarta.json.JsonArrayBuilder;
import jakarta.json.JsonObject;
import jakarta.json.JsonValue;
import org.eclipse.edc.connector.controlplane.test.system.utils.Participant;
import org.eclipse.edc.connector.controlplane.transfer.spi.types.TransferProcessStates;
import org.eclipse.edc.connector.dataplane.spi.Endpoint;
import org.eclipse.edc.connector.dataplane.spi.iam.PublicEndpointGeneratorService;
import org.eclipse.edc.junit.extensions.EdcClassRuntimesExtension;
import org.eclipse.edc.junit.extensions.EdcRuntimeExtension;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;

import java.time.Duration;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.TimeUnit;

import static org.assertj.core.api.Assertions.assertThat;
import static org.awaitility.Awaitility.await;
import static org.eclipse.edc.connector.controlplane.test.system.utils.PolicyFixtures.inForceDatePolicy;
import static org.eclipse.edc.connector.controlplane.transfer.spi.types.TransferProcessStates.COMPLETED;
import static org.eclipse.edc.connector.controlplane.transfer.spi.types.TransferProcessStates.STARTED;
import static org.eclipse.edc.jsonld.spi.JsonLdKeywords.TYPE;
import static org.eclipse.edc.junit.testfixtures.TestUtils.getFileFromResourceName;
import static org.eclipse.edc.spi.constants.CoreConstants.EDC_NAMESPACE;


@OtcTest
public class OtcTransferEndToEndTest {

Expand All @@ -57,7 +66,7 @@ public class OtcTransferEndToEndTest {
.apiKey("password")
.build();

private static final Duration TIMEOUT = Duration.ofSeconds(30);
private static final Duration TIMEOUT = Duration.ofMinutes(1);
private static final String OBS_OTC_CLOUD_URL = "https://obs.eu-de.otc.t-systems.com";


Expand Down Expand Up @@ -90,8 +99,19 @@ void setup() {
id = UUID.randomUUID().toString();
sourceBucket = "src-" + id;
destBucket = "dest-" + id;
providerClient = providerRuntime.getContext().getService(ObsClientProvider.class).obsClient(OBS_OTC_CLOUD_URL);
consumerClient = consumerRuntime.getContext().getService(ObsClientProvider.class).obsClient(OBS_OTC_CLOUD_URL);
providerClient = providerRuntime.getService(ObsClientProvider.class).obsClient(OBS_OTC_CLOUD_URL);
consumerClient = consumerRuntime.getService(ObsClientProvider.class).obsClient(OBS_OTC_CLOUD_URL);
var providerClientProviderImp = (ObsClientProviderImpl) providerRuntime.getService(ObsClientProvider.class);
providerClientProviderImp.getVault().storeSecret("publickey", PUBLIC_KEY);
providerClientProviderImp.getVault().storeSecret("privatekey", PRIVATE_KEY);
var consumerClientProviderImp = (ObsClientProviderImpl) consumerRuntime.getService(ObsClientProvider.class);
consumerClientProviderImp.getVault().storeSecret("publickey", PUBLIC_KEY);
consumerClientProviderImp.getVault().storeSecret("privatekey", PRIVATE_KEY);
var providerEndpointGeneratorService = (PublicEndpointGeneratorService) providerRuntime.getService(PublicEndpointGeneratorService.class);
var consumerEndpointGeneratorService = (PublicEndpointGeneratorService) consumerRuntime.getService(PublicEndpointGeneratorService.class);
var endpoint = new Endpoint("endpoint", "obs");
providerEndpointGeneratorService.addGeneratorFunction("HttpData", dataAddress1 -> endpoint);
consumerEndpointGeneratorService.addGeneratorFunction("HttpData", dataAddress1 -> endpoint);
}

@Test
Expand All @@ -103,33 +123,66 @@ void obsToObsTransfer() {
var f = getFileFromResourceName(TESTFILE_NAME);
providerClient.putObject(sourceBucket, TESTFILE_NAME, f);

createResourcesOnProvider(assetId, sourceAddress(sourceBucket, prefix));
JsonArrayBuilder allowedSourceTypes = Json.createArrayBuilder();
allowedSourceTypes.add(Json.createValue(ObsBucketSchema.TYPE));
JsonArrayBuilder allowedDestTypes = Json.createArrayBuilder();
allowedDestTypes.add(Json.createValue(ObsBucketSchema.TYPE));
JsonArrayBuilder allowedTransferTypes = Json.createArrayBuilder();
allowedTransferTypes.add(Json.createValue(ObsBucketSchema.TRANSFERTYPE_PUSH));

var transferProcessId = CONSUMER.requestAsset(PROVIDER, assetId, noPrivateProperty(), obsSink(destBucket, prefix));
JsonObject dataPlaneRequestBody = Json.createObjectBuilder().add("@context", Json.createObjectBuilder().add("@vocab", "https://w3id.org/edc/v0.0.1/ns/"))
.add("@id", "http-push-provider-dataplane")
.add("url", PROVIDER.getControlEndpoint().getUrl().toString().concat("/transfer"))
.add("allowedSourceTypes", allowedSourceTypes.build())
.add("allowedDestTypes", allowedDestTypes.build())
.add("allowedTransferTypes", allowedTransferTypes)
.add("properties", "").build();

PROVIDER.getManagementEndpoint().baseRequest().contentType(ContentType.JSON).body(dataPlaneRequestBody).when().post("/v2/dataplanes");
createResourcesOnProvider(assetId, sourceAddress(sourceBucket, prefix));

var transferType = ObsBucketSchema.TRANSFERTYPE_PUSH;
var offer = getOfferForAsset(PROVIDER, assetId);
var contractAggId = CONSUMER.negotiateContract(PROVIDER, offer);
var transferProcessId = CONSUMER.initiateTransfer(PROVIDER, contractAggId, null, obsSink(destBucket, prefix), transferType);
await().atMost(TIMEOUT).untilAsserted(() -> {
var state = CONSUMER.getTransferProcessState(transferProcessId);
assertThat(state).isEqualTo(COMPLETED.name());
assertThat(TransferProcessStates.valueOf(state).code()).isGreaterThanOrEqualTo(STARTED.code());
});

assertThat(consumerClient.listObjects(destBucket).getObjects())
.isNotEmpty()
.allSatisfy(obsObject -> assertThat(obsObject.getObjectKey()).isEqualTo(TESTFILE_NAME));

List<ObsObject> consumerObsObjectList = consumerClient.listObjects(destBucket).getObjects();
if (!consumerObsObjectList.isEmpty()) {
assertThat(consumerObsObjectList)
.allSatisfy(obsObject -> assertThat(obsObject.getObjectKey()).isEqualTo(TESTFILE_NAME));
}
try {
TimeUnit.SECONDS.sleep(20);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
cleanup();
}

@AfterEach
void cleanup() {
cleanResource(providerClient, sourceBucket);
cleanResource(consumerClient, destBucket);
}

private JsonObject getOfferForAsset(Participant provider, String assetId) {
JsonObject dataset = PROVIDER.getDatasetForAsset(provider, assetId);
JsonObject policy = ((JsonValue) dataset.getJsonArray("http://www.w3.org/ns/odrl/2/hasPolicy").get(0)).asJsonObject();
return Json.createObjectBuilder(policy).add("http://www.w3.org/ns/odrl/2/assigner", Json.createObjectBuilder().add("@id", provider.getId())).add("http://www.w3.org/ns/odrl/2/target", Json.createObjectBuilder().add("@id", (JsonValue) dataset.get("@id"))).build();
}

void cleanResource(ObsClient obsClient, String bucketName) {
if (obsClient.headBucket(bucketName)) {
obsClient.listObjects(bucketName).getObjects()
.forEach(obj -> obsClient.deleteObject(bucketName, obj.getObjectKey()));
obsClient.deleteBucket(bucketName);
try {
if (obsClient.headBucket(bucketName)) {
obsClient.listObjects(bucketName).getObjects()
.forEach(obj -> obsClient.deleteObject(bucketName, obj.getObjectKey()));
obsClient.deleteBucket(bucketName);
}
} catch (Exception e) {
System.out.println("--> error : " + e.getMessage());
}
}

Expand Down Expand Up @@ -165,4 +218,59 @@ private void createResourcesOnProvider(String assetId, Map<String, Object> dataA
PROVIDER.createContractDefinition(assetId, UUID.randomUUID().toString(), policyDefinition, policyDefinition);
}

private static final String PUBLIC_KEY = """
-----BEGIN CERTIFICATE-----
MIIDazCCAlOgAwIBAgIUZ3/sZXYzW4PjmOXKrZn6WBmUJ+4wDQYJKoZIhvcNAQEL
BQAwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM
GEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDAeFw0yMjAyMjMxNTA2MDNaFw0zMjAy
MjExNTA2MDNaMEUxCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEw
HwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQwggEiMA0GCSqGSIb3DQEB
AQUAA4IBDwAwggEKAoIBAQDBl6XaJnXTL+6DWip3aBhU+MzmY4d1V9hbTm1tiZ3g
E0VbUrvGO3LoYaxpPv6zFmsg3uJv6JxVAde7E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udUlKQOKEjNhIxwkrvQBXIrWbz7lh0Tcu49al
BcaHxru4QLO6pkM7fGHq0fh3ufJ8EZjMrjF1xjdk26Q05o0aXe+hLKHVIRVBhlfo
ArB4fRo+HcpdJXjox0KcDQCvHe+1v9DYBTWvymv4QQKBgBy3YH7hKz35DcXvA2r4
Kis9a4ycuZqTXockO4rkcIwC6CJp9JbHDIRzig8HYOaRqmZ4a+coqLmddXr2uOF1
7+iAxxG1KzdT6uFNd+e/j2cdUjnqcSmz49PRtdDswgyYhoDT+W4yVGNQ4VuKg6a3
Z3pC+KTdoHSKeA2FyAGnSUpD
-----END PRIVATE KEY-----
""";

}
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,7 @@ public interface ObsBucketSchema {
String ACCESS_KEY_ID = "accessKeyId";
String SECRET_ACCESS_KEY = "secretAccessKey";
String ENDPOINT = "endpoint";
String TRANSFERTYPE_PUSH = TYPE + "-PUSH";
String TRANSFERTYPE_PULL = TYPE + "-PULL";

}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import com.obs.services.ObsClient;
import com.obs.services.ObsConfiguration;
import org.eclipse.edc.spi.monitor.Monitor;
import org.eclipse.edc.spi.security.Vault;
import org.jetbrains.annotations.NotNull;

import java.io.IOException;
Expand All @@ -39,11 +40,19 @@ public class ObsClientProviderImpl implements ObsClientProvider {

private IamClient iamClient;

private Vault vault;

public ObsClientProviderImpl(ObsClientProviderConfiguration configuration, Monitor monitor) {
this.configuration = configuration;
this.monitor = monitor;
}

public ObsClientProviderImpl(ObsClientProviderConfiguration configuration, Monitor monitor, Vault vault) {
this.configuration = configuration;
this.monitor = monitor;
this.vault = vault;
}

@NotNull
private static ObsConfiguration createObsConfiguration(String endpoint) {
var config = new ObsConfiguration();
Expand Down Expand Up @@ -115,6 +124,10 @@ private IamClient getOrCreateIamclient(ObsClientProviderConfiguration configurat
}
}

public Vault getVault() {
return vault;
}

private void closeClient(Map.Entry<String, ObsClient> clientEntry) {
try {
clientEntry.getValue().close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public void initialize(ServiceExtensionContext context) {
.iamEndpoint(iamEndpoint)
.build();

clientProvider = new ObsClientProviderImpl(configuration, monitor);
clientProvider = new ObsClientProviderImpl(configuration, monitor, vault);

context.registerService(ObsClientProvider.class, clientProvider);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -852,15 +852,15 @@ void findByCorrelationIdAndLease_shouldReturnTheEntityAndLeaseIt() {
var correlationId = UUID.randomUUID().toString();
getContractNegotiationStore().save(createNegotiationBuilder(id).correlationId(correlationId).build());

var result = getContractNegotiationStore().findByCorrelationIdAndLease(correlationId);
var result = getContractNegotiationStore().findByIdAndLease(correlationId);

AbstractResultAssert.assertThat(result).isSucceeded();
assertThat(isLeasedBy(id, CONNECTOR_NAME)).isTrue();
}

@Test
void findByCorrelationIdAndLease_shouldReturnNotFound_whenEntityDoesNotExist() {
var result = getContractNegotiationStore().findByCorrelationIdAndLease("unexistent");
var result = getContractNegotiationStore().findByIdAndLease("unexistent");

AbstractResultAssert.assertThat(result).isFailed().extracting(StoreFailure::getReason).isEqualTo(NOT_FOUND);
}
Expand All @@ -872,7 +872,7 @@ void findByCorrelationIdAndLease_shouldReturnAlreadyLeased_whenEntityIsAlreadyLe
getContractNegotiationStore().save(createNegotiationBuilder(id).correlationId(correlationId).build());
leaseEntity(id, "other owner");

var result = getContractNegotiationStore().findByCorrelationIdAndLease(correlationId);
var result = getContractNegotiationStore().findByIdAndLease(correlationId);

AbstractResultAssert.assertThat(result).isFailed().extracting(StoreFailure::getReason).isEqualTo(ALREADY_LEASED);
}
Expand Down
Loading
Loading