diff --git a/docs/release-notes/Version 0.1.5.md b/docs/release-notes/Version 0.1.5.md new file mode 100644 index 000000000..5b7fbff54 --- /dev/null +++ b/docs/release-notes/Version 0.1.5.md @@ -0,0 +1,25 @@ +# Release Notes Version 0.1.5 + +13.02.2023 + +## 0. Summary + +1. [Version updates](#1-version-updates) + - Use patched EDC version: 0.0.1-20220922.2-SNAPSHOT +2. [Extensions](#2-extensions) + - [2.1 Data Encryption Extension](#22-data-encryption-extension) + - Fixed usage of a blocking algorithm + +## 1. Version Updates + +## 1.1 Use patched EDC version: 0.0.1-20220922.2-SNAPSHOT + +The version has been updated to the patched version `0.0.1-20220922.2-SNAPSHOT` that brings in a bugfix regarding the +catalog pagination. [GitHub issue](https://github.com/eclipse-edc/Connector/issues/2008) + +## 2. Extensions + +### 2.2 Data Encryption Extension + +The encryption of the `EndpointDataReference` took up to 3 minutes unter certain circumstances. +This was fixed by using a not blocking algorithm and setting the Java CMD flag `java.security.egd` correctly. diff --git a/edc-controlplane/edc-controlplane-memory/src/main/docker/Dockerfile b/edc-controlplane/edc-controlplane-memory/src/main/docker/Dockerfile index aec27cd97..4dbb66c62 100644 --- a/edc-controlplane/edc-controlplane-memory/src/main/docker/Dockerfile +++ b/edc-controlplane/edc-controlplane-memory/src/main/docker/Dockerfile @@ -10,13 +10,13 @@ # Contributors: # Mercedes-Benz Tech Innovation GmbH - Initial Dockerfile # -FROM alpine:3.16.2 as otel +FROM alpine:3.17.1 as otel ENV OTEL_AGENT_LOCATION "https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v1.12.1/opentelemetry-javaagent.jar" RUN wget ${OTEL_AGENT_LOCATION} -O /tmp/opentelemetry-javaagent.jar -FROM alpine:3.16.2 +FROM alpine:3.17.1 ARG JAR ARG LIB @@ -25,7 +25,7 @@ ARG APP_USER=docker ARG APP_UID=10100 RUN apk update && \ - apk add openjdk11-jre-headless=11.0.16.1_p1-r0 --no-cache && \ + apk add openjdk11-jre-headless=11.0.18_p10-r0 --no-cache && \ rm -rf /var/cache/apk/* RUN addgroup --system "$APP_USER" @@ -53,6 +53,6 @@ CMD ["java", \ "-Dotel.javaagent.configuration-file=/app/opentelemetry.properties", \ "-Dotel.metrics.exporter=prometheus", \ "-Dotel.exporter.prometheus.port=9090", \ - "-Djava.security.edg=file:/dev/.urandom", \ + "-Djava.security.egd=file:/dev/urandom", \ "-jar", \ "edc-controlplane.jar"] diff --git a/edc-controlplane/edc-controlplane-postgresql-hashicorp-vault/src/main/docker/Dockerfile b/edc-controlplane/edc-controlplane-postgresql-hashicorp-vault/src/main/docker/Dockerfile index aec27cd97..2be259654 100644 --- a/edc-controlplane/edc-controlplane-postgresql-hashicorp-vault/src/main/docker/Dockerfile +++ b/edc-controlplane/edc-controlplane-postgresql-hashicorp-vault/src/main/docker/Dockerfile @@ -10,13 +10,14 @@ # Contributors: # Mercedes-Benz Tech Innovation GmbH - Initial Dockerfile # -FROM alpine:3.16.2 as otel + +FROM alpine:3.17.1 as otel ENV OTEL_AGENT_LOCATION "https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v1.12.1/opentelemetry-javaagent.jar" RUN wget ${OTEL_AGENT_LOCATION} -O /tmp/opentelemetry-javaagent.jar -FROM alpine:3.16.2 +FROM alpine:3.17.1 ARG JAR ARG LIB @@ -25,7 +26,7 @@ ARG APP_USER=docker ARG APP_UID=10100 RUN apk update && \ - apk add openjdk11-jre-headless=11.0.16.1_p1-r0 --no-cache && \ + apk add openjdk11-jre-headless=11.0.18_p10-r0 --no-cache && \ rm -rf /var/cache/apk/* RUN addgroup --system "$APP_USER" @@ -53,6 +54,6 @@ CMD ["java", \ "-Dotel.javaagent.configuration-file=/app/opentelemetry.properties", \ "-Dotel.metrics.exporter=prometheus", \ "-Dotel.exporter.prometheus.port=9090", \ - "-Djava.security.edg=file:/dev/.urandom", \ + "-Djava.security.egd=file:/dev/urandom", \ "-jar", \ "edc-controlplane.jar"] diff --git a/edc-controlplane/edc-controlplane-postgresql/src/main/docker/Dockerfile b/edc-controlplane/edc-controlplane-postgresql/src/main/docker/Dockerfile index aec27cd97..2be259654 100644 --- a/edc-controlplane/edc-controlplane-postgresql/src/main/docker/Dockerfile +++ b/edc-controlplane/edc-controlplane-postgresql/src/main/docker/Dockerfile @@ -10,13 +10,14 @@ # Contributors: # Mercedes-Benz Tech Innovation GmbH - Initial Dockerfile # -FROM alpine:3.16.2 as otel + +FROM alpine:3.17.1 as otel ENV OTEL_AGENT_LOCATION "https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v1.12.1/opentelemetry-javaagent.jar" RUN wget ${OTEL_AGENT_LOCATION} -O /tmp/opentelemetry-javaagent.jar -FROM alpine:3.16.2 +FROM alpine:3.17.1 ARG JAR ARG LIB @@ -25,7 +26,7 @@ ARG APP_USER=docker ARG APP_UID=10100 RUN apk update && \ - apk add openjdk11-jre-headless=11.0.16.1_p1-r0 --no-cache && \ + apk add openjdk11-jre-headless=11.0.18_p10-r0 --no-cache && \ rm -rf /var/cache/apk/* RUN addgroup --system "$APP_USER" @@ -53,6 +54,6 @@ CMD ["java", \ "-Dotel.javaagent.configuration-file=/app/opentelemetry.properties", \ "-Dotel.metrics.exporter=prometheus", \ "-Dotel.exporter.prometheus.port=9090", \ - "-Djava.security.edg=file:/dev/.urandom", \ + "-Djava.security.egd=file:/dev/urandom", \ "-jar", \ "edc-controlplane.jar"] diff --git a/edc-dataplane/edc-dataplane-azure-vault/src/main/docker/Dockerfile b/edc-dataplane/edc-dataplane-azure-vault/src/main/docker/Dockerfile index 2aec25e1b..cddbf69eb 100644 --- a/edc-dataplane/edc-dataplane-azure-vault/src/main/docker/Dockerfile +++ b/edc-dataplane/edc-dataplane-azure-vault/src/main/docker/Dockerfile @@ -10,13 +10,13 @@ # Contributors: # Mercedes-Benz Tech Innovation GmbH - Initial Dockerfile # -FROM alpine:3.16.2 as otel +FROM alpine:3.17.1 as otel ENV OTEL_AGENT_LOCATION "https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v1.12.1/opentelemetry-javaagent.jar" RUN wget ${OTEL_AGENT_LOCATION} -O /tmp/opentelemetry-javaagent.jar -FROM alpine:3.16.2 +FROM alpine:3.17.1 ARG JAR ARG LIB @@ -25,7 +25,7 @@ ARG APP_USER=docker ARG APP_UID=10100 RUN apk update && \ - apk add openjdk11-jre-headless=11.0.16.1_p1-r0 --no-cache && \ + apk add openjdk11-jre-headless=11.0.18_p10-r0 --no-cache && \ rm -rf /var/cache/apk/* RUN addgroup --system "$APP_USER" @@ -53,6 +53,6 @@ CMD ["java", \ "-Dotel.javaagent.configuration-file=/app/opentelemetry.properties", \ "-Dotel.metrics.exporter=prometheus", \ "-Dotel.exporter.prometheus.port=9090", \ - "-Djava.security.edg=file:/dev/.urandom", \ + "-Djava.security.egd=file:/dev/urandom", \ "-jar", \ "edc-dataplane.jar"] diff --git a/edc-dataplane/edc-dataplane-hashicorp-vault/src/main/docker/Dockerfile b/edc-dataplane/edc-dataplane-hashicorp-vault/src/main/docker/Dockerfile index 2aec25e1b..cddbf69eb 100644 --- a/edc-dataplane/edc-dataplane-hashicorp-vault/src/main/docker/Dockerfile +++ b/edc-dataplane/edc-dataplane-hashicorp-vault/src/main/docker/Dockerfile @@ -10,13 +10,13 @@ # Contributors: # Mercedes-Benz Tech Innovation GmbH - Initial Dockerfile # -FROM alpine:3.16.2 as otel +FROM alpine:3.17.1 as otel ENV OTEL_AGENT_LOCATION "https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v1.12.1/opentelemetry-javaagent.jar" RUN wget ${OTEL_AGENT_LOCATION} -O /tmp/opentelemetry-javaagent.jar -FROM alpine:3.16.2 +FROM alpine:3.17.1 ARG JAR ARG LIB @@ -25,7 +25,7 @@ ARG APP_USER=docker ARG APP_UID=10100 RUN apk update && \ - apk add openjdk11-jre-headless=11.0.16.1_p1-r0 --no-cache && \ + apk add openjdk11-jre-headless=11.0.18_p10-r0 --no-cache && \ rm -rf /var/cache/apk/* RUN addgroup --system "$APP_USER" @@ -53,6 +53,6 @@ CMD ["java", \ "-Dotel.javaagent.configuration-file=/app/opentelemetry.properties", \ "-Dotel.metrics.exporter=prometheus", \ "-Dotel.exporter.prometheus.port=9090", \ - "-Djava.security.edg=file:/dev/.urandom", \ + "-Djava.security.egd=file:/dev/urandom", \ "-jar", \ "edc-dataplane.jar"] diff --git a/edc-extensions/business-partner-validation/src/main/java/net/catenax/edc/validation/businesspartner/BusinessPartnerValidationExtension.java b/edc-extensions/business-partner-validation/src/main/java/net/catenax/edc/validation/businesspartner/BusinessPartnerValidationExtension.java index d97953e84..b183a0fcc 100644 --- a/edc-extensions/business-partner-validation/src/main/java/net/catenax/edc/validation/businesspartner/BusinessPartnerValidationExtension.java +++ b/edc-extensions/business-partner-validation/src/main/java/net/catenax/edc/validation/businesspartner/BusinessPartnerValidationExtension.java @@ -22,10 +22,10 @@ import org.eclipse.dataspaceconnector.policy.model.Duty; import org.eclipse.dataspaceconnector.policy.model.Permission; import org.eclipse.dataspaceconnector.policy.model.Prohibition; -import org.eclipse.dataspaceconnector.runtime.metamodel.annotation.Requires; import org.eclipse.dataspaceconnector.spi.monitor.Monitor; import org.eclipse.dataspaceconnector.spi.policy.engine.PolicyEngine; import org.eclipse.dataspaceconnector.spi.policy.engine.RuleBindingRegistry; +import org.eclipse.dataspaceconnector.spi.system.Requires; import org.eclipse.dataspaceconnector.spi.system.ServiceExtension; import org.eclipse.dataspaceconnector.spi.system.ServiceExtensionContext; diff --git a/edc-extensions/cx-oauth2/src/main/java/net/catenax/edc/oauth2/OAuth2Extension.java b/edc-extensions/cx-oauth2/src/main/java/net/catenax/edc/oauth2/OAuth2Extension.java index 9fe15001c..310d82729 100644 --- a/edc-extensions/cx-oauth2/src/main/java/net/catenax/edc/oauth2/OAuth2Extension.java +++ b/edc-extensions/cx-oauth2/src/main/java/net/catenax/edc/oauth2/OAuth2Extension.java @@ -18,16 +18,12 @@ import lombok.Setter; import okhttp3.OkHttpClient; import org.eclipse.dataspaceconnector.iam.oauth2.spi.Oauth2JwtDecoratorRegistry; -import org.eclipse.dataspaceconnector.runtime.metamodel.annotation.EdcSetting; -import org.eclipse.dataspaceconnector.runtime.metamodel.annotation.Inject; -import org.eclipse.dataspaceconnector.runtime.metamodel.annotation.Provides; -import org.eclipse.dataspaceconnector.runtime.metamodel.annotation.Requires; import org.eclipse.dataspaceconnector.spi.EdcException; +import org.eclipse.dataspaceconnector.spi.EdcSetting; import org.eclipse.dataspaceconnector.spi.iam.IdentityService; import org.eclipse.dataspaceconnector.spi.jwt.TokenGenerationService; import org.eclipse.dataspaceconnector.spi.jwt.TokenValidationService; -import org.eclipse.dataspaceconnector.spi.system.ServiceExtension; -import org.eclipse.dataspaceconnector.spi.system.ServiceExtensionContext; +import org.eclipse.dataspaceconnector.spi.system.*; @Provides(IdentityService.class) @Requires({ diff --git a/edc-extensions/cx-oauth2/src/main/java/net/catenax/edc/oauth2/jwt/decorator/JwtDecoratorExtension.java b/edc-extensions/cx-oauth2/src/main/java/net/catenax/edc/oauth2/jwt/decorator/JwtDecoratorExtension.java index 7f551fcc4..510875a2c 100644 --- a/edc-extensions/cx-oauth2/src/main/java/net/catenax/edc/oauth2/jwt/decorator/JwtDecoratorExtension.java +++ b/edc-extensions/cx-oauth2/src/main/java/net/catenax/edc/oauth2/jwt/decorator/JwtDecoratorExtension.java @@ -21,14 +21,10 @@ import lombok.NonNull; import lombok.Setter; import org.eclipse.dataspaceconnector.iam.oauth2.spi.Oauth2JwtDecoratorRegistry; -import org.eclipse.dataspaceconnector.runtime.metamodel.annotation.EdcSetting; -import org.eclipse.dataspaceconnector.runtime.metamodel.annotation.Inject; -import org.eclipse.dataspaceconnector.runtime.metamodel.annotation.Provides; -import org.eclipse.dataspaceconnector.runtime.metamodel.annotation.Requires; import org.eclipse.dataspaceconnector.spi.EdcException; +import org.eclipse.dataspaceconnector.spi.EdcSetting; import org.eclipse.dataspaceconnector.spi.security.CertificateResolver; -import org.eclipse.dataspaceconnector.spi.system.ServiceExtension; -import org.eclipse.dataspaceconnector.spi.system.ServiceExtensionContext; +import org.eclipse.dataspaceconnector.spi.system.*; @Provides(Oauth2JwtDecoratorRegistry.class) @Requires(CertificateResolver.class) diff --git a/edc-extensions/cx-oauth2/src/main/java/net/catenax/edc/oauth2/jwt/generator/JwtTokenGenerationServiceExtension.java b/edc-extensions/cx-oauth2/src/main/java/net/catenax/edc/oauth2/jwt/generator/JwtTokenGenerationServiceExtension.java index 0fcdf35f6..2d239045b 100644 --- a/edc-extensions/cx-oauth2/src/main/java/net/catenax/edc/oauth2/jwt/generator/JwtTokenGenerationServiceExtension.java +++ b/edc-extensions/cx-oauth2/src/main/java/net/catenax/edc/oauth2/jwt/generator/JwtTokenGenerationServiceExtension.java @@ -16,14 +16,10 @@ import java.security.PrivateKey; import lombok.NonNull; import lombok.Setter; -import org.eclipse.dataspaceconnector.runtime.metamodel.annotation.EdcSetting; -import org.eclipse.dataspaceconnector.runtime.metamodel.annotation.Inject; -import org.eclipse.dataspaceconnector.runtime.metamodel.annotation.Provides; -import org.eclipse.dataspaceconnector.runtime.metamodel.annotation.Requires; +import org.eclipse.dataspaceconnector.spi.EdcSetting; import org.eclipse.dataspaceconnector.spi.jwt.TokenGenerationService; import org.eclipse.dataspaceconnector.spi.security.PrivateKeyResolver; -import org.eclipse.dataspaceconnector.spi.system.ServiceExtension; -import org.eclipse.dataspaceconnector.spi.system.ServiceExtensionContext; +import org.eclipse.dataspaceconnector.spi.system.*; @Provides(TokenGenerationService.class) @Requires(PrivateKeyResolver.class) diff --git a/edc-extensions/cx-oauth2/src/main/java/net/catenax/edc/oauth2/jwt/validation/JwtValidationExtension.java b/edc-extensions/cx-oauth2/src/main/java/net/catenax/edc/oauth2/jwt/validation/JwtValidationExtension.java index c4e5d9ff4..bb1e7b1af 100644 --- a/edc-extensions/cx-oauth2/src/main/java/net/catenax/edc/oauth2/jwt/validation/JwtValidationExtension.java +++ b/edc-extensions/cx-oauth2/src/main/java/net/catenax/edc/oauth2/jwt/validation/JwtValidationExtension.java @@ -28,13 +28,9 @@ import net.catenax.edc.oauth2.jwk.RsaPublicKeyReader; import okhttp3.OkHttpClient; import org.eclipse.dataspaceconnector.iam.oauth2.spi.Oauth2ValidationRulesRegistry; -import org.eclipse.dataspaceconnector.runtime.metamodel.annotation.EdcSetting; -import org.eclipse.dataspaceconnector.runtime.metamodel.annotation.Inject; -import org.eclipse.dataspaceconnector.runtime.metamodel.annotation.Provides; -import org.eclipse.dataspaceconnector.runtime.metamodel.annotation.Requires; +import org.eclipse.dataspaceconnector.spi.EdcSetting; import org.eclipse.dataspaceconnector.spi.jwt.TokenValidationService; -import org.eclipse.dataspaceconnector.spi.system.ServiceExtension; -import org.eclipse.dataspaceconnector.spi.system.ServiceExtensionContext; +import org.eclipse.dataspaceconnector.spi.system.*; @Provides(TokenValidationService.class) @Requires({OkHttpClient.class, Clock.class}) diff --git a/edc-extensions/data-encryption/src/main/java/net/catenax/edc/data/encryption/DataEncryptionExtension.java b/edc-extensions/data-encryption/src/main/java/net/catenax/edc/data/encryption/DataEncryptionExtension.java index ac5d2898b..5f9446dfa 100644 --- a/edc-extensions/data-encryption/src/main/java/net/catenax/edc/data/encryption/DataEncryptionExtension.java +++ b/edc-extensions/data-encryption/src/main/java/net/catenax/edc/data/encryption/DataEncryptionExtension.java @@ -22,12 +22,12 @@ import net.catenax.edc.data.encryption.key.CryptoKeyFactory; import net.catenax.edc.data.encryption.key.CryptoKeyFactoryImpl; import net.catenax.edc.data.encryption.provider.AesKeyProvider; -import org.eclipse.dataspaceconnector.runtime.metamodel.annotation.EdcSetting; -import org.eclipse.dataspaceconnector.runtime.metamodel.annotation.Provides; -import org.eclipse.dataspaceconnector.runtime.metamodel.annotation.Requires; import org.eclipse.dataspaceconnector.spi.EdcException; +import org.eclipse.dataspaceconnector.spi.EdcSetting; import org.eclipse.dataspaceconnector.spi.monitor.Monitor; import org.eclipse.dataspaceconnector.spi.security.Vault; +import org.eclipse.dataspaceconnector.spi.system.Provides; +import org.eclipse.dataspaceconnector.spi.system.Requires; import org.eclipse.dataspaceconnector.spi.system.ServiceExtension; import org.eclipse.dataspaceconnector.spi.system.ServiceExtensionContext; import org.eclipse.dataspaceconnector.transfer.dataplane.spi.security.DataEncrypter; diff --git a/edc-extensions/data-encryption/src/main/java/net/catenax/edc/data/encryption/algorithms/aes/AesAlgorithm.java b/edc-extensions/data-encryption/src/main/java/net/catenax/edc/data/encryption/algorithms/aes/AesAlgorithm.java index 8aaddfb85..6214fe90e 100644 --- a/edc-extensions/data-encryption/src/main/java/net/catenax/edc/data/encryption/algorithms/aes/AesAlgorithm.java +++ b/edc-extensions/data-encryption/src/main/java/net/catenax/edc/data/encryption/algorithms/aes/AesAlgorithm.java @@ -16,6 +16,7 @@ import java.security.InvalidAlgorithmParameterException; import java.security.InvalidKeyException; import java.security.NoSuchAlgorithmException; +import java.security.SecureRandom; import javax.crypto.BadPaddingException; import javax.crypto.Cipher; import javax.crypto.IllegalBlockSizeException; @@ -23,6 +24,7 @@ import javax.crypto.spec.GCMParameterSpec; import javax.crypto.spec.SecretKeySpec; import lombok.NonNull; +import lombok.SneakyThrows; import net.catenax.edc.data.encryption.algorithms.CryptoAlgorithm; import net.catenax.edc.data.encryption.data.CryptoDataFactory; import net.catenax.edc.data.encryption.data.DecryptedData; @@ -30,6 +32,7 @@ import net.catenax.edc.data.encryption.key.AesKey; import net.catenax.edc.data.encryption.util.ArrayUtil; import org.bouncycastle.jce.provider.BouncyCastleProvider; +import org.jetbrains.annotations.NotNull; public class AesAlgorithm implements CryptoAlgorithm { @@ -37,12 +40,21 @@ public class AesAlgorithm implements CryptoAlgorithm { private static final String AES = "AES"; private static final Object MONITOR = new Object(); + private final SecureRandom secureRandom; + @NonNull private final CryptoDataFactory cryptoDataFactory; private AesInitializationVectorIterator initializationVectorIterator; - public AesAlgorithm(CryptoDataFactory cryptoDataFactory) { + @SneakyThrows + public AesAlgorithm(@NotNull CryptoDataFactory cryptoDataFactory) { this.cryptoDataFactory = cryptoDataFactory; - this.initializationVectorIterator = new AesInitializationVectorIterator(); + + // We use new SecureRandom() and not SecureRandom.getInstanceStrong(), as the second one + // would use a blocking algorithm, which leads to an increased encryption time of up to 3 + // minutes. Since we have already used /dev/urandom, which only provides pseudo-randomness and + // is also non-blocking, switching to a non-blocking algorithm should not matter here either. + this.secureRandom = new SecureRandom(); + this.initializationVectorIterator = new AesInitializationVectorIterator(this.secureRandom); } @Override @@ -53,7 +65,7 @@ public synchronized EncryptedData encrypt(DecryptedData data, AesKey key) final byte[] initializationVector; synchronized (MONITOR) { if (!initializationVectorIterator.hasNext()) { - initializationVectorIterator = new AesInitializationVectorIterator(); + initializationVectorIterator = new AesInitializationVectorIterator(this.secureRandom); } initializationVector = initializationVectorIterator.next(); @@ -86,4 +98,8 @@ public DecryptedData decrypt(EncryptedData data, AesKey key) byte[] decryptedData = cipher.doFinal(encrypted); return cryptoDataFactory.decryptedFromBytes(decryptedData); } + + public String getAlgorithm() { + return this.secureRandom.getAlgorithm(); + } } diff --git a/edc-extensions/data-encryption/src/main/java/net/catenax/edc/data/encryption/algorithms/aes/AesInitializationVectorIterator.java b/edc-extensions/data-encryption/src/main/java/net/catenax/edc/data/encryption/algorithms/aes/AesInitializationVectorIterator.java index 03a5cf789..e7121c613 100644 --- a/edc-extensions/data-encryption/src/main/java/net/catenax/edc/data/encryption/algorithms/aes/AesInitializationVectorIterator.java +++ b/edc-extensions/data-encryption/src/main/java/net/catenax/edc/data/encryption/algorithms/aes/AesInitializationVectorIterator.java @@ -16,19 +16,20 @@ import java.security.SecureRandom; import java.util.Iterator; import java.util.NoSuchElementException; -import lombok.SneakyThrows; import net.catenax.edc.data.encryption.util.ArrayUtil; public class AesInitializationVectorIterator implements Iterator { public static final int RANDOM_SIZE = 12; public static final int COUNTER_SIZE = 4; - public static final int VECTOR_SIZE = RANDOM_SIZE + COUNTER_SIZE; private final ByteCounter counter; - public AesInitializationVectorIterator() { - counter = new ByteCounter(COUNTER_SIZE); + private SecureRandom secureRandom; + + public AesInitializationVectorIterator(SecureRandom secureRandom) { + this.counter = new ByteCounter(COUNTER_SIZE); + this.secureRandom = secureRandom; } public AesInitializationVectorIterator(ByteCounter byteCounter) { @@ -52,11 +53,9 @@ public byte[] next() { return ArrayUtil.concat(random, counter.getBytes()); } - @SneakyThrows public byte[] getNextRandom() { - SecureRandom random = SecureRandom.getInstanceStrong(); byte[] newVector = new byte[RANDOM_SIZE]; - random.nextBytes(newVector); + secureRandom.nextBytes(newVector); return newVector; } } diff --git a/edc-extensions/data-encryption/src/test/java/net/catenax/edc/data/encryption/algorithms/aes/AesInitializationVectorIteratorTest.java b/edc-extensions/data-encryption/src/test/java/net/catenax/edc/data/encryption/algorithms/aes/AesInitializationVectorIteratorTest.java index 5a79a42b5..d7bf3d885 100644 --- a/edc-extensions/data-encryption/src/test/java/net/catenax/edc/data/encryption/algorithms/aes/AesInitializationVectorIteratorTest.java +++ b/edc-extensions/data-encryption/src/test/java/net/catenax/edc/data/encryption/algorithms/aes/AesInitializationVectorIteratorTest.java @@ -13,6 +13,7 @@ */ package net.catenax.edc.data.encryption.algorithms.aes; +import java.security.SecureRandom; import java.util.ArrayList; import java.util.List; import java.util.NoSuchElementException; @@ -28,7 +29,8 @@ class AesInitializationVectorIteratorTest { @SneakyThrows void testDistinctVectors() { final int vectorCount = 100; - AesInitializationVectorIterator iterator = new AesInitializationVectorIterator(); + final SecureRandom secureRandom = new SecureRandom(); + AesInitializationVectorIterator iterator = new AesInitializationVectorIterator(secureRandom); List vectors = new ArrayList<>(); for (var i = 0; i < vectorCount; i++) { diff --git a/edc-extensions/dataplane-selector-configuration/src/main/java/net/catenax/edc/dataplane/selector/configuration/DataPlaneSelectorConfigurationServiceExtension.java b/edc-extensions/dataplane-selector-configuration/src/main/java/net/catenax/edc/dataplane/selector/configuration/DataPlaneSelectorConfigurationServiceExtension.java index 976d468d9..68072498e 100644 --- a/edc-extensions/dataplane-selector-configuration/src/main/java/net/catenax/edc/dataplane/selector/configuration/DataPlaneSelectorConfigurationServiceExtension.java +++ b/edc-extensions/dataplane-selector-configuration/src/main/java/net/catenax/edc/dataplane/selector/configuration/DataPlaneSelectorConfigurationServiceExtension.java @@ -24,10 +24,10 @@ import java.util.stream.Collectors; import org.eclipse.dataspaceconnector.dataplane.selector.DataPlaneSelectorService; import org.eclipse.dataspaceconnector.dataplane.selector.instance.DataPlaneInstanceImpl; -import org.eclipse.dataspaceconnector.runtime.metamodel.annotation.EdcSetting; -import org.eclipse.dataspaceconnector.runtime.metamodel.annotation.Requires; import org.eclipse.dataspaceconnector.spi.EdcException; +import org.eclipse.dataspaceconnector.spi.EdcSetting; import org.eclipse.dataspaceconnector.spi.monitor.Monitor; +import org.eclipse.dataspaceconnector.spi.system.Requires; import org.eclipse.dataspaceconnector.spi.system.ServiceExtension; import org.eclipse.dataspaceconnector.spi.system.ServiceExtensionContext; import org.eclipse.dataspaceconnector.spi.system.configuration.Config; diff --git a/edc-extensions/dataplane-selector-configuration/src/test/java/net/catenax/edc/dataplane/selector/configuration/DataPlaneSelectorConfigurationServiceExtensionEdcExtensionTest.java b/edc-extensions/dataplane-selector-configuration/src/test/java/net/catenax/edc/dataplane/selector/configuration/DataPlaneSelectorConfigurationServiceExtensionEdcExtensionTest.java index 6ace3d84c..8d162e0d3 100644 --- a/edc-extensions/dataplane-selector-configuration/src/test/java/net/catenax/edc/dataplane/selector/configuration/DataPlaneSelectorConfigurationServiceExtensionEdcExtensionTest.java +++ b/edc-extensions/dataplane-selector-configuration/src/test/java/net/catenax/edc/dataplane/selector/configuration/DataPlaneSelectorConfigurationServiceExtensionEdcExtensionTest.java @@ -18,7 +18,7 @@ import java.util.Map; import org.eclipse.dataspaceconnector.dataplane.selector.DataPlaneSelectorService; import org.eclipse.dataspaceconnector.junit.extensions.EdcExtension; -import org.eclipse.dataspaceconnector.runtime.metamodel.annotation.Provides; +import org.eclipse.dataspaceconnector.spi.system.Provides; import org.eclipse.dataspaceconnector.spi.system.ServiceExtension; import org.eclipse.dataspaceconnector.spi.system.ServiceExtensionContext; import org.eclipse.dataspaceconnector.spi.types.domain.DataAddress; diff --git a/edc-extensions/hashicorp-vault/src/main/java/net/catenax/edc/hashicorpvault/AbstractHashicorpVaultExtension.java b/edc-extensions/hashicorp-vault/src/main/java/net/catenax/edc/hashicorpvault/AbstractHashicorpVaultExtension.java index 23486385a..4512e8512 100644 --- a/edc-extensions/hashicorp-vault/src/main/java/net/catenax/edc/hashicorpvault/AbstractHashicorpVaultExtension.java +++ b/edc-extensions/hashicorp-vault/src/main/java/net/catenax/edc/hashicorpvault/AbstractHashicorpVaultExtension.java @@ -16,7 +16,7 @@ import java.time.Duration; import okhttp3.OkHttpClient; -import org.eclipse.dataspaceconnector.runtime.metamodel.annotation.EdcSetting; +import org.eclipse.dataspaceconnector.spi.EdcSetting; import org.eclipse.dataspaceconnector.spi.system.ServiceExtensionContext; /** diff --git a/edc-extensions/hashicorp-vault/src/main/java/net/catenax/edc/hashicorpvault/HashicorpVaultHealthExtension.java b/edc-extensions/hashicorp-vault/src/main/java/net/catenax/edc/hashicorpvault/HashicorpVaultHealthExtension.java index 62bc5bc00..9e904a2c7 100644 --- a/edc-extensions/hashicorp-vault/src/main/java/net/catenax/edc/hashicorpvault/HashicorpVaultHealthExtension.java +++ b/edc-extensions/hashicorp-vault/src/main/java/net/catenax/edc/hashicorpvault/HashicorpVaultHealthExtension.java @@ -15,8 +15,8 @@ package net.catenax.edc.hashicorpvault; import okhttp3.OkHttpClient; -import org.eclipse.dataspaceconnector.runtime.metamodel.annotation.EdcSetting; -import org.eclipse.dataspaceconnector.runtime.metamodel.annotation.Requires; +import org.eclipse.dataspaceconnector.spi.EdcSetting; +import org.eclipse.dataspaceconnector.spi.system.Requires; import org.eclipse.dataspaceconnector.spi.system.ServiceExtension; import org.eclipse.dataspaceconnector.spi.system.ServiceExtensionContext; import org.eclipse.dataspaceconnector.spi.system.health.HealthCheckService; diff --git a/edc-extensions/hashicorp-vault/src/main/java/net/catenax/edc/hashicorpvault/HashicorpVaultVaultExtension.java b/edc-extensions/hashicorp-vault/src/main/java/net/catenax/edc/hashicorpvault/HashicorpVaultVaultExtension.java index c7bfc6674..f6afafb07 100644 --- a/edc-extensions/hashicorp-vault/src/main/java/net/catenax/edc/hashicorpvault/HashicorpVaultVaultExtension.java +++ b/edc-extensions/hashicorp-vault/src/main/java/net/catenax/edc/hashicorpvault/HashicorpVaultVaultExtension.java @@ -17,11 +17,11 @@ package net.catenax.edc.hashicorpvault; import okhttp3.OkHttpClient; -import org.eclipse.dataspaceconnector.runtime.metamodel.annotation.Provides; import org.eclipse.dataspaceconnector.spi.security.CertificateResolver; import org.eclipse.dataspaceconnector.spi.security.PrivateKeyResolver; import org.eclipse.dataspaceconnector.spi.security.Vault; import org.eclipse.dataspaceconnector.spi.security.VaultPrivateKeyResolver; +import org.eclipse.dataspaceconnector.spi.system.Provides; import org.eclipse.dataspaceconnector.spi.system.ServiceExtension; import org.eclipse.dataspaceconnector.spi.system.ServiceExtensionContext; diff --git a/edc-extensions/postgresql-migration/src/main/java/net/catenax/edc/postgresql/migration/ContractDefinitionPostgresqlMigrationExtension.java b/edc-extensions/postgresql-migration/src/main/java/net/catenax/edc/postgresql/migration/ContractDefinitionPostgresqlMigrationExtension.java index 31285de95..1834cde8f 100644 --- a/edc-extensions/postgresql-migration/src/main/java/net/catenax/edc/postgresql/migration/ContractDefinitionPostgresqlMigrationExtension.java +++ b/edc-extensions/postgresql-migration/src/main/java/net/catenax/edc/postgresql/migration/ContractDefinitionPostgresqlMigrationExtension.java @@ -14,7 +14,7 @@ package net.catenax.edc.postgresql.migration; -import org.eclipse.dataspaceconnector.runtime.metamodel.annotation.EdcSetting; +import org.eclipse.dataspaceconnector.spi.EdcSetting; public class ContractDefinitionPostgresqlMigrationExtension extends AbstractPostgresqlMigrationExtension { diff --git a/edc-extensions/postgresql-migration/src/main/java/net/catenax/edc/postgresql/migration/ContractNegotiationPostgresqlMigrationExtension.java b/edc-extensions/postgresql-migration/src/main/java/net/catenax/edc/postgresql/migration/ContractNegotiationPostgresqlMigrationExtension.java index b198b4834..8c732742f 100644 --- a/edc-extensions/postgresql-migration/src/main/java/net/catenax/edc/postgresql/migration/ContractNegotiationPostgresqlMigrationExtension.java +++ b/edc-extensions/postgresql-migration/src/main/java/net/catenax/edc/postgresql/migration/ContractNegotiationPostgresqlMigrationExtension.java @@ -14,7 +14,7 @@ package net.catenax.edc.postgresql.migration; -import org.eclipse.dataspaceconnector.runtime.metamodel.annotation.EdcSetting; +import org.eclipse.dataspaceconnector.spi.EdcSetting; public class ContractNegotiationPostgresqlMigrationExtension extends AbstractPostgresqlMigrationExtension { diff --git a/edc-extensions/postgresql-migration/src/main/java/net/catenax/edc/postgresql/migration/PolicyPostgresqlMigrationExtension.java b/edc-extensions/postgresql-migration/src/main/java/net/catenax/edc/postgresql/migration/PolicyPostgresqlMigrationExtension.java index 5e6333ad1..9e3b64ff9 100644 --- a/edc-extensions/postgresql-migration/src/main/java/net/catenax/edc/postgresql/migration/PolicyPostgresqlMigrationExtension.java +++ b/edc-extensions/postgresql-migration/src/main/java/net/catenax/edc/postgresql/migration/PolicyPostgresqlMigrationExtension.java @@ -14,7 +14,7 @@ package net.catenax.edc.postgresql.migration; -import org.eclipse.dataspaceconnector.runtime.metamodel.annotation.EdcSetting; +import org.eclipse.dataspaceconnector.spi.EdcSetting; public class PolicyPostgresqlMigrationExtension extends AbstractPostgresqlMigrationExtension { private static final String NAME_SUBSYSTEM = "policy"; diff --git a/edc-extensions/postgresql-migration/src/main/java/net/catenax/edc/postgresql/migration/TransferProcessPostgresqlMigrationExtension.java b/edc-extensions/postgresql-migration/src/main/java/net/catenax/edc/postgresql/migration/TransferProcessPostgresqlMigrationExtension.java index f17373cf5..4ef0d97f4 100644 --- a/edc-extensions/postgresql-migration/src/main/java/net/catenax/edc/postgresql/migration/TransferProcessPostgresqlMigrationExtension.java +++ b/edc-extensions/postgresql-migration/src/main/java/net/catenax/edc/postgresql/migration/TransferProcessPostgresqlMigrationExtension.java @@ -14,7 +14,7 @@ package net.catenax.edc.postgresql.migration; -import org.eclipse.dataspaceconnector.runtime.metamodel.annotation.EdcSetting; +import org.eclipse.dataspaceconnector.spi.EdcSetting; public class TransferProcessPostgresqlMigrationExtension extends AbstractPostgresqlMigrationExtension { diff --git a/edc-tests/src/main/resources/deployment/helm/all-in-one/Chart.yaml b/edc-tests/src/main/resources/deployment/helm/all-in-one/Chart.yaml index ab8eee0cd..04b1147b5 100644 --- a/edc-tests/src/main/resources/deployment/helm/all-in-one/Chart.yaml +++ b/edc-tests/src/main/resources/deployment/helm/all-in-one/Chart.yaml @@ -54,7 +54,7 @@ dependencies: alias: platovault condition: platovault.enabled - name: postgresql - version: 11.2.4 + version: 12.1.6 repository: https://charts.bitnami.com/bitnami alias: platopostgresql condition: platopostgresql.enabled @@ -81,7 +81,7 @@ dependencies: alias: sokratesvault condition: sokratesvault.enabled - name: postgresql - version: 11.2.4 + version: 12.1.6 repository: https://charts.bitnami.com/bitnami alias: sokratespostgresql condition: sokratespostgresql.enabled diff --git a/edc-tests/src/test/java/net/catenax/edc/tests/DataManagementAPI.java b/edc-tests/src/test/java/net/catenax/edc/tests/DataManagementAPI.java index 5338a4f5e..7520b5fa7 100644 --- a/edc-tests/src/test/java/net/catenax/edc/tests/DataManagementAPI.java +++ b/edc-tests/src/test/java/net/catenax/edc/tests/DataManagementAPI.java @@ -67,7 +67,7 @@ public List requestCatalogFrom(String receivingConnectorUrl) thro final DataManagementApiContractOfferCatalog catalog = get( CATALOG_PATH, - "providerUrl=" + encodedUrl, + "providerUrl=" + encodedUrl + "&limit=1000", new TypeToken() {}); log.debug("Received " + catalog.contractOffers.size() + " offers"); diff --git a/pom.xml b/pom.xml index 2e858d861..48a062dfb 100644 --- a/pom.xml +++ b/pom.xml @@ -66,7 +66,7 @@ 0.0.1-SNAPSHOT - 0.0.1-20220922-SNAPSHOT + 0.0.1-20220922.2-SNAPSHOT 1.2.2 42.5.0 9.3.1