From 25d94dc4cabc733fb1c85fb09dc8b73320cbe222 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20James=20Toussaint?= <33313130+jeremyjams@users.noreply.github.com> Date: Mon, 6 Mar 2023 12:29:10 +0100 Subject: [PATCH 01/30] Add next section in changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ae8b638..6ccfe8eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ All notable changes to this project will be documented in this file. +## [[NEXT]](https://github.com/iExecBlockchainComputing/iexec-sms/releases/tag/vNEXT) 2023 + + ## [[8.0.0]](https://github.com/iExecBlockchainComputing/iexec-sms/releases/tag/v8.0.0) 2023-03-06 ### New Features From 3b846d208f660e3426ee23635bcbb68eb6e474c4 Mon Sep 17 00:00:00 2001 From: Jeremy Bernard Date: Fri, 10 Mar 2023 11:48:13 +0100 Subject: [PATCH 02/30] Add `micrometer-registry-prometheus` dependency --- build.gradle | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build.gradle b/build.gradle index da654a1f..c61bc322 100644 --- a/build.gradle +++ b/build.gradle @@ -76,6 +76,9 @@ dependencies { // It is required to define the dependency version required by web3j until migration to at least Spring Boot 2.7.X implementation 'com.squareup.okhttp3:okhttp:4.9.0' // Web3j issue: https://github.com/web3j/web3j/issues/1180 + // observability + runtimeOnly 'io.micrometer:micrometer-registry-prometheus' + // velocity for templating implementation 'org.apache.velocity:velocity-engine-core:2.0' From b3a407f01e2976528099b52097ce738f72d6f493 Mon Sep 17 00:00:00 2001 From: Jeremy Bernard Date: Fri, 10 Mar 2023 11:49:47 +0100 Subject: [PATCH 03/30] Update CHANGELOG.md --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ccfe8eb..7376366d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ All notable changes to this project will be documented in this file. ## [[NEXT]](https://github.com/iExecBlockchainComputing/iexec-sms/releases/tag/vNEXT) 2023 +### New Features +* Enable Prometheus actuator. (#166) ## [[8.0.0]](https://github.com/iExecBlockchainComputing/iexec-sms/releases/tag/v8.0.0) 2023-03-06 From 88b7d74674cb3b7e092c2f93d96cd765ed016b20 Mon Sep 17 00:00:00 2001 From: Jeremy Bernard Date: Tue, 14 Mar 2023 15:39:20 +0100 Subject: [PATCH 04/30] Upgrade to feign@11.10 --- CHANGELOG.md | 2 ++ build.gradle | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7376366d..50ec68bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ All notable changes to this project will be documented in this file. ### New Features * Enable Prometheus actuator. (#166) +### Dependency Upgrades +* Upgrade to `feign` 11.10. (#167) ## [[8.0.0]](https://github.com/iExecBlockchainComputing/iexec-sms/releases/tag/v8.0.0) 2023-03-06 diff --git a/build.gradle b/build.gradle index c61bc322..4f47c2d1 100644 --- a/build.gradle +++ b/build.gradle @@ -9,7 +9,7 @@ plugins { } ext { - openFeignVersion = '11.7' + openFeignVersion = '11.10' } if (!project.hasProperty('gitBranch')) { @@ -100,7 +100,6 @@ dependencies { testImplementation 'org.testcontainers:mongodb:1.16.0' // feign - implementation "io.github.openfeign:feign-core:$openFeignVersion" implementation "io.github.openfeign:feign-jackson:$openFeignVersion" implementation "io.github.openfeign:feign-slf4j:$openFeignVersion" } From b598bae487a94925916a501007f5073cdbf152e0 Mon Sep 17 00:00:00 2001 From: Jeremy Bernard Date: Fri, 24 Mar 2023 09:14:40 +0100 Subject: [PATCH 05/30] Remove unused dependencies --- build.gradle | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/build.gradle b/build.gradle index 4f47c2d1..58d37bab 100644 --- a/build.gradle +++ b/build.gradle @@ -79,25 +79,10 @@ dependencies { // observability runtimeOnly 'io.micrometer:micrometer-registry-prometheus' - // velocity for templating - implementation 'org.apache.velocity:velocity-engine-core:2.0' - - // MongoDB - //implementation "org.springframework.boot:spring-boot-starter-data-mongodb" - //implementation 'org.springframework.boot:spring-boot-starter' - //testImplementation 'org.springframework.boot:spring-boot-starter-test' - // test testImplementation('org.springframework.boot:spring-boot-starter-test') { exclude group: 'org.junit.vintage', module: 'junit-vintage-engine' } - testImplementation 'org.springframework.security:spring-security-test' - // testImplementation 'org.mockito:mockito-inline:2.13.0' // activates mocking final classes/methods - - // test containers - testImplementation 'org.testcontainers:junit-jupiter:1.16.0' - testImplementation 'org.testcontainers:testcontainers:1.16.0' - testImplementation 'org.testcontainers:mongodb:1.16.0' // feign implementation "io.github.openfeign:feign-jackson:$openFeignVersion" From 3dcf7a5218017abde9472d884d2daea52d3fdd35 Mon Sep 17 00:00:00 2001 From: Jeremy Bernard Date: Fri, 24 Mar 2023 10:20:32 +0100 Subject: [PATCH 06/30] Fix imports in tests --- .../sms/tee/session/base/SecretSessionBaseServiceTests.java | 2 +- .../tee/session/gramine/GramineSessionHandlerServiceTests.java | 2 +- .../tee/session/gramine/GramineSessionMakerServiceTests.java | 2 +- .../sms/tee/session/scone/SconeSessionHandlerServiceTests.java | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/test/java/com/iexec/sms/tee/session/base/SecretSessionBaseServiceTests.java b/src/test/java/com/iexec/sms/tee/session/base/SecretSessionBaseServiceTests.java index 9030e295..02b29f16 100644 --- a/src/test/java/com/iexec/sms/tee/session/base/SecretSessionBaseServiceTests.java +++ b/src/test/java/com/iexec/sms/tee/session/base/SecretSessionBaseServiceTests.java @@ -38,7 +38,7 @@ import static com.iexec.sms.tee.session.TeeSessionTestUtils.*; import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.Assert.assertThrows; +import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.ArgumentMatchers.any; diff --git a/src/test/java/com/iexec/sms/tee/session/gramine/GramineSessionHandlerServiceTests.java b/src/test/java/com/iexec/sms/tee/session/gramine/GramineSessionHandlerServiceTests.java index 6d9a8a9f..f8fafef5 100644 --- a/src/test/java/com/iexec/sms/tee/session/gramine/GramineSessionHandlerServiceTests.java +++ b/src/test/java/com/iexec/sms/tee/session/gramine/GramineSessionHandlerServiceTests.java @@ -34,7 +34,7 @@ import org.springframework.boot.test.system.CapturedOutput; import org.springframework.boot.test.system.OutputCaptureExtension; -import static org.junit.Assert.assertThrows; +import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.mock; diff --git a/src/test/java/com/iexec/sms/tee/session/gramine/GramineSessionMakerServiceTests.java b/src/test/java/com/iexec/sms/tee/session/gramine/GramineSessionMakerServiceTests.java index 9fedc989..13e4876b 100644 --- a/src/test/java/com/iexec/sms/tee/session/gramine/GramineSessionMakerServiceTests.java +++ b/src/test/java/com/iexec/sms/tee/session/gramine/GramineSessionMakerServiceTests.java @@ -15,7 +15,7 @@ import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.MockitoAnnotations; -import org.testcontainers.shaded.org.yaml.snakeyaml.Yaml; +import org.yaml.snakeyaml.Yaml; import java.util.Map; diff --git a/src/test/java/com/iexec/sms/tee/session/scone/SconeSessionHandlerServiceTests.java b/src/test/java/com/iexec/sms/tee/session/scone/SconeSessionHandlerServiceTests.java index a726ec46..b8a5307b 100644 --- a/src/test/java/com/iexec/sms/tee/session/scone/SconeSessionHandlerServiceTests.java +++ b/src/test/java/com/iexec/sms/tee/session/scone/SconeSessionHandlerServiceTests.java @@ -18,7 +18,7 @@ import org.springframework.boot.test.system.OutputCaptureExtension; import org.springframework.http.ResponseEntity; -import static org.junit.Assert.assertThrows; +import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.mock; From e06db3eb404727a8111d0545507b2073469821a0 Mon Sep 17 00:00:00 2001 From: Jeremy Bernard Date: Fri, 24 Mar 2023 10:53:51 +0100 Subject: [PATCH 07/30] Update CHANGELOG.md --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 50ec68bc..dcfab466 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ All notable changes to this project will be documented in this file. ### New Features * Enable Prometheus actuator. (#166) +### Bug Fixes +* Remove unused dependencies. (#168) ### Dependency Upgrades * Upgrade to `feign` 11.10. (#167) From d7a120d077e886a0719a0ff2cda05dcf9610919f Mon Sep 17 00:00:00 2001 From: Jeremy Bernard Date: Fri, 24 Mar 2023 12:37:41 +0100 Subject: [PATCH 08/30] Optimize imports in fixed test classes --- .../sms/tee/session/base/SecretSessionBaseServiceTests.java | 4 +--- .../session/gramine/GramineSessionHandlerServiceTests.java | 4 +--- .../tee/session/scone/SconeSessionHandlerServiceTests.java | 4 +--- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/test/java/com/iexec/sms/tee/session/base/SecretSessionBaseServiceTests.java b/src/test/java/com/iexec/sms/tee/session/base/SecretSessionBaseServiceTests.java index 02b29f16..4967cc95 100644 --- a/src/test/java/com/iexec/sms/tee/session/base/SecretSessionBaseServiceTests.java +++ b/src/test/java/com/iexec/sms/tee/session/base/SecretSessionBaseServiceTests.java @@ -38,9 +38,7 @@ import static com.iexec.sms.tee.session.TeeSessionTestUtils.*; import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; -import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.*; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.*; diff --git a/src/test/java/com/iexec/sms/tee/session/gramine/GramineSessionHandlerServiceTests.java b/src/test/java/com/iexec/sms/tee/session/gramine/GramineSessionHandlerServiceTests.java index f8fafef5..12c7f3d6 100644 --- a/src/test/java/com/iexec/sms/tee/session/gramine/GramineSessionHandlerServiceTests.java +++ b/src/test/java/com/iexec/sms/tee/session/gramine/GramineSessionHandlerServiceTests.java @@ -34,9 +34,7 @@ import org.springframework.boot.test.system.CapturedOutput; import org.springframework.boot.test.system.OutputCaptureExtension; -import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.*; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/src/test/java/com/iexec/sms/tee/session/scone/SconeSessionHandlerServiceTests.java b/src/test/java/com/iexec/sms/tee/session/scone/SconeSessionHandlerServiceTests.java index b8a5307b..3f4b9514 100644 --- a/src/test/java/com/iexec/sms/tee/session/scone/SconeSessionHandlerServiceTests.java +++ b/src/test/java/com/iexec/sms/tee/session/scone/SconeSessionHandlerServiceTests.java @@ -18,9 +18,7 @@ import org.springframework.boot.test.system.OutputCaptureExtension; import org.springframework.http.ResponseEntity; -import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.*; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; From 670759e8c169633671ee7cd79b0cde6dd8b661dc Mon Sep 17 00:00:00 2001 From: Jeremy Bernard Date: Fri, 14 Apr 2023 12:26:18 +0200 Subject: [PATCH 09/30] Use iexec-common@8.0.0 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index e15dd102..5d55bfc5 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ version=8.0.0 -iexecCommonVersion=7.0.0 +iexecCommonVersion=8.0.0 nexusUser nexusPassword From 3f3560e9fc596901ae348e2339c12d24e4fa3309 Mon Sep 17 00:00:00 2001 From: Jeremy Bernard Date: Fri, 14 Apr 2023 12:27:13 +0200 Subject: [PATCH 10/30] Use iexec-commons-poco@1.0.2 --- build.gradle | 1 + gradle.properties | 1 + iexec-sms-library/build.gradle | 1 + 3 files changed, 3 insertions(+) diff --git a/build.gradle b/build.gradle index 58d37bab..e15dedd3 100644 --- a/build.gradle +++ b/build.gradle @@ -52,6 +52,7 @@ configurations { dependencies { // iexec + implementation "com.iexec.commons:iexec-commons-poco:$iexecCommonsPocoVersion" implementation "com.iexec.common:iexec-common:$iexecCommonVersion" implementation project(':iexec-sms-library') diff --git a/gradle.properties b/gradle.properties index 5d55bfc5..b0607d8b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,6 @@ version=8.0.0 iexecCommonVersion=8.0.0 +iexecCommonsPocoVersion=1.0.2 nexusUser nexusPassword diff --git a/iexec-sms-library/build.gradle b/iexec-sms-library/build.gradle index 00f55e4d..84130723 100644 --- a/iexec-sms-library/build.gradle +++ b/iexec-sms-library/build.gradle @@ -6,6 +6,7 @@ plugins { } dependencies { + implementation "com.iexec.commons:iexec-commons-poco:$iexecCommonsPocoVersion" implementation "com.iexec.common:iexec-common:$iexecCommonVersion" testImplementation "org.assertj:assertj-core:3.22.0" testImplementation 'org.junit.jupiter:junit-jupiter:5.8.2' From 6dd0e65113579ab37706bfe1f0928b5ac98b0ff9 Mon Sep 17 00:00:00 2001 From: Jeremy Bernard Date: Fri, 14 Apr 2023 12:35:06 +0200 Subject: [PATCH 11/30] Update classes --- .../java/com/iexec/sms/api/SmsClient.java | 6 ++--- .../api/config/GramineServicesProperties.java | 4 ++-- .../api/config/SconeServicesProperties.java | 4 ++-- .../sms/api/config/TeeServicesProperties.java | 4 ++-- .../authorization/AuthorizationService.java | 18 +++++++------- .../iexec/sms/blockchain/IexecHubService.java | 4 ++-- .../iexec/sms/blockchain/Web3jService.java | 4 ++-- .../sms/encryption/EncryptionService.java | 4 ++-- .../java/com/iexec/sms/ssl/SslConfig.java | 4 ++-- .../com/iexec/sms/ssl/TwoWaySslClient.java | 4 ++-- .../sms/tee/ConditionalOnTeeFramework.java | 18 +++++++++++++- .../sms/tee/OnTeeFrameworkCondition.java | 18 +++++++++++++- .../java/com/iexec/sms/tee/TeeController.java | 6 ++--- .../iexec/sms/tee/TeeFrameworkConverter.java | 18 +++++++++++++- .../TeeWorkerInternalConfiguration.java | 18 +++++++++++++- .../sms/tee/session/TeeSessionService.java | 6 ++--- .../base/SecretSessionBaseService.java | 10 ++++---- .../session/generic/TeeSessionRequest.java | 4 ++-- .../gramine/GramineSessionHandlerService.java | 4 ++-- .../gramine/GramineSessionMakerService.java | 4 ++-- .../session/gramine/sps/SpsConfiguration.java | 4 ++-- .../scone/SconeSessionHandlerService.java | 4 ++-- .../scone/SconeSessionMakerService.java | 4 ++-- .../scone/SconeSessionSecurityConfig.java | 4 ++-- .../sms/tee/session/scone/cas/CasClient.java | 4 ++-- .../session/scone/cas/CasConfiguration.java | 4 ++-- .../iexec/sms/utils/EthereumCredentials.java | 4 ++-- .../AuthorizationServiceTests.java | 16 ++++++------- .../tee/ConditionalOnTeeFrameworkTests.java | 18 +++++++++++++- .../com/iexec/sms/tee/TeeControllerTests.java | 20 ++++++++++++++-- .../sms/tee/TeeFrameworkConverterTests.java | 20 ++++++++++++++-- .../TeeWorkerInternalConfigurationTests.java | 18 +++++++++++++- .../tee/session/TeeSessionServiceTests.java | 20 ++++++++++++++-- .../sms/tee/session/TeeSessionTestUtils.java | 6 ++--- .../base/SecretSessionBaseServiceTests.java | 24 +++++++++++++++---- .../GramineSessionHandlerServiceTests.java | 4 ++-- .../GramineSessionMakerServiceTests.java | 18 +++++++++++++- .../SconeSessionHandlerServiceTests.java | 18 +++++++++++++- .../scone/SconeSessionMakerServiceTests.java | 4 ++-- .../sms/utils/EthereumCredentialsTest.java | 4 ++-- 40 files changed, 286 insertions(+), 94 deletions(-) diff --git a/iexec-sms-library/src/main/java/com/iexec/sms/api/SmsClient.java b/iexec-sms-library/src/main/java/com/iexec/sms/api/SmsClient.java index 11d8341a..4b63ba8f 100644 --- a/iexec-sms-library/src/main/java/com/iexec/sms/api/SmsClient.java +++ b/iexec-sms-library/src/main/java/com/iexec/sms/api/SmsClient.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 IEXEC BLOCKCHAIN TECH + * 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. @@ -16,9 +16,9 @@ package com.iexec.sms.api; -import com.iexec.common.chain.WorkerpoolAuthorization; -import com.iexec.common.tee.TeeFramework; import com.iexec.common.web.ApiResponseBody; +import com.iexec.commons.poco.chain.WorkerpoolAuthorization; +import com.iexec.commons.poco.tee.TeeFramework; import com.iexec.sms.api.config.TeeServicesProperties; import feign.Headers; import feign.Param; diff --git a/iexec-sms-library/src/main/java/com/iexec/sms/api/config/GramineServicesProperties.java b/iexec-sms-library/src/main/java/com/iexec/sms/api/config/GramineServicesProperties.java index 85e17089..5ce0bb19 100644 --- a/iexec-sms-library/src/main/java/com/iexec/sms/api/config/GramineServicesProperties.java +++ b/iexec-sms-library/src/main/java/com/iexec/sms/api/config/GramineServicesProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 IEXEC BLOCKCHAIN TECH + * 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. @@ -18,7 +18,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -import com.iexec.common.tee.TeeFramework; +import com.iexec.commons.poco.tee.TeeFramework; import lombok.Getter; @Getter diff --git a/iexec-sms-library/src/main/java/com/iexec/sms/api/config/SconeServicesProperties.java b/iexec-sms-library/src/main/java/com/iexec/sms/api/config/SconeServicesProperties.java index 887e0e1d..72019609 100644 --- a/iexec-sms-library/src/main/java/com/iexec/sms/api/config/SconeServicesProperties.java +++ b/iexec-sms-library/src/main/java/com/iexec/sms/api/config/SconeServicesProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 IEXEC BLOCKCHAIN TECH + * 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. @@ -18,7 +18,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -import com.iexec.common.tee.TeeFramework; +import com.iexec.commons.poco.tee.TeeFramework; import lombok.Getter; @Getter diff --git a/iexec-sms-library/src/main/java/com/iexec/sms/api/config/TeeServicesProperties.java b/iexec-sms-library/src/main/java/com/iexec/sms/api/config/TeeServicesProperties.java index 9c50746d..1ca3cc56 100644 --- a/iexec-sms-library/src/main/java/com/iexec/sms/api/config/TeeServicesProperties.java +++ b/iexec-sms-library/src/main/java/com/iexec/sms/api/config/TeeServicesProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 IEXEC BLOCKCHAIN TECH + * 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. @@ -18,7 +18,7 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.iexec.common.tee.TeeFramework; +import com.iexec.commons.poco.tee.TeeFramework; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/src/main/java/com/iexec/sms/authorization/AuthorizationService.java b/src/main/java/com/iexec/sms/authorization/AuthorizationService.java index b3e96c17..1a267f77 100644 --- a/src/main/java/com/iexec/sms/authorization/AuthorizationService.java +++ b/src/main/java/com/iexec/sms/authorization/AuthorizationService.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 IEXEC BLOCKCHAIN TECH + * 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. @@ -17,14 +17,14 @@ package com.iexec.sms.authorization; -import com.iexec.common.chain.ChainDeal; -import com.iexec.common.chain.ChainTask; -import com.iexec.common.chain.ChainTaskStatus; -import com.iexec.common.chain.WorkerpoolAuthorization; -import com.iexec.common.security.Signature; -import com.iexec.common.utils.BytesUtils; -import com.iexec.common.utils.HashUtils; -import com.iexec.common.utils.SignatureUtils; +import com.iexec.commons.poco.chain.ChainDeal; +import com.iexec.commons.poco.chain.ChainTask; +import com.iexec.commons.poco.chain.ChainTaskStatus; +import com.iexec.commons.poco.chain.WorkerpoolAuthorization; +import com.iexec.commons.poco.security.Signature; +import com.iexec.commons.poco.utils.BytesUtils; +import com.iexec.commons.poco.utils.HashUtils; +import com.iexec.commons.poco.utils.SignatureUtils; import com.iexec.sms.blockchain.IexecHubService; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; diff --git a/src/main/java/com/iexec/sms/blockchain/IexecHubService.java b/src/main/java/com/iexec/sms/blockchain/IexecHubService.java index e7cb778f..73b4df6e 100644 --- a/src/main/java/com/iexec/sms/blockchain/IexecHubService.java +++ b/src/main/java/com/iexec/sms/blockchain/IexecHubService.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 IEXEC BLOCKCHAIN TECH + * 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. @@ -17,7 +17,7 @@ package com.iexec.sms.blockchain; -import com.iexec.common.chain.IexecHubAbstractService; +import com.iexec.commons.poco.chain.IexecHubAbstractService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; diff --git a/src/main/java/com/iexec/sms/blockchain/Web3jService.java b/src/main/java/com/iexec/sms/blockchain/Web3jService.java index f1d1efa5..4b08c50d 100644 --- a/src/main/java/com/iexec/sms/blockchain/Web3jService.java +++ b/src/main/java/com/iexec/sms/blockchain/Web3jService.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 IEXEC BLOCKCHAIN TECH + * 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. @@ -16,7 +16,7 @@ package com.iexec.sms.blockchain; -import com.iexec.common.chain.Web3jAbstractService; +import com.iexec.commons.poco.chain.Web3jAbstractService; import org.springframework.stereotype.Service; @Service diff --git a/src/main/java/com/iexec/sms/encryption/EncryptionService.java b/src/main/java/com/iexec/sms/encryption/EncryptionService.java index deef1559..62d69e41 100644 --- a/src/main/java/com/iexec/sms/encryption/EncryptionService.java +++ b/src/main/java/com/iexec/sms/encryption/EncryptionService.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 IEXEC BLOCKCHAIN TECH + * 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. @@ -18,8 +18,8 @@ import com.iexec.common.security.CipherHelper; -import com.iexec.common.utils.BytesUtils; import com.iexec.common.utils.FileHelper; +import com.iexec.commons.poco.utils.BytesUtils; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import org.web3j.crypto.Hash; diff --git a/src/main/java/com/iexec/sms/ssl/SslConfig.java b/src/main/java/com/iexec/sms/ssl/SslConfig.java index 9f8a0ffd..d189ff3d 100644 --- a/src/main/java/com/iexec/sms/ssl/SslConfig.java +++ b/src/main/java/com/iexec/sms/ssl/SslConfig.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 IEXEC BLOCKCHAIN TECH + * 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. @@ -16,7 +16,7 @@ package com.iexec.sms.ssl; -import com.iexec.common.tee.TeeFramework; +import com.iexec.commons.poco.tee.TeeFramework; import com.iexec.sms.tee.ConditionalOnTeeFramework; import lombok.extern.slf4j.Slf4j; import org.apache.http.ssl.SSLContexts; diff --git a/src/main/java/com/iexec/sms/ssl/TwoWaySslClient.java b/src/main/java/com/iexec/sms/ssl/TwoWaySslClient.java index c6b0aad5..3bb98c5a 100644 --- a/src/main/java/com/iexec/sms/ssl/TwoWaySslClient.java +++ b/src/main/java/com/iexec/sms/ssl/TwoWaySslClient.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 IEXEC BLOCKCHAIN TECH + * 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. @@ -16,7 +16,7 @@ package com.iexec.sms.ssl; -import com.iexec.common.tee.TeeFramework; +import com.iexec.commons.poco.tee.TeeFramework; import com.iexec.sms.tee.ConditionalOnTeeFramework; import org.apache.http.conn.ssl.NoopHostnameVerifier; import org.apache.http.impl.client.HttpClientBuilder; diff --git a/src/main/java/com/iexec/sms/tee/ConditionalOnTeeFramework.java b/src/main/java/com/iexec/sms/tee/ConditionalOnTeeFramework.java index 8f83b789..ac4143fb 100644 --- a/src/main/java/com/iexec/sms/tee/ConditionalOnTeeFramework.java +++ b/src/main/java/com/iexec/sms/tee/ConditionalOnTeeFramework.java @@ -1,6 +1,22 @@ +/* + * 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.sms.tee; -import com.iexec.common.tee.TeeFramework; +import com.iexec.commons.poco.tee.TeeFramework; import org.springframework.context.annotation.Conditional; import java.lang.annotation.ElementType; diff --git a/src/main/java/com/iexec/sms/tee/OnTeeFrameworkCondition.java b/src/main/java/com/iexec/sms/tee/OnTeeFrameworkCondition.java index 741215b6..b2f5be60 100644 --- a/src/main/java/com/iexec/sms/tee/OnTeeFrameworkCondition.java +++ b/src/main/java/com/iexec/sms/tee/OnTeeFrameworkCondition.java @@ -1,6 +1,22 @@ +/* + * 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.sms.tee; -import com.iexec.common.tee.TeeFramework; +import com.iexec.commons.poco.tee.TeeFramework; import lombok.extern.slf4j.Slf4j; import org.springframework.boot.autoconfigure.condition.ConditionMessage; import org.springframework.boot.autoconfigure.condition.ConditionOutcome; diff --git a/src/main/java/com/iexec/sms/tee/TeeController.java b/src/main/java/com/iexec/sms/tee/TeeController.java index d52a468c..eb0be72f 100644 --- a/src/main/java/com/iexec/sms/tee/TeeController.java +++ b/src/main/java/com/iexec/sms/tee/TeeController.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 IEXEC BLOCKCHAIN TECH + * 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. @@ -17,9 +17,9 @@ package com.iexec.sms.tee; -import com.iexec.common.chain.WorkerpoolAuthorization; -import com.iexec.common.tee.TeeFramework; import com.iexec.common.web.ApiResponseBody; +import com.iexec.commons.poco.chain.WorkerpoolAuthorization; +import com.iexec.commons.poco.tee.TeeFramework; import com.iexec.sms.api.TeeSessionGenerationError; import com.iexec.sms.api.TeeSessionGenerationResponse; import com.iexec.sms.api.config.TeeServicesProperties; diff --git a/src/main/java/com/iexec/sms/tee/TeeFrameworkConverter.java b/src/main/java/com/iexec/sms/tee/TeeFrameworkConverter.java index 78ccd54e..b120a629 100644 --- a/src/main/java/com/iexec/sms/tee/TeeFrameworkConverter.java +++ b/src/main/java/com/iexec/sms/tee/TeeFrameworkConverter.java @@ -1,6 +1,22 @@ +/* + * 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.sms.tee; -import com.iexec.common.tee.TeeFramework; +import com.iexec.commons.poco.tee.TeeFramework; import org.springframework.core.convert.converter.Converter; import org.springframework.stereotype.Component; diff --git a/src/main/java/com/iexec/sms/tee/config/TeeWorkerInternalConfiguration.java b/src/main/java/com/iexec/sms/tee/config/TeeWorkerInternalConfiguration.java index e907ba26..7d3e750f 100644 --- a/src/main/java/com/iexec/sms/tee/config/TeeWorkerInternalConfiguration.java +++ b/src/main/java/com/iexec/sms/tee/config/TeeWorkerInternalConfiguration.java @@ -1,6 +1,22 @@ +/* + * 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.sms.tee.config; -import com.iexec.common.tee.TeeFramework; +import com.iexec.commons.poco.tee.TeeFramework; import com.iexec.sms.api.config.GramineServicesProperties; import com.iexec.sms.api.config.SconeServicesProperties; import com.iexec.sms.api.config.TeeAppProperties; diff --git a/src/main/java/com/iexec/sms/tee/session/TeeSessionService.java b/src/main/java/com/iexec/sms/tee/session/TeeSessionService.java index b2b26390..5efcaf61 100644 --- a/src/main/java/com/iexec/sms/tee/session/TeeSessionService.java +++ b/src/main/java/com/iexec/sms/tee/session/TeeSessionService.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 IEXEC BLOCKCHAIN TECH + * 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. @@ -16,8 +16,8 @@ package com.iexec.sms.tee.session; -import com.iexec.common.task.TaskDescription; -import com.iexec.common.tee.TeeFramework; +import com.iexec.commons.poco.task.TaskDescription; +import com.iexec.commons.poco.tee.TeeFramework; import com.iexec.sms.api.TeeSessionGenerationResponse; import com.iexec.sms.blockchain.IexecHubService; import com.iexec.sms.tee.session.generic.TeeSessionGenerationException; diff --git a/src/main/java/com/iexec/sms/tee/session/base/SecretSessionBaseService.java b/src/main/java/com/iexec/sms/tee/session/base/SecretSessionBaseService.java index c6d561d1..a6509661 100644 --- a/src/main/java/com/iexec/sms/tee/session/base/SecretSessionBaseService.java +++ b/src/main/java/com/iexec/sms/tee/session/base/SecretSessionBaseService.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 IEXEC BLOCKCHAIN TECH + * 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. @@ -16,10 +16,10 @@ package com.iexec.sms.tee.session.base; -import com.iexec.common.task.TaskDescription; -import com.iexec.common.tee.TeeEnclaveConfiguration; import com.iexec.common.utils.IexecEnvUtils; import com.iexec.common.utils.IexecFileHelper; +import com.iexec.commons.poco.task.TaskDescription; +import com.iexec.commons.poco.tee.TeeEnclaveConfiguration; import com.iexec.sms.api.config.TeeServicesProperties; import com.iexec.sms.secret.compute.OnChainObjectType; import com.iexec.sms.secret.compute.SecretOwnerRole; @@ -40,10 +40,10 @@ import java.util.*; -import static com.iexec.common.chain.DealParams.DROPBOX_RESULT_STORAGE_PROVIDER; import static com.iexec.common.precompute.PreComputeUtils.IS_DATASET_REQUIRED; -import static com.iexec.common.tee.TeeUtils.booleanToYesNo; import static com.iexec.common.worker.result.ResultUtils.*; +import static com.iexec.commons.poco.chain.DealParams.DROPBOX_RESULT_STORAGE_PROVIDER; +import static com.iexec.commons.poco.tee.TeeUtils.booleanToYesNo; import static com.iexec.sms.api.TeeSessionGenerationError.*; import static com.iexec.sms.secret.ReservedSecretKeyName.*; diff --git a/src/main/java/com/iexec/sms/tee/session/generic/TeeSessionRequest.java b/src/main/java/com/iexec/sms/tee/session/generic/TeeSessionRequest.java index 117d62ef..8f5541cf 100644 --- a/src/main/java/com/iexec/sms/tee/session/generic/TeeSessionRequest.java +++ b/src/main/java/com/iexec/sms/tee/session/generic/TeeSessionRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 IEXEC BLOCKCHAIN TECH + * 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. @@ -16,7 +16,7 @@ package com.iexec.sms.tee.session.generic; -import com.iexec.common.task.TaskDescription; +import com.iexec.commons.poco.task.TaskDescription; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; diff --git a/src/main/java/com/iexec/sms/tee/session/gramine/GramineSessionHandlerService.java b/src/main/java/com/iexec/sms/tee/session/gramine/GramineSessionHandlerService.java index 862899be..d0f171df 100644 --- a/src/main/java/com/iexec/sms/tee/session/gramine/GramineSessionHandlerService.java +++ b/src/main/java/com/iexec/sms/tee/session/gramine/GramineSessionHandlerService.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 IEXEC BLOCKCHAIN TECH + * 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. @@ -16,7 +16,7 @@ package com.iexec.sms.tee.session.gramine; -import com.iexec.common.tee.TeeFramework; +import com.iexec.commons.poco.tee.TeeFramework; import com.iexec.sms.api.TeeSessionGenerationError; import com.iexec.sms.tee.ConditionalOnTeeFramework; import com.iexec.sms.tee.session.TeeSessionLogConfiguration; diff --git a/src/main/java/com/iexec/sms/tee/session/gramine/GramineSessionMakerService.java b/src/main/java/com/iexec/sms/tee/session/gramine/GramineSessionMakerService.java index 86de236e..253683ad 100644 --- a/src/main/java/com/iexec/sms/tee/session/gramine/GramineSessionMakerService.java +++ b/src/main/java/com/iexec/sms/tee/session/gramine/GramineSessionMakerService.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 IEXEC BLOCKCHAIN TECH + * 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. @@ -16,7 +16,7 @@ package com.iexec.sms.tee.session.gramine; -import com.iexec.common.tee.TeeFramework; +import com.iexec.commons.poco.tee.TeeFramework; import com.iexec.sms.tee.ConditionalOnTeeFramework; import com.iexec.sms.tee.session.base.SecretEnclaveBase; import com.iexec.sms.tee.session.base.SecretSessionBase; diff --git a/src/main/java/com/iexec/sms/tee/session/gramine/sps/SpsConfiguration.java b/src/main/java/com/iexec/sms/tee/session/gramine/sps/SpsConfiguration.java index bb2e628a..c9d6dbb8 100644 --- a/src/main/java/com/iexec/sms/tee/session/gramine/sps/SpsConfiguration.java +++ b/src/main/java/com/iexec/sms/tee/session/gramine/sps/SpsConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 IEXEC BLOCKCHAIN TECH + * 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. @@ -16,8 +16,8 @@ package com.iexec.sms.tee.session.gramine.sps; -import com.iexec.common.tee.TeeFramework; import com.iexec.common.utils.FeignBuilder; +import com.iexec.commons.poco.tee.TeeFramework; import com.iexec.sms.tee.ConditionalOnTeeFramework; import feign.Logger.Level; import lombok.Getter; diff --git a/src/main/java/com/iexec/sms/tee/session/scone/SconeSessionHandlerService.java b/src/main/java/com/iexec/sms/tee/session/scone/SconeSessionHandlerService.java index a77e31c0..3c9f60f7 100644 --- a/src/main/java/com/iexec/sms/tee/session/scone/SconeSessionHandlerService.java +++ b/src/main/java/com/iexec/sms/tee/session/scone/SconeSessionHandlerService.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 IEXEC BLOCKCHAIN TECH + * 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. @@ -16,7 +16,7 @@ package com.iexec.sms.tee.session.scone; -import com.iexec.common.tee.TeeFramework; +import com.iexec.commons.poco.tee.TeeFramework; import com.iexec.sms.api.TeeSessionGenerationError; import com.iexec.sms.tee.ConditionalOnTeeFramework; import com.iexec.sms.tee.session.TeeSessionLogConfiguration; diff --git a/src/main/java/com/iexec/sms/tee/session/scone/SconeSessionMakerService.java b/src/main/java/com/iexec/sms/tee/session/scone/SconeSessionMakerService.java index 52b48cf1..7ff2f9a6 100644 --- a/src/main/java/com/iexec/sms/tee/session/scone/SconeSessionMakerService.java +++ b/src/main/java/com/iexec/sms/tee/session/scone/SconeSessionMakerService.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 IEXEC BLOCKCHAIN TECH + * 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. @@ -16,7 +16,7 @@ package com.iexec.sms.tee.session.scone; -import com.iexec.common.tee.TeeFramework; +import com.iexec.commons.poco.tee.TeeFramework; import com.iexec.sms.api.config.TeeServicesProperties; import com.iexec.sms.tee.ConditionalOnTeeFramework; import com.iexec.sms.tee.session.base.SecretEnclaveBase; diff --git a/src/main/java/com/iexec/sms/tee/session/scone/SconeSessionSecurityConfig.java b/src/main/java/com/iexec/sms/tee/session/scone/SconeSessionSecurityConfig.java index 1124f157..8acd071e 100644 --- a/src/main/java/com/iexec/sms/tee/session/scone/SconeSessionSecurityConfig.java +++ b/src/main/java/com/iexec/sms/tee/session/scone/SconeSessionSecurityConfig.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 IEXEC BLOCKCHAIN TECH + * 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. @@ -16,7 +16,7 @@ package com.iexec.sms.tee.session.scone; -import com.iexec.common.tee.TeeFramework; +import com.iexec.commons.poco.tee.TeeFramework; import com.iexec.sms.tee.ConditionalOnTeeFramework; import lombok.Getter; import org.springframework.beans.factory.annotation.Value; diff --git a/src/main/java/com/iexec/sms/tee/session/scone/cas/CasClient.java b/src/main/java/com/iexec/sms/tee/session/scone/cas/CasClient.java index 0ed6f964..e9b2edf7 100644 --- a/src/main/java/com/iexec/sms/tee/session/scone/cas/CasClient.java +++ b/src/main/java/com/iexec/sms/tee/session/scone/cas/CasClient.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 IEXEC BLOCKCHAIN TECH + * 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. @@ -16,7 +16,7 @@ package com.iexec.sms.tee.session.scone.cas; -import com.iexec.common.tee.TeeFramework; +import com.iexec.commons.poco.tee.TeeFramework; import com.iexec.sms.ssl.TwoWaySslClient; import com.iexec.sms.tee.ConditionalOnTeeFramework; import org.springframework.http.HttpEntity; diff --git a/src/main/java/com/iexec/sms/tee/session/scone/cas/CasConfiguration.java b/src/main/java/com/iexec/sms/tee/session/scone/cas/CasConfiguration.java index eeb96ac0..776ac570 100644 --- a/src/main/java/com/iexec/sms/tee/session/scone/cas/CasConfiguration.java +++ b/src/main/java/com/iexec/sms/tee/session/scone/cas/CasConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2021 IEXEC BLOCKCHAIN TECH + * Copyright 2021-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. @@ -16,7 +16,7 @@ package com.iexec.sms.tee.session.scone.cas; -import com.iexec.common.tee.TeeFramework; +import com.iexec.commons.poco.tee.TeeFramework; import com.iexec.sms.tee.ConditionalOnTeeFramework; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/src/main/java/com/iexec/sms/utils/EthereumCredentials.java b/src/main/java/com/iexec/sms/utils/EthereumCredentials.java index 8c16a909..90e8a50a 100644 --- a/src/main/java/com/iexec/sms/utils/EthereumCredentials.java +++ b/src/main/java/com/iexec/sms/utils/EthereumCredentials.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 IEXEC BLOCKCHAIN TECH + * 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. @@ -16,7 +16,7 @@ package com.iexec.sms.utils; -import com.iexec.common.utils.CredentialsUtils; +import com.iexec.commons.poco.utils.CredentialsUtils; import lombok.AllArgsConstructor; import lombok.Data; import lombok.Getter; diff --git a/src/test/java/com/iexec/sms/authorization/AuthorizationServiceTests.java b/src/test/java/com/iexec/sms/authorization/AuthorizationServiceTests.java index 0ff228b8..183a1ed8 100644 --- a/src/test/java/com/iexec/sms/authorization/AuthorizationServiceTests.java +++ b/src/test/java/com/iexec/sms/authorization/AuthorizationServiceTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 IEXEC BLOCKCHAIN TECH + * 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. @@ -16,11 +16,11 @@ package com.iexec.sms.authorization; -import com.iexec.common.chain.ChainDeal; -import com.iexec.common.chain.ChainTask; -import com.iexec.common.chain.WorkerpoolAuthorization; -import com.iexec.common.security.Signature; -import com.iexec.common.utils.TestUtils; +import com.iexec.commons.poco.chain.ChainDeal; +import com.iexec.commons.poco.chain.ChainTask; +import com.iexec.commons.poco.chain.WorkerpoolAuthorization; +import com.iexec.commons.poco.security.Signature; +import com.iexec.commons.poco.utils.TestUtils; import com.iexec.sms.blockchain.IexecHubService; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeEach; @@ -31,8 +31,8 @@ import java.util.Optional; -import static com.iexec.common.chain.ChainTaskStatus.ACTIVE; -import static com.iexec.common.chain.ChainTaskStatus.UNSET; +import static com.iexec.commons.poco.chain.ChainTaskStatus.ACTIVE; +import static com.iexec.commons.poco.chain.ChainTaskStatus.UNSET; import static com.iexec.sms.authorization.AuthorizationError.*; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.when; diff --git a/src/test/java/com/iexec/sms/tee/ConditionalOnTeeFrameworkTests.java b/src/test/java/com/iexec/sms/tee/ConditionalOnTeeFrameworkTests.java index be828dba..44218afa 100644 --- a/src/test/java/com/iexec/sms/tee/ConditionalOnTeeFrameworkTests.java +++ b/src/test/java/com/iexec/sms/tee/ConditionalOnTeeFrameworkTests.java @@ -1,6 +1,22 @@ +/* + * 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.sms.tee; -import com.iexec.common.tee.TeeFramework; +import com.iexec.commons.poco.tee.TeeFramework; import com.iexec.sms.tee.session.generic.TeeSessionHandler; import com.iexec.sms.tee.session.gramine.GramineSessionHandlerService; import com.iexec.sms.tee.session.gramine.GramineSessionMakerService; diff --git a/src/test/java/com/iexec/sms/tee/TeeControllerTests.java b/src/test/java/com/iexec/sms/tee/TeeControllerTests.java index 252efb71..64acfee3 100644 --- a/src/test/java/com/iexec/sms/tee/TeeControllerTests.java +++ b/src/test/java/com/iexec/sms/tee/TeeControllerTests.java @@ -1,8 +1,24 @@ +/* + * 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.sms.tee; -import com.iexec.common.chain.WorkerpoolAuthorization; -import com.iexec.common.tee.TeeFramework; import com.iexec.common.web.ApiResponseBody; +import com.iexec.commons.poco.chain.WorkerpoolAuthorization; +import com.iexec.commons.poco.tee.TeeFramework; import com.iexec.sms.api.TeeSessionGenerationError; import com.iexec.sms.api.TeeSessionGenerationResponse; import com.iexec.sms.api.config.GramineServicesProperties; diff --git a/src/test/java/com/iexec/sms/tee/TeeFrameworkConverterTests.java b/src/test/java/com/iexec/sms/tee/TeeFrameworkConverterTests.java index 02697da5..ffd02474 100644 --- a/src/test/java/com/iexec/sms/tee/TeeFrameworkConverterTests.java +++ b/src/test/java/com/iexec/sms/tee/TeeFrameworkConverterTests.java @@ -1,11 +1,27 @@ +/* + * 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.sms.tee; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; -import static com.iexec.common.tee.TeeFramework.GRAMINE; -import static com.iexec.common.tee.TeeFramework.SCONE; +import static com.iexec.commons.poco.tee.TeeFramework.GRAMINE; +import static com.iexec.commons.poco.tee.TeeFramework.SCONE; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; diff --git a/src/test/java/com/iexec/sms/tee/config/TeeWorkerInternalConfigurationTests.java b/src/test/java/com/iexec/sms/tee/config/TeeWorkerInternalConfigurationTests.java index 28554630..920bb40f 100644 --- a/src/test/java/com/iexec/sms/tee/config/TeeWorkerInternalConfigurationTests.java +++ b/src/test/java/com/iexec/sms/tee/config/TeeWorkerInternalConfigurationTests.java @@ -1,6 +1,22 @@ +/* + * 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.sms.tee.config; -import com.iexec.common.tee.TeeFramework; +import com.iexec.commons.poco.tee.TeeFramework; import com.iexec.sms.api.config.GramineServicesProperties; import com.iexec.sms.api.config.SconeServicesProperties; import com.iexec.sms.api.config.TeeAppProperties; diff --git a/src/test/java/com/iexec/sms/tee/session/TeeSessionServiceTests.java b/src/test/java/com/iexec/sms/tee/session/TeeSessionServiceTests.java index 4acc4227..c60a7524 100644 --- a/src/test/java/com/iexec/sms/tee/session/TeeSessionServiceTests.java +++ b/src/test/java/com/iexec/sms/tee/session/TeeSessionServiceTests.java @@ -1,7 +1,23 @@ +/* + * 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.sms.tee.session; -import com.iexec.common.task.TaskDescription; -import com.iexec.common.tee.TeeFramework; +import com.iexec.commons.poco.task.TaskDescription; +import com.iexec.commons.poco.tee.TeeFramework; import com.iexec.sms.api.TeeSessionGenerationError; import com.iexec.sms.api.TeeSessionGenerationResponse; import com.iexec.sms.blockchain.IexecHubService; diff --git a/src/test/java/com/iexec/sms/tee/session/TeeSessionTestUtils.java b/src/test/java/com/iexec/sms/tee/session/TeeSessionTestUtils.java index ad3cfdf2..c4405de3 100644 --- a/src/test/java/com/iexec/sms/tee/session/TeeSessionTestUtils.java +++ b/src/test/java/com/iexec/sms/tee/session/TeeSessionTestUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 IEXEC BLOCKCHAIN TECH + * 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. @@ -17,9 +17,9 @@ package com.iexec.sms.tee.session; import com.iexec.common.precompute.PreComputeUtils; -import com.iexec.common.task.TaskDescription; -import com.iexec.common.tee.TeeEnclaveConfiguration; import com.iexec.common.utils.IexecEnvUtils; +import com.iexec.commons.poco.task.TaskDescription; +import com.iexec.commons.poco.tee.TeeEnclaveConfiguration; import com.iexec.sms.secret.compute.OnChainObjectType; import com.iexec.sms.secret.compute.SecretOwnerRole; import com.iexec.sms.secret.compute.TeeTaskComputeSecret; diff --git a/src/test/java/com/iexec/sms/tee/session/base/SecretSessionBaseServiceTests.java b/src/test/java/com/iexec/sms/tee/session/base/SecretSessionBaseServiceTests.java index 4967cc95..c26a6b8e 100644 --- a/src/test/java/com/iexec/sms/tee/session/base/SecretSessionBaseServiceTests.java +++ b/src/test/java/com/iexec/sms/tee/session/base/SecretSessionBaseServiceTests.java @@ -1,9 +1,25 @@ +/* + * 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.sms.tee.session.base; -import com.iexec.common.chain.DealParams; -import com.iexec.common.task.TaskDescription; -import com.iexec.common.tee.TeeEnclaveConfiguration; -import com.iexec.common.tee.TeeFramework; +import com.iexec.commons.poco.chain.DealParams; +import com.iexec.commons.poco.task.TaskDescription; +import com.iexec.commons.poco.tee.TeeEnclaveConfiguration; +import com.iexec.commons.poco.tee.TeeFramework; import com.iexec.common.utils.IexecEnvUtils; import com.iexec.sms.api.TeeSessionGenerationError; import com.iexec.sms.api.config.TeeAppProperties; diff --git a/src/test/java/com/iexec/sms/tee/session/gramine/GramineSessionHandlerServiceTests.java b/src/test/java/com/iexec/sms/tee/session/gramine/GramineSessionHandlerServiceTests.java index 12c7f3d6..cf96eec4 100644 --- a/src/test/java/com/iexec/sms/tee/session/gramine/GramineSessionHandlerServiceTests.java +++ b/src/test/java/com/iexec/sms/tee/session/gramine/GramineSessionHandlerServiceTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 IEXEC BLOCKCHAIN TECH + * 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. @@ -16,7 +16,7 @@ package com.iexec.sms.tee.session.gramine; -import com.iexec.common.task.TaskDescription; +import com.iexec.commons.poco.task.TaskDescription; import com.iexec.sms.api.TeeSessionGenerationError; import com.iexec.sms.tee.session.TeeSessionLogConfiguration; import com.iexec.sms.tee.session.generic.TeeSessionGenerationException; diff --git a/src/test/java/com/iexec/sms/tee/session/gramine/GramineSessionMakerServiceTests.java b/src/test/java/com/iexec/sms/tee/session/gramine/GramineSessionMakerServiceTests.java index 13e4876b..af23db67 100644 --- a/src/test/java/com/iexec/sms/tee/session/gramine/GramineSessionMakerServiceTests.java +++ b/src/test/java/com/iexec/sms/tee/session/gramine/GramineSessionMakerServiceTests.java @@ -1,7 +1,23 @@ +/* + * 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.sms.tee.session.gramine; -import com.iexec.common.tee.TeeEnclaveConfiguration; import com.iexec.common.utils.FileHelper; +import com.iexec.commons.poco.tee.TeeEnclaveConfiguration; import com.iexec.sms.api.config.GramineServicesProperties; import com.iexec.sms.api.config.TeeAppProperties; import com.iexec.sms.tee.session.base.SecretEnclaveBase; diff --git a/src/test/java/com/iexec/sms/tee/session/scone/SconeSessionHandlerServiceTests.java b/src/test/java/com/iexec/sms/tee/session/scone/SconeSessionHandlerServiceTests.java index 3f4b9514..8c18362e 100644 --- a/src/test/java/com/iexec/sms/tee/session/scone/SconeSessionHandlerServiceTests.java +++ b/src/test/java/com/iexec/sms/tee/session/scone/SconeSessionHandlerServiceTests.java @@ -1,6 +1,22 @@ +/* + * 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.sms.tee.session.scone; -import com.iexec.common.task.TaskDescription; +import com.iexec.commons.poco.task.TaskDescription; import com.iexec.sms.api.TeeSessionGenerationError; import com.iexec.sms.tee.session.TeeSessionLogConfiguration; import com.iexec.sms.tee.session.generic.TeeSessionGenerationException; diff --git a/src/test/java/com/iexec/sms/tee/session/scone/SconeSessionMakerServiceTests.java b/src/test/java/com/iexec/sms/tee/session/scone/SconeSessionMakerServiceTests.java index 1f7e77df..cef34b5a 100644 --- a/src/test/java/com/iexec/sms/tee/session/scone/SconeSessionMakerServiceTests.java +++ b/src/test/java/com/iexec/sms/tee/session/scone/SconeSessionMakerServiceTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 IEXEC BLOCKCHAIN TECH + * 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. @@ -16,8 +16,8 @@ package com.iexec.sms.tee.session.scone; -import com.iexec.common.tee.TeeEnclaveConfiguration; import com.iexec.common.utils.FileHelper; +import com.iexec.commons.poco.tee.TeeEnclaveConfiguration; import com.iexec.sms.api.config.SconeServicesProperties; import com.iexec.sms.api.config.TeeAppProperties; import com.iexec.sms.tee.session.base.SecretEnclaveBase; diff --git a/src/test/java/com/iexec/sms/utils/EthereumCredentialsTest.java b/src/test/java/com/iexec/sms/utils/EthereumCredentialsTest.java index 97847712..880b8629 100644 --- a/src/test/java/com/iexec/sms/utils/EthereumCredentialsTest.java +++ b/src/test/java/com/iexec/sms/utils/EthereumCredentialsTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2021 IEXEC BLOCKCHAIN TECH + * Copyright 2021-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. @@ -16,8 +16,8 @@ package com.iexec.sms.utils; -import com.iexec.common.utils.BytesUtils; import com.iexec.common.utils.EthAddress; +import com.iexec.commons.poco.utils.BytesUtils; import org.junit.jupiter.api.Test; import org.web3j.crypto.Credentials; From dac7704584a019710f8adc2404933f356fd54372 Mon Sep 17 00:00:00 2001 From: Jeremy Bernard Date: Fri, 14 Apr 2023 14:09:56 +0200 Subject: [PATCH 12/30] Update CHANGELOG.md --- CHANGELOG.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dcfab466..9e9b40da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,11 +5,13 @@ All notable changes to this project will be documented in this file. ## [[NEXT]](https://github.com/iExecBlockchainComputing/iexec-sms/releases/tag/vNEXT) 2023 ### New Features -* Enable Prometheus actuator. (#166) +- Enable Prometheus actuator. (#166) ### Bug Fixes -* Remove unused dependencies. (#168) +- Remove unused dependencies. (#168) ### Dependency Upgrades -* Upgrade to `feign` 11.10. (#167) +- Upgrade to `feign` 11.10. (#167) +- Upgrade to `iexec-common` 8.0.0. (#169) +- Upgrade to `iexec-commons-poco` 1.0.2. (#169) ## [[8.0.0]](https://github.com/iExecBlockchainComputing/iexec-sms/releases/tag/v8.0.0) 2023-03-06 From b98451c01d560f4e3664ab0c18099d25e6f35d87 Mon Sep 17 00:00:00 2001 From: Jeremy Bernard Date: Fri, 14 Apr 2023 14:29:57 +0200 Subject: [PATCH 13/30] Reword CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e9b40da..90370601 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,7 @@ All notable changes to this project will be documented in this file. ### Dependency Upgrades - Upgrade to `feign` 11.10. (#167) - Upgrade to `iexec-common` 8.0.0. (#169) -- Upgrade to `iexec-commons-poco` 1.0.2. (#169) +- Add new `iexec-commons-poco` 1.0.2 dependency. (#169) ## [[8.0.0]](https://github.com/iExecBlockchainComputing/iexec-sms/releases/tag/v8.0.0) 2023-03-06 From 072b2f1c906eff9b00d4055a4a2996dba6d55ef0 Mon Sep 17 00:00:00 2001 From: Jeremy Bernard Date: Fri, 14 Apr 2023 15:45:33 +0200 Subject: [PATCH 14/30] Fix integration tests --- .../TeeTaskComputeSecretIntegrationTests.java | 8 ++++---- .../iexec/sms/tee/TeeBeansLoadingTests.java | 18 +++++++++++++++++- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/src/itest/java/com/iexec/sms/secret/compute/TeeTaskComputeSecretIntegrationTests.java b/src/itest/java/com/iexec/sms/secret/compute/TeeTaskComputeSecretIntegrationTests.java index 92372783..eb27ae79 100644 --- a/src/itest/java/com/iexec/sms/secret/compute/TeeTaskComputeSecretIntegrationTests.java +++ b/src/itest/java/com/iexec/sms/secret/compute/TeeTaskComputeSecretIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2021 IEXEC BLOCKCHAIN TECH + * Copyright 2021-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. @@ -16,8 +16,8 @@ package com.iexec.sms.secret.compute; -import com.iexec.common.contract.generated.Ownable; -import com.iexec.common.utils.HashUtils; +import com.iexec.commons.poco.contract.generated.Ownable; +import com.iexec.commons.poco.utils.HashUtils; import com.iexec.sms.CommonTestSetup; import com.iexec.sms.api.SmsClient; import com.iexec.sms.api.SmsClientBuilder; @@ -45,7 +45,7 @@ import java.util.Random; import java.util.stream.Collectors; -import static com.iexec.common.utils.SignatureUtils.signMessageHashAndGetSignature; +import static com.iexec.commons.poco.utils.SignatureUtils.signMessageHashAndGetSignature; import static com.iexec.sms.MockChainConfiguration.MOCK_CHAIN_PROFILE; import static com.iexec.sms.MockTeeConfiguration.MOCK_TEE_PROFILE; import static org.mockito.Mockito.mock; diff --git a/src/itest/java/com/iexec/sms/tee/TeeBeansLoadingTests.java b/src/itest/java/com/iexec/sms/tee/TeeBeansLoadingTests.java index 5322bd53..73bdcec9 100644 --- a/src/itest/java/com/iexec/sms/tee/TeeBeansLoadingTests.java +++ b/src/itest/java/com/iexec/sms/tee/TeeBeansLoadingTests.java @@ -1,6 +1,22 @@ +/* + * 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.sms.tee; -import com.iexec.common.tee.TeeFramework; +import com.iexec.commons.poco.tee.TeeFramework; import com.iexec.sms.CommonTestSetup; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Test; From f8ca3b9d577ae2bff8d4bb5c8c20e4b777b6657b Mon Sep 17 00:00:00 2001 From: Jeremy Bernard Date: Fri, 14 Apr 2023 16:01:36 +0200 Subject: [PATCH 15/30] Update CHANGELOG.md --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 90370601..035623a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,8 +10,8 @@ All notable changes to this project will be documented in this file. - Remove unused dependencies. (#168) ### Dependency Upgrades - Upgrade to `feign` 11.10. (#167) -- Upgrade to `iexec-common` 8.0.0. (#169) -- Add new `iexec-commons-poco` 1.0.2 dependency. (#169) +- Upgrade to `iexec-common` 8.0.0. (#169, #170) +- Add new `iexec-commons-poco` 1.0.2 dependency. (#169, #170) ## [[8.0.0]](https://github.com/iExecBlockchainComputing/iexec-sms/releases/tag/v8.0.0) 2023-03-06 From 6e6850d5a55c31d1996248dea340846a442ac3fe Mon Sep 17 00:00:00 2001 From: Jeremy Bernard Date: Wed, 17 May 2023 10:40:20 +0200 Subject: [PATCH 16/30] Use iexec-commons-poco@2.0.0 and iexec-common@8.1.0-NEXT-SNAPSHOT --- gradle.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index b0607d8b..edf6e6fc 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ version=8.0.0 -iexecCommonVersion=8.0.0 -iexecCommonsPocoVersion=1.0.2 +iexecCommonVersion=8.1.0-NEXT-SNAPSHOT +iexecCommonsPocoVersion=2.0.0 nexusUser nexusPassword From 8a370720ebf96efa1276504a56be5773c950c5c7 Mon Sep 17 00:00:00 2001 From: Jeremy Bernard Date: Wed, 17 May 2023 11:40:31 +0200 Subject: [PATCH 17/30] Update CHANGELOG.md --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 035623a3..4b1c96ca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,8 +10,8 @@ All notable changes to this project will be documented in this file. - Remove unused dependencies. (#168) ### Dependency Upgrades - Upgrade to `feign` 11.10. (#167) -- Upgrade to `iexec-common` 8.0.0. (#169, #170) -- Add new `iexec-commons-poco` 1.0.2 dependency. (#169, #170) +- Upgrade to `iexec-common` 8.1.0-NEXT-SNAPSHOT. (#169 #170 #171) +- Add new `iexec-commons-poco` 2.0.0 dependency. (#169 #170 #171) ## [[8.0.0]](https://github.com/iExecBlockchainComputing/iexec-sms/releases/tag/v8.0.0) 2023-03-06 From 74878e212709dc854fe1babe44c943c47bcfa03e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Cordier?= Date: Thu, 25 May 2023 09:02:39 +0200 Subject: [PATCH 18/30] Use DatasetAddress in `IEXEC_DATASET_FILENAME` environment variable --- CHANGELOG.md | 1 + .../sms/tee/session/base/SecretSessionBaseServiceTests.java | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b1c96ca..ff499ad7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ All notable changes to this project will be documented in this file. - Enable Prometheus actuator. (#166) ### Bug Fixes - Remove unused dependencies. (#168) +- Use DatasetAddress in `IEXEC_DATASET_FILENAME` environment variable. (#172) ### Dependency Upgrades - Upgrade to `feign` 11.10. (#167) - Upgrade to `iexec-common` 8.1.0-NEXT-SNAPSHOT. (#169 #170 #171) diff --git a/src/test/java/com/iexec/sms/tee/session/base/SecretSessionBaseServiceTests.java b/src/test/java/com/iexec/sms/tee/session/base/SecretSessionBaseServiceTests.java index c26a6b8e..b4d83dd6 100644 --- a/src/test/java/com/iexec/sms/tee/session/base/SecretSessionBaseServiceTests.java +++ b/src/test/java/com/iexec/sms/tee/session/base/SecretSessionBaseServiceTests.java @@ -185,7 +185,7 @@ void shouldGetPreComputeTokens() throws Exception { expectedTokens.put("IS_DATASET_REQUIRED", true); expectedTokens.put("IEXEC_DATASET_KEY", DATASET_KEY); expectedTokens.put("IEXEC_DATASET_URL", DATASET_URL); - expectedTokens.put("IEXEC_DATASET_FILENAME", DATASET_NAME); + expectedTokens.put("IEXEC_DATASET_FILENAME", DATASET_ADDRESS); expectedTokens.put("IEXEC_DATASET_CHECKSUM", DATASET_CHECKSUM); expectedTokens.put("IEXEC_INPUT_FILES_FOLDER", "/iexec_in"); expectedTokens.put("IEXEC_INPUT_FILES_NUMBER", "2"); @@ -243,7 +243,7 @@ void shouldGetAppTokensForAdvancedTaskDescription() throws TeeSessionGenerationE expectedTokens.put("IEXEC_IN", "/iexec_in"); expectedTokens.put("IEXEC_OUT", "/iexec_out"); expectedTokens.put("IEXEC_DATASET_ADDRESS", DATASET_ADDRESS); - expectedTokens.put("IEXEC_DATASET_FILENAME", DATASET_NAME); + expectedTokens.put("IEXEC_DATASET_FILENAME", DATASET_ADDRESS); expectedTokens.put("IEXEC_BOT_SIZE", "1"); expectedTokens.put("IEXEC_BOT_FIRST_INDEX", "0"); expectedTokens.put("IEXEC_BOT_TASK_INDEX", "0"); @@ -306,7 +306,7 @@ void shouldGetTokensWithEmptyAppComputeSecretWhenSecretsDoNotExist() throws TeeS expectedTokens.put("IEXEC_IN", "/iexec_in"); expectedTokens.put("IEXEC_OUT", "/iexec_out"); expectedTokens.put("IEXEC_DATASET_ADDRESS", DATASET_ADDRESS); - expectedTokens.put("IEXEC_DATASET_FILENAME", DATASET_NAME); + expectedTokens.put("IEXEC_DATASET_FILENAME", DATASET_ADDRESS); expectedTokens.put("IEXEC_BOT_SIZE", "1"); expectedTokens.put("IEXEC_BOT_FIRST_INDEX", "0"); expectedTokens.put("IEXEC_BOT_TASK_INDEX", "0"); From 184fa67f7be16b5c4f53f952ae53f0183ad4b17e Mon Sep 17 00:00:00 2001 From: Jeremy Bernard Date: Tue, 6 Jun 2023 12:12:14 +0200 Subject: [PATCH 19/30] Use iexec-commons-poco@3.0.0 and iexec-common@8.2.0 --- gradle.properties | 4 ++-- .../java/com/iexec/sms/blockchain/BlockchainConfig.java | 7 ++++++- src/main/java/com/iexec/sms/blockchain/Web3jService.java | 4 ++++ src/main/resources/application.yml | 1 + 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/gradle.properties b/gradle.properties index edf6e6fc..ad4c47c0 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ version=8.0.0 -iexecCommonVersion=8.1.0-NEXT-SNAPSHOT -iexecCommonsPocoVersion=2.0.0 +iexecCommonVersion=8.2.0 +iexecCommonsPocoVersion=3.0.0 nexusUser nexusPassword diff --git a/src/main/java/com/iexec/sms/blockchain/BlockchainConfig.java b/src/main/java/com/iexec/sms/blockchain/BlockchainConfig.java index 70a06f09..77df41db 100644 --- a/src/main/java/com/iexec/sms/blockchain/BlockchainConfig.java +++ b/src/main/java/com/iexec/sms/blockchain/BlockchainConfig.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 IEXEC BLOCKCHAIN TECH + * 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. @@ -22,6 +22,8 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; +import java.time.Duration; + @Component @Getter @AllArgsConstructor @@ -37,6 +39,9 @@ public class BlockchainConfig { @Value("${blockchain.hub-address}") private String hubAddress; + @Value("${blockchain.block-time}") + private Duration blockTime; + @Value("${blockchain.gas-price-multiplier}") private float gasPriceMultiplier; diff --git a/src/main/java/com/iexec/sms/blockchain/Web3jService.java b/src/main/java/com/iexec/sms/blockchain/Web3jService.java index 4b08c50d..8af7b8c0 100644 --- a/src/main/java/com/iexec/sms/blockchain/Web3jService.java +++ b/src/main/java/com/iexec/sms/blockchain/Web3jService.java @@ -19,12 +19,16 @@ import com.iexec.commons.poco.chain.Web3jAbstractService; import org.springframework.stereotype.Service; +import java.time.Duration; + @Service public class Web3jService extends Web3jAbstractService { public Web3jService(BlockchainConfig blockchainConfig) { super( + blockchainConfig.getChainId(), blockchainConfig.getNodeAddress(), + blockchainConfig.getBlockTime(), blockchainConfig.getGasPriceMultiplier(), blockchainConfig.getGasPriceCap(), blockchainConfig.isSidechain() diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 63c00e9c..c890ee12 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -38,6 +38,7 @@ blockchain: id: ${IEXEC_CHAIN_ID:17} node-address: ${IEXEC_SMS_BLOCKCHAIN_NODE_ADDRESS:http://localhost:8545} hub-address: ${IEXEC_HUB_ADDRESS:0xBF6B2B07e47326B7c8bfCb4A5460bef9f0Fd2002} + block-time: ${IEXEC_BLOCK_TIME:PT5S} gas-price-multiplier: ${IEXEC_GAS_PRICE_MULTIPLIER:1.0} # txs will be sent with networkGasPrice*gasPriceMultiplier, 4.0 means superfast gas-price-cap: ${IEXEC_GAS_PRICE_CAP:22000000000} #in Wei, will be used for txs if networkGasPrice*gasPriceMultiplier > gasPriceCap is-sidechain: ${IEXEC_IS_SIDECHAIN:false} From 5ee78dd2051efa4aabd9990c6730f609b07db457 Mon Sep 17 00:00:00 2001 From: Jeremy Bernard Date: Tue, 6 Jun 2023 13:24:19 +0200 Subject: [PATCH 20/30] Fix `TaskDescription` usage in tests --- .../sms/tee/session/TeeSessionTestUtils.java | 5 +- .../base/SecretSessionBaseServiceTests.java | 63 ++++++++++--------- .../GramineSessionHandlerServiceTests.java | 4 +- .../GramineSessionMakerServiceTests.java | 2 +- .../SconeSessionHandlerServiceTests.java | 8 +-- .../scone/SconeSessionMakerServiceTests.java | 2 +- 6 files changed, 45 insertions(+), 39 deletions(-) diff --git a/src/test/java/com/iexec/sms/tee/session/TeeSessionTestUtils.java b/src/test/java/com/iexec/sms/tee/session/TeeSessionTestUtils.java index c4405de3..3a866195 100644 --- a/src/test/java/com/iexec/sms/tee/session/TeeSessionTestUtils.java +++ b/src/test/java/com/iexec/sms/tee/session/TeeSessionTestUtils.java @@ -110,7 +110,7 @@ public static TeeSessionRequest createSessionRequest(TaskDescription taskDescrip .build(); } - public static TaskDescription createTaskDescription(TeeEnclaveConfiguration enclaveConfig) { + public static TaskDescription.TaskDescriptionBuilder createTaskDescription(TeeEnclaveConfiguration enclaveConfig) { String appAddress = createEthereumAddress(); String requesterAddress = createEthereumAddress(); String beneficiaryAddress = createEthereumAddress(); @@ -133,8 +133,7 @@ public static TaskDescription createTaskDescription(TeeEnclaveConfiguration encl .secrets(Map.of("1", REQUESTER_SECRET_KEY_1, "2", REQUESTER_SECRET_KEY_2)) .botSize(1) .botFirstIndex(0) - .botIndex(0) - .build(); + .botIndex(0); } public static Map getPreComputeTokens() { diff --git a/src/test/java/com/iexec/sms/tee/session/base/SecretSessionBaseServiceTests.java b/src/test/java/com/iexec/sms/tee/session/base/SecretSessionBaseServiceTests.java index b4d83dd6..754cef9d 100644 --- a/src/test/java/com/iexec/sms/tee/session/base/SecretSessionBaseServiceTests.java +++ b/src/test/java/com/iexec/sms/tee/session/base/SecretSessionBaseServiceTests.java @@ -16,11 +16,11 @@ package com.iexec.sms.tee.session.base; +import com.iexec.common.utils.IexecEnvUtils; import com.iexec.commons.poco.chain.DealParams; import com.iexec.commons.poco.task.TaskDescription; import com.iexec.commons.poco.tee.TeeEnclaveConfiguration; import com.iexec.commons.poco.tee.TeeFramework; -import com.iexec.common.utils.IexecEnvUtils; import com.iexec.sms.api.TeeSessionGenerationError; import com.iexec.sms.api.config.TeeAppProperties; import com.iexec.sms.api.config.TeeServicesProperties; @@ -96,7 +96,7 @@ void beforeEach() { // region getSecretsTokens @Test void shouldGetSecretsTokens() throws Exception { - TaskDescription taskDescription = createTaskDescription(enclaveConfig); + TaskDescription taskDescription = createTaskDescription(enclaveConfig).build(); TeeSessionRequest request = createSessionRequest(taskDescription); String beneficiary = request.getTaskDescription().getBeneficiary(); @@ -169,7 +169,7 @@ void shouldNotGetSecretsTokensSinceTaskDescriptionIsMissing() { // region getPreComputeTokens @Test void shouldGetPreComputeTokens() throws Exception { - TaskDescription taskDescription = createTaskDescription(enclaveConfig); + TaskDescription taskDescription = createTaskDescription(enclaveConfig).build(); TeeSessionRequest request = createSessionRequest(taskDescription); when(preComputeProperties.getFingerprint()) .thenReturn(PRE_COMPUTE_FINGERPRINT); @@ -226,7 +226,7 @@ void shouldGetPreComputeTokensWithoutDataset() throws Exception { // region getAppTokens @Test void shouldGetAppTokensForAdvancedTaskDescription() throws TeeSessionGenerationException { - TeeSessionRequest request = createSessionRequest(createTaskDescription(enclaveConfig)); + TeeSessionRequest request = createSessionRequest(createTaskDescription(enclaveConfig).build()); String appAddress = request.getTaskDescription().getAppAddress(); String requesterAddress = request.getTaskDescription().getRequester(); @@ -349,7 +349,8 @@ void shouldFailToGetAppTokensSinceNoEnclaveConfig() { @Test void shouldFailToGetAppTokensInvalidEnclaveConfig() { // invalid enclave config - TeeSessionRequest request = createSessionRequest(createTaskDescription(TeeEnclaveConfiguration.builder().build())); + final TaskDescription taskDescription = createTaskDescription(TeeEnclaveConfiguration.builder().build()).build(); + TeeSessionRequest request = createSessionRequest(taskDescription); TeeSessionGenerationException exception = assertThrows(TeeSessionGenerationException.class, () -> teeSecretsService.getAppTokens(request)); @@ -358,7 +359,7 @@ void shouldFailToGetAppTokensInvalidEnclaveConfig() { @Test void shouldAddMultipleRequesterSecrets() { - TeeSessionRequest request = createSessionRequest(createTaskDescription(enclaveConfig)); + TeeSessionRequest request = createSessionRequest(createTaskDescription(enclaveConfig).build()); String requesterAddress = request.getTaskDescription().getRequester(); addRequesterSecret(requesterAddress, REQUESTER_SECRET_KEY_1, REQUESTER_SECRET_VALUE_1); @@ -378,11 +379,12 @@ void shouldAddMultipleRequesterSecrets() { @Test void shouldFilterRequesterSecretIndexLowerThanZero() { - TeeSessionRequest request = createSessionRequest(createTaskDescription(enclaveConfig)); + final TaskDescription taskDescription = createTaskDescription(enclaveConfig) + .secrets(Map.of("1", REQUESTER_SECRET_KEY_1, "-1", "out-of-bound-requester-secret")) + .build(); + TeeSessionRequest request = createSessionRequest(taskDescription); String requesterAddress = request.getTaskDescription().getRequester(); - request.getTaskDescription() - .setSecrets(Map.of("1", REQUESTER_SECRET_KEY_1, "-1", "out-of-bound-requester-secret")); addRequesterSecret(requesterAddress, REQUESTER_SECRET_KEY_1, REQUESTER_SECRET_VALUE_1); SecretEnclaveBase enclaveBase = assertDoesNotThrow(() -> teeSecretsService.getAppTokens(request)); verify(teeTaskComputeSecretService).getSecret(eq(OnChainObjectType.APPLICATION), eq(""), @@ -395,7 +397,7 @@ void shouldFilterRequesterSecretIndexLowerThanZero() { // region getPostComputeTokens @Test void shouldGetPostComputeTokens() throws Exception { - TeeSessionRequest request = createSessionRequest(createTaskDescription(enclaveConfig)); + TeeSessionRequest request = createSessionRequest(createTaskDescription(enclaveConfig).build()); String requesterAddress = request.getTaskDescription().getRequester(); @@ -451,8 +453,10 @@ void shouldNotGetPostComputeTokensSinceTaskDescriptionMissing() { // region getPostComputeEncryptionTokens @Test void shouldGetPostComputeStorageTokensWithCallback() { - final TeeSessionRequest sessionRequest = createSessionRequest(createTaskDescription(enclaveConfig)); - sessionRequest.getTaskDescription().setCallback("callback"); + final TaskDescription taskDescription = createTaskDescription(enclaveConfig) + .callback("callback") + .build(); + final TeeSessionRequest sessionRequest = createSessionRequest(taskDescription); final Map tokens = assertDoesNotThrow( () -> teeSecretsService.getPostComputeStorageTokens(sessionRequest)); @@ -468,7 +472,7 @@ void shouldGetPostComputeStorageTokensWithCallback() { @Test void shouldGetPostComputeStorageTokensOnIpfs() { - final TeeSessionRequest sessionRequest = createSessionRequest(createTaskDescription(enclaveConfig)); + final TeeSessionRequest sessionRequest = createSessionRequest(createTaskDescription(enclaveConfig).build()); final TaskDescription taskDescription = sessionRequest.getTaskDescription(); final String secretValue = "Secret value"; @@ -490,9 +494,10 @@ void shouldGetPostComputeStorageTokensOnIpfs() { @Test void shouldGetPostComputeStorageTokensOnDropbox() { - final TeeSessionRequest sessionRequest = createSessionRequest(createTaskDescription(enclaveConfig)); - final TaskDescription taskDescription = sessionRequest.getTaskDescription(); - taskDescription.setResultStorageProvider(DealParams.DROPBOX_RESULT_STORAGE_PROVIDER); + final TaskDescription taskDescription = createTaskDescription(enclaveConfig) + .resultStorageProvider(DealParams.DROPBOX_RESULT_STORAGE_PROVIDER) + .build(); + final TeeSessionRequest sessionRequest = createSessionRequest(taskDescription); final String secretValue = "Secret value"; when(web2SecretService.getDecryptedValue(taskDescription.getRequester(), @@ -513,7 +518,7 @@ void shouldGetPostComputeStorageTokensOnDropbox() { @Test void shouldNotGetPostComputeStorageTokensSinceNoSecret() { - final TeeSessionRequest sessionRequest = createSessionRequest(createTaskDescription(enclaveConfig)); + final TeeSessionRequest sessionRequest = createSessionRequest(createTaskDescription(enclaveConfig).build()); final TaskDescription taskDescription = sessionRequest.getTaskDescription(); when(web2SecretService.getDecryptedValue(taskDescription.getRequester(), @@ -531,8 +536,8 @@ void shouldNotGetPostComputeStorageTokensSinceNoSecret() { @Test void shouldGetPostComputeSignTokens() throws GeneralSecurityException { - final TeeSessionRequest sessionRequest = createSessionRequest(createTaskDescription(enclaveConfig)); - final TaskDescription taskDescription = sessionRequest.getTaskDescription(); + final TaskDescription taskDescription = createTaskDescription(enclaveConfig).build(); + final TeeSessionRequest sessionRequest = createSessionRequest(taskDescription); final String taskId = taskDescription.getChainTaskId(); final EthereumCredentials credentials = EthereumCredentials.generate(); @@ -554,7 +559,7 @@ void shouldGetPostComputeSignTokens() throws GeneralSecurityException { @NullSource @ValueSource(strings = { "" }) void shouldNotGetPostComputeSignTokensSinceNoWorkerAddress(String emptyWorkerAddress) { - final TeeSessionRequest sessionRequest = createSessionRequest(createTaskDescription(enclaveConfig)); + final TeeSessionRequest sessionRequest = createSessionRequest(createTaskDescription(enclaveConfig).build()); final String taskId = sessionRequest.getTaskDescription().getChainTaskId(); sessionRequest.setWorkerAddress(emptyWorkerAddress); @@ -571,7 +576,7 @@ void shouldNotGetPostComputeSignTokensSinceNoWorkerAddress(String emptyWorkerAdd @NullSource @ValueSource(strings = { "" }) void shouldNotGetPostComputeSignTokensSinceNoEnclaveChallenge(String emptyEnclaveChallenge) { - final TeeSessionRequest sessionRequest = createSessionRequest(createTaskDescription(enclaveConfig)); + final TeeSessionRequest sessionRequest = createSessionRequest(createTaskDescription(enclaveConfig).build()); final String taskId = sessionRequest.getTaskDescription().getChainTaskId(); sessionRequest.setEnclaveChallenge(emptyEnclaveChallenge); @@ -586,7 +591,7 @@ void shouldNotGetPostComputeSignTokensSinceNoEnclaveChallenge(String emptyEnclav @Test void shouldNotGetPostComputeSignTokensSinceNoTeeChallenge() { - final TeeSessionRequest sessionRequest = createSessionRequest(createTaskDescription(enclaveConfig)); + final TeeSessionRequest sessionRequest = createSessionRequest(createTaskDescription(enclaveConfig).build()); final String taskId = sessionRequest.getTaskDescription().getChainTaskId(); when(teeChallengeService.getOrCreate(taskId, true)) @@ -603,7 +608,7 @@ void shouldNotGetPostComputeSignTokensSinceNoTeeChallenge() { @Test void shouldNotGetPostComputeSignTokensSinceNoEnclaveCredentials() { - final TeeSessionRequest sessionRequest = createSessionRequest(createTaskDescription(enclaveConfig)); + final TeeSessionRequest sessionRequest = createSessionRequest(createTaskDescription(enclaveConfig).build()); final String taskId = sessionRequest.getTaskDescription().getChainTaskId(); when(teeChallengeService.getOrCreate(taskId, true)) @@ -620,7 +625,7 @@ void shouldNotGetPostComputeSignTokensSinceNoEnclaveCredentials() { @Test void shouldNotGetPostComputeSignTokensSinceNoEnclaveCredentialsPrivateKey() { - final TeeSessionRequest sessionRequest = createSessionRequest(createTaskDescription(enclaveConfig)); + final TeeSessionRequest sessionRequest = createSessionRequest(createTaskDescription(enclaveConfig).build()); final String taskId = sessionRequest.getTaskDescription().getChainTaskId(); when(teeChallengeService.getOrCreate(taskId, true)) @@ -638,7 +643,7 @@ void shouldNotGetPostComputeSignTokensSinceNoEnclaveCredentialsPrivateKey() { @Test void shouldGetPostComputeEncryptionTokensWithEncryption() { - TeeSessionRequest request = createSessionRequest(createTaskDescription(enclaveConfig)); + TeeSessionRequest request = createSessionRequest(createTaskDescription(enclaveConfig).build()); String beneficiary = request.getTaskDescription().getBeneficiary(); when(web2SecretService.getDecryptedValue( @@ -657,8 +662,10 @@ void shouldGetPostComputeEncryptionTokensWithEncryption() { @Test void shouldGetPostComputeEncryptionTokensWithoutEncryption() { - TeeSessionRequest request = createSessionRequest(createTaskDescription(enclaveConfig)); - request.getTaskDescription().setResultEncryption(false); + final TaskDescription taskDescription = createTaskDescription(enclaveConfig) + .isResultEncryption(false) + .build(); + TeeSessionRequest request = createSessionRequest(taskDescription); final Map encryptionTokens = assertDoesNotThrow( () -> teeSecretsService.getPostComputeEncryptionTokens(request)); @@ -671,7 +678,7 @@ void shouldGetPostComputeEncryptionTokensWithoutEncryption() { @Test void shouldNotGetPostComputeEncryptionTokensSinceEmptyBeneficiaryKey() { - TeeSessionRequest request = createSessionRequest(createTaskDescription(enclaveConfig)); + TeeSessionRequest request = createSessionRequest(createTaskDescription(enclaveConfig).build()); when(web2SecretService.getDecryptedValue( request.getTaskDescription().getBeneficiary(), diff --git a/src/test/java/com/iexec/sms/tee/session/gramine/GramineSessionHandlerServiceTests.java b/src/test/java/com/iexec/sms/tee/session/gramine/GramineSessionHandlerServiceTests.java index cf96eec4..caeb5a40 100644 --- a/src/test/java/com/iexec/sms/tee/session/gramine/GramineSessionHandlerServiceTests.java +++ b/src/test/java/com/iexec/sms/tee/session/gramine/GramineSessionHandlerServiceTests.java @@ -60,7 +60,7 @@ void beforeEach() { @Test void shouldBuildAndPostSession(CapturedOutput output) throws TeeSessionGenerationException { TeeSessionRequest request = mock(TeeSessionRequest.class); - TaskDescription taskDescription = mock(TaskDescription.class); + TaskDescription taskDescription = TaskDescription.builder().build(); when(request.getTaskDescription()).thenReturn(taskDescription); GramineSession spsSession = mock(GramineSession.class); when(spsSession.toString()).thenReturn("sessionContent"); @@ -92,7 +92,7 @@ void shouldNotBuildAndPostSessionSinceBuildSessionFailed() void shouldNotBuildAndPostSessionSincePostSessionFailed() throws TeeSessionGenerationException { TeeSessionRequest request = mock(TeeSessionRequest.class); - TaskDescription taskDescription = mock(TaskDescription.class); + TaskDescription taskDescription = TaskDescription.builder().build(); when(request.getTaskDescription()).thenReturn(taskDescription); GramineSession spsSession = mock(GramineSession.class); when(spsSession.toString()).thenReturn("sessionContent"); diff --git a/src/test/java/com/iexec/sms/tee/session/gramine/GramineSessionMakerServiceTests.java b/src/test/java/com/iexec/sms/tee/session/gramine/GramineSessionMakerServiceTests.java index af23db67..e3d58463 100644 --- a/src/test/java/com/iexec/sms/tee/session/gramine/GramineSessionMakerServiceTests.java +++ b/src/test/java/com/iexec/sms/tee/session/gramine/GramineSessionMakerServiceTests.java @@ -64,7 +64,7 @@ void shouldGetSessionJson() throws Exception { TeeEnclaveConfiguration enclaveConfig = TeeEnclaveConfiguration.builder() .fingerprint(APP_FINGERPRINT) .build(); - TeeSessionRequest request = createSessionRequest(createTaskDescription(enclaveConfig)); + TeeSessionRequest request = createSessionRequest(createTaskDescription(enclaveConfig).build()); when(postComputeProperties.getFingerprint()).thenReturn(POST_COMPUTE_FINGERPRINT); when(postComputeProperties.getEntrypoint()).thenReturn(POST_COMPUTE_ENTRYPOINT); diff --git a/src/test/java/com/iexec/sms/tee/session/scone/SconeSessionHandlerServiceTests.java b/src/test/java/com/iexec/sms/tee/session/scone/SconeSessionHandlerServiceTests.java index 8c18362e..694c6e22 100644 --- a/src/test/java/com/iexec/sms/tee/session/scone/SconeSessionHandlerServiceTests.java +++ b/src/test/java/com/iexec/sms/tee/session/scone/SconeSessionHandlerServiceTests.java @@ -63,7 +63,7 @@ void beforeEach() { void shouldBuildAndPostSessionWithLogs(CapturedOutput output) throws TeeSessionGenerationException { TeeSessionRequest request = mock(TeeSessionRequest.class); - TaskDescription taskDescription = mock(TaskDescription.class); + TaskDescription taskDescription = TaskDescription.builder().build(); when(request.getTaskDescription()).thenReturn(taskDescription); SconeSession casSession = mock(SconeSession.class); when(casSession.toString()).thenReturn("sessionContent"); @@ -86,7 +86,7 @@ void shouldBuildAndPostSessionWithLogs(CapturedOutput output) void shouldBuildAndPostSessionWithoutLogs(CapturedOutput output) throws TeeSessionGenerationException { TeeSessionRequest request = mock(TeeSessionRequest.class); - TaskDescription taskDescription = mock(TaskDescription.class); + TaskDescription taskDescription = TaskDescription.builder().build(); when(request.getTaskDescription()).thenReturn(taskDescription); SconeSession casSession = mock(SconeSession.class); when(casSession.toString()).thenReturn("sessionContent"); @@ -122,7 +122,7 @@ void shouldNotBuildAndPostSessionSinceBuildSessionFailed() void shouldNotBuildAndPostSessionSincePostSessionFailed() throws TeeSessionGenerationException { TeeSessionRequest request = mock(TeeSessionRequest.class); - TaskDescription taskDescription = mock(TaskDescription.class); + TaskDescription taskDescription = TaskDescription.builder().build(); when(request.getTaskDescription()).thenReturn(taskDescription); SconeSession casSession = mock(SconeSession.class); when(sessionService.generateSession(request)).thenReturn(casSession); @@ -139,7 +139,7 @@ void shouldNotBuildAndPostSessionSincePostSessionFailed() void shouldNotBuildAndPostSessionSinceNoResponse() throws TeeSessionGenerationException { TeeSessionRequest request = mock(TeeSessionRequest.class); - TaskDescription taskDescription = mock(TaskDescription.class); + TaskDescription taskDescription = TaskDescription.builder().build(); when(request.getTaskDescription()).thenReturn(taskDescription); SconeSession casSession = mock(SconeSession.class); when(sessionService.generateSession(request)).thenReturn(casSession); diff --git a/src/test/java/com/iexec/sms/tee/session/scone/SconeSessionMakerServiceTests.java b/src/test/java/com/iexec/sms/tee/session/scone/SconeSessionMakerServiceTests.java index cef34b5a..be8ce610 100644 --- a/src/test/java/com/iexec/sms/tee/session/scone/SconeSessionMakerServiceTests.java +++ b/src/test/java/com/iexec/sms/tee/session/scone/SconeSessionMakerServiceTests.java @@ -73,7 +73,7 @@ void shouldGetSessionYml() throws Exception { .fingerprint(APP_FINGERPRINT) .entrypoint(APP_ENTRYPOINT) .build(); - TeeSessionRequest request = createSessionRequest(createTaskDescription(enclaveConfig)); + TeeSessionRequest request = createSessionRequest(createTaskDescription(enclaveConfig).build()); when(preComputeProperties.getEntrypoint()).thenReturn(PRE_COMPUTE_ENTRYPOINT); when(postComputeProperties.getEntrypoint()).thenReturn(POST_COMPUTE_ENTRYPOINT); From 114b6ad746a04739e77d6a1a16dec2481e3f02d7 Mon Sep 17 00:00:00 2001 From: Jeremy Bernard Date: Wed, 7 Jun 2023 14:18:21 +0200 Subject: [PATCH 21/30] Update `application.yml` with bellecour sidechain properties --- src/main/resources/application.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index c890ee12..3a0b92f2 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -35,13 +35,13 @@ encryption: aesKeyPath: ${IEXEC_SMS_STORAGE_ENCRYPTION_AES_KEY_PATH:/data/iexec-sms-aes.key} blockchain: - id: ${IEXEC_CHAIN_ID:17} - node-address: ${IEXEC_SMS_BLOCKCHAIN_NODE_ADDRESS:http://localhost:8545} - hub-address: ${IEXEC_HUB_ADDRESS:0xBF6B2B07e47326B7c8bfCb4A5460bef9f0Fd2002} + id: ${IEXEC_CHAIN_ID:134} + is-sidechain: ${IEXEC_IS_SIDECHAIN:true} + node-address: ${IEXEC_SMS_BLOCKCHAIN_NODE_ADDRESS:https://bellecour.iex.ec} + hub-address: ${IEXEC_HUB_ADDRESS:0x3eca1B216A7DF1C7689aEb259fFB83ADFB894E7f} block-time: ${IEXEC_BLOCK_TIME:PT5S} gas-price-multiplier: ${IEXEC_GAS_PRICE_MULTIPLIER:1.0} # txs will be sent with networkGasPrice*gasPriceMultiplier, 4.0 means superfast gas-price-cap: ${IEXEC_GAS_PRICE_CAP:22000000000} #in Wei, will be used for txs if networkGasPrice*gasPriceMultiplier > gasPriceCap - is-sidechain: ${IEXEC_IS_SIDECHAIN:false} logging: tee.display-debug-session: ${IEXEC_SMS_DISPLAY_DEBUG_SESSION:false} From 003e0a69601cfa69fb23289ae22cb96fcd8713fc Mon Sep 17 00:00:00 2001 From: Jeremy Bernard Date: Wed, 7 Jun 2023 14:55:13 +0200 Subject: [PATCH 22/30] Set `BlockchainConfig` immutable and add `Web3jServiceTests` --- .../sms/blockchain/BlockchainConfig.java | 44 ++++++------------ .../sms/blockchain/Web3jServiceTests.java | 46 +++++++++++++++++++ 2 files changed, 59 insertions(+), 31 deletions(-) create mode 100644 src/test/java/com/iexec/sms/blockchain/Web3jServiceTests.java diff --git a/src/main/java/com/iexec/sms/blockchain/BlockchainConfig.java b/src/main/java/com/iexec/sms/blockchain/BlockchainConfig.java index 77df41db..bf48624a 100644 --- a/src/main/java/com/iexec/sms/blockchain/BlockchainConfig.java +++ b/src/main/java/com/iexec/sms/blockchain/BlockchainConfig.java @@ -16,39 +16,21 @@ package com.iexec.sms.blockchain; -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Component; +import lombok.Value; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.boot.context.properties.ConstructorBinding; import java.time.Duration; -@Component -@Getter -@AllArgsConstructor -@NoArgsConstructor +@Value +@ConstructorBinding +@ConfigurationProperties(prefix = "blockchain") public class BlockchainConfig { - - @Value("${blockchain.id}") - private Integer chainId; - - @Value("${blockchain.node-address}") - private String nodeAddress; - - @Value("${blockchain.hub-address}") - private String hubAddress; - - @Value("${blockchain.block-time}") - private Duration blockTime; - - @Value("${blockchain.gas-price-multiplier}") - private float gasPriceMultiplier; - - @Value("${blockchain.gas-price-cap}") - private long gasPriceCap; - - @Value("${blockchain.is-sidechain}") - private boolean isSidechain; - + int chainId; + String nodeAddress; + String hubAddress; + Duration blockTime; + float gasPriceMultiplier; + long gasPriceCap; + boolean isSidechain; } diff --git a/src/test/java/com/iexec/sms/blockchain/Web3jServiceTests.java b/src/test/java/com/iexec/sms/blockchain/Web3jServiceTests.java new file mode 100644 index 00000000..f7fe2d75 --- /dev/null +++ b/src/test/java/com/iexec/sms/blockchain/Web3jServiceTests.java @@ -0,0 +1,46 @@ +/* + * Copyright 2023-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.sms.blockchain; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.test.context.TestPropertySource; +import org.springframework.test.context.junit.jupiter.SpringExtension; + +import static org.assertj.core.api.Assertions.assertThat; + +@ExtendWith(SpringExtension.class) +@EnableConfigurationProperties(value = BlockchainConfig.class) +@TestPropertySource(properties = { + "blockchain.id=134", + "blockchain.is-sidechain=true", + "blockchain.node-ddress=https://bellecour.iex.ec", + "blockchain.hub-ddress=0x3eca1B216A7DF1C7689aEb259fFB83ADFB894E7f", + "blockchain.block-time=PT5S", + "blockchain.gas-price-multiplier=1.0", + "blockchain.gas-price-cap=22000000000" }) +class Web3jServiceTests { + @Autowired + private BlockchainConfig blockchainConfig; + + @Test + void shouldCreateInstance() { + assertThat(new Web3jService(blockchainConfig)).isNotNull(); + } +} From a30a934eddf77e8d769d5077b58cea928bc1c1db Mon Sep 17 00:00:00 2001 From: Jeremy Bernard Date: Wed, 7 Jun 2023 14:56:49 +0200 Subject: [PATCH 23/30] Use iexec-commons-poco@3.0.2 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index ad4c47c0..efe98924 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ version=8.0.0 iexecCommonVersion=8.2.0 -iexecCommonsPocoVersion=3.0.0 +iexecCommonsPocoVersion=3.0.2 nexusUser nexusPassword From c6f16b82afd59a2bf8e7ecd795346b6e9ceaf121 Mon Sep 17 00:00:00 2001 From: Jeremy Bernard Date: Wed, 7 Jun 2023 15:03:55 +0200 Subject: [PATCH 24/30] Update CHANGELOG.md --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ff499ad7..d9ca737f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,8 +11,8 @@ All notable changes to this project will be documented in this file. - Use DatasetAddress in `IEXEC_DATASET_FILENAME` environment variable. (#172) ### Dependency Upgrades - Upgrade to `feign` 11.10. (#167) -- Upgrade to `iexec-common` 8.1.0-NEXT-SNAPSHOT. (#169 #170 #171) -- Add new `iexec-commons-poco` 2.0.0 dependency. (#169 #170 #171) +- Upgrade to `iexec-common` 8.2.0. (#169 #170 #171 #173) +- Add new `iexec-commons-poco` 3.0.2 dependency. (#169 #170 #171 #173) ## [[8.0.0]](https://github.com/iExecBlockchainComputing/iexec-sms/releases/tag/v8.0.0) 2023-03-06 From 05a1a5bc9f875cb971901ec2abe19f2a01f444c2 Mon Sep 17 00:00:00 2001 From: Jeremy Bernard Date: Wed, 7 Jun 2023 16:00:41 +0200 Subject: [PATCH 25/30] Update default values in README.md --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 772fcba5..2aa32d05 100644 --- a/README.md +++ b/README.md @@ -52,12 +52,12 @@ To support: | `IEXEC_SMS_H2_URL` | JDBC URL of the database. | URL | `jdbc:h2:file:/tmp/h2/sms-h2` | `jdbc:h2:file:/tmp/h2/sms-h2` | | `IEXEC_SMS_H2_CONSOLE` | Whether to enable the H2 console. | Boolean | `false` | `false` | | `IEXEC_SMS_STORAGE_ENCRYPTION_AES_KEY_PATH` | Path to the key created and used to encrypt secrets. | String | `src/main/resources/iexec-sms-aes.key` | `src/main/resources/iexec-sms-aes.key` | -| `IEXEC_CHAIN_ID` | Chain ID of the blockchain network to connect. | Positive integer | `17` | `17` | -| `IEXEC_SMS_BLOCKCHAIN_NODE_ADDRESS` | URL to connect to the blockchain node. | URL | `http://localhost:8545` | `http://localhost:8545` | -| `IEXEC_HUB_ADDRESS` | Proxy contract address to interact with the iExec on-chain protocol. | String | `0xBF6B2B07e47326B7c8bfCb4A5460bef9f0Fd2002` | `0xBF6B2B07e47326B7c8bfCb4A5460bef9f0Fd2002` | +| `IEXEC_CHAIN_ID` | Chain ID of the blockchain network to connect. | Positive integer | `134` | `134` | +| `IEXEC_IS_SIDECHAIN` | Define if iExec on-chain protocol is built on top of token (`false`) or native currency (`true`). | Boolean | `true` | `true` | +| `IEXEC_SMS_BLOCKCHAIN_NODE_ADDRESS` | URL to connect to the blockchain node. | URL | `https://bellecour.iex.ec` | `https://bellecour.iex.ec` | +| `IEXEC_HUB_ADDRESS` | Proxy contract address to interact with the iExec on-chain protocol. | String | `0x3eca1B216A7DF1C7689aEb259fFB83ADFB894E7f` | `0x3eca1B216A7DF1C7689aEb259fFB83ADFB894E7f` | | `IEXEC_GAS_PRICE_MULTIPLIER` | Transactions will be sent with `networkGasPrice * IEXEC_GAS_PRICE_MULTIPLIER`. | Float | `1.0` | `1.0` | | `IEXEC_GAS_PRICE_CAP` | In Wei, will be used for transactions if `networkGasPrice * IEXEC_GAS_PRICE_MULTIPLIER > IEXEC_GAS_PRICE_CAP`. | Integer | `22000000000` | `22000000000` | -| `IEXEC_IS_SIDECHAIN` | Define if iExec on-chain protocol is built on top of token (`false`) or native currency (`true`). | Boolean | `false` | `false` | | `IEXEC_SMS_DISPLAY_DEBUG_SESSION` | Whether to display TEE enclaves sessions configuration in SMS logs. | Boolean | `false` | `false` | | `IEXEC_SECRET_PROVISIONER_WEB_HOSTNAME` | Secret provisioner server host for session management. Used to post sessions of secrets. | String | `localhost` | `localhost` | | `IEXEC_SECRET_PROVISIONER_WEB_PORT` | Secret provisioner server port for session management. | Positive integer | `8081` | `8080` | From 08a70014a53084acaa23aab3b31d4a24e04ef1c9 Mon Sep 17 00:00:00 2001 From: Jeremy Bernard Date: Wed, 7 Jun 2023 16:01:22 +0200 Subject: [PATCH 26/30] Add `License` link in README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 2aa32d05..9b314cb6 100644 --- a/README.md +++ b/README.md @@ -89,3 +89,7 @@ To support: A health endpoint (`/actuator/health`) is enabled by default and can be accessed on the `IEXEC_SMS_PORT`. This endpoint allows to define health checks in an orchestrator or a [compose file](https://github.com/compose-spec/compose-spec/blob/master/spec.md#healthcheck). No default strategy has been implemented in the [Dockerfile](Dockerfile) at the moment. + +## License + +This repository code is released under the [Apache License 2.0](LICENSE). From 13242adb6a3192644b81e70c502820a1f46bd22e Mon Sep 17 00:00:00 2001 From: Jeremy Bernard Date: Wed, 7 Jun 2023 16:15:05 +0200 Subject: [PATCH 27/30] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9b314cb6..859250eb 100644 --- a/README.md +++ b/README.md @@ -53,9 +53,10 @@ To support: | `IEXEC_SMS_H2_CONSOLE` | Whether to enable the H2 console. | Boolean | `false` | `false` | | `IEXEC_SMS_STORAGE_ENCRYPTION_AES_KEY_PATH` | Path to the key created and used to encrypt secrets. | String | `src/main/resources/iexec-sms-aes.key` | `src/main/resources/iexec-sms-aes.key` | | `IEXEC_CHAIN_ID` | Chain ID of the blockchain network to connect. | Positive integer | `134` | `134` | -| `IEXEC_IS_SIDECHAIN` | Define if iExec on-chain protocol is built on top of token (`false`) or native currency (`true`). | Boolean | `true` | `true` | +| `IEXEC_IS_SIDECHAIN` | Define whether iExec on-chain protocol is built on top of token (`false`) or native currency (`true`). | Boolean | `true` | `true` | | `IEXEC_SMS_BLOCKCHAIN_NODE_ADDRESS` | URL to connect to the blockchain node. | URL | `https://bellecour.iex.ec` | `https://bellecour.iex.ec` | | `IEXEC_HUB_ADDRESS` | Proxy contract address to interact with the iExec on-chain protocol. | String | `0x3eca1B216A7DF1C7689aEb259fFB83ADFB894E7f` | `0x3eca1B216A7DF1C7689aEb259fFB83ADFB894E7f` | +| `IEXEC_BLOCK_TIME` | Duration between consecutive blocks on the blockchain network. | String | `PT5S` | `PT5S` | | `IEXEC_GAS_PRICE_MULTIPLIER` | Transactions will be sent with `networkGasPrice * IEXEC_GAS_PRICE_MULTIPLIER`. | Float | `1.0` | `1.0` | | `IEXEC_GAS_PRICE_CAP` | In Wei, will be used for transactions if `networkGasPrice * IEXEC_GAS_PRICE_MULTIPLIER > IEXEC_GAS_PRICE_CAP`. | Integer | `22000000000` | `22000000000` | | `IEXEC_SMS_DISPLAY_DEBUG_SESSION` | Whether to display TEE enclaves sessions configuration in SMS logs. | Boolean | `false` | `false` | From 4782c359bffdcf162a99b01ad5f5ff0c74e75c02 Mon Sep 17 00:00:00 2001 From: Jeremy Bernard Date: Wed, 7 Jun 2023 16:26:39 +0200 Subject: [PATCH 28/30] Remove unsued import in `Web3jervice` --- src/main/java/com/iexec/sms/blockchain/Web3jService.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/main/java/com/iexec/sms/blockchain/Web3jService.java b/src/main/java/com/iexec/sms/blockchain/Web3jService.java index 8af7b8c0..e6792abc 100644 --- a/src/main/java/com/iexec/sms/blockchain/Web3jService.java +++ b/src/main/java/com/iexec/sms/blockchain/Web3jService.java @@ -19,8 +19,6 @@ import com.iexec.commons.poco.chain.Web3jAbstractService; import org.springframework.stereotype.Service; -import java.time.Duration; - @Service public class Web3jService extends Web3jAbstractService { From 3a026c37b520806d9ad00209b38cb4beeb960570 Mon Sep 17 00:00:00 2001 From: Jeremy Bernard Date: Wed, 7 Jun 2023 16:51:57 +0200 Subject: [PATCH 29/30] Fix `BlockchainConfig` and add test --- .../iexec/sms/blockchain/BlockchainConfig.java | 4 ++-- .../com/iexec/sms/blockchain/Web3jService.java | 2 +- .../iexec/sms/blockchain/Web3jServiceTests.java | 15 +++++++++++++-- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/iexec/sms/blockchain/BlockchainConfig.java b/src/main/java/com/iexec/sms/blockchain/BlockchainConfig.java index bf48624a..c6988930 100644 --- a/src/main/java/com/iexec/sms/blockchain/BlockchainConfig.java +++ b/src/main/java/com/iexec/sms/blockchain/BlockchainConfig.java @@ -26,11 +26,11 @@ @ConstructorBinding @ConfigurationProperties(prefix = "blockchain") public class BlockchainConfig { - int chainId; + int id; + boolean isSidechain; String nodeAddress; String hubAddress; Duration blockTime; float gasPriceMultiplier; long gasPriceCap; - boolean isSidechain; } diff --git a/src/main/java/com/iexec/sms/blockchain/Web3jService.java b/src/main/java/com/iexec/sms/blockchain/Web3jService.java index e6792abc..d4dd4ba5 100644 --- a/src/main/java/com/iexec/sms/blockchain/Web3jService.java +++ b/src/main/java/com/iexec/sms/blockchain/Web3jService.java @@ -24,7 +24,7 @@ public class Web3jService extends Web3jAbstractService { public Web3jService(BlockchainConfig blockchainConfig) { super( - blockchainConfig.getChainId(), + blockchainConfig.getId(), blockchainConfig.getNodeAddress(), blockchainConfig.getBlockTime(), blockchainConfig.getGasPriceMultiplier(), diff --git a/src/test/java/com/iexec/sms/blockchain/Web3jServiceTests.java b/src/test/java/com/iexec/sms/blockchain/Web3jServiceTests.java index f7fe2d75..51dc255f 100644 --- a/src/test/java/com/iexec/sms/blockchain/Web3jServiceTests.java +++ b/src/test/java/com/iexec/sms/blockchain/Web3jServiceTests.java @@ -23,6 +23,8 @@ import org.springframework.test.context.TestPropertySource; import org.springframework.test.context.junit.jupiter.SpringExtension; +import java.time.Duration; + import static org.assertj.core.api.Assertions.assertThat; @ExtendWith(SpringExtension.class) @@ -30,8 +32,8 @@ @TestPropertySource(properties = { "blockchain.id=134", "blockchain.is-sidechain=true", - "blockchain.node-ddress=https://bellecour.iex.ec", - "blockchain.hub-ddress=0x3eca1B216A7DF1C7689aEb259fFB83ADFB894E7f", + "blockchain.node-address=https://bellecour.iex.ec", + "blockchain.hub-address=0x3eca1B216A7DF1C7689aEb259fFB83ADFB894E7f", "blockchain.block-time=PT5S", "blockchain.gas-price-multiplier=1.0", "blockchain.gas-price-cap=22000000000" }) @@ -39,6 +41,15 @@ class Web3jServiceTests { @Autowired private BlockchainConfig blockchainConfig; + @Test + void checkBlockchainConfig() { + BlockchainConfig expectedConfig = new BlockchainConfig( + 134, true, "https://bellecour.iex.ec", + "0x3eca1B216A7DF1C7689aEb259fFB83ADFB894E7f", Duration.ofSeconds(5), + 1.0f, 22_000_000_000L + ); + assertThat(blockchainConfig).isEqualTo(expectedConfig); + } @Test void shouldCreateInstance() { assertThat(new Web3jService(blockchainConfig)).isNotNull(); From fb98ebd7af3cbcc0272884c760404a562886b0b3 Mon Sep 17 00:00:00 2001 From: Jeremy Bernard Date: Wed, 7 Jun 2023 17:13:56 +0200 Subject: [PATCH 30/30] Release version 8.1.0 --- CHANGELOG.md | 2 +- gradle.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d9ca737f..8ca8856f 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-sms/releases/tag/vNEXT) 2023 +## [[8.1.0]](https://github.com/iExecBlockchainComputing/iexec-sms/releases/tag/v8.1.0) 2023-06-07 ### New Features - Enable Prometheus actuator. (#166) diff --git a/gradle.properties b/gradle.properties index efe98924..3fa90f8b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -version=8.0.0 +version=8.1.0 iexecCommonVersion=8.2.0 iexecCommonsPocoVersion=3.0.2