From e6e0676b964411a78bce6f7e08c3919ec089ba60 Mon Sep 17 00:00:00 2001 From: Jeremy Bernard Date: Thu, 29 Feb 2024 11:12:21 +0100 Subject: [PATCH 01/14] Backmerge 8.4.0 --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index aba09090..519df666 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ All notable changes to this project will be documented in this file. +## [[NEXT]](https://github.com/iExecBlockchainComputing/iexec-common/releases/tag/vNEXT) 2024 + ## [[8.4.0]](https://github.com/iExecBlockchainComputing/iexec-common/releases/tag/v8.4.0) 2024-02-27 ### New Feature From 5ff64fc60998d3b591715d5e844692198fd9b35e Mon Sep 17 00:00:00 2001 From: Jeremy Bernard Date: Wed, 27 Mar 2024 10:49:44 +0100 Subject: [PATCH 02/14] Add `ConfigServerClient` feign client to fetch configuration remotely (#446) --- CHANGELOG.md | 6 ++++- .../common/config/ConfigServerClient.java | 24 +++++++++++++++++++ .../iexec/common/utils/FileHelperTests.java | 2 +- 3 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 src/main/java/com/iexec/common/config/ConfigServerClient.java diff --git a/CHANGELOG.md b/CHANGELOG.md index 519df666..f007afa5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,9 +4,13 @@ All notable changes to this project will be documented in this file. ## [[NEXT]](https://github.com/iExecBlockchainComputing/iexec-common/releases/tag/vNEXT) 2024 +### New Features + +- Add `ConfigServerClient` feign client to fetch configuration remotely. (#446) + ## [[8.4.0]](https://github.com/iExecBlockchainComputing/iexec-common/releases/tag/v8.4.0) 2024-02-27 -### New Feature +### New Features - Add `enclaveSignature` field to `ResultModel`. (#439 #441) - Add `error-message` field to `ComputedFile`. (#440) diff --git a/src/main/java/com/iexec/common/config/ConfigServerClient.java b/src/main/java/com/iexec/common/config/ConfigServerClient.java new file mode 100644 index 00000000..85747868 --- /dev/null +++ b/src/main/java/com/iexec/common/config/ConfigServerClient.java @@ -0,0 +1,24 @@ +/* + * Copyright 2024-2024 IEXEC BLOCKCHAIN TECH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://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. + */ + +package com.iexec.common.config; + +import feign.RequestLine; + +public interface ConfigServerClient { + @RequestLine("GET /config/chain") + PublicChainConfig getPublicChainConfig(); +} diff --git a/src/test/java/com/iexec/common/utils/FileHelperTests.java b/src/test/java/com/iexec/common/utils/FileHelperTests.java index fe4d1166..faeab35d 100644 --- a/src/test/java/com/iexec/common/utils/FileHelperTests.java +++ b/src/test/java/com/iexec/common/utils/FileHelperTests.java @@ -45,7 +45,7 @@ class FileHelperTests { "/wikipedia/commons/thumb/6/65/600px_Black_bordered_HEX-0082D6.svg/600px-600px_Black_bordered_HEX-0082D6.svg.png"; // private static final String HTTPS_FILENAME = "token.svg"; private static final String HTTPS_FILE_DIGEST = - "0x7ee6112553cfa9ef3fd9311f55d6543f959a969700cfd39499f8775b4201739b"; + "0xa7e1a706b2d60dad840c56594662deb37061815fd3ae2a04c1ca6328b0683fe6"; // redirection // private static final String REDIRECTION_URL = "https://goo.gl/t8JxoX"; // private static final String REDIRECTION_FILE_DIGEST = "TODO"; From 4f1c7db55b1f8d06e982c2c3084c0883a9df03fa Mon Sep 17 00:00:00 2001 From: Jeremy Bernard Date: Wed, 10 Apr 2024 17:50:30 +0200 Subject: [PATCH 03/14] Add `ConfigServerClientBuilder` helper class (#447) --- CHANGELOG.md | 1 + .../config/ConfigServerClientBuilder.java | 30 +++++++++++++++++++ .../config/ConfigServerClientTests.java | 30 +++++++++++++++++++ 3 files changed, 61 insertions(+) create mode 100644 src/main/java/com/iexec/common/config/ConfigServerClientBuilder.java create mode 100644 src/test/java/com/iexec/common/config/ConfigServerClientTests.java diff --git a/CHANGELOG.md b/CHANGELOG.md index f007afa5..6f536470 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ All notable changes to this project will be documented in this file. ### New Features - Add `ConfigServerClient` feign client to fetch configuration remotely. (#446) +- Add `ConfigServerClientBuilder` helper class to create feign client instances. (#447) ## [[8.4.0]](https://github.com/iExecBlockchainComputing/iexec-common/releases/tag/v8.4.0) 2024-02-27 diff --git a/src/main/java/com/iexec/common/config/ConfigServerClientBuilder.java b/src/main/java/com/iexec/common/config/ConfigServerClientBuilder.java new file mode 100644 index 00000000..dd760ce2 --- /dev/null +++ b/src/main/java/com/iexec/common/config/ConfigServerClientBuilder.java @@ -0,0 +1,30 @@ +/* + * Copyright 2024-2024 IEXEC BLOCKCHAIN TECH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://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. + */ + +package com.iexec.common.config; + +import com.iexec.common.utils.FeignBuilder; +import feign.Logger; +import lombok.AccessLevel; +import lombok.NoArgsConstructor; + +@NoArgsConstructor(access = AccessLevel.PRIVATE) +public class ConfigServerClientBuilder { + public static ConfigServerClient getInstance(final Logger.Level logLevel, final String url) { + return FeignBuilder.createBuilder(logLevel) + .target(ConfigServerClient.class, url); + } +} diff --git a/src/test/java/com/iexec/common/config/ConfigServerClientTests.java b/src/test/java/com/iexec/common/config/ConfigServerClientTests.java new file mode 100644 index 00000000..864a8579 --- /dev/null +++ b/src/test/java/com/iexec/common/config/ConfigServerClientTests.java @@ -0,0 +1,30 @@ +/* + * Copyright 2024-2024 IEXEC BLOCKCHAIN TECH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://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. + */ + +package com.iexec.common.config; + +import feign.Logger; +import org.junit.jupiter.api.Test; + +import static org.assertj.core.api.AssertionsForInterfaceTypes.assertThat; + +class ConfigServerClientTests { + @Test + void instantiationTest() { + assertThat(ConfigServerClientBuilder.getInstance(Logger.Level.HEADERS, "localhost")) + .isNotNull(); + } +} From 00dc24e4c203b125ebf1c189b8e0e85b4fa71de2 Mon Sep 17 00:00:00 2001 From: Jeremy Bernard Date: Fri, 12 Apr 2024 15:34:16 +0200 Subject: [PATCH 04/14] Configure Gradle JVM Test Suite Plugin (#448) --- CHANGELOG.md | 4 ++++ build.gradle | 40 ++++++++++++++++++++++++---------------- 2 files changed, 28 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f536470..10da4067 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,10 @@ All notable changes to this project will be documented in this file. - Add `ConfigServerClient` feign client to fetch configuration remotely. (#446) - Add `ConfigServerClientBuilder` helper class to create feign client instances. (#447) +### Quality + +- Configure Gradle JVM Test Suite Plugin. (#448) + ## [[8.4.0]](https://github.com/iExecBlockchainComputing/iexec-common/releases/tag/v8.4.0) 2024-02-27 ### New Features diff --git a/build.gradle b/build.gradle index 835e0d6c..57b4775d 100644 --- a/build.gradle +++ b/build.gradle @@ -17,11 +17,12 @@ if (!project.hasProperty('gitBranch')) { ext.gitBranch = 'git rev-parse --abbrev-ref HEAD'.execute().text.trim() } -if (gitBranch != 'main' && gitBranch != 'master' && ! (gitBranch ==~ '(release|hotfix|support)/.*')) { +if (gitBranch != 'main' && gitBranch != 'master' && !(gitBranch ==~ '(release|hotfix|support)/.*')) { version += '-NEXT-SNAPSHOT' } repositories { + mavenLocal() mavenCentral() maven { url = 'https://docker-regis-adm.iex.ec/repository/maven-public/' @@ -74,19 +75,6 @@ dependencies { // expiring map implementation 'net.jodah:expiringmap:0.5.10' - - // test - testImplementation 'org.junit.jupiter:junit-jupiter' - testRuntimeOnly("org.junit.platform:junit-platform-launcher") - testImplementation 'org.mockito:mockito-junit-jupiter' - testImplementation 'org.assertj:assertj-core' - // mock-server - testImplementation "org.mock-server:mockserver-client-java:$mockServerVersion" - testImplementation "org.mock-server:mockserver-junit-jupiter:$mockServerVersion" - // spring-boot-test to capture test outputs - testImplementation 'org.springframework.boot:spring-boot-test' - // spring-test for ReflectionTestUtils - testImplementation 'org.springframework:spring-test' } java { @@ -99,8 +87,29 @@ java { withSourcesJar() } +testing { + suites { + test { + useJUnitJupiter() + dependencies { + implementation 'org.junit.jupiter:junit-jupiter' + implementation 'org.mockito:mockito-junit-jupiter' + implementation 'org.assertj:assertj-core' + // mock-server + implementation "org.mock-server:mockserver-client-java:$mockServerVersion" + implementation "org.mock-server:mockserver-junit-jupiter:$mockServerVersion" + // spring-test for ReflectionTestUtils + implementation 'org.springframework:spring-test' + } + } + } +} + +tasks.withType(Test).configureEach { + finalizedBy jacocoTestReport +} + test { - useJUnitPlatform() reports { junitXml.required = true html.required = true @@ -118,7 +127,6 @@ jacocoTestReport { xml.required = true } } -tasks.test.finalizedBy tasks.jacocoTestReport tasks.sonarqube.dependsOn tasks.jacocoTestReport publishing { From 5be70c517acdaf9be5266fc1e654544829b0da6c Mon Sep 17 00:00:00 2001 From: Jeremy Bernard Date: Mon, 15 Apr 2024 12:30:18 +0200 Subject: [PATCH 05/14] Upgrade to Gradle 8.7 (#449) --- CHANGELOG.md | 4 ++++ build.gradle | 4 ++-- gradle/wrapper/gradle-wrapper.properties | 2 +- gradlew | 17 +++++++++-------- gradlew.bat | 20 ++++++++++---------- 5 files changed, 26 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 10da4067..c4513f58 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,10 @@ All notable changes to this project will be documented in this file. - Configure Gradle JVM Test Suite Plugin. (#448) +### Dependency Upgrades + +- Upgrade to Gradle 8.7. (#449) + ## [[8.4.0]](https://github.com/iExecBlockchainComputing/iexec-common/releases/tag/v8.4.0) 2024-02-27 ### New Features diff --git a/build.gradle b/build.gradle index 57b4775d..48d6de58 100644 --- a/build.gradle +++ b/build.gradle @@ -1,8 +1,8 @@ plugins { id 'java-library' - id 'io.freefair.lombok' version '8.2.2' + id 'io.freefair.lombok' version '8.6' id 'jacoco' - id 'org.sonarqube' version '4.2.1.3168' + id 'org.sonarqube' version '5.0.0.4638' id 'maven-publish' } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 9f4197d5..b82aa23a 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index fcb6fca1..1aa94a42 100755 --- a/gradlew +++ b/gradlew @@ -83,7 +83,8 @@ done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -144,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -152,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -201,11 +202,11 @@ fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ diff --git a/gradlew.bat b/gradlew.bat index 6689b85b..7101f8e4 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -43,11 +43,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail From 092f48915c75664365434cead7e99199dccef0d7 Mon Sep 17 00:00:00 2001 From: Jeremy Bernard Date: Thu, 18 Apr 2024 13:49:13 +0200 Subject: [PATCH 06/14] Upgrade to Spring Boot 2.7.18 (#450) --- CHANGELOG.md | 1 + build.gradle | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c4513f58..6b923e3d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ All notable changes to this project will be documented in this file. ### Dependency Upgrades - Upgrade to Gradle 8.7. (#449) +- Upgrade to Spring Boot 2.7.18. (#450) ## [[8.4.0]](https://github.com/iExecBlockchainComputing/iexec-common/releases/tag/v8.4.0) 2024-02-27 diff --git a/build.gradle b/build.gradle index 48d6de58..dadad47d 100644 --- a/build.gradle +++ b/build.gradle @@ -36,11 +36,15 @@ repositories { } } +//configurations.configureEach { +// resolutionStrategy.failOnVersionConflict() +//} + // java-library plugin defines 'api' configuration // 'api' configuration allows to expose dependencies with 'compile' scope in pom // 'implementation' configuration allows to expose dependencies with 'runtime' scope in pom dependencies { - implementation platform('org.springframework.boot:spring-boot-dependencies:2.7.17') + implementation platform('org.springframework.boot:spring-boot-dependencies:2.7.18') // feign api "io.github.openfeign:feign-jackson:$openFeignVersion" From d3b3ed8dc8a306ef8b3d9a68098543149c0eabb5 Mon Sep 17 00:00:00 2001 From: Frederic Date: Tue, 23 Apr 2024 10:28:27 +0200 Subject: [PATCH 07/14] Rename `blockchainAdapterUrl` to `configServerUrl` in class `PublicConfiguration` (#451) --- CHANGELOG.md | 1 + .../common/config/PublicConfiguration.java | 16 +++++++- .../config/PublicConfigurationTests.java | 39 ++++++++++++++++++- 3 files changed, 52 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b923e3d..94c187c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ All notable changes to this project will be documented in this file. - Add `ConfigServerClient` feign client to fetch configuration remotely. (#446) - Add `ConfigServerClientBuilder` helper class to create feign client instances. (#447) +- Rename `blockchainAdapterUrl` to `configServerUrl` in `PublicConfiguration` class. (#451) ### Quality diff --git a/src/main/java/com/iexec/common/config/PublicConfiguration.java b/src/main/java/com/iexec/common/config/PublicConfiguration.java index 2fbe980c..6b04134c 100644 --- a/src/main/java/com/iexec/common/config/PublicConfiguration.java +++ b/src/main/java/com/iexec/common/config/PublicConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2023 IEXEC BLOCKCHAIN TECH + * Copyright 2020-2024 IEXEC BLOCKCHAIN TECH * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,18 +21,30 @@ import lombok.Builder; import lombok.Value; +/** + * The {@link #blockchainAdapterUrl} and {@link #configServerUrl} fields are repetitive, + * so if both are populated, they must contain the same value. + * Duplicating these fields ensures worker/scheduler compatibility on different v8 versions. + * In v9, the {@link #blockchainAdapterUrl} field will be removed. + */ @Value @Builder @JsonDeserialize(builder = PublicConfiguration.PublicConfigurationBuilder.class) public class PublicConfiguration { String workerPoolAddress; String schedulerPublicAddress; + /** + * @deprecated Use {@link PublicConfiguration#configServerUrl} instead. + */ + @Deprecated(forRemoval = true) String blockchainAdapterUrl; + String configServerUrl; String resultRepositoryURL; long askForReplicatePeriod; String requiredWorkerVersion; @JsonPOJOBuilder(withPrefix = "") - public static class PublicConfigurationBuilder{} + public static class PublicConfigurationBuilder { + } } diff --git a/src/test/java/com/iexec/common/config/PublicConfigurationTests.java b/src/test/java/com/iexec/common/config/PublicConfigurationTests.java index 334a1e7c..09042b61 100644 --- a/src/test/java/com/iexec/common/config/PublicConfigurationTests.java +++ b/src/test/java/com/iexec/common/config/PublicConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2023 IEXEC BLOCKCHAIN TECH + * Copyright 2023-2024 IEXEC BLOCKCHAIN TECH * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,10 +31,45 @@ void shouldSerializeAndDeserialize() throws JsonProcessingException { PublicConfiguration config = PublicConfiguration.builder().build(); String jsonString = mapper.writeValueAsString(config); assertThat(jsonString).isEqualTo("{\"workerPoolAddress\":null,\"schedulerPublicAddress\":null," + - "\"blockchainAdapterUrl\":null,\"resultRepositoryURL\":null," + + "\"blockchainAdapterUrl\":null,\"configServerUrl\":null,\"resultRepositoryURL\":null," + "\"askForReplicatePeriod\":0,\"requiredWorkerVersion\":null}"); PublicConfiguration parsedConfig = mapper.readValue(jsonString, PublicConfiguration.class); assertThat(parsedConfig).isEqualTo(config); } + @Test + void shouldDeserializeWhenBlockchainAdapterUrlIsPresentButConfigServerUrlNot() throws JsonProcessingException { + + String jsonString = "{\"workerPoolAddress\":null,\"schedulerPublicAddress\":null," + + "\"blockchainAdapterUrl\":\"http://localhost:8080\",\"resultRepositoryURL\":null," + + "\"askForReplicatePeriod\":0,\"requiredWorkerVersion\":null}"; + + PublicConfiguration parsedConfig = mapper.readValue(jsonString, PublicConfiguration.class); + assertThat(parsedConfig.getBlockchainAdapterUrl()).isEqualTo("http://localhost:8080"); + assertThat(parsedConfig.getConfigServerUrl()).isNull(); + } + + @Test + void shouldDeserializeWhenConfigServerUrlIsPresentButBlockchainAdapterUrlNot() throws JsonProcessingException { + + String jsonString = "{\"workerPoolAddress\":null,\"schedulerPublicAddress\":null," + + "\"configServerUrl\":\"http://localhost:8080\",\"resultRepositoryURL\":null," + + "\"askForReplicatePeriod\":0,\"requiredWorkerVersion\":null}"; + + PublicConfiguration parsedConfig = mapper.readValue(jsonString, PublicConfiguration.class); + assertThat(parsedConfig.getConfigServerUrl()).isEqualTo("http://localhost:8080"); + assertThat(parsedConfig.getBlockchainAdapterUrl()).isNull(); + } + + @Test + void shouldDeserializeWhenConfigServerUrlAndBlockchainAdapterUrlArePresent() throws JsonProcessingException { + + String jsonString = "{\"workerPoolAddress\":null,\"schedulerPublicAddress\":null," + + "\"configServerUrl\":\"http://localhost:8080\",\"blockchainAdapterUrl\":\"http://localhost:8082\",\"resultRepositoryURL\":null," + + "\"askForReplicatePeriod\":0,\"requiredWorkerVersion\":null}"; + + PublicConfiguration parsedConfig = mapper.readValue(jsonString, PublicConfiguration.class); + assertThat(parsedConfig.getConfigServerUrl()).isEqualTo("http://localhost:8080"); + assertThat(parsedConfig.getBlockchainAdapterUrl()).isEqualTo("http://localhost:8082"); + } } From b59c16ab5051e0093f2e4b27c9362e0e791d101e Mon Sep 17 00:00:00 2001 From: Jeremy Bernard Date: Thu, 30 May 2024 15:34:35 +0200 Subject: [PATCH 08/14] Remove `ReplicateActionResponse` and `ReplicateTaskSummary` classes (#452) --- CHANGELOG.md | 1 + .../replicate/ReplicateActionResponse.java | 91 ------------------- .../replicate/ReplicateTaskSummary.java | 36 -------- 3 files changed, 1 insertion(+), 127 deletions(-) delete mode 100644 src/main/java/com/iexec/common/replicate/ReplicateActionResponse.java delete mode 100644 src/main/java/com/iexec/common/replicate/ReplicateTaskSummary.java diff --git a/CHANGELOG.md b/CHANGELOG.md index 94c187c6..cd7354c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ All notable changes to this project will be documented in this file. ### Quality - Configure Gradle JVM Test Suite Plugin. (#448) +- Remove `ReplicateActionResponse` and `ReplicateTaskSummary` classes. (#452) ### Dependency Upgrades diff --git a/src/main/java/com/iexec/common/replicate/ReplicateActionResponse.java b/src/main/java/com/iexec/common/replicate/ReplicateActionResponse.java deleted file mode 100644 index 341a0938..00000000 --- a/src/main/java/com/iexec/common/replicate/ReplicateActionResponse.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright 2020-2023 IEXEC BLOCKCHAIN TECH - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://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. - */ - -package com.iexec.common.replicate; - -import com.iexec.commons.poco.chain.ChainReceipt; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - - -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public class ReplicateActionResponse { - - private boolean isSuccess; - private ReplicateStatusDetails details; - - public static ReplicateActionResponse success() { - return new ReplicateActionResponse(true, null); - } - - public static ReplicateActionResponse success(ChainReceipt chainReceipt) { - ReplicateStatusDetails details = ReplicateStatusDetails.builder() - .chainReceipt(chainReceipt) - .build(); - return new ReplicateActionResponse(true, details); - } - - public static ReplicateActionResponse success(String resultLink, String callbackData) { - ReplicateStatusDetails details = ReplicateStatusDetails.builder() - .resultLink(resultLink) - .chainCallbackData(callbackData) - .build(); - return new ReplicateActionResponse(true, details); - } - - public static ReplicateActionResponse successWithLogs(ComputeLogs computeLogs) { - ReplicateStatusDetails details = ReplicateStatusDetails.builder() - .computeLogs(computeLogs) - .build(); - return new ReplicateActionResponse(true, details); - } - - public static ReplicateActionResponse failure() { - return new ReplicateActionResponse(false, null); - } - - public static ReplicateActionResponse failure(ReplicateStatusCause cause) { - ReplicateStatusDetails details = ReplicateStatusDetails.builder() - .cause(cause) - .build(); - return new ReplicateActionResponse(false, details); - } - - public static ReplicateActionResponse failureWithStdout(String stdout) { - ReplicateStatusDetails details = ReplicateStatusDetails.builder() - .computeLogs(ComputeLogs.builder().stdout(stdout).build()) - .build(); - return new ReplicateActionResponse(false, details); - } - - public static ReplicateActionResponse failureWithStdout(ReplicateStatusCause cause, String stdout) { - ReplicateStatusDetails details = ReplicateStatusDetails.builder() - .cause(cause) - .computeLogs(ComputeLogs.builder().stdout(stdout).build()) - .build(); - return new ReplicateActionResponse(false, details); - } - - public static ReplicateActionResponse failureWithDetails(ReplicateStatusDetails details) { - return new ReplicateActionResponse(false, details); - } -} diff --git a/src/main/java/com/iexec/common/replicate/ReplicateTaskSummary.java b/src/main/java/com/iexec/common/replicate/ReplicateTaskSummary.java deleted file mode 100644 index 1fbf3bf8..00000000 --- a/src/main/java/com/iexec/common/replicate/ReplicateTaskSummary.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2022-2023 IEXEC BLOCKCHAIN TECH - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://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. - */ - -package com.iexec.common.replicate; - -import com.iexec.commons.poco.chain.WorkerpoolAuthorization; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -//TODO: Eventually move this to an iexec-core-library embedding DTOs -// (Eventually move this along with TaskNotificationExtra & more) -@Data -@NoArgsConstructor -@AllArgsConstructor -@Builder -public class ReplicateTaskSummary { - - private WorkerpoolAuthorization workerpoolAuthorization; - private String smsUrl; - -} From 2a0ff3d44d7500a236126400432b6ae3a0d8f5e4 Mon Sep 17 00:00:00 2001 From: Jeremy Bernard Date: Thu, 6 Jun 2024 14:05:54 +0200 Subject: [PATCH 09/14] Update `ReplicateStatusCause` (#453) --- CHANGELOG.md | 1 + .../iexec/common/replicate/ReplicateStatusCause.java | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cd7354c9..c17f666d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ All notable changes to this project will be documented in this file. - Add `ConfigServerClient` feign client to fetch configuration remotely. (#446) - Add `ConfigServerClientBuilder` helper class to create feign client instances. (#447) - Rename `blockchainAdapterUrl` to `configServerUrl` in `PublicConfiguration` class. (#451) +- Add `PRE_COMPUTE_MISSING_ENCLAVE_CONFIGURATION` and `POST_COMPUTE_MALFORMED_ENCRYPTION_PUBLIC_KEY` statuses to `ReplicateStatusCause`. (#453) ### Quality diff --git a/src/main/java/com/iexec/common/replicate/ReplicateStatusCause.java b/src/main/java/com/iexec/common/replicate/ReplicateStatusCause.java index 3983d346..990e7a9e 100644 --- a/src/main/java/com/iexec/common/replicate/ReplicateStatusCause.java +++ b/src/main/java/com/iexec/common/replicate/ReplicateStatusCause.java @@ -22,7 +22,6 @@ public enum ReplicateStatusCause { // region chain CHAIN_UNREACHABLE, - CHAIN_UNSYNCHRONIZED, BLOCK_NOT_REACHED, STAKE_TOO_LOW, OUT_OF_GAS, @@ -71,15 +70,14 @@ public enum ReplicateStatusCause { // Secure session generation TEE_SESSION_GENERATION_SECURE_SESSION_STORAGE_CALL_FAILED, TEE_SESSION_GENERATION_SECURE_SESSION_GENERATION_FAILED, + TEE_SESSION_GENERATION_SECURE_SESSION_NO_TEE_FRAMEWORK, + @Deprecated(forRemoval = true) TEE_SESSION_GENERATION_SECURE_SESSION_NO_TEE_PROVIDER, - TEE_SESSION_GENERATION_SECURE_SESSION_UNKNOWN_TEE_PROVIDER, // Miscellaneous TEE_SESSION_GENERATION_GET_TASK_DESCRIPTION_FAILED, TEE_SESSION_GENERATION_NO_SESSION_REQUEST, TEE_SESSION_GENERATION_NO_TASK_DESCRIPTION, - TEE_SESSION_GENERATION_GET_SESSION_FAILED, - TEE_SESSION_GENERATION_UNKNOWN_ISSUE, // endregion @@ -89,7 +87,8 @@ public enum ReplicateStatusCause { APP_COMPUTE_TIMEOUT, // endregion - // region pre-computate + // region pre-compute + PRE_COMPUTE_MISSING_ENCLAVE_CONFIGURATION, PRE_COMPUTE_INVALID_ENCLAVE_CONFIGURATION, PRE_COMPUTE_INVALID_ENCLAVE_HEAP_CONFIGURATION, PRE_COMPUTE_IMAGE_MISSING, @@ -120,6 +119,7 @@ public enum ReplicateStatusCause { POST_COMPUTE_WORKER_ADDRESS_MISSING, //exit 1 (known) POST_COMPUTE_TEE_CHALLENGE_PRIVATE_KEY_MISSING, POST_COMPUTE_ENCRYPTION_PUBLIC_KEY_MISSING, + POST_COMPUTE_MALFORMED_ENCRYPTION_PUBLIC_KEY, POST_COMPUTE_STORAGE_TOKEN_MISSING, POST_COMPUTE_COMPUTED_FILE_NOT_FOUND, POST_COMPUTE_RESULT_DIGEST_COMPUTATION_FAILED, From a4d89baea5192e153aa028b83543eb57e6f991eb Mon Sep 17 00:00:00 2001 From: Jeremy Bernard Date: Fri, 7 Jun 2024 15:10:30 +0200 Subject: [PATCH 10/14] Remove `DateTimeUtils`, `EthAddress` and `VersionUtils` classes (#454) --- CHANGELOG.md | 1 + gradle.properties | 2 +- .../chain/CredentialsAbstractService.java | 14 +++--- .../EthereumNonZeroAddressValidator.java | 4 +- .../com/iexec/common/utils/DateTimeUtils.java | 38 -------------- .../com/iexec/common/utils/EthAddress.java | 49 ------------------- .../com/iexec/common/utils/VersionUtils.java | 29 ----------- .../iexec/common/utils/EthAddressTests.java | 28 ----------- 8 files changed, 10 insertions(+), 155 deletions(-) delete mode 100644 src/main/java/com/iexec/common/utils/DateTimeUtils.java delete mode 100644 src/main/java/com/iexec/common/utils/EthAddress.java delete mode 100644 src/main/java/com/iexec/common/utils/VersionUtils.java delete mode 100644 src/test/java/com/iexec/common/utils/EthAddressTests.java diff --git a/CHANGELOG.md b/CHANGELOG.md index c17f666d..19cf23e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ All notable changes to this project will be documented in this file. - Configure Gradle JVM Test Suite Plugin. (#448) - Remove `ReplicateActionResponse` and `ReplicateTaskSummary` classes. (#452) +- Remove `DateTimeUtils`, `EthAddress` and `VersionUtils` classes. (#454) ### Dependency Upgrades diff --git a/gradle.properties b/gradle.properties index d417a133..dc0572f1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ version=8.4.0 -iexecCommonsPocoVersion=3.2.0 +iexecCommonsPocoVersion=4.0.0-NEXT-SNAPSHOT nexusUser nexusPassword diff --git a/src/main/java/com/iexec/common/chain/CredentialsAbstractService.java b/src/main/java/com/iexec/common/chain/CredentialsAbstractService.java index cd58dec4..688e7616 100644 --- a/src/main/java/com/iexec/common/chain/CredentialsAbstractService.java +++ b/src/main/java/com/iexec/common/chain/CredentialsAbstractService.java @@ -16,10 +16,11 @@ package com.iexec.common.chain; -import com.iexec.common.utils.EthAddress; import com.iexec.commons.poco.eip712.EIP712Entity; import com.iexec.commons.poco.security.Signature; +import com.iexec.commons.poco.utils.EthAddress; import com.iexec.commons.poco.utils.SignatureUtils; +import lombok.Getter; import lombok.extern.slf4j.Slf4j; import org.web3j.crypto.*; import org.web3j.utils.Numeric; @@ -29,6 +30,7 @@ import java.security.NoSuchAlgorithmException; import java.security.NoSuchProviderException; +@Getter @Slf4j public abstract class CredentialsAbstractService { @@ -66,13 +68,9 @@ protected CredentialsAbstractService(String walletPassword, String walletPath) t } } - public Credentials getCredentials() { - return credentials; - } - - /* - * Signs messages with Ethereum prefix - */ + /** + * Signs messages with Ethereum prefix + */ public Signature hashAndSignMessage(String message) { String hexPrivateKey = Numeric.toHexStringWithPrefix(credentials.getEcKeyPair().getPrivateKey()); return SignatureUtils.signMessageHashAndGetSignature(message, hexPrivateKey); diff --git a/src/main/java/com/iexec/common/chain/validation/EthereumNonZeroAddressValidator.java b/src/main/java/com/iexec/common/chain/validation/EthereumNonZeroAddressValidator.java index 8c1eb397..e6d1df48 100644 --- a/src/main/java/com/iexec/common/chain/validation/EthereumNonZeroAddressValidator.java +++ b/src/main/java/com/iexec/common/chain/validation/EthereumNonZeroAddressValidator.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2023 IEXEC BLOCKCHAIN TECH + * Copyright 2022-2024 IEXEC BLOCKCHAIN TECH * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,8 +16,8 @@ package com.iexec.common.chain.validation; -import com.iexec.common.utils.EthAddress; import com.iexec.commons.poco.utils.BytesUtils; +import com.iexec.commons.poco.utils.EthAddress; import javax.validation.ConstraintValidator; import javax.validation.ConstraintValidatorContext; diff --git a/src/main/java/com/iexec/common/utils/DateTimeUtils.java b/src/main/java/com/iexec/common/utils/DateTimeUtils.java deleted file mode 100644 index 61fe91a9..00000000 --- a/src/main/java/com/iexec/common/utils/DateTimeUtils.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2020-2024 IEXEC BLOCKCHAIN TECH - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://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. - */ - -package com.iexec.common.utils; - -import lombok.AccessLevel; -import lombok.NoArgsConstructor; - -import java.util.Calendar; -import java.util.Date; - -@NoArgsConstructor(access = AccessLevel.PRIVATE) -public class DateTimeUtils { - - public static Date addMinutesToDate(Date date, int minutes) { - Calendar calendar = Calendar.getInstance(); - calendar.setTime(date); - calendar.add(Calendar.MINUTE, minutes); - return calendar.getTime(); - } - - public static long now() { - return new Date().getTime(); - } -} diff --git a/src/main/java/com/iexec/common/utils/EthAddress.java b/src/main/java/com/iexec/common/utils/EthAddress.java deleted file mode 100644 index 3d5992e5..00000000 --- a/src/main/java/com/iexec/common/utils/EthAddress.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.iexec.common.utils; - -import org.apache.commons.lang3.StringUtils; -import org.web3j.crypto.Keys; - -import java.util.regex.Pattern; - -/** - * Account utility functions. - */ -public class EthAddress extends org.web3j.abi.datatypes.Address { - - public EthAddress(String hexValue) { - super(hexValue); - } - - private static final String IGNORE_CASE_ADDRESS_PATTERN = "(?i)^(0x)?[0-9a-f]{40}$"; - private static final String LOWERCASE_ADDRESS_PATTERN = "^(0x)?[0-9a-f]{40}$"; - private static final String UPPERCASE_ADDRESS_PATTERN = "^(0x)?[0-9A-F]{40}$"; - - /** - * Check if the given string is a valid Ethereum address. Inspired by - * the web3js implementation. - * - * @param address in hex - * @return true if address is valid, false otherwise - * @see - * web3.js isAddress implementation - */ - public static boolean validate(String address) { - // check address is not empty and contains the valid - // number (40 without 0x) and type (alphanumeric) of characters - if (StringUtils.isEmpty(address) || - !matchesRegex(address, IGNORE_CASE_ADDRESS_PATTERN)) { - return false; - } - // check for all upper/lower case - if (matchesRegex(address, LOWERCASE_ADDRESS_PATTERN) - || matchesRegex(address, UPPERCASE_ADDRESS_PATTERN)) { - return true; - } - // validate checksum address when mixed case - return Keys.toChecksumAddress(address).equals(address); - } - - private static boolean matchesRegex(String address, String regex) { - return Pattern.compile(regex).matcher(address).find(); - } -} \ No newline at end of file diff --git a/src/main/java/com/iexec/common/utils/VersionUtils.java b/src/main/java/com/iexec/common/utils/VersionUtils.java deleted file mode 100644 index b892bc9b..00000000 --- a/src/main/java/com/iexec/common/utils/VersionUtils.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2020 IEXEC BLOCKCHAIN TECH - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://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. - */ - -package com.iexec.common.utils; - -public class VersionUtils { - - private VersionUtils() { - throw new UnsupportedOperationException(); - } - - public static boolean isSnapshot(String version) { - return version.contains("NEXT"); - } - -} diff --git a/src/test/java/com/iexec/common/utils/EthAddressTests.java b/src/test/java/com/iexec/common/utils/EthAddressTests.java deleted file mode 100644 index 4322b4ac..00000000 --- a/src/test/java/com/iexec/common/utils/EthAddressTests.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.iexec.common.utils; - -import org.junit.jupiter.api.Test; - -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertTrue; - -class EthAddressTests { - @Test - void validateAddress() { - String validChecksumAddress = "0x1Ec09E1782a43a770D54e813379c730E0b29aD4B"; - // valid lowercase address - assertTrue(EthAddress.validate(validChecksumAddress.toLowerCase())); - // valid uppercase address - assertTrue(EthAddress.validate(validChecksumAddress.toUpperCase().replace("0X", "0x"))); - // valid checksum address - assertTrue(EthAddress.validate(validChecksumAddress)); - - // invalid non-hex address - assertFalse(EthAddress.validate(validChecksumAddress.replace("c", "z"))); - // invalid non-alphanumeric address - assertFalse(EthAddress.validate(validChecksumAddress.replace("c", "&"))); - // invalid length address - assertFalse(EthAddress.validate(validChecksumAddress.substring(0, 41))); - // invalid checksum address - assertFalse(EthAddress.validate(validChecksumAddress.replace('E', 'e'))); - } -} From eb1e397cb5cd4b7a9017773c090faa4d2041ebea Mon Sep 17 00:00:00 2001 From: Jeremy Bernard Date: Thu, 13 Jun 2024 13:42:41 +0200 Subject: [PATCH 11/14] Catch all exceptions in `CipherHelper` methods (#455) --- CHANGELOG.md | 4 + .../iexec/common/security/CipherHelper.java | 123 ++++++++---------- .../com/iexec/common/utils/FileHelper.java | 18 +-- .../common/security/CipherHelperTests.java | 71 +++++++--- .../iexec/common/utils/FileHelperTests.java | 11 -- 5 files changed, 118 insertions(+), 109 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 19cf23e2..3ef350f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,10 @@ All notable changes to this project will be documented in this file. - Rename `blockchainAdapterUrl` to `configServerUrl` in `PublicConfiguration` class. (#451) - Add `PRE_COMPUTE_MISSING_ENCLAVE_CONFIGURATION` and `POST_COMPUTE_MALFORMED_ENCRYPTION_PUBLIC_KEY` statuses to `ReplicateStatusCause`. (#453) +### Bug Fixes + +- Catch all exceptions in `CipherHelper`. (#455) + ### Quality - Configure Gradle JVM Test Suite Plugin. (#448) diff --git a/src/main/java/com/iexec/common/security/CipherHelper.java b/src/main/java/com/iexec/common/security/CipherHelper.java index dc09730b..f10c9890 100644 --- a/src/main/java/com/iexec/common/security/CipherHelper.java +++ b/src/main/java/com/iexec/common/security/CipherHelper.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 IEXEC BLOCKCHAIN TECH + * Copyright 2020-2024 IEXEC BLOCKCHAIN TECH * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,10 +19,11 @@ import lombok.AccessLevel; import lombok.NoArgsConstructor; -import javax.crypto.*; +import javax.crypto.Cipher; +import javax.crypto.KeyGenerator; +import javax.crypto.SecretKey; import javax.crypto.spec.SecretKeySpec; import java.security.*; -import java.security.spec.InvalidKeySpecException; import java.security.spec.PKCS8EncodedKeySpec; import java.security.spec.X509EncodedKeySpec; import java.util.Base64; @@ -34,15 +35,11 @@ public class CipherHelper { - /**************** - * - * AES material - * - * **************/ + // region AES - /* + /** * Generate AES key - * */ + */ public static byte[] generateAesKey(int size) { byte[] encodedKey = null; try { @@ -50,7 +47,7 @@ public static byte[] generateAesKey(int size) { generator.init(size); // The AES key size in number of bits SecretKey secKey = generator.generateKey(); encodedKey = Base64.getEncoder().encode(secKey.getEncoded()); - } catch (NoSuchAlgorithmException e) { + } catch (Exception e) { e.printStackTrace(); } return encodedKey; @@ -60,11 +57,11 @@ public static byte[] generateAesKey() { return generateAesKey(128); } - /* + /** * AES encryption - * + *

