Skip to content

Commit

Permalink
chore: updates edc to 0.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
wolf4ood committed May 21, 2024
1 parent e037eba commit ab42a0f
Show file tree
Hide file tree
Showing 13 changed files with 87 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@ spec:
value: {{ .Values.dataplane.endpoints.signaling.port | quote }}
- name: "WEB_HTTP_SIGNALING_PATH"
value: {{ .Values.dataplane.endpoints.signaling.path | quote }}
- name: "WEB_HTTP_CONTROL_PORT"
value: {{ .Values.dataplane.endpoints.control.port | quote }}
- name: "WEB_HTTP_CONTROL_PATH"
value: {{ .Values.dataplane.endpoints.control.path | quote }}
- name: "WEB_HTTP_PUBLIC_PORT"
value: {{ .Values.dataplane.endpoints.public.port | quote }}
- name: "WEB_HTTP_PUBLIC_PATH"
Expand Down
3 changes: 3 additions & 0 deletions charts/tractusx-connector-azure-vault/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,9 @@ dataplane:
signaling:
port: 8083
path: /api/signaling
control:
port: 8084
path: /api/control
proxy:
port: 8186
path: /proxy
Expand Down
4 changes: 4 additions & 0 deletions charts/tractusx-connector/templates/deployment-dataplane.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@ spec:
value: {{ .Values.dataplane.endpoints.signaling.port | quote }}
- name: "WEB_HTTP_SIGNALING_PATH"
value: {{ .Values.dataplane.endpoints.signaling.path | quote }}
- name: "WEB_HTTP_CONTROL_PORT"
value: {{ .Values.dataplane.endpoints.control.port | quote }}
- name: "WEB_HTTP_CONTROL_PATH"
value: {{ .Values.dataplane.endpoints.control.path | quote }}
- name: "WEB_HTTP_PUBLIC_PORT"
value: {{ .Values.dataplane.endpoints.public.port | quote }}
- name: "WEB_HTTP_PUBLIC_PATH"
Expand Down
3 changes: 3 additions & 0 deletions charts/tractusx-connector/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,9 @@ dataplane:
signaling:
port: 8083
path: /api/signaling
control:
port: 8084
path: /api/control
proxy:
port: 8186
path: /proxy
Expand Down
49 changes: 49 additions & 0 deletions docs/migration/Version_0.5.x_0.7.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,11 +236,60 @@ this [test class](https://github.com/eclipse-tractusx/tractusx-edc/blob/main/edc
## 5. EDC Management API

### 5.0 Policies

Due to [#4192](https://github.com/eclipse-edc/Connector/issues/4192) and [#4179](https://github.com/eclipse-edc/Connector/issues/4179)

The `action` and the `leftOperand` field are now represented as `@id` instead of `value` in JSON-LD.

`action` from:

```json
{
"odrl:permission": {
"odrl:action": {
"odrl:type": "http://www.w3.org/ns/odrl/2/use"
}
}
}
```
to:

```json
{
"odrl:action": {
"@id": "odrl:use"
}
}
```

`leftOperand` from:

```json
{
"odrl:leftOperand": "https://w3id.org/catenax/policy/FrameworkAgreement"
}
```

to:

```json
{
"odrl:leftOperand": {
"@id": "cx-policy:FrameworkAgreement"
}
}
```

This is reflected in the `Catalog` as well as in `PolicyDefinition` API.

### 5.1 Catalog

- `counterPartyId` is a **required** property for the catalog request in Tractus-X EDC. It's not enforced currently (
backward compatibility) but if not provided, the IATP flows won't work and thus the catalog request will fail.



### 5.2 Transfer Process

- `transferType` is a needed property for the transfer request to be working in tx-edc. `transferTypes` are the
Expand Down
1 change: 1 addition & 0 deletions edc-controlplane/edc-controlplane-base/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ dependencies {
runtimeOnly(libs.edc.api.management)
runtimeOnly(libs.edc.api.controlplane)
runtimeOnly(libs.edc.api.management.config)
runtimeOnly(libs.edc.api.core)
runtimeOnly(libs.edc.api.observability)
runtimeOnly(libs.edc.dsp)
runtimeOnly(libs.edc.spi.jwt)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import static org.eclipse.tractusx.edc.dataplane.selector.configuration.DataPlaneSelectorConfigurationServiceExtension.PROPERTIES_SUFFIX;
import static org.eclipse.tractusx.edc.dataplane.selector.configuration.DataPlaneSelectorConfigurationServiceExtension.PUBLIC_API_URL_PROPERTY;
import static org.eclipse.tractusx.edc.dataplane.selector.configuration.DataPlaneSelectorConfigurationServiceExtension.SOURCE_TYPES_SUFFIX;
import static org.eclipse.tractusx.edc.dataplane.selector.configuration.DataPlaneSelectorConfigurationServiceExtension.TRANSFER_TYPES_SUFFIX;
import static org.eclipse.tractusx.edc.dataplane.selector.configuration.DataPlaneSelectorConfigurationServiceExtension.URL_SUFFIX;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
Expand All @@ -57,16 +58,16 @@
class DataPlaneSelectorConfigurationServiceExtensionTest {
private static final String S3_BUCKET = "s3-bucket";
private static final String BLOB_STORAGE = "blob-storage";
private static final String LOCAL_FILE_SYSTEM = "local-file-system";

private static final String DATA_PLANE_INSTANCE_ID = "test-plane";
private static final String DATA_PLANE_INSTANCE_URL = "http://127.0.0.1:8080/test";
private static final String DATA_PLANE_INSTANCE_SOURCE_TYPES = "%s, %s".formatted(S3_BUCKET, BLOB_STORAGE);
private static final String DATA_PLANE_INSTANCE_DESTINATION_TYPES = LOCAL_FILE_SYSTEM;
private static final String DATA_PLANE_INSTANCE_TRANSFER_TYPES = "%s".formatted(S3_BUCKET);

private static final String URL_KEY = "%s.%s".formatted(DATA_PLANE_INSTANCE_ID, URL_SUFFIX);
private static final String SOURCE_TYPES_KEY = "%s.%s".formatted(DATA_PLANE_INSTANCE_ID, SOURCE_TYPES_SUFFIX);
private static final String DESTINATION_TYPES_KEY = "%s.%s".formatted(DATA_PLANE_INSTANCE_ID, DESTINATION_TYPES_SUFFIX);
private static final String TRANSFER_TYPES_KEY = "%s.%s".formatted(DATA_PLANE_INSTANCE_ID, TRANSFER_TYPES_SUFFIX);
private static final String PROPERTIES_KEY = "%s.%s".formatted(DATA_PLANE_INSTANCE_ID, PROPERTIES_SUFFIX);
private final ServiceExtensionContext serviceExtensionContext = mock();
private final DataPlaneSelectorService dataPlaneSelectorService = mock();
Expand Down Expand Up @@ -106,12 +107,11 @@ void testInitialize() {
.addInstance(argThat(dataPlaneInstance -> {
var s3Source = DataAddress.Builder.newInstance().type(S3_BUCKET).build();
var blobSource = DataAddress.Builder.newInstance().type(BLOB_STORAGE).build();
var fsSink = DataAddress.Builder.newInstance().type(LOCAL_FILE_SYSTEM).build();

return dataPlaneInstance.getId().equals(DATA_PLANE_INSTANCE_ID) &&
dataPlaneInstance.getUrl().toString().equals(DATA_PLANE_INSTANCE_URL) &&
dataPlaneInstance.canHandle(s3Source, fsSink) &&
dataPlaneInstance.canHandle(blobSource, fsSink);
dataPlaneInstance.canHandle(s3Source, S3_BUCKET) &&
dataPlaneInstance.canHandle(blobSource, S3_BUCKET);
}));
}

Expand All @@ -125,7 +125,7 @@ void testWarningOnPropertyMissing(String configKey, String configValue) {
extension.initialize(serviceExtensionContext);

// one warning config missing, one warning data plane instance skipped
verify(monitor, times(3)).warning(anyString());
verify(monitor, times(2)).warning(anyString());
}

@Test
Expand All @@ -143,7 +143,8 @@ private Map<String, String> getConfig() {
{
put(URL_KEY, DATA_PLANE_INSTANCE_URL);
put(SOURCE_TYPES_KEY, DATA_PLANE_INSTANCE_SOURCE_TYPES);
put(DESTINATION_TYPES_KEY, DATA_PLANE_INSTANCE_DESTINATION_TYPES);
put(TRANSFER_TYPES_KEY, DATA_PLANE_INSTANCE_TRANSFER_TYPES);
put(DESTINATION_TYPES_KEY, S3_BUCKET);
put(PROPERTIES_KEY, "{ \"%s\": \"%s\" }".formatted(PUBLIC_API_URL_PROPERTY, DATA_PLANE_INSTANCE_URL));
}
};
Expand Down
1 change: 1 addition & 0 deletions edc-extensions/edr/edr-api-v2/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ dependencies {
implementation(project(":spi:tokenrefresh-spi"))

implementation(libs.edc.api.management)
implementation(libs.edc.api.core)
implementation(libs.edc.lib.validator)
implementation(libs.edc.spi.edrstore)
implementation(libs.jakarta.rsApi)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import jakarta.json.JsonArray;
import jakarta.json.JsonObject;
import org.eclipse.edc.api.model.ApiCoreSchema;
import org.eclipse.edc.connector.api.management.configuration.ManagementApiSchema;
import org.eclipse.edc.connector.controlplane.api.management.contractnegotiation.ContractNegotiationApi;
import org.eclipse.edc.edr.spi.types.EndpointDataReferenceEntry;
import org.eclipse.edc.web.spi.ApiErrorDetail;
Expand Down Expand Up @@ -71,7 +70,7 @@ public interface EdrCacheApi {
},
responses = {
@ApiResponse(responseCode = "200", description = "The data address",
content = @Content(schema = @Schema(implementation = ManagementApiSchema.DataAddressSchema.class))),
content = @Content(schema = @Schema(implementation = ApiCoreSchema.DataAddressSchema.class))),
@ApiResponse(responseCode = "400", description = "Request was malformed, e.g. id was null",
content = @Content(array = @ArraySchema(schema = @Schema(implementation = ApiCoreSchema.ApiErrorDetailSchema.class)))),
@ApiResponse(responseCode = "404", description = "An EDR data address with the given transfer process ID does not exist",
Expand All @@ -95,7 +94,7 @@ public interface EdrCacheApi {
},
responses = {
@ApiResponse(responseCode = "200", description = "The data address",
content = @Content(schema = @Schema(implementation = ManagementApiSchema.DataAddressSchema.class))),
content = @Content(schema = @Schema(implementation = ApiCoreSchema.DataAddressSchema.class))),
@ApiResponse(responseCode = "400", description = "Request was malformed, e.g. id was null",
content = @Content(array = @ArraySchema(schema = @Schema(implementation = ApiCoreSchema.ApiErrorDetailSchema.class)))),
@ApiResponse(responseCode = "404", description = "An EDR data address with the given transfer process ID does not exist",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ public Stream<? extends Arguments> provideArguments(ExtensionContext extensionCo
return Stream.of(
Arguments.of(frameworkPolicy(Map.of(CX_POLICY_NS + "Membership", "active")), "MembershipCredential"),
Arguments.of(frameworkPolicy(Map.of(CX_POLICY_NS + "FrameworkAgreement.pcf", "active")), "PCF Use Case (legacy notation)"),
Arguments.of(frameworkPolicy(Map.of(CX_POLICY_NS + "FrameworkAgreement", "pcf")), "PCF Use Case (new notation)"),
Arguments.of(frameworkPolicy(Map.of(CX_POLICY_NS + "FrameworkAgreement", "Pcf")), "PCF Use Case (new notation)"),
Arguments.of(frameworkPolicy(Map.of(CX_POLICY_NS + "Dismantler", "active")), "Dismantler Credential"),
Arguments.of(frameworkPolicy(Map.of(CX_POLICY_NS + "Dismantler.activityType", "vehicleDismantle")), "Dismantler Cred (activity type)"),
Arguments.of(frameworkPolicy(CX_POLICY_NS + "Dismantler.allowedBrands", Operator.IS_ANY_OF, List.of("Moskvich", "Tatra")), "Dismantler allowedBrands (IS_ANY_OF, one intersects)"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
public class RuntimeConfig {

private final Endpoint publicApi = new Endpoint(URI.create("http://localhost:%d/public".formatted(getFreePort())));
private final Endpoint signalingApi = new Endpoint(URI.create("http://localhost:%d/signaling".formatted(getFreePort())));
private final Endpoint controlApi = new Endpoint(URI.create("http://localhost:%d/control".formatted(getFreePort())));
private final Endpoint refreshApi = publicApi;
private final Endpoint defaultApi = new Endpoint(URI.create("http://localhost:%d/api".formatted(getFreePort())));

Expand All @@ -50,8 +50,8 @@ public Map<String, String> baseConfig() {
put("web.http.port", String.valueOf(defaultApi.url().getPort()));
put("web.http.public.path", publicApi.url().getPath());
put("web.http.public.port", String.valueOf(publicApi.url().getPort()));
put("web.http.signaling.path", signalingApi.url().getPath());
put("web.http.signaling.port", String.valueOf(signalingApi.url().getPort()));
put("web.http.control.path", controlApi.url().getPath());
put("web.http.control.port", String.valueOf(controlApi.url().getPort()));
put("edc.iam.issuer.id", "did:web:" + UUID.randomUUID());
put("edc.iam.sts.oauth.token.url", "http://sts.example.com/token");
put("edc.iam.sts.oauth.client.id", "test-clientid");
Expand All @@ -66,8 +66,8 @@ public Endpoint getPublicApi() {
return publicApi;
}

public Endpoint getSignalingApi() {
return signalingApi;
public Endpoint getControlApi() {
return controlApi;
}

public Endpoint getRefreshApi() {
Expand Down
3 changes: 2 additions & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
format.version = "1.1"

[versions]
edc = "0.6.4"
edc = "0.6.5-SNAPSHOT"
apache-sshd = "2.12.1"
assertj = "3.25.3"
awaitility = "4.2.1"
Expand Down Expand Up @@ -68,6 +68,7 @@ edc-controlplane-callback-staticendpoint = { module = "org.eclipse.edc:callback-
edc-junit = { module = "org.eclipse.edc:junit", version.ref = "edc" }
edc-api-management-config = { module = "org.eclipse.edc:management-api-configuration", version.ref = "edc" }
edc-api-management = { module = "org.eclipse.edc:management-api", version.ref = "edc" }
edc-api-core = { module = "org.eclipse.edc:api-core", version.ref = "edc" }
edc-api-management-test-fixtures = { module = "org.eclipse.edc:management-api-test-fixtures", version.ref = "edc" }
edc-api-catalog = { module = "org.eclipse.edc:catalog-api", version.ref = "edc" }
edc-api-observability = { module = "org.eclipse.edc:api-observability", version.ref = "edc" }
Expand Down
4 changes: 4 additions & 0 deletions samples/multi-tenancy/src/test/resources/tenants.properties
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,16 @@ edc.tenants.one.web.http.port=18181
edc.tenants.one.web.http.path=/api
edc.tenants.one.web.http.protocol.port=18282
edc.tenants.one.web.http.protocol.path=/protocol
edc.tenants.one.web.http.control.port=18283
edc.tenants.one.web.http.control.path=/control
edc.tenants.one.tx.edc.iam.iatp.bdrs.server.url=http://bdrs.test.com
edc.tenants.one.edc.iam.issuer.id=did:web:tenant1
edc.tenants.two.edc.any=any
edc.tenants.two.web.http.port=28181
edc.tenants.two.web.http.path=/api
edc.tenants.two.web.http.protocol.port=28282
edc.tenants.two.web.http.protocol.path=/protocol
edc.tenants.two.web.http.control.port=28283
edc.tenants.two.web.http.control.path=/control
edc.tenants.two.tx.edc.iam.iatp.bdrs.server.url=http://bdrs.test.com
edc.tenants.two.edc.iam.issuer.id=did:web:tenant2

0 comments on commit ab42a0f

Please sign in to comment.