diff --git a/Dockerfile b/Dockerfile index 537898fb..35e21323 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM eclipse-temurin:17.0.13_11-jre-focal +FROM eclipse-temurin:21.0.11_10-jre-noble ARG jar diff --git a/build.gradle b/build.gradle index 59daa216..340de6be 100644 --- a/build.gradle +++ b/build.gradle @@ -33,10 +33,10 @@ allprojects { } java { toolchain { - languageVersion.set(JavaLanguageVersion.of(17)) + languageVersion.set(JavaLanguageVersion.of(21)) } - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + sourceCompatibility = JavaVersion.VERSION_21 + targetCompatibility = JavaVersion.VERSION_21 } tasks.withType(JavaCompile).configureEach { diff --git a/iexec-sms-library/build.gradle b/iexec-sms-library/build.gradle index 67dd6969..d47b76b4 100644 --- a/iexec-sms-library/build.gradle +++ b/iexec-sms-library/build.gradle @@ -13,8 +13,8 @@ dependencies { } java { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + sourceCompatibility = JavaVersion.VERSION_21 + targetCompatibility = JavaVersion.VERSION_21 withJavadocJar() withSourcesJar() } 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 6fd3a0fc..3dee6424 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-2025 IEXEC BLOCKCHAIN TECH + * Copyright 2020-2026 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. @@ -112,7 +112,7 @@ public TeeServicesProperties resolveTeeServiceProperties(final String version) { } private String createSessionId(final String taskId) { - final String randomString = RandomStringUtils.randomAlphanumeric(10); + final String randomString = RandomStringUtils.secure().nextAlphanumeric(10); return String.format("%s0000%s", randomString, taskId); } 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 8c78e9d2..0a467f14 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-2025 IEXEC BLOCKCHAIN TECH + * Copyright 2020-2026 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. @@ -38,6 +38,8 @@ import org.yaml.snakeyaml.Yaml; import java.net.MalformedURLException; +import java.net.URI; +import java.net.URISyntaxException; import java.net.URL; import java.util.List; import java.util.Map; @@ -57,9 +59,9 @@ class SconeSessionMakerServiceTests { static { try { - MAA_URL_OUT_OF_SERVICE = new URL("https://broken.maa.attestation.service"); - MAA_URL = new URL("https://maa.attestation.service"); - } catch (MalformedURLException e) { + MAA_URL_OUT_OF_SERVICE = new URI("https://broken.maa.attestation.service").toURL(); + MAA_URL = new URI("https://maa.attestation.service").toURL(); + } catch (URISyntaxException | MalformedURLException e) { throw new RuntimeException(e); } } diff --git a/src/test/java/com/iexec/sms/tee/session/scone/SconeSessionSecurityConfigTests.java b/src/test/java/com/iexec/sms/tee/session/scone/SconeSessionSecurityConfigTests.java index 6fcec0cd..bb3136e2 100644 --- a/src/test/java/com/iexec/sms/tee/session/scone/SconeSessionSecurityConfigTests.java +++ b/src/test/java/com/iexec/sms/tee/session/scone/SconeSessionSecurityConfigTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2025 IEXEC BLOCKCHAIN TECH + * Copyright 2025-2026 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. @@ -24,6 +24,8 @@ import org.junit.jupiter.api.Test; import java.net.MalformedURLException; +import java.net.URI; +import java.net.URISyntaxException; import java.net.URL; import java.util.List; import java.util.Set; @@ -39,8 +41,8 @@ class SconeSessionSecurityConfigTests { static { try { - MAA_URL = new URL("https://maa.attestation.service"); - } catch (MalformedURLException e) { + MAA_URL = new URI("https://maa.attestation.service").toURL(); + } catch (URISyntaxException | MalformedURLException e) { throw new RuntimeException(e); } }