* For large files: https://stackoverflow.com/a/34004582 - * */ + */ public static byte[] aesEncrypt(byte[] data, byte[] aesKey) { byte[] encryptedData = null; try { @@ -76,15 +73,15 @@ public static byte[] aesEncrypt(byte[] data, byte[] aesKey) { aesCipher.init(Cipher.ENCRYPT_MODE, originalKey); byte[] byteCipherText = aesCipher.doFinal(data); encryptedData = Base64.getEncoder().encode(byteCipherText); - } catch (IllegalBlockSizeException | BadPaddingException | NoSuchPaddingException | NoSuchAlgorithmException | InvalidKeyException e) { + } catch (Exception e) { e.printStackTrace(); } return encryptedData; } - /* + /** * AES decryption - * */ + */ public static byte[] aesDecrypt(byte[] encryptedData, byte[] aesKey) { byte[] decryptedData = null; try { @@ -95,74 +92,70 @@ public static byte[] aesDecrypt(byte[] encryptedData, byte[] aesKey) { Cipher aesCipher = Cipher.getInstance("AES"); aesCipher.init(Cipher.DECRYPT_MODE, originalKey); decryptedData = aesCipher.doFinal(Base64.getDecoder().decode(encryptedData));//heap size issues after 500MB - } catch (IllegalBlockSizeException | BadPaddingException | NoSuchPaddingException | NoSuchAlgorithmException | InvalidKeyException e) { + } catch (Exception e) { e.printStackTrace(); } return decryptedData; } - /**************** - * - * RSA material - * - * **************/ + // endregion - /* + // region RSA + + /** * Generate RSA keys - * */ + */ public static KeyPair generateRsaKeys(int size) { - KeyPair keyPair = null; try { - KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA"); + final KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA"); keyPairGenerator.initialize(size); - keyPair = keyPairGenerator.generateKeyPair(); - return keyPair; - } catch (NoSuchAlgorithmException e) { + return keyPairGenerator.generateKeyPair(); + } catch (Exception e) { e.printStackTrace(); } - return keyPair; + return null; } public static KeyPair generateRsaKeys() { return generateRsaKeys(2048); } - /* + /** * RSA encryption - * */ + */ public static byte[] rsaDecrypt(byte[] encryptedData, PrivateKey privateKey) { byte[] rsaDecryptedAesKey = null; try { Cipher cipher = Cipher.getInstance("RSA"); cipher.init(Cipher.DECRYPT_MODE, privateKey); rsaDecryptedAesKey = cipher.doFinal(Base64.getDecoder().decode(encryptedData)); - } catch (NoSuchAlgorithmException | NoSuchPaddingException | BadPaddingException | IllegalBlockSizeException | InvalidKeyException e) { + } catch (Exception e) { e.printStackTrace(); } return rsaDecryptedAesKey; } - /* + /** * RSA decryption - * */ + */ public static byte[] rsaEncrypt(byte[] data, PublicKey publicKey) { byte[] rsaEncryptedAesKey = null; try { Cipher cipher = Cipher.getInstance("RSA"); cipher.init(Cipher.ENCRYPT_MODE, publicKey); rsaEncryptedAesKey = Base64.getEncoder().encode(cipher.doFinal(data)); - } catch (NoSuchAlgorithmException | NoSuchPaddingException | BadPaddingException | IllegalBlockSizeException | InvalidKeyException e) { + } catch (Exception e) { e.printStackTrace(); } return rsaEncryptedAesKey; } - /* - * Read RSA keyPair fromĀ files - * */ + /** + * Read RSA key pair from files + */ public static KeyPair getRsaKeyPair(String publicKeyPath, String privateKeyPath) { - String plainTextRsaPub = readFile(publicKeyPath); - String plainTextRsaPriv = readFile(privateKeyPath); + final String plainTextRsaPub = readFile(publicKeyPath); + final String plainTextRsaPriv = readFile(privateKeyPath); if (!plainTextRsaPub.isEmpty() && !plainTextRsaPriv.isEmpty()) { return new KeyPair( @@ -173,51 +166,47 @@ public static KeyPair getRsaKeyPair(String publicKeyPath, String privateKeyPath) return null; } - - /* - * Read RSA publicKey from fileBytes - * */ + + /** + * Read RSA public key from file bytes + */ public static PublicKey plainText2RsaPublicKey(String plainTextRsaPub) { - PublicKey publicKey = null; try { - //String base64Key = new String(publicKeyBytes); plainTextRsaPub = plainTextRsaPub .replace("\n", "") .replace("-----BEGIN PUBLIC KEY-----", "") .replace("-----END PUBLIC KEY-----", ""); - byte[] decodedKey = Base64.getDecoder().decode(plainTextRsaPub.getBytes()); - - X509EncodedKeySpec spec = new X509EncodedKeySpec(decodedKey); - KeyFactory kf = KeyFactory.getInstance("RSA"); + final byte[] decodedKey = Base64.getDecoder().decode(plainTextRsaPub.getBytes()); + final X509EncodedKeySpec spec = new X509EncodedKeySpec(decodedKey); - publicKey = kf.generatePublic(spec); - } catch (InvalidKeySpecException | NoSuchAlgorithmException e) { + return KeyFactory.getInstance("RSA") + .generatePublic(spec); + } catch (Exception e) { e.printStackTrace(); } - return publicKey; + return null; } - /* - * Read RSA privateKey from file - * */ + /** + * Read RSA private key from file + */ public static PrivateKey plainText2RsaPrivateKey(String plainTextRsaPriv) { - PrivateKey privateKey = null; try { plainTextRsaPriv = plainTextRsaPriv .replace("\n", "") .replace("-----BEGIN PRIVATE KEY-----", "") .replace("-----END PRIVATE KEY-----", ""); - byte[] decodedKey = Base64.getDecoder().decode(plainTextRsaPriv.getBytes()); - - PKCS8EncodedKeySpec spec = - new PKCS8EncodedKeySpec(decodedKey); - KeyFactory kf = KeyFactory.getInstance("RSA"); + final byte[] decodedKey = Base64.getDecoder().decode(plainTextRsaPriv.getBytes()); + final PKCS8EncodedKeySpec spec = new PKCS8EncodedKeySpec(decodedKey); - privateKey = kf.generatePrivate(spec); - } catch (InvalidKeySpecException | NoSuchAlgorithmException e) { + return KeyFactory.getInstance("RSA") + .generatePrivate(spec); + } catch (Exception e) { e.printStackTrace(); } - return privateKey; + return null; } + // endregion + } diff --git a/src/main/java/com/iexec/common/utils/FileHelper.java b/src/main/java/com/iexec/common/utils/FileHelper.java index 5c200ca7..6cd6d4e9 100644 --- a/src/main/java/com/iexec/common/utils/FileHelper.java +++ b/src/main/java/com/iexec/common/utils/FileHelper.java @@ -16,6 +16,8 @@ package com.iexec.common.utils; +import lombok.AccessLevel; +import lombok.NoArgsConstructor; import lombok.extern.slf4j.Slf4j; import net.lingala.zip4j.ZipFile; import net.lingala.zip4j.exception.ZipException; @@ -35,26 +37,14 @@ import java.util.zip.ZipOutputStream; @Slf4j +@NoArgsConstructor(access = AccessLevel.PRIVATE) public class FileHelper { - @Deprecated(forRemoval = true) - public static final String SLASH_IEXEC_OUT = File.separator + "iexec_out"; - @Deprecated(forRemoval = true) - public static final String SLASH_IEXEC_IN = File.separator + "iexec_in"; - @Deprecated(forRemoval = true) - public static final String SLASH_OUTPUT = File.separator + "output"; - @Deprecated(forRemoval = true) - public static final String SLASH_INPUT = File.separator + "input"; - - private FileHelper() { - throw new UnsupportedOperationException(); - } - public static String readFile(String filePath) { try { byte[] content = Files.readAllBytes(Paths.get(filePath)); return new String(content); - } catch (IOException e) { + } catch (Exception e) { log.error("Failed to read file [filePath:{}]", filePath); } return ""; diff --git a/src/test/java/com/iexec/common/security/CipherHelperTests.java b/src/test/java/com/iexec/common/security/CipherHelperTests.java index fcfa1f15..203f313b 100644 --- a/src/test/java/com/iexec/common/security/CipherHelperTests.java +++ b/src/test/java/com/iexec/common/security/CipherHelperTests.java @@ -17,21 +17,23 @@ package com.iexec.common.security; import com.iexec.commons.poco.utils.BytesUtils; +import org.apache.commons.lang3.RandomStringUtils; import org.junit.jupiter.api.Test; import org.web3j.crypto.Hash; import java.security.KeyPair; -import java.util.Random; - +import java.security.SecureRandom; import static com.iexec.common.security.CipherHelper.*; -import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.assertj.core.api.AssertionsForClassTypes.assertThat; class CipherHelperTests { private static final int KB = 1000; private static final int MB = 1000 * KB; + private final SecureRandom random = new SecureRandom(); + @Test void shouldEncryptAndDecryptWithAes() { byte[] originalData = getRandomByteArray(1 * MB); @@ -42,10 +44,8 @@ void shouldEncryptAndDecryptWithAes() { byte[] data = aesDecrypt(encryptedOriginalData, aesKey); - assertEquals( - BytesUtils.bytesToString(Hash.sha3(originalData)), - BytesUtils.bytesToString(Hash.sha3(data)) - ); + assertThat(BytesUtils.bytesToString(Hash.sha3(data))) + .isEqualTo(BytesUtils.bytesToString(Hash.sha3(originalData))); } @Test @@ -58,10 +58,8 @@ void shouldEncryptAndDecryptWithRsaKeys() { byte[] data = rsaDecrypt(encryptedOriginalData, rsaKeys.getPrivate()); - assertEquals( - BytesUtils.bytesToString(Hash.sha3(originalData)), - BytesUtils.bytesToString(Hash.sha3(data)) - ); + assertThat(BytesUtils.bytesToString(Hash.sha3(data))) + .isEqualTo(BytesUtils.bytesToString(Hash.sha3(originalData))); } @Test @@ -74,21 +72,60 @@ void shouldEncryptAndDecryptWithRsaKeysFile() { keyDirPath + "/test_rsa_key.pub", keyDirPath + "/test_rsa_key"); + assertThat(rsaKeys).isNotNull(); byte[] encryptedOriginalData = rsaEncrypt(originalData, rsaKeys.getPublic()); byte[] data = rsaDecrypt(encryptedOriginalData, rsaKeys.getPrivate()); - assertEquals( - BytesUtils.bytesToString(Hash.sha3(originalData)), - BytesUtils.bytesToString(Hash.sha3(data)) - ); + assertThat(BytesUtils.bytesToString(Hash.sha3(data))) + .isEqualTo(BytesUtils.bytesToString(Hash.sha3(originalData))); + } + + // region errors + @Test + void shouldFailToAesEncryptWithEmptyKey() { + final byte[] data = getRandomByteArray(1024); + final byte[] key = new byte[0]; + assertThat(aesEncrypt(data, key)).isNull(); + } + + @Test + void shouldFailToAesDecryptWithEmptyKey() { + final byte[] data = getRandomByteArray(1024); + final byte[] key = new byte[0]; + assertThat(aesDecrypt(data, key)).isNull(); + } + + @Test + void shouldFailToRsaEncryptWithNullKey() { + final byte[] data = getRandomByteArray(256); + assertThat(rsaEncrypt(data, null)).isNull(); } + @Test + void shouldFailToRsaDecryptWithNullKey() { + final byte[] data = getRandomByteArray(256); + assertThat(rsaDecrypt(data, null)).isNull(); + } + + @Test + void errorExtractingRsaKeys() { + final String weirdCharacters = RandomStringUtils.randomAlphanumeric(256); + assertThat(plainText2RsaPrivateKey(weirdCharacters)).isNull(); + assertThat(plainText2RsaPublicKey(weirdCharacters)).isNull(); + } + + @Test + void shouldNotGetRsaKeyPair() { + assertThat(getRsaKeyPair(null, null)).isNull(); + assertThat(getRsaKeyPair("", "")).isNull(); + } + // endregion + private byte[] getRandomByteArray(int size) { byte[] randomByteArray = new byte[size]; - new Random().nextBytes(randomByteArray); + random.nextBytes(randomByteArray); return randomByteArray; } - } diff --git a/src/test/java/com/iexec/common/utils/FileHelperTests.java b/src/test/java/com/iexec/common/utils/FileHelperTests.java index faeab35d..aab07226 100644 --- a/src/test/java/com/iexec/common/utils/FileHelperTests.java +++ b/src/test/java/com/iexec/common/utils/FileHelperTests.java @@ -23,13 +23,11 @@ import java.io.File; import java.io.IOException; -import java.lang.reflect.Constructor; import java.nio.file.Files; import java.nio.file.Paths; import static com.iexec.common.utils.FileHelper.downloadFile; import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.jupiter.api.Assertions.assertThrows; class FileHelperTests { @@ -63,15 +61,6 @@ void tearDown() throws IOException { FileUtils.deleteDirectory(new File(TEST_FOLDER)); } - @Test - void shouldThrowExceptionWhenInvokingConstructor() throws Exception { - Constructor clazz = FileHelper.class.getDeclaredConstructor(); - clazz.setAccessible(true); - // calling the private constructor - assertThrows(Exception.class, clazz::newInstance); - } - - @Test void shouldCreateFileWithContent() throws IOException { String data = "a test"; From 794e2f7b1ea50eff523194dc810f82778a0e45fd Mon Sep 17 00:00:00 2001 From: Jeremy Bernard Date: Thu, 13 Jun 2024 14:01:06 +0200 Subject: [PATCH 12/14] Remove `CredentialsAbstractService` class (#456) --- CHANGELOG.md | 1 + .../chain/CredentialsAbstractService.java | 100 ------------ .../CredentialsAbstractServiceTests.java | 147 ------------------ 3 files changed, 1 insertion(+), 247 deletions(-) delete mode 100644 src/main/java/com/iexec/common/chain/CredentialsAbstractService.java delete mode 100644 src/test/java/com/iexec/common/chain/CredentialsAbstractServiceTests.java diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ef350f6..ae3c9844 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ All notable changes to this project will be documented in this file. - Configure Gradle JVM Test Suite Plugin. (#448) - Remove `ReplicateActionResponse` and `ReplicateTaskSummary` classes. (#452) - Remove `DateTimeUtils`, `EthAddress` and `VersionUtils` classes. (#454) +- Remove `CredentialsAbstractService` class. (#456) ### Dependency Upgrades diff --git a/src/main/java/com/iexec/common/chain/CredentialsAbstractService.java b/src/main/java/com/iexec/common/chain/CredentialsAbstractService.java deleted file mode 100644 index 688e7616..00000000 --- a/src/main/java/com/iexec/common/chain/CredentialsAbstractService.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright 2020-2023 IEXEC BLOCKCHAIN TECH - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://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. - */ - -package com.iexec.common.chain; - -import com.iexec.commons.poco.eip712.EIP712Entity; -import com.iexec.commons.poco.security.Signature; -import com.iexec.commons.poco.utils.EthAddress; -import com.iexec.commons.poco.utils.SignatureUtils; -import lombok.Getter; -import lombok.extern.slf4j.Slf4j; -import org.web3j.crypto.*; -import org.web3j.utils.Numeric; - -import java.io.IOException; -import java.security.InvalidAlgorithmParameterException; -import java.security.NoSuchAlgorithmException; -import java.security.NoSuchProviderException; - -@Getter -@Slf4j -public abstract class CredentialsAbstractService { - - private final Credentials credentials; - - protected CredentialsAbstractService() throws Exception { - try { - ECKeyPair ecKeyPair = Keys.createEcKeyPair(); - credentials = Credentials.create(ecKeyPair); - log.info("Created new wallet credentials [address:{}] ", credentials.getAddress()); - } catch (NoSuchAlgorithmException | NoSuchProviderException | InvalidAlgorithmParameterException e) { - log.error("Cannot create new wallet credentials", e); - throw e; - } - } - - protected CredentialsAbstractService(Credentials credentials) { - this.credentials = credentials; - if (credentials != null - && EthAddress.validate(credentials.getAddress())) { - log.info("Loaded wallet credentials [address:{}]", - credentials.getAddress()); - } else { - throw new ExceptionInInitializerError("Cannot create credential service"); - } - } - - protected CredentialsAbstractService(String walletPassword, String walletPath) throws Exception { - try { - credentials = WalletUtils.loadCredentials(walletPassword, walletPath); - log.info("Loaded wallet credentials [address:{}] ", credentials.getAddress()); - } catch (IOException | CipherException e) { - log.error("Cannot load wallet credentials", e); - throw e; - } - } - - /** - * Signs messages with Ethereum prefix - */ - public Signature hashAndSignMessage(String message) { - String hexPrivateKey = Numeric.toHexStringWithPrefix(credentials.getEcKeyPair().getPrivateKey()); - return SignatureUtils.signMessageHashAndGetSignature(message, hexPrivateKey); - } - - /** - * Builds an authorization token for given {@link EIP712Entity}. - *

