Skip to content

Commit

Permalink
refactor: code base now uses DPS (#1146)
Browse files Browse the repository at this point in the history
* remove provider dataplane proxy

* remove old edr api

* re-enable callbacks

* introduce fixtures module

* introduce fixtures module

* introduce controlplane test modules

* http pull transfer w/ signaling

* split tests

* fix negotiate edr test

* get http push to work

* rename edr-test edr-api-test

* added policy tests

* cleanup

* transfer type in SSI/DIM/IATP tests

* iatp test

* fix DIM tests

* add legacy SSI tests

* compile errors

* DEPENDENCIES

* add SQL migration for DataAddress change

* temporarily made DIM and TokenRefresh config optional

* fix MIW e2e tests
  • Loading branch information
paullatzelsperger authored Mar 20, 2024
1 parent e856f95 commit 19c7866
Show file tree
Hide file tree
Showing 163 changed files with 2,693 additions and 4,764 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/verify.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,12 @@ jobs:
strategy:
fail-fast: false
matrix:
variant: [ { dir: edc-tests/edc-controlplane},
{ dir: edc-tests/e2e-tests}
variant: [ { dir: edc-tests/edc-controlplane/catalog-tests },
{ dir: edc-tests/edc-controlplane/edr-api-tests },
{ dir: edc-tests/edc-controlplane/iatp-tests },
{ dir: edc-tests/edc-controlplane/policy-tests },
{ dir: edc-tests/edc-controlplane/ssi-summarycred-tests },
{ dir: edc-tests/edc-controlplane/transfer-tests }
]
steps:
- uses: actions/checkout@v4
Expand Down
8 changes: 5 additions & 3 deletions DEPENDENCIES
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ maven/mavencentral/net.java.dev.jna/jna-platform/5.13.0, Apache-2.0 OR LGPL-2.1-
maven/mavencentral/net.java.dev.jna/jna-platform/5.6.0, Apache-2.0 OR LGPL-2.1-or-later, approved, CQ22390
maven/mavencentral/net.java.dev.jna/jna/5.13.0, Apache-2.0 AND LGPL-2.1-or-later, approved, #6709
maven/mavencentral/net.javacrumbs.json-unit/json-unit-core/2.36.0, Apache-2.0, approved, clearlydefined
maven/mavencentral/net.minidev/accessors-smart/2.4.7, Apache-2.0, approved, #7515
maven/mavencentral/net.minidev/accessors-smart/2.5.0, Apache-2.0, approved, clearlydefined
maven/mavencentral/net.minidev/json-smart/2.4.10, Apache-2.0, approved, #3288
maven/mavencentral/net.minidev/json-smart/2.4.7, Apache-2.0, approved, #3288
Expand Down Expand Up @@ -325,6 +326,7 @@ maven/mavencentral/org.bouncycastle/bcpkix-jdk18on/1.72, MIT, approved, #3789
maven/mavencentral/org.bouncycastle/bcpkix-jdk18on/1.77, MIT, approved, #11593
maven/mavencentral/org.bouncycastle/bcprov-jdk18on/1.72, MIT AND CC0-1.0, approved, #3538
maven/mavencentral/org.bouncycastle/bcprov-jdk18on/1.77, MIT AND CC0-1.0, approved, #11595
maven/mavencentral/org.bouncycastle/bcutil-jdk18on/1.72, MIT, approved, #3790
maven/mavencentral/org.bouncycastle/bcutil-jdk18on/1.77, MIT, approved, #11596
maven/mavencentral/org.ccil.cowan.tagsoup/tagsoup/1.2.1, Apache-2.0, approved, clearlydefined
maven/mavencentral/org.checkerframework/checker-qual/3.12.0, MIT, approved, clearlydefined
Expand Down Expand Up @@ -376,19 +378,18 @@ maven/mavencentral/org.eclipse.edc/data-address-http-data-spi/0.5.2-SNAPSHOT, Ap
maven/mavencentral/org.eclipse.edc/data-plane-aws-s3/0.5.2-SNAPSHOT, Apache-2.0, approved, technology.edc
maven/mavencentral/org.eclipse.edc/data-plane-azure-storage/0.5.2-SNAPSHOT, Apache-2.0, approved, technology.edc
maven/mavencentral/org.eclipse.edc/data-plane-client-embedded/0.5.2-SNAPSHOT, Apache-2.0, approved, technology.edc
maven/mavencentral/org.eclipse.edc/data-plane-client/0.5.2-SNAPSHOT, Apache-2.0, approved, technology.edc
maven/mavencentral/org.eclipse.edc/data-plane-control-api/0.5.2-SNAPSHOT, Apache-2.0, approved, technology.edc
maven/mavencentral/org.eclipse.edc/data-plane-core/0.5.2-SNAPSHOT, Apache-2.0, approved, technology.edc
maven/mavencentral/org.eclipse.edc/data-plane-http-oauth2-core/0.5.2-SNAPSHOT, Apache-2.0, approved, technology.edc
maven/mavencentral/org.eclipse.edc/data-plane-http-oauth2/0.5.2-SNAPSHOT, Apache-2.0, approved, technology.edc
maven/mavencentral/org.eclipse.edc/data-plane-http-spi/0.5.2-SNAPSHOT, Apache-2.0, approved, technology.edc
maven/mavencentral/org.eclipse.edc/data-plane-http/0.5.2-SNAPSHOT, Apache-2.0, approved, technology.edc
maven/mavencentral/org.eclipse.edc/data-plane-public-api-v2/0.5.2-SNAPSHOT, Apache-2.0, approved, technology.edc
maven/mavencentral/org.eclipse.edc/data-plane-public-api/0.5.2-SNAPSHOT, Apache-2.0, approved, technology.edc
maven/mavencentral/org.eclipse.edc/data-plane-selector-core/0.5.2-SNAPSHOT, Apache-2.0, approved, technology.edc
maven/mavencentral/org.eclipse.edc/data-plane-selector-spi/0.5.2-SNAPSHOT, Apache-2.0, approved, technology.edc
maven/mavencentral/org.eclipse.edc/data-plane-signaling-api-configuration/0.5.2-SNAPSHOT, Apache-2.0, approved, technology.edc
maven/mavencentral/org.eclipse.edc/data-plane-signaling-api/0.5.2-SNAPSHOT, Apache-2.0, approved, technology.edc
maven/mavencentral/org.eclipse.edc/data-plane-signaling-client/0.5.2-SNAPSHOT, Apache-2.0, approved, technology.edc
maven/mavencentral/org.eclipse.edc/data-plane-signaling-transform/0.5.2-SNAPSHOT, Apache-2.0, approved, technology.edc
maven/mavencentral/org.eclipse.edc/data-plane-spi/0.5.2-SNAPSHOT, Apache-2.0, approved, technology.edc
maven/mavencentral/org.eclipse.edc/data-plane-util/0.5.2-SNAPSHOT, Apache-2.0, approved, technology.edc
Expand Down Expand Up @@ -478,8 +479,8 @@ maven/mavencentral/org.eclipse.edc/transaction-datasource-spi/0.5.2-SNAPSHOT, Ap
maven/mavencentral/org.eclipse.edc/transaction-local/0.5.2-SNAPSHOT, Apache-2.0, approved, technology.edc
maven/mavencentral/org.eclipse.edc/transaction-spi/0.5.2-SNAPSHOT, Apache-2.0, approved, technology.edc
maven/mavencentral/org.eclipse.edc/transfer-core/0.5.2-SNAPSHOT, Apache-2.0, approved, technology.edc
maven/mavencentral/org.eclipse.edc/transfer-data-plane-signaling/0.5.2-SNAPSHOT, Apache-2.0, approved, technology.edc
maven/mavencentral/org.eclipse.edc/transfer-data-plane-spi/0.5.2-SNAPSHOT, Apache-2.0, approved, technology.edc
maven/mavencentral/org.eclipse.edc/transfer-data-plane/0.5.2-SNAPSHOT, Apache-2.0, approved, technology.edc
maven/mavencentral/org.eclipse.edc/transfer-process-api/0.5.2-SNAPSHOT, Apache-2.0, approved, technology.edc
maven/mavencentral/org.eclipse.edc/transfer-process-store-sql/0.5.2-SNAPSHOT, Apache-2.0, approved, technology.edc
maven/mavencentral/org.eclipse.edc/transfer-pull-http-dynamic-receiver/0.5.2-SNAPSHOT, Apache-2.0, approved, technology.edc
Expand Down Expand Up @@ -582,6 +583,7 @@ maven/mavencentral/org.ow2.asm/asm-commons/9.5, BSD-3-Clause, approved, #7553
maven/mavencentral/org.ow2.asm/asm-commons/9.6, BSD-3-Clause, approved, #10775
maven/mavencentral/org.ow2.asm/asm-tree/9.5, BSD-3-Clause, approved, #7555
maven/mavencentral/org.ow2.asm/asm-tree/9.6, BSD-3-Clause, approved, #10773
maven/mavencentral/org.ow2.asm/asm/9.1, BSD-3-Clause, approved, CQ23029
maven/mavencentral/org.ow2.asm/asm/9.3, BSD-3-Clause, approved, clearlydefined
maven/mavencentral/org.ow2.asm/asm/9.5, BSD-3-Clause, approved, #7554
maven/mavencentral/org.ow2.asm/asm/9.6, BSD-3-Clause, approved, #10776
Expand Down
1 change: 1 addition & 0 deletions core/core-utils/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ plugins {
}

dependencies {
implementation(libs.edc.spi.core)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* Copyright (c) 2024 Bayerische Motoren Werke Aktiengesellschaft
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Apache License, Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* SPDX-License-Identifier: Apache-2.0
*/

package org.eclipse.tractusx.edc.core.utils;

import org.eclipse.edc.spi.monitor.Monitor;

public class RequiredConfigWarnings {

public static void warningNotPresent(Monitor monitor, String missingConfig) {
monitor.severe("Mandatory config value missing: '%s'. This runtime will not be fully operational! Starting with v0.7.x this will be a runtime error.".formatted(missingConfig));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -247,20 +247,18 @@ private StatusResult<Void> fireTransferProcess(EndpointDataReferenceEntry entry)
if (transferProcess == null) {
return StatusResult.failure(ResponseStatus.FATAL_ERROR, format("Failed to find transfer process %s", entry.getTransferProcessId()));
}
var dataRequest = transferProcess.getDataRequest();

var transferRequest = TransferRequest.Builder.newInstance()
.assetId(dataRequest.getAssetId())
.contractId(dataRequest.getContractId())
.protocol(dataRequest.getProtocol())
.counterPartyAddress(dataRequest.getConnectorAddress())
.dataDestination(dataRequest.getDataDestination())
.assetId(transferProcess.getAssetId())
.contractId(transferProcess.getContractId())
.protocol(transferProcess.getProtocol())
.counterPartyAddress(transferProcess.getCounterPartyAddress())
.dataDestination(transferProcess.getDataDestination())
.callbackAddresses(transferProcess.getCallbackAddresses())
.build();

var result = transferProcessService.initiateTransfer(transferRequest);
if (result.failed()) {
var msg = format("Failed to initiate a transfer for contract %s and asset %s, error: %s", dataRequest.getContractId(), dataRequest.getAssetId(), result.getFailureDetail());
var msg = format("Failed to initiate a transfer for contract %s and asset %s, error: %s", transferProcess.getContractId(), transferProcess.getAssetId(), result.getFailureDetail());
monitor.severe(msg);
return StatusResult.failure(ResponseStatus.ERROR_RETRY, result.getFailureDetail());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import org.eclipse.edc.connector.contract.spi.types.negotiation.ContractRequest;
import org.eclipse.edc.connector.spi.contractnegotiation.ContractNegotiationService;
import org.eclipse.edc.connector.spi.transferprocess.TransferProcessService;
import org.eclipse.edc.connector.transfer.spi.types.DataRequest;
import org.eclipse.edc.connector.transfer.spi.types.ProvisionedResourceSet;
import org.eclipse.edc.connector.transfer.spi.types.TransferProcess;
import org.eclipse.edc.connector.transfer.spi.types.TransferProcessStates;
Expand All @@ -31,6 +30,7 @@
import org.eclipse.edc.spi.query.QuerySpec;
import org.eclipse.edc.spi.result.ServiceResult;
import org.eclipse.edc.spi.result.StoreResult;
import org.eclipse.edc.spi.types.domain.DataAddress;
import org.eclipse.tractusx.edc.edr.spi.store.EndpointDataReferenceCache;
import org.eclipse.tractusx.edc.edr.spi.types.EndpointDataReferenceEntry;
import org.junit.jupiter.api.BeforeEach;
Expand Down Expand Up @@ -254,30 +254,21 @@ private EndpointDataReferenceEntry.Builder edrEntryBuilder() {

private TransferProcess.Builder createTransferProcessBuilder() {
var processId = UUID.randomUUID().toString();
var dataRequest = createDataRequestBuilder()
.processId(processId)
.protocol("protocol")
.connectorAddress("http://an/address")
.build();

return TransferProcess.Builder.newInstance()
.provisionedResourceSet(ProvisionedResourceSet.Builder.newInstance().build())
.type(CONSUMER)
.id("test-process-" + processId)
.state(TransferProcessStates.COMPLETED.code())
.dataRequest(dataRequest);
}

private DataRequest.Builder createDataRequestBuilder() {
return DataRequest.Builder.newInstance()
.id(UUID.randomUUID().toString())
.contractId(UUID.randomUUID().toString())
.assetId(UUID.randomUUID().toString())
.destinationType("test-type");
.protocol("protocol")
.dataDestination(DataAddress.Builder.newInstance().type("test-type").build())
.counterPartyAddress("http://an/address");
}

private Criterion[] stateIs(int state) {
return aryEq(new Criterion[] {hasState(state)});
return aryEq(new Criterion[]{ hasState(state) });
}

}
9 changes: 7 additions & 2 deletions edc-controlplane/edc-controlplane-base/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,16 @@ dependencies {
runtimeOnly(project(":core:edr-cache-core"))
runtimeOnly(project(":core:edr-core"))
runtimeOnly(project(":edc-extensions:dataplane:dataplane-selector-configuration"))
runtimeOnly(project(":edc-extensions:data-encryption"))

runtimeOnly(project(":edc-extensions:provision-additional-headers"))
runtimeOnly(project(":edc-extensions:edr:edr-api"))
runtimeOnly(project(":edc-extensions:edr:edr-api-v2"))
runtimeOnly(project(":edc-extensions:edr:edr-callback"))
runtimeOnly(project(":edc-extensions:tokenrefresh-handler"))
runtimeOnly(libs.edc.core.edrstore)
runtimeOnly(libs.edc.edr.store.receiver)
runtimeOnly(libs.edc.dpf.transfer.signaling)

runtimeOnly(project(":edc-extensions:iatp:tx-iatp-sts-dim"))

// needed for BPN validation
runtimeOnly(project(":edc-extensions:bpn-validation"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,12 @@ plugins {
dependencies {
runtimeOnly(project(":edc-controlplane:edc-controlplane-base"))
runtimeOnly(project(":edc-extensions:postgresql-migration"))
runtimeOnly(project(":edc-extensions:edr:edr-cache-sql"))
runtimeOnly(project(":edc-extensions:bpn-validation:business-partner-store-sql"))
runtimeOnly(libs.edc.azure.vault)
runtimeOnly(libs.bundles.edc.sqlstores)
runtimeOnly(libs.edc.transaction.local)
runtimeOnly(libs.edc.sql.pool)
runtimeOnly(libs.edc.core.controlplane)
runtimeOnly(libs.edc.dpf.transfer)
runtimeOnly(libs.postgres)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,12 @@ plugins {
dependencies {
runtimeOnly(project(":edc-controlplane:edc-controlplane-base"))
runtimeOnly(project(":edc-extensions:postgresql-migration"))
runtimeOnly(project(":edc-extensions:edr:edr-cache-sql"))
runtimeOnly(project(":edc-extensions:bpn-validation:business-partner-store-sql"))
runtimeOnly(libs.edc.vault.hashicorp)
runtimeOnly(libs.bundles.edc.sqlstores)
runtimeOnly(libs.edc.transaction.local)
runtimeOnly(libs.edc.sql.pool)
runtimeOnly(libs.edc.core.controlplane)
runtimeOnly(libs.edc.dpf.transfer)
runtimeOnly(libs.postgres)
}

Expand Down
1 change: 0 additions & 1 deletion edc-dataplane/edc-dataplane-azure-vault/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ dependencies {
}
implementation(libs.edc.azure.identity)
implementation("com.azure:azure-security-keyvault-secrets:4.8.0")
runtimeOnly(project(":edc-extensions:edr:edr-cache-sql"))
runtimeOnly(libs.edc.transaction.local)
runtimeOnly(libs.edc.sql.pool)
runtimeOnly(libs.postgres)
Expand Down
3 changes: 0 additions & 3 deletions edc-dataplane/edc-dataplane-base/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ plugins {
dependencies {
runtimeOnly(project(":core:edr-cache-core"))
runtimeOnly(project(":edc-extensions:dataplane:dataplane-proxy:edc-dataplane-proxy-consumer-api"))
runtimeOnly(project(":edc-extensions:dataplane:dataplane-proxy:edc-dataplane-proxy-provider-api"))
runtimeOnly(project(":edc-extensions:dataplane:dataplane-proxy:edc-dataplane-proxy-provider-core"))
runtimeOnly(project(":edc-extensions:dataplane:dataplane-token-refresh:token-refresh-core"))
runtimeOnly(project(":edc-extensions:dataplane:dataplane-token-refresh:token-refresh-api"))

Expand All @@ -45,7 +43,6 @@ dependencies {
runtimeOnly(libs.edc.dpf.api.control)
runtimeOnly(libs.edc.dpf.api.signaling)

runtimeOnly(libs.edc.dpf.api.public.v1)
runtimeOnly(libs.edc.dpf.api.public.v2)
runtimeOnly(libs.edc.core.connector)
runtimeOnly(libs.edc.boot)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ plugins {
dependencies {
implementation(project(":edc-dataplane:edc-dataplane-base"))
runtimeOnly(libs.edc.vault.hashicorp)
runtimeOnly(project(":edc-extensions:edr:edr-cache-sql"))
runtimeOnly(libs.edc.transaction.local)
runtimeOnly(libs.edc.sql.pool)
runtimeOnly(libs.postgres)
Expand Down

This file was deleted.

Loading

0 comments on commit 19c7866

Please sign in to comment.