Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion advanced/advanced-01-open-telemetry/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,11 +214,11 @@ which has to be stored in the root folder of this sample as well. The only addit
WEB_HTTP_PATH: /api
WEB_HTTP_MANAGEMENT_PORT: 9192
WEB_HTTP_MANAGEMENT_PATH: /management
WEB_HTTP_MANAGEMENT_AUTH_KEY: password
WEB_HTTP_PROTOCOL_PORT: 9292
WEB_HTTP_PROTOCOL_PATH: /protocol
EDC_DSP_CALLBACK_ADDRESS: http://consumer:9292/protocol
EDC_PARTICIPANT_ID: consumer
EDC_API_AUTH_KEY: password
entrypoint: java
-javaagent:/resources/opentelemetry-javaagent.jar
-Djava.util.logging.config.file=/resources/logging.properties
Expand Down
4 changes: 2 additions & 2 deletions advanced/advanced-01-open-telemetry/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ services:
WEB_HTTP_PUBLIC_PATH: /public
WEB_HTTP_CONTROL_PORT: 29192
WEB_HTTP_CONTROL_PATH: /control
WEB_HTTP_MANAGEMENT_AUTH_KEY: password
WEB_HTTP_MANAGEMENT_PORT: 29193
WEB_HTTP_MANAGEMENT_PATH: /management
WEB_HTTP_PROTOCOL_PORT: 29194
Expand All @@ -33,7 +34,6 @@ services:
EDC_CONTROL_ENDPOINT: http://consumer:29192/control
EDC_DSP_CALLBACK_ADDRESS: http://consumer:29194/protocol
EDC_PARTICIPANT_ID: consumer
EDC_API_AUTH_KEY: password
EDC_KEYSTORE: /prerequisites/resources/certs/cert.pfx
EDC_KEYSTORE_PASSWORD: 123456
EDC_FS_CONFIG: /prerequisites/resources/configuration/provider-configuration.properties
Expand Down Expand Up @@ -65,14 +65,14 @@ services:
WEB_HTTP_CONTROL_PATH: /control
WEB_HTTP_MANAGEMENT_PORT: 19193
WEB_HTTP_MANAGEMENT_PATH: /management
WEB_HTTP_MANAGEMENT_AUTH_KEY: password
WEB_HTTP_PROTOCOL_PORT: 19194
WEB_HTTP_PROTOCOL_PATH: /protocol
WEB_HTTP_VERSION_PORT: 19195
WEB_HTTP_VERSION_PATH: /version
EDC_CONTROL_ENDPOINT: http://provider:19192/control
EDC_DSP_CALLBACK_ADDRESS: http://provider:19194/protocol
EDC_PARTICIPANT_ID: provider
EDC_API_AUTH_KEY: password
EDC_KEYSTORE: /prerequisites/resources/certs/cert.pfx
EDC_KEYSTORE_PASSWORD: 123456
EDC_FS_CONFIG: /prerequisites/resources/configuration/consumer-configuration.properties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ dependencies {
implementation(libs.edc.iam.mock)
implementation(libs.edc.management.api)
implementation(libs.edc.transfer.data.plane.signaling)
implementation(libs.edc.transfer.pull.http.receiver)

implementation(libs.edc.data.plane.selector.api)
implementation(libs.edc.data.plane.selector.core)
Expand Down
4 changes: 0 additions & 4 deletions advanced/advanced-02-custom-runtime/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ dependencies {

implementation(libs.edc.iam.mock)
implementation(libs.edc.configuration.filesystem)

testImplementation(libs.junit.jupiter.api)
testRuntimeOnly(libs.junit.jupiter.engine)

}

application {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ web.http.control.path=/control
edc.dataplane.api.public.baseurl=http://localhost:29291/public


edc.api.auth.key=password
web.http.management.auth.key=password
edc.ids.id=urn:connector:provider
edc.mock.region=us

Expand Down
7 changes: 1 addition & 6 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ format.version = "1.1"

[versions]
awaitility = "4.2.2"
edc = "0.11.1"
jupiter = "5.12.0"
edc = "0.12.0"
okhttp-mockwebserver = "5.0.0-alpha.14"
restAssured = "5.5.1"
rsApi = "4.0.0"
Expand Down Expand Up @@ -53,14 +52,10 @@ edc-management-api-test-fixtures = { module = "org.eclipse.edc:management-api-te
edc-monitor-jdk-logger = { module = "org.eclipse.edc:monitor-jdk-logger", version.ref = "edc" }
edc-token-core = { module = "org.eclipse.edc:token-core", version.ref = "edc" }
edc-transfer-data-plane-signaling = { module = "org.eclipse.edc:transfer-data-plane-signaling", version.ref = "edc" }
edc-transfer-pull-http-receiver = { module = "org.eclipse.edc:transfer-pull-http-dynamic-receiver", version.ref = "edc" }
edc-transfer-pull-http-dynamic-receiver = { module = "org.eclipse.edc:transfer-pull-http-dynamic-receiver", version.ref = "edc" }
edc-vault-hashicorp = { module = "org.eclipse.edc:vault-hashicorp", version.ref = "edc" }
edc-validator-data-address-http-data = { module = "org.eclipse.edc:validator-data-address-http-data", version.ref = "edc" }
edc-web-spi = { module = "org.eclipse.edc:web-spi", version.ref = "edc" }
jakarta-rsApi = { module = "jakarta.ws.rs:jakarta.ws.rs-api", version.ref = "rsApi" }
junit-jupiter-api = { module = "org.junit.jupiter:junit-jupiter-api", version.ref = "jupiter" }
junit-jupiter-engine = { module = "org.junit.jupiter:junit-jupiter-engine", version.ref = "jupiter" }
okhttp-mockwebserver = { module = "com.squareup.okhttp3:mockwebserver", version.ref = "okhttp-mockwebserver" }
opentelemetry-annotations = { module = "io.opentelemetry:opentelemetry-extension-annotations", version = "1.18.0" }
opentelemetry-exporter-otlp = { module = "io.opentelemetry:opentelemetry-exporter-otlp", version = "1.49.0" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ web.http.protocol.path=/protocol\
web.http.version.port=29195
web.http.version.path=/version

edc.api.auth.key=password
web.http.management.auth.key=password
edc.dsp.callback.address=http://localhost:29194/protocol
edc.participant.id=consumer
edc.ids.id=urn:connector:consumer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ web.http.protocol.path=/protocol
web.http.version.port=19195
web.http.version.path=/version

edc.api.auth.key=password
web.http.management.auth.key=password
edc.dsp.callback.address=http://localhost:19194/protocol
edc.participant.id=provider
edc.ids.id=urn:connector:provider
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public class Transfer05fileTransferCloudTest {
entry("web.http.protocol.path", "/protocol"),
entry("web.http.version.port", "19195"),
entry("web.http.version.path", "/version"),
entry("edc.api.auth.key", "password"),
entry("web.http.management.auth.key", "password"),
entry("edc.transfer.proxy.token.signer.privatekey.alias", "private-key"),
entry("edc.transfer.proxy.token.verifier.publickey.alias", "public-key"),
entry("web.http.public.port", "19291"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
import org.eclipse.edc.junit.extensions.EmbeddedRuntime;
import org.eclipse.edc.junit.extensions.RuntimeExtension;
import org.eclipse.edc.junit.extensions.RuntimePerClassExtension;
import org.eclipse.edc.spi.types.domain.edr.EndpointDataReference;
import org.eclipse.edc.spi.types.domain.DataAddress;
import org.eclipse.edc.util.io.Ports;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
Expand Down Expand Up @@ -70,6 +70,7 @@
import static java.util.concurrent.TimeUnit.SECONDS;
import static org.assertj.core.api.Assertions.assertThat;
import static org.awaitility.Awaitility.await;
import static org.eclipse.edc.connector.controlplane.contract.spi.types.negotiation.ContractNegotiationStates.FINALIZED;
import static org.eclipse.edc.connector.controlplane.transfer.spi.types.TransferProcessStates.STARTED;
import static org.eclipse.edc.samples.common.FileTransferCommon.getFileContentFromRelativePath;
import static org.eclipse.edc.samples.common.FileTransferCommon.getFileFromRelativePath;
Expand Down Expand Up @@ -144,8 +145,8 @@ void streamData() throws InterruptedException, JsonProcessingException {
var contractNegotiationId = CONSUMER.negotiateContract(negotiateContractBody);

await().atMost(TIMEOUT).untilAsserted(() -> {
var contractAgreementId = CONSUMER.getContractAgreementId(contractNegotiationId);
assertThat(contractAgreementId).isNotNull();
var state = CONSUMER.getContractNegotiationState(contractNegotiationId);
assertThat(state).isEqualTo(FINALIZED.name());
});

var contractAgreementId = CONSUMER.getContractAgreementId(contractNegotiationId);
Expand All @@ -161,19 +162,18 @@ void streamData() throws InterruptedException, JsonProcessingException {
assertThat(state).isEqualTo(STARTED.name());
});

await().atMost(TIMEOUT).untilAsserted(() -> {
var state = CONSUMER.getTransferProcessState(transferProcessId);
assertThat(state).isEqualTo(STARTED.name());
});

var producer = createKafkaProducer();
var message = "message";
Executors.newSingleThreadScheduledExecutor().scheduleAtFixedRate(() -> producer
.send(new ProducerRecord<>(TOPIC, "key", message)), 0L, 100L, MICROSECONDS);

var endpointDataReference = readEndpointDataReference();

try (var clientConsumer = createKafkaConsumer(endpointDataReference.getEndpoint(), endpointDataReference.getAuthKey(), endpointDataReference.getAuthCode())) {
var endpoint = endpointDataReference.getStringProperty("endpoint");
var authKey = endpointDataReference.getStringProperty("authKey");
var authCode = endpointDataReference.getStringProperty("authCode");

try (var clientConsumer = createKafkaConsumer(endpoint, authKey, authCode)) {
clientConsumer.subscribe(List.of(endpointDataReference.getProperties().get(EDC_NAMESPACE + "topic").toString()));

await().atMost(TIMEOUT).untilAsserted(() -> {
Expand All @@ -186,10 +186,11 @@ void streamData() throws InterruptedException, JsonProcessingException {
producer.close();
}

private EndpointDataReference readEndpointDataReference() throws InterruptedException, JsonProcessingException {
private DataAddress readEndpointDataReference() throws InterruptedException, JsonProcessingException {
var request = edrReceiverServer.takeRequest(TIMEOUT.getSeconds(), SECONDS);
var body = request.getBody().readString(Charset.defaultCharset());
return new ObjectMapper().readValue(body, EndpointDataReference.class);
var jsonNode = new ObjectMapper().readTree(body).get("payload").get("dataAddress");
return new ObjectMapper().convertValue(jsonNode, DataAddress.class);
}

private AclBinding userCanAccess(String principal, ResourceType resourceType, String resourceName) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ web.http.management.path=/management
web.http.protocol.port=29194
web.http.protocol.path=/protocol

edc.api.auth.key=password
web.http.management.auth.key=password
edc.dsp.callback.address=http://localhost:29194/protocol
edc.participant.id=consumer
edc.ids.id=urn:connector:consumer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ web.http.management.path=/management
web.http.protocol.port=29194
web.http.protocol.path=/protocol

edc.api.auth.key=password
web.http.management.auth.key=password
edc.dsp.callback.address=http://localhost:29194/protocol
edc.participant.id=consumer
edc.ids.id=urn:connector:consumer
Expand Down
12 changes: 9 additions & 3 deletions transfer/streaming/streaming-03-kafka-broker/6-transfer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@
"contractId": "{{contract-agreement-id}}",
"connectorId": "provider",
"counterPartyAddress": "http://localhost:18182/protocol",
"privateProperties": {
"receiverHttpEndpoint" : "http://localhost:4000"
}
"callbackAddresses": [
{
"transactional": false,
"uri": "http://localhost:4000",
"events": [
"transfer.process.started"
]
}
]
}
41 changes: 33 additions & 8 deletions transfer/streaming/streaming-03-kafka-broker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,16 +173,41 @@ curl "http://localhost:28181/management/v3/transferprocesses/{{transfer-process-
```

### Consume events
Now in the console of the `http-request-logger` we started before, the `EndpointDataReference` should have appeared:
Now in the console of the `http-request-logger` we started before, the `TransferProcessStarted` event should have appeared,
containing the EDR in the `payload.dataAddress.properties` field.
```json
{
"id":"8c52a781-2588-4c9b-8c70-4e5ad428eea9",
"endpoint": "localhost:9093",
"authKey": "alice",
"authCode": "alice-secret",
"properties": {
"https://w3id.org/edc/v0.0.1/ns/topic": "kafka-stream-topic"
}
"id": "8afc0e1d-3f4d-4aea-a58f-01658946c2fa",
"at": 1744189281207,
"payload": {
"transferProcessId": "1475e24b-ce19-4913-ac32-e47014ae090e",
"callbackAddresses": [
{
"uri": "http://localhost:64359",
"events": [
"transfer.process.started"
],
"transactional": false,
"authKey": null,
"authCodeId": null
}
],
"assetId": "kafka-stream-asset",
"type": "CONSUMER",
"contractId": "ef587d3b-8ca0-4c09-a72a-edb18aea96dd",
"dataAddress": {
"properties": {
"https://w3id.org/edc/v0.0.1/ns/type": "EDR",
"https://w3id.org/edc/v0.0.1/ns/endpoint": "PLAINTEXT://localhost:32783",
"https://w3id.org/edc/v0.0.1/ns/authCode": "alice-secret",
"https://w3id.org/edc/v0.0.1/ns/contractId": "ef587d3b-8ca0-4c09-a72a-edb18aea96dd",
"https://w3id.org/edc/v0.0.1/ns/topic": "topic-a49ac783-d008-41f7-81f2-8dd0a6a726d4",
"https://w3id.org/edc/v0.0.1/ns/id": "1475e24b-ce19-4913-ac32-e47014ae090e",
"https://w3id.org/edc/v0.0.1/ns/authKey": "alice"
}
}
},
"type": "TransferProcessStarted"
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,10 @@ plugins {
}

dependencies {
implementation(libs.edc.bom.controlplane.base)
implementation(libs.edc.control.plane.api.client)
implementation(libs.edc.control.plane.core)
implementation(libs.edc.data.plane.selector.core)
implementation(libs.edc.api.observability)
implementation(libs.edc.configuration.filesystem)
implementation(libs.edc.iam.mock)
implementation(libs.edc.management.api)
implementation(libs.edc.dsp)
implementation(libs.edc.http)
implementation(libs.edc.edr.store.core)
implementation(libs.edc.data.plane.selector.api)
implementation(libs.edc.transfer.data.plane.signaling)
implementation(libs.edc.transfer.pull.http.dynamic.receiver)

implementation(libs.edc.data.plane.spi)
implementation(libs.edc.data.plane.core)
implementation(libs.edc.data.plane.http)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ dependencies {
implementation(libs.edc.iam.mock)
implementation(libs.edc.management.api)
implementation(libs.edc.transfer.data.plane.signaling)
implementation(libs.edc.transfer.pull.http.receiver)
implementation(libs.edc.validator.data.address.http.data)

implementation(libs.edc.edr.cache.api)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ dependencies {
implementation(libs.edc.iam.mock)
implementation(libs.edc.management.api)
implementation(libs.edc.transfer.data.plane.signaling)
implementation(libs.edc.transfer.pull.http.receiver)
implementation(libs.edc.validator.data.address.http.data)

implementation(libs.edc.edr.cache.api)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ dependencies {
implementation(libs.edc.management.api)
implementation(libs.edc.edr.store.core)
implementation(libs.edc.transfer.data.plane.signaling)
implementation(libs.edc.transfer.pull.http.receiver)
implementation(libs.edc.validator.data.address.http.data)

implementation(libs.edc.data.plane.selector.api)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ web.http.management.port=29193
web.http.management.path=/management
web.http.protocol.port=29194
web.http.protocol.path=/protocol
edc.api.auth.key=password
web.http.management.auth.key=password
web.http.public.port=29291
web.http.public.path=/public
web.http.control.port=29192
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ dependencies {
implementation(libs.edc.management.api)
implementation(libs.edc.edr.store.core)
implementation(libs.edc.transfer.data.plane.signaling)
implementation(libs.edc.transfer.pull.http.receiver)
implementation(libs.edc.validator.data.address.http.data)

implementation(libs.edc.data.plane.selector.api)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ web.http.management.port=19193
web.http.management.path=/management
web.http.protocol.port=19194
web.http.protocol.path=/protocol
edc.api.auth.key=password
web.http.management.auth.key=password
web.http.public.port=19291
web.http.public.path=/public
web.http.control.port=19192
Expand Down