Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: use encryption in all inmem tests #835

Merged
merged 1 commit into from
Oct 19, 2023
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
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 @@ -15,10 +15,15 @@
package org.eclipse.tractusx.edc.tests.edr;


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 @@ -45,4 +50,17 @@ public class DeleteEdrInMemoryTest extends AbstractDeleteEdrTest {
PLATO_BPN,
renewalConfiguration(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);

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,15 @@
package org.eclipse.tractusx.edc.tests.edr;


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 @@ -44,4 +49,17 @@ public class NegotiateEdrInMemoryTest extends AbstractNegotiateEdrTest {
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);

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,15 @@
package org.eclipse.tractusx.edc.tests.edr;


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 @@ -45,4 +50,17 @@ public class RenewalEdrInMemoryTest extends AbstractRenewalEdrTest {
PLATO_BPN,
renewalConfiguration(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);

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

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

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 @@ -27,7 +32,7 @@

@EndToEndTest
public class DataPlaneProxyInMemoryTest extends AbstractDataPlaneProxyTest {

@RegisterExtension
protected static final ParticipantRuntime SOKRATES_RUNTIME = new ParticipantRuntime(
":edc-tests:runtime:runtime-memory",
Expand All @@ -43,4 +48,17 @@ public class DataPlaneProxyInMemoryTest extends AbstractDataPlaneProxyTest {
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);

}
}
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