Skip to content

Commit

Permalink
build(deps): bump EDC to 0.7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ndr-brt committed Jun 28, 2024
1 parent 6cc90ad commit 047c0d2
Show file tree
Hide file tree
Showing 24 changed files with 100 additions and 88 deletions.
12 changes: 6 additions & 6 deletions advanced/advanced-01-open-telemetry/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Create a Policy on the provider connector:
```bash
curl -H "X-Api-Key: password" \
-d @transfer/transfer-01-negotiation/resources/create-policy.json \
-H 'content-type: application/json' http://localhost:19193/management/v2/policydefinitions \
-H 'content-type: application/json' http://localhost:19193/management/v3/policydefinitions \
-s | jq
```

Expand All @@ -60,7 +60,7 @@ Follow up with the creation of a contract definition:
```bash
curl -H "X-Api-Key: password" \
-d @transfer/transfer-01-negotiation/resources/create-contract-definition.json \
-H 'content-type: application/json' http://localhost:19193/management/v2/contractdefinitions \
-H 'content-type: application/json' http://localhost:19193/management/v3/contractdefinitions \
-s | jq
```

Expand All @@ -72,7 +72,7 @@ directly with this call:
curl -H "X-Api-Key: password" \
-H "Content-Type: application/json" \
-d @advanced/advanced-01-open-telemetry/resources/get-dataset.json \
-X POST "http://localhost:29193/management/v2/catalog/dataset/request" \
-X POST "http://localhost:29193/management/v3/catalog/dataset/request" \
-s | jq
```

Expand Down Expand Up @@ -141,7 +141,7 @@ and request the contract negotiation:
curl -H "X-Api-Key: password" \
-H "Content-Type: application/json" \
-d @advanced/advanced-01-open-telemetry/resources/negotiate-contract.json \
-X POST "http://localhost:29193/management/v2/contractnegotiations" \
-X POST "http://localhost:29193/management/v3/contractnegotiations" \
-s | jq
```

Expand All @@ -150,7 +150,7 @@ state with this call, replacing `{{contract-negotiation-id}}` with the id return

```shell
curl -H 'X-Api-Key: password' \
-X GET "http://localhost:29193/management/v2/contractnegotiations/{{contract-negotiation-id}}" \
-X GET "http://localhost:29193/management/v3/contractnegotiations/{{contract-negotiation-id}}" \
-s | jq
```

