Skip to content

Commit

Permalink
feat: use data encryptor in the HTTP pull inmem test
Browse files Browse the repository at this point in the history
  • Loading branch information
paullatzelsperger committed Oct 18, 2023
1 parent 894451c commit 657c4ee
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ public static Map<String, String> sokratesConfiguration() {
put("edc.receiver.http.dynamic.endpoint", "http://localhost:" + SOKRATES_CONNECTOR_PORT + "/api/consumer/datareference");
put("tractusx.businesspartnervalidation.log.agreement.validation", "true");
put("edc.agent.identity.key", "BusinessPartnerNumber");
put("edc.data.encryption.keys.alias", "test-alias");
}
};
}
Expand Down Expand Up @@ -145,6 +146,7 @@ public static Map<String, String> platoConfiguration() {
put("edc.agent.identity.key", "BusinessPartnerNumber");
put("tx.dpf.proxy.gateway.aas.proxied.path", "http://localhost:" + PLATO_PROXIED_AAS_BACKEND_PORT + PROXIED_PATH);
put("tx.dpf.proxy.gateway.aas.authorization.type", "none");
put("edc.data.encryption.keys.alias", "test-alias");
}
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public abstract class AbstractHttpConsumerPullWithProxyTest {
@BeforeEach
void setup() throws IOException {
server = new MockWebServer();

}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,15 @@

package org.eclipse.tractusx.edc.tests.transfer;

import com.nimbusds.jose.util.Base64;
import org.eclipse.edc.junit.annotations.EndToEndTest;
import org.eclipse.edc.spi.security.Vault;
import org.eclipse.tractusx.edc.lifecycle.ParticipantRuntime;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.extension.RegisterExtension;

import java.security.SecureRandom;

import static org.eclipse.tractusx.edc.lifecycle.TestRuntimeConfiguration.PLATO_BPN;
import static org.eclipse.tractusx.edc.lifecycle.TestRuntimeConfiguration.PLATO_NAME;
import static org.eclipse.tractusx.edc.lifecycle.TestRuntimeConfiguration.SOKRATES_BPN;
Expand All @@ -43,4 +48,17 @@ public class HttpConsumerPullWithProxyInMemoryTest extends AbstractHttpConsumerP
PLATO_BPN,
platoConfiguration()
);

@BeforeAll
static void prepare() {
var bytes = new byte[32];

new SecureRandom().nextBytes(bytes);
var value = Base64.encode(bytes).toString();
var vault = SOKRATES_RUNTIME.getContext().getService(Vault.class);
vault.storeSecret("test-alias", value);
vault = PLATO_RUNTIME.getContext().getService(Vault.class);
vault.storeSecret("test-alias", value);

}
}
2 changes: 1 addition & 1 deletion edc-tests/runtime/runtime-memory/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ dependencies {
exclude("org.eclipse.edc", "oauth2-core")
exclude("org.eclipse.edc", "oauth2-daps")

exclude(module = "data-encryption")
// exclude(module = "data-encryption")
exclude(module = "json-ld-core")
exclude(module = "ssi-identity-core")
exclude(module = "ssi-miw-credential-client")
Expand Down

0 comments on commit 657c4ee

Please sign in to comment.