- * An authorization token is the concatenation of the following values, - * delimited by an underscore: - *

    - *
  1. Entity hash;
  2. - *
  3. Signed message;
  4. - *
  5. Credentials address.
  6. - *
- * - * @param eip712Entity Entity to sign a token for. - * @return The authorization token. - */ - public String signEIP712EntityAndBuildToken(EIP712Entity eip712Entity) { - final Credentials currentCredentials = this.getCredentials(); - - final String hash = eip712Entity.getHash(); - final String signedMessage = eip712Entity.signMessage(currentCredentials.getEcKeyPair()); - return String.join("_", hash, signedMessage, currentCredentials.getAddress()); - } -} diff --git a/src/test/java/com/iexec/common/chain/CredentialsAbstractServiceTests.java b/src/test/java/com/iexec/common/chain/CredentialsAbstractServiceTests.java deleted file mode 100644 index ed41c1a6..00000000 --- a/src/test/java/com/iexec/common/chain/CredentialsAbstractServiceTests.java +++ /dev/null @@ -1,147 +0,0 @@ -/* - * Copyright 2020 IEXEC BLOCKCHAIN TECH - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://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. - */ - -package com.iexec.common.chain; - -import com.iexec.commons.poco.eip712.EIP712Domain; -import com.iexec.commons.poco.eip712.entity.Challenge; -import com.iexec.commons.poco.eip712.entity.EIP712Challenge; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.io.TempDir; -import org.web3j.crypto.CipherException; -import org.web3j.crypto.Credentials; -import org.web3j.crypto.Hash; -import org.web3j.crypto.WalletUtils; - -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileWriter; -import java.io.IOException; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.mockito.Mockito.*; - -class CredentialsAbstractServiceTests { - - @TempDir - File tempDir; - - public static final String WALLET_PASS = "wallet-pass"; - - static class CredentialsServiceStub extends CredentialsAbstractService { - public CredentialsServiceStub(String walletPassword, String walletPath) throws Exception { - super(walletPassword, walletPath); - } - - public CredentialsServiceStub(Credentials credentials) { - super(credentials); - } - - public CredentialsServiceStub() throws Exception { - super(); - } - } - - // region constructor (Credentials) - @Test - void shouldConstructFromCredentials() { - Credentials credentials = Credentials.create(Hash.sha3("")); - - CredentialsServiceStub credentialsService = new CredentialsServiceStub(credentials); - Credentials claimedCredentials = credentialsService.getCredentials(); - - assertThat(claimedCredentials).isEqualTo(credentials); - assertThat(claimedCredentials.getAddress()).isEqualTo("0x9cce34f7ab185c7aba1b7c8140d620b4bda941d6"); - } - - @Test - void shouldNotConstructFromNullCredentials() { - Credentials credentials = mock(Credentials.class); - assertThrows(ExceptionInInitializerError.class, () -> new CredentialsServiceStub(credentials)); - } - - @Test - void shouldNotConstructFromInvalidCredentials() { - Credentials credentials = mock(Credentials.class); - when(credentials.getAddress()).thenReturn("0xwrongFormat"); - assertThrows(ExceptionInInitializerError.class, () -> new CredentialsServiceStub(credentials)); - } - // endregion - - // region constructor (String, String) - @Test - void shouldLoadCorrectCredentials() throws Exception { - String walletPath = createTempWallet(WALLET_PASS); - - CredentialsServiceStub credentialsService = new CredentialsServiceStub(WALLET_PASS, walletPath); - Credentials claimedCredentials = credentialsService.getCredentials(); - Credentials correctCredentials = WalletUtils.loadCredentials(WALLET_PASS, walletPath); - - assertThat(claimedCredentials).isEqualTo(correctCredentials); - assertThat(claimedCredentials.getAddress()).isEqualTo(correctCredentials.getAddress()); - } - - @Test - void shouldThrowIOExceptionSinceWalletFileNotFind() throws Exception { - assertThrows(FileNotFoundException.class, () -> new CredentialsServiceStub(WALLET_PASS, "dummy-path")); - } - - @Test - void shouldThrowIOExceptionSinceCorruptedWalletFile() throws Exception { - String walletPath = createTempWallet(WALLET_PASS); - FileWriter fw = new FileWriter(walletPath); - fw.write("{new: devilish corrupted content}"); - fw.close(); - assertThrows(IOException.class, () -> new CredentialsServiceStub(WALLET_PASS, walletPath)); - } - - @Test - void shouldThrowCipherExceptionSinceWrongPassword() throws Exception { - String wrongPass = "wrong-pass"; - String walletPath = createTempWallet(WALLET_PASS); - assertThrows(CipherException.class, () -> new CredentialsServiceStub(wrongPass, walletPath)); - } - // endregion - - // region EIP712Challenge - @Test - void shouldBuildAuthorizationTokenFromCredentials() throws Exception { - final Challenge challenge = Challenge.builder().challenge("abcd").build(); - final EIP712Domain domain = new EIP712Domain("OTHER DOMAIN", "2", 13L, null); - final EIP712Challenge eip712Challenge = new EIP712Challenge(domain, challenge); - final Credentials credentials = Credentials.create("0x2a46e8c1535792f6689b10d5c882c9363910c30751ec193ae71ec71630077909"); - - final String expectedToken = "0xe001855eda78679dfa4972de06d1cf28c630561e17fc6b075130ce688f448bfe" + - "_0xc0b3f255c47783e482e1932923dc388cfb5a737ebebdcec04b8ad7ac427c8c9d5155c3211a375704416b639ff8aa7571ef999122a0259bfaf1bbf822345505b11c" + - "_0x2d29bfbec903479fe4ba991918bab99b494f2bef"; - - final CredentialsServiceStub credentialsServiceStub = spy(CredentialsServiceStub.class); - when(credentialsServiceStub.getCredentials()).thenReturn(credentials); - - final String token = credentialsServiceStub.signEIP712EntityAndBuildToken(eip712Challenge); - assertThat(token) - .isNotEmpty() - .isEqualTo(expectedToken); - } - // endregion - - - String createTempWallet(String password) throws Exception { - String walletFilename = WalletUtils.generateFullNewWalletFile(password, tempDir); - return tempDir + "/" + walletFilename; - } -} \ No newline at end of file From 31c03ff1118dc867d13fb537da0a649b3733de55 Mon Sep 17 00:00:00 2001 From: Jeremy Bernard Date: Mon, 17 Jun 2024 15:36:14 +0200 Subject: [PATCH 13/14] Upgrade to `iexec-commons-poco` 4.1.0 (#457) --- CHANGELOG.md | 1 + gradle.properties | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ae3c9844..0b6e10bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ All notable changes to this project will be documented in this file. - Upgrade to Gradle 8.7. (#449) - Upgrade to Spring Boot 2.7.18. (#450) +- Upgrade to `iexec-commons-poco` 4.1.0. (#457) ## [[8.4.0]](https://github.com/iExecBlockchainComputing/iexec-common/releases/tag/v8.4.0) 2024-02-27 diff --git a/gradle.properties b/gradle.properties index dc0572f1..58d776de 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ version=8.4.0 -iexecCommonsPocoVersion=4.0.0-NEXT-SNAPSHOT +iexecCommonsPocoVersion=4.1.0 nexusUser nexusPassword From 843ce1adb3be310c549dc1b90edfb66b604b7f82 Mon Sep 17 00:00:00 2001 From: Jeremy Bernard Date: Mon, 17 Jun 2024 15:55:06 +0200 Subject: [PATCH 14/14] Release 8.5.0 --- CHANGELOG.md | 2 +- gradle.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b6e10bc..dc602558 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ All notable changes to this project will be documented in this file. -## [[NEXT]](https://github.com/iExecBlockchainComputing/iexec-common/releases/tag/vNEXT) 2024 +## [[8.5.0]](https://github.com/iExecBlockchainComputing/iexec-common/releases/tag/v8.5.0) 2024-06-17 ### New Features diff --git a/gradle.properties b/gradle.properties index 58d776de..c1572198 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -version=8.4.0 +version=8.5.0 iexecCommonsPocoVersion=4.1.0 nexusUser