Expand All @@ -160,7 +160,7 @@ Finally, update the contract agreement id in the [start-transfer.json](resources
curl -H "X-Api-Key: password" \
-H "Content-Type: application/json" \
-d @advanced/advanced-01-open-telemetry/resources/start-transfer.json \
-X POST "http://localhost:29193/management/v2/transferprocesses" \
-X POST "http://localhost:29193/management/v3/transferprocesses" \
-s | jq
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class CustomRuntime extends BaseRuntime {
* instantiate the {@code BaseRuntime}.
*/
public static void main(String[] args) {
new CustomRuntime().boot();
new CustomRuntime().boot(true);
}

@Override
Expand Down
11 changes: 6 additions & 5 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ format.version = "1.1"
[versions]
assertj = "3.26.0"
awaitility = "4.2.1"
edc = "0.7.0"
edc = "0.7.1"
jakarta-json = "2.0.1"
junit-pioneer = "2.2.0"
jupiter = "5.10.2"
Expand All @@ -24,14 +24,15 @@ edc-boot = { module = "org.eclipse.edc:boot", version.ref = "edc" }
edc-build-plugin = { module = "org.eclipse.edc.edc-build:org.eclipse.edc.edc-build.gradle.plugin", version.ref = "edc" }
edc-configuration-filesystem = { module = "org.eclipse.edc:configuration-filesystem", version.ref = "edc" }
edc-connector-core = { module = "org.eclipse.edc:connector-core", version.ref = "edc" }
edc-control-api-configuration = { module = "org.eclipse.edc:control-api-configuration", version.ref = "edc" }
edc-control-plane-api-client = { module = "org.eclipse.edc:control-plane-api-client", version.ref = "edc" }
edc-control-plane-api = { module = "org.eclipse.edc:control-plane-api", version.ref = "edc" }
edc-control-plane-core = { module = "org.eclipse.edc:control-plane-core", version.ref = "edc" }
edc-control-plane-spi = { module = "org.eclipse.edc:control-plane-spi", version.ref = "edc" }
edc-data-plane-control-api = { module = "org.eclipse.edc:data-plane-control-api", version.ref = "edc" }
edc-data-plane-public-api = { module = "org.eclipse.edc:data-plane-public-api-v2", version.ref = "edc" }
edc-data-plane-aws-s3 = { module = "org.eclipse.edc:data-plane-aws-s3", version.ref = "edc" }
edc-data-plane-azure-storage = { module = "org.eclipse.edc:data-plane-azure-storage", version.ref = "edc" }
edc-data-plane-aws-s3 = { module = "org.eclipse.edc.aws:data-plane-aws-s3", version.ref = "edc" }
edc-data-plane-azure-storage = { module = "org.eclipse.edc.azure:data-plane-azure-storage", version.ref = "edc" }
edc-data-plane-client = { module = "org.eclipse.edc:data-plane-client", version.ref = "edc" }
edc-data-plane-core = { module = "org.eclipse.edc:data-plane-core", version.ref = "edc" }
edc-data-plane-http = { module = "org.eclipse.edc:data-plane-http", version.ref = "edc" }
Expand All @@ -56,14 +57,14 @@ edc-management-api = { module = "org.eclipse.edc:management-api", version.ref =
edc-management-api-test-fixtures = { module = "org.eclipse.edc:management-api-test-fixtures", version.ref = "edc" }
edc-micrometer-core = { module = "org.eclipse.edc:micrometer-core", version.ref = "edc" }
edc-monitor-jdk-logger = { module = "org.eclipse.edc:monitor-jdk-logger", version.ref = "edc" }
edc-provision-aws-s3 = { module = "org.eclipse.edc:provision-aws-s3", version.ref = "edc" }
edc-provision-aws-s3 = { module = "org.eclipse.edc.aws:provision-aws-s3", version.ref = "edc" }
edc-runtime-metamodel = { module = "org.eclipse.edc:runtime-metamodel", version.ref = "edc" }
edc-transfer-data-plane-signaling = { module = "org.eclipse.edc:transfer-data-plane-signaling", version.ref = "edc" }
edc-transfer-process-api = { module = "org.eclipse.edc:transfer-process-api", 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-util = { module = "org.eclipse.edc:util", version.ref = "edc" }
edc-vault-azure = { module = "org.eclipse.edc:vault-azure", version.ref = "edc" }
edc-vault-azure = { module = "org.eclipse.edc.azure:vault-azure", version.ref = "edc" }
edc-validator-data-address-http-data = { module = "org.eclipse.edc:validator-data-address-http-data", version.ref = "edc" }
jakarta-rsApi = { module = "jakarta.ws.rs:jakarta.ws.rs-api", version.ref = "rsApi" }
jakartaJson = { module = "org.glassfish:jakarta.json", version.ref = "jakarta-json" }
Expand Down
10 changes: 5 additions & 5 deletions policy/policy-01-policy-enforcement/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ be equal to `eu`. You can view the request body for creating the policy definiti
```bash
curl -X POST -H "Content-Type: application/json" -H "X-Api-Key: password" \
-d @policy/policy-01-policy-enforcement/resources/create-policy.json \
"http://localhost:19193/management/v2/policydefinitions" | jq
"http://localhost:19193/management/v3/policydefinitions" | jq
```

#### 2.3 Create the contract definition
Expand All @@ -216,7 +216,7 @@ the contract definition:
```bash
curl -X POST -H "Content-Type: application/json" -H "X-Api-Key: password" \
-d @policy/policy-01-policy-enforcement/resources/create-contract-definition.json \
"http://localhost:19193/management/v2/contractdefinitions" | jq
"http://localhost:19193/management/v3/contractdefinitions" | jq
```

With this, the provider now offers the asset under the condition that the requesting participant is located in the EU.
Expand All @@ -230,7 +230,7 @@ in the request. The request body is prepared in [catalog-request.json](resources
```bash
curl -X POST -H "Content-Type: application/json" -H "X-Api-Key: password" \
-d @policy/policy-01-policy-enforcement/resources/catalog-request.json \
"http://localhost:29193/management/v2/catalog/request" | jq
"http://localhost:29193/management/v3/catalog/request" | jq
```

We'll receive the following catalog in the response, where we can see the offer created in the provider's extension.
Expand Down Expand Up @@ -303,7 +303,7 @@ which protocol to use and which offer we want to negotiate. The request body is
```bash
curl -X POST -H "Content-Type: application/json" -H "X-Api-Key: password" \
-d @policy/policy-01-policy-enforcement/resources/contract-request.json \
"http://localhost:29193/management/v2/contractnegotiations" | jq
"http://localhost:29193/management/v3/contractnegotiations" | jq
```

You'll get back a UUID. This is the ID of the contract negotiation process which is being asynchronously executed
Expand All @@ -315,7 +315,7 @@ Using the ID received in the previous step, we can now view the state of the neg
of the consumer's management API:

```bash
curl -X GET -H "X-Api-Key: password" "http://localhost:29193/management/v2/contractnegotiations/<UUID>" | jq
curl -X GET -H "X-Api-Key: password" "http://localhost:29193/management/v3/contractnegotiations/<UUID>" | jq
```

In the response we'll get a description of the negotiation, similar to the following:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ plugins {
dependencies {
implementation(libs.edc.connector.core)
implementation(libs.edc.control.plane.core)
implementation(libs.edc.data.plane.selector.core)
implementation(libs.edc.configuration.filesystem)
implementation(libs.edc.management.api)
implementation(libs.edc.dsp)
Expand All @@ -34,7 +33,6 @@ application {
}

tasks.withType<com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar> {
//exclude("**/pom.properties", "**/pom.xm")
mergeServiceFiles()
archiveFileName.set("consumer.jar")
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ plugins {
dependencies {
implementation(libs.edc.connector.core)
implementation(libs.edc.control.plane.core)
implementation(libs.edc.data.plane.selector.core)
implementation(libs.edc.configuration.filesystem)
implementation(libs.edc.management.api)
implementation(libs.edc.dsp)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
package org.eclipse.edc.samples.basic;

import org.eclipse.edc.junit.annotations.EndToEndTest;
import org.eclipse.edc.junit.extensions.EdcRuntimeExtension;
import org.eclipse.edc.junit.extensions.EmbeddedRuntime;
import org.eclipse.edc.junit.extensions.RuntimeExtension;
import org.eclipse.edc.junit.extensions.RuntimePerClassExtension;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;

Expand All @@ -28,14 +30,14 @@
class Basic01basicConnectorTest {

@RegisterExtension
static EdcRuntimeExtension connector = new EdcRuntimeExtension(
":basic:basic-01-basic-connector",
static RuntimeExtension connector = new RuntimePerClassExtension(new EmbeddedRuntime(
"connector",
emptyMap()
);
emptyMap(),
":basic:basic-01-basic-connector"
));

@Test
void shouldStartConnector() {
assertThat(connector.getContext().getService(Clock.class)).isNotNull();
assertThat(connector.getService(Clock.class)).isNotNull();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ public class NegotiationCommon {
private static final String CREATE_ASSET_FILE_PATH = "transfer/transfer-01-negotiation/resources/create-asset.json";
private static final String V3_ASSETS_PATH = "/v3/assets";
private static final String CREATE_POLICY_FILE_PATH = "transfer/transfer-01-negotiation/resources/create-policy.json";
private static final String V2_POLICY_DEFINITIONS_PATH = "/v2/policydefinitions";
private static final String V2_POLICY_DEFINITIONS_PATH = "/v3/policydefinitions";
private static final String CREATE_CONTRACT_DEFINITION_FILE_PATH = "transfer/transfer-01-negotiation/resources/create-contract-definition.json";
private static final String V2_CONTRACT_DEFINITIONS_PATH = "/v2/contractdefinitions";
private static final String V2_CATALOG_DATASET_REQUEST_PATH = "/v2/catalog/dataset/request";
private static final String V2_CONTRACT_DEFINITIONS_PATH = "/v3/contractdefinitions";
private static final String V2_CATALOG_DATASET_REQUEST_PATH = "/v3/catalog/dataset/request";
private static final String FETCH_DATASET_FROM_CATALOG_FILE_PATH = "transfer/transfer-01-negotiation/resources/get-dataset.json";
private static final String CATALOG_DATASET_ID = "\"odrl:hasPolicy\".'@id'";
private static final String NEGOTIATE_CONTRACT_FILE_PATH = "transfer/transfer-01-negotiation/resources/negotiate-contract.json";
private static final String V2_CONTRACT_NEGOTIATIONS_PATH = "/v2/contractnegotiations/";
private static final String V2_CONTRACT_NEGOTIATIONS_PATH = "/v3/contractnegotiations/";
private static final String CONTRACT_NEGOTIATION_ID = "@id";
private static final String CONTRACT_AGREEMENT_ID = "contractAgreementId";
private static final String CONTRACT_OFFER_ID_KEY = "{{contract-offer-id}}";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
public class PolicyCommon {

private static final String V3_ASSETS_PATH = "/v3/assets";
private static final String V2_POLICY_DEFINITIONS_PATH = "/v2/policydefinitions";
private static final String V2_CONTRACT_DEFINITIONS_PATH = "/v2/contractdefinitions";
private static final String V2_POLICY_DEFINITIONS_PATH = "/v3/policydefinitions";
private static final String V2_CONTRACT_DEFINITIONS_PATH = "/v3/contractdefinitions";

public static void createAsset(String createAssetFilePath) {
post(PrerequisitesCommon.PROVIDER_MANAGEMENT_URL + V3_ASSETS_PATH, getFileContentFromRelativePath(createAssetFilePath));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
package org.eclipse.edc.samples.policy;

import org.eclipse.edc.junit.annotations.EndToEndTest;
import org.eclipse.edc.junit.extensions.EdcRuntimeExtension;
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.samples.common.NegotiationCommon;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
Expand All @@ -42,14 +44,14 @@ class Policy01BasicTest {
private static final String CREATE_CONTRACT_DEFINITION_FILE_PATH = SAMPLE_FOLDER + "/resources/create-contract-definition.json";
private static final String CONTRACT_OFFER_FILE_PATH = SAMPLE_FOLDER + "/resources/contract-request.json";

@RegisterExtension
static final EdcRuntimeExtension PROVIDER_RUNTIME = provider();

@Nested
class Terminated {

@RegisterExtension
static final EdcRuntimeExtension CONSUMER_RUNTIME = consumer("system-tests/src/test/resources/policy/config-us.properties");
static final RuntimeExtension PROVIDER_RUNTIME = provider();

@RegisterExtension
static final RuntimeExtension CONSUMER_RUNTIME = consumer("system-tests/src/test/resources/policy/config-us.properties");

@Test
void runSampleSteps() {
Expand All @@ -70,7 +72,10 @@ void runSampleSteps() {
class Finalized {

@RegisterExtension
static final EdcRuntimeExtension CONSUMER_RUNTIME = consumer("system-tests/src/test/resources/policy/config-eu.properties");
static final RuntimeExtension PROVIDER_RUNTIME = provider();

@RegisterExtension
static final RuntimeExtension CONSUMER_RUNTIME = consumer("system-tests/src/test/resources/policy/config-eu.properties");

@Test
void runSampleSteps() {
Expand All @@ -85,16 +90,20 @@ void runSampleSteps() {

}

private static EdcRuntimeExtension provider() {
return new EdcRuntimeExtension(":policy:policy-01-policy-enforcement:policy-enforcement-provider",
private static RuntimeExtension provider() {
return new RuntimePerClassExtension(new EmbeddedRuntime(
"provider",
Map.of("edc.fs.config", getFileFromRelativePath(SAMPLE_FOLDER + "/policy-enforcement-provider/config.properties").getAbsolutePath())
);
Map.of("edc.fs.config", getFileFromRelativePath(SAMPLE_FOLDER + "/policy-enforcement-provider/config.properties").getAbsolutePath()),
":policy:policy-01-policy-enforcement:policy-enforcement-provider"
));
}

private static EdcRuntimeExtension consumer(String configurationFilePath) {
return new EdcRuntimeExtension(":policy:policy-01-policy-enforcement:policy-enforcement-consumer",
"consumer", Map.of("edc.fs.config", getFileFromRelativePath(configurationFilePath).getAbsolutePath()));
private static RuntimeExtension consumer(String configurationFilePath) {
return new RuntimePerClassExtension(new EmbeddedRuntime(
"consumer",
Map.of("edc.fs.config", getFileFromRelativePath(configurationFilePath).getAbsolutePath()),
":policy:policy-01-policy-enforcement:policy-enforcement-consumer"
));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ void runSampleSteps() {

var edr = given()
.when()
.get(CONSUMER_MANAGEMENT_URL + "/v1/edrs/{id}/dataaddress", transferProcessId)
.get(CONSUMER_MANAGEMENT_URL + "/v3/edrs/{id}/dataaddress", transferProcessId)
.then()
.log().ifValidationFails()
.statusCode(200)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public String createPolicyDefinition(String requestBody) {
.contentType(JSON)
.body(requestBody)
.when()
.post("/v2/policydefinitions")
.post("/v3/policydefinitions")
.then()
.statusCode(200)
.contentType(JSON)
Expand All @@ -62,7 +62,7 @@ public String createContractDefinition(String requestBody) {
.contentType(JSON)
.body(requestBody)
.when()
.post("/v2/contractdefinitions")
.post("/v3/contractdefinitions")
.then()
.statusCode(200)
.extract().jsonPath().getString(ID);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class TransferUtil {
public static final Duration POLL_INTERVAL = Duration.ofMillis(500);

private static final String CONTRACT_AGREEMENT_ID_KEY = "{{contract-agreement-id}}";
private static final String V2_TRANSFER_PROCESSES_PATH = "/v2/transferprocesses/";
private static final String V2_TRANSFER_PROCESSES_PATH = "/v3/transferprocesses/";
private static final String EDC_STATE = "state";

public static void get(String url) {
Expand Down
Loading

0 comments on commit 047c0d2

Please sign in to comment.