From 239b1e8f62dbe134e6fcb8b59326f6554487e011 Mon Sep 17 00:00:00 2001 From: buildmaster Date: Tue, 17 Sep 2024 13:06:20 +0000 Subject: [PATCH 1/6] Bumping versions --- .../config/client/aot/ConfigClientHints.java | 47 +++++++------------ 1 file changed, 18 insertions(+), 29 deletions(-) diff --git a/spring-cloud-config-client/src/main/java/org/springframework/cloud/config/client/aot/ConfigClientHints.java b/spring-cloud-config-client/src/main/java/org/springframework/cloud/config/client/aot/ConfigClientHints.java index e025ab0d..afac39e9 100644 --- a/spring-cloud-config-client/src/main/java/org/springframework/cloud/config/client/aot/ConfigClientHints.java +++ b/spring-cloud-config-client/src/main/java/org/springframework/cloud/config/client/aot/ConfigClientHints.java @@ -38,38 +38,27 @@ class ConfigClientHints implements RuntimeHintsRegistrar { @Override public void registerHints(RuntimeHints hints, ClassLoader classLoader) { if (!ClassUtils.isPresent("org.springframework.cloud.config.client.ConfigServerConfigDataLoader", - classLoader)) { + classLoader)) { return; } hints.reflection() .registerType(TypeReference.of(ConfigClientAutoConfiguration.class), - hint -> hint.withMembers( - MemberCategory.INVOKE_DECLARED_CONSTRUCTORS) - ).registerType(TypeReference.of(ConfigDataLocation.class), - hint -> hint.withMembers( - MemberCategory.INVOKE_DECLARED_METHODS) - ).registerType(TypeReference.of("org.springframework.boot.context.config.ConfigDataProperties"), - hint -> hint.withMembers( - MemberCategory.INVOKE_DECLARED_CONSTRUCTORS, - MemberCategory.DECLARED_FIELDS, - MemberCategory.INTROSPECT_DECLARED_METHODS) - ).registerType(TypeReference.of(Environment.class), - hint -> hint.withMembers( - MemberCategory.INVOKE_DECLARED_CONSTRUCTORS, - MemberCategory.INTROSPECT_DECLARED_METHODS, - MemberCategory.DECLARED_FIELDS) - ).registerType(TypeReference.of(PropertySource.class), - hint -> hint.withMembers( - MemberCategory.INVOKE_DECLARED_CONSTRUCTORS, - MemberCategory.INTROSPECT_DECLARED_METHODS, - MemberCategory.DECLARED_FIELDS) - ).registerType(TypeReference.of(RetryTemplateFactory.class), - hint -> hint.withMembers( - MemberCategory.INTROSPECT_DECLARED_CONSTRUCTORS, - MemberCategory.INVOKE_DECLARED_CONSTRUCTORS, - MemberCategory.DECLARED_FIELDS, - MemberCategory.INTROSPECT_DECLARED_METHODS, - MemberCategory.INVOKE_DECLARED_METHODS) - ); + hint -> hint.withMembers(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS)) + .registerType(TypeReference.of(ConfigDataLocation.class), + hint -> hint.withMembers(MemberCategory.INVOKE_DECLARED_METHODS)) + .registerType(TypeReference.of("org.springframework.boot.context.config.ConfigDataProperties"), + hint -> hint.withMembers(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS, + MemberCategory.DECLARED_FIELDS, MemberCategory.INTROSPECT_DECLARED_METHODS)) + .registerType(TypeReference.of(Environment.class), + hint -> hint.withMembers(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS, + MemberCategory.INTROSPECT_DECLARED_METHODS, MemberCategory.DECLARED_FIELDS)) + .registerType(TypeReference.of(PropertySource.class), + hint -> hint.withMembers(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS, + MemberCategory.INTROSPECT_DECLARED_METHODS, MemberCategory.DECLARED_FIELDS)) + .registerType(TypeReference.of(RetryTemplateFactory.class), + hint -> hint.withMembers(MemberCategory.INTROSPECT_DECLARED_CONSTRUCTORS, + MemberCategory.INVOKE_DECLARED_CONSTRUCTORS, MemberCategory.DECLARED_FIELDS, + MemberCategory.INTROSPECT_DECLARED_METHODS, MemberCategory.INVOKE_DECLARED_METHODS)); } + } From bcc8729e2de26e8a70d9a8217c6bfdb110d62ac4 Mon Sep 17 00:00:00 2001 From: Ryan Baxter Date: Thu, 19 Sep 2024 14:04:44 -0400 Subject: [PATCH 2/6] Add 4.1.x to push and pull requests --- .github/workflows/maven.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/maven.yaml b/.github/workflows/maven.yaml index 9b781b39..c59295d9 100644 --- a/.github/workflows/maven.yaml +++ b/.github/workflows/maven.yaml @@ -5,9 +5,9 @@ name: Build on: push: - branches: [ main, 4.0.x, 3.1.x ] + branches: [ main, 4.1.x, 4.0.x, 3.1.x ] pull_request: - branches: [ main, 4.0.x, 3.1.x ] + branches: [ main, 4.1.x, 4.0.x, 3.1.x ] jobs: build: From 8ede564c4dd8d623be13f8587b4b062ed90b9e6d Mon Sep 17 00:00:00 2001 From: Ryan Baxter Date: Thu, 19 Sep 2024 14:11:14 -0400 Subject: [PATCH 3/6] Upgrading actions/upload-artifact to v4 --- .github/workflows/maven.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/maven.yaml b/.github/workflows/maven.yaml index c59295d9..d8ce12c1 100644 --- a/.github/workflows/maven.yaml +++ b/.github/workflows/maven.yaml @@ -36,7 +36,7 @@ jobs: with: report_paths: '**/surefire-reports/TEST-*.xml' - name: Archive code coverage results - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: surefire-reports path: '**/surefire-reports/*' From a225f1f3874aad9dbadd0320eb9d0ad9352cdc49 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Sep 2024 09:02:59 -0400 Subject: [PATCH 4/6] Bump @springio/asciidoctor-extensions in /docs (#2555) Bumps [@springio/asciidoctor-extensions](https://github.com/spring-io/asciidoctor-extensions) from 1.0.0-alpha.10 to 1.0.0-alpha.14. - [Changelog](https://github.com/spring-io/asciidoctor-extensions/blob/main/CHANGELOG.adoc) - [Commits](https://github.com/spring-io/asciidoctor-extensions/compare/v1.0.0-alpha.10...v1.0.0-alpha.14) --- updated-dependencies: - dependency-name: "@springio/asciidoctor-extensions" dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- docs/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/package.json b/docs/package.json index 64368b8d..98e36c74 100644 --- a/docs/package.json +++ b/docs/package.json @@ -5,6 +5,6 @@ "@antora/collector-extension": "1.0.0-alpha.3", "@asciidoctor/tabs": "1.0.0-beta.6", "@springio/antora-extensions": "1.14.2", - "@springio/asciidoctor-extensions": "1.0.0-alpha.10" + "@springio/asciidoctor-extensions": "1.0.0-alpha.14" } } From fa75ff9deace4d1fc31e4b3e687f26b86719f167 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Sep 2024 09:08:20 -0400 Subject: [PATCH 5/6] Bump io.awspring.cloud:spring-cloud-aws-dependencies from 3.0.0 to 3.0.5 (#2552) Bumps [io.awspring.cloud:spring-cloud-aws-dependencies](https://github.com/awspring/spring-cloud-aws) from 3.0.0 to 3.0.5. - [Release notes](https://github.com/awspring/spring-cloud-aws/releases) - [Commits](https://github.com/awspring/spring-cloud-aws/compare/v3.0.0...v3.0.5) --- updated-dependencies: - dependency-name: io.awspring.cloud:spring-cloud-aws-dependencies dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6d92fcea..7fc533bd 100644 --- a/pom.xml +++ b/pom.xml @@ -32,7 +32,7 @@ v1-rev20201112-1.30.10 1.17.6 2.31.0 - 3.0.0 + 3.0.5 true true From 0c0ff0635d6c4f8cc4d50e6c5be9db26a1e454ff Mon Sep 17 00:00:00 2001 From: Ryan Baxter Date: Tue, 24 Sep 2024 16:51:50 -0400 Subject: [PATCH 6/6] Update tls tests to add test that tests creating a truststore without a keystore (#2543) Fixes #2514 Co-authored-by: Ryan Baxter <524254+ryanjbaxter@users.noreply.github.com> --- .../client/tls/ConfigClientTlsTests.java | 50 +++++++++++++------ 1 file changed, 36 insertions(+), 14 deletions(-) diff --git a/spring-cloud-config-client-tls-tests/src/test/java/org/springframework/cloud/config/client/tls/ConfigClientTlsTests.java b/spring-cloud-config-client-tls-tests/src/test/java/org/springframework/cloud/config/client/tls/ConfigClientTlsTests.java index dd6237e6..d9dedb08 100644 --- a/spring-cloud-config-client-tls-tests/src/test/java/org/springframework/cloud/config/client/tls/ConfigClientTlsTests.java +++ b/spring-cloud-config-client-tls-tests/src/test/java/org/springframework/cloud/config/client/tls/ConfigClientTlsTests.java @@ -20,8 +20,7 @@ import java.io.File; import org.apache.commons.logging.LogFactory; import org.apache.hc.core5.http.io.SocketConfig; -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; import org.springframework.boot.SpringBootConfiguration; @@ -37,21 +36,18 @@ public class ConfigClientTlsTests extends AbstractTlsSetup { protected static TlsConfigServerRunner server; - @BeforeAll - public static void setupAll() throws Exception { - startConfigServer(); - } - - @AfterAll - public static void tearDownAll() { + @AfterEach + public void tearDownAll() { stopConfigServer(); } - private static void startConfigServer() { + private static void startConfigServer(boolean withKeyStore) { server = new TlsConfigServerRunner(TestConfigServer.class); - server.enableTls(); - server.setKeyStore(serverCert, KEY_STORE_PASSWORD, "server", KEY_PASSWORD); - server.setTrustStore(caCert, KEY_STORE_PASSWORD); + if (withKeyStore) { + server.enableTls(); + server.setKeyStore(serverCert, KEY_STORE_PASSWORD, "server", KEY_PASSWORD); + server.setTrustStore(caCert, KEY_STORE_PASSWORD); + } server.property("logging.level.org.springframework.cloud.config.server", "TRACE"); server.start(); @@ -63,6 +59,7 @@ public class ConfigClientTlsTests extends AbstractTlsSetup { @Test public void clientCertCanWork() { + startConfigServer(true); try (TlsConfigClientRunner client = createConfigClient()) { enableTlsClient(client); client.property("logging.level.org.springframework.boot.context.config", "TRACE"); @@ -72,9 +69,22 @@ public class ConfigClientTlsTests extends AbstractTlsSetup { } } + @Test + public void clientCanStartWithoutKeyStoreSet() { + startConfigServer(false); + try (TlsConfigClientRunner client = createConfigClient()) { + enableTlsClient(client, false); + client.property("logging.level.org.springframework.boot.context.config", "TRACE"); + client.property("logging.level.org.springframework.cloud.config.client", "DEBUG"); + client.start(); + assertThat(client.getProperty("dumb.key")).isEqualTo("dumb-value"); + } + } + @Test @SuppressWarnings({ "unchecked" }) public void tlsSetsRequestReadTimeout() { + startConfigServer(true); try (TlsConfigClientRunner client = createConfigClient()) { enableTlsClient(client); client.property("logging.level.org.springframework.boot.context.config", "TRACE"); @@ -91,6 +101,7 @@ public class ConfigClientTlsTests extends AbstractTlsSetup { @Test public void tlsClientCanBeDisabled() { + startConfigServer(true); try (TlsConfigClientRunner client = createConfigClient()) { enableTlsClient(client); client.property("spring.cloud.config.tls.enabled", "false"); @@ -101,6 +112,7 @@ public class ConfigClientTlsTests extends AbstractTlsSetup { @Test public void noCertCannotWork() { + startConfigServer(true); try (TlsConfigClientRunner client = createConfigClient()) { client.disableTls(); client.start(); @@ -110,6 +122,7 @@ public class ConfigClientTlsTests extends AbstractTlsSetup { @Test public void wrongCertCannotWork() { + startConfigServer(true); try (TlsConfigClientRunner client = createConfigClient()) { enableTlsClient(client); client.setKeyStore(wrongClientCert); @@ -120,6 +133,7 @@ public class ConfigClientTlsTests extends AbstractTlsSetup { @Test public void wrongPasswordCauseFailure() { + startConfigServer(true); assertThatExceptionOfType(IllegalStateException.class).isThrownBy(() -> { TlsConfigClientRunner client = createConfigClient(false); enableTlsClient(client); @@ -130,6 +144,7 @@ public class ConfigClientTlsTests extends AbstractTlsSetup { @Test public void nonExistKeyStoreCauseFailure() { + startConfigServer(true); assertThatExceptionOfType(IllegalStateException.class).isThrownBy(() -> { TlsConfigClientRunner client = createConfigClient(false); enableTlsClient(client); @@ -140,6 +155,7 @@ public class ConfigClientTlsTests extends AbstractTlsSetup { @Test public void wrongTrustStoreCannotWork() { + startConfigServer(true); try (TlsConfigClientRunner client = createConfigClient()) { enableTlsClient(client); client.setTrustStore(wrongCaCert); @@ -161,8 +177,14 @@ public class ConfigClientTlsTests extends AbstractTlsSetup { } private void enableTlsClient(TlsConfigClientRunner runner) { + enableTlsClient(runner, true); + } + + private void enableTlsClient(TlsConfigClientRunner runner, boolean withKeyStore) { runner.enableTls(); - runner.setKeyStore(clientCert, KEY_STORE_PASSWORD, KEY_PASSWORD); + if (withKeyStore) { + runner.setKeyStore(clientCert, KEY_STORE_PASSWORD, KEY_PASSWORD); + } runner.setTrustStore(caCert, KEY_STORE_PASSWORD); }