diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d87f2385..f9827a922 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,3 +3,4 @@ - [fix: add gateway context config example.](https://github.com/Tencent/spring-cloud-tencent/pull/1564) - [feat:support config empty protection.](https://github.com/Tencent/spring-cloud-tencent/pull/1586) +- [feat:upgrade to 2023.0.5.](https://github.com/Tencent/spring-cloud-tencent/pull/1588) diff --git a/pom.xml b/pom.xml index 52dc40d3b..1677f13c9 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.springframework.cloud spring-cloud-build - 4.1.3 + 4.1.5 4.0.0 @@ -90,16 +90,16 @@ - 2.0.2.0-2023.0.3-SNAPSHOT + 2.0.2.0-2023.0.5-SNAPSHOT - 6.1.14 + 6.1.20 - 3.3.5 + 3.3.12 - 2023.0.3 + 2023.0.5 0.8.12 diff --git a/spring-cloud-tencent-dependencies/pom.xml b/spring-cloud-tencent-dependencies/pom.xml index 431543628..c53d1ff54 100644 --- a/spring-cloud-tencent-dependencies/pom.xml +++ b/spring-cloud-tencent-dependencies/pom.xml @@ -5,7 +5,7 @@ org.springframework.cloud spring-cloud-dependencies-parent - 4.1.3 + 4.1.5 4.0.0 @@ -71,7 +71,7 @@ - 2.0.2.0-2023.0.3-SNAPSHOT + 2.0.2.0-2023.0.5-SNAPSHOT 2.0.2.0-SNAPSHOT @@ -207,12 +207,6 @@ ${revision} - - com.tencent.cloud - spring-cloud-tencent-security-protection-plugin - ${revision} - - org.springdoc diff --git a/spring-cloud-tencent-plugin-starters/pom.xml b/spring-cloud-tencent-plugin-starters/pom.xml index 1ba1a6322..ebad1d2e8 100644 --- a/spring-cloud-tencent-plugin-starters/pom.xml +++ b/spring-cloud-tencent-plugin-starters/pom.xml @@ -21,7 +21,6 @@ spring-cloud-starter-tencent-threadlocal-plugin spring-cloud-starter-tencent-trace-plugin spring-cloud-starter-tencent-fault-tolerance - spring-cloud-tencent-security-protection-plugin diff --git a/spring-cloud-tencent-plugin-starters/spring-cloud-tencent-security-protection-plugin/pom.xml b/spring-cloud-tencent-plugin-starters/spring-cloud-tencent-security-protection-plugin/pom.xml deleted file mode 100644 index 1674db4e8..000000000 --- a/spring-cloud-tencent-plugin-starters/spring-cloud-tencent-security-protection-plugin/pom.xml +++ /dev/null @@ -1,59 +0,0 @@ - - - - spring-cloud-tencent-plugin-starters - com.tencent.cloud - ${revision} - ../pom.xml - - 4.0.0 - - spring-cloud-tencent-security-protection-plugin - Spring Cloud Tencent Lossless Plugin - - - - - org.springframework.boot - spring-boot-autoconfigure - - - - org.springframework - spring-beans - - - - org.slf4j - slf4j-api - - - - org.springframework - spring-webmvc - true - - - - org.springframework - spring-webflux - true - - - - org.springframework.boot - spring-boot-starter-test - test - - - - org.mockito - mockito-inline - test - - - - - diff --git a/spring-cloud-tencent-plugin-starters/spring-cloud-tencent-security-protection-plugin/src/main/java/com/tencent/cloud/plugin/protection/ExitUtils.java b/spring-cloud-tencent-plugin-starters/spring-cloud-tencent-security-protection-plugin/src/main/java/com/tencent/cloud/plugin/protection/ExitUtils.java deleted file mode 100644 index 2bf12db99..000000000 --- a/spring-cloud-tencent-plugin-starters/spring-cloud-tencent-security-protection-plugin/src/main/java/com/tencent/cloud/plugin/protection/ExitUtils.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making spring-cloud-tencent available. - * - * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. - * - * Licensed under the BSD 3-Clause License (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://opensource.org/licenses/BSD-3-Clause - * - * 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.tencent.cloud.plugin.protection; - -import org.springframework.context.ApplicationContext; -import org.springframework.context.ConfigurableApplicationContext; - -/** - * ExitUtils. - * - * @author Shedfree Wu - */ -public final class ExitUtils { - - private ExitUtils() { - - } - - public static void exit(ApplicationContext context) { - exit(context, 3000); - } - - public static void exit(ApplicationContext context, int delay) { - if (context instanceof ConfigurableApplicationContext) { - ConfigurableApplicationContext configurableContext = (ConfigurableApplicationContext) context; - configurableContext.close(); - } - - try { - Thread.sleep(delay); - } - catch (InterruptedException e) { - // do nothing - } - System.exit(0); - } -} diff --git a/spring-cloud-tencent-plugin-starters/spring-cloud-tencent-security-protection-plugin/src/main/java/com/tencent/cloud/plugin/protection/SecurityProtectionAutoConfiguration.java b/spring-cloud-tencent-plugin-starters/spring-cloud-tencent-security-protection-plugin/src/main/java/com/tencent/cloud/plugin/protection/SecurityProtectionAutoConfiguration.java deleted file mode 100644 index 589240c63..000000000 --- a/spring-cloud-tencent-plugin-starters/spring-cloud-tencent-security-protection-plugin/src/main/java/com/tencent/cloud/plugin/protection/SecurityProtectionAutoConfiguration.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making spring-cloud-tencent available. - * - * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. - * - * Licensed under the BSD 3-Clause License (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://opensource.org/licenses/BSD-3-Clause - * - * 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.tencent.cloud.plugin.protection; - - -import java.util.List; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import org.springframework.beans.factory.InitializingBean; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.context.ApplicationContext; -import org.springframework.context.annotation.Configuration; -import org.springframework.web.servlet.function.RouterFunction; - -/** - * SecurityProtectionAutoConfiguration. - * - * @author Shedfree Wu - */ -@Configuration -public class SecurityProtectionAutoConfiguration { - - private static final Logger LOGGER = LoggerFactory.getLogger(SecurityProtectionAutoConfiguration.class); - - @Configuration - @ConditionalOnProperty(name = "spring.cloud.tencent.security.protection.servlet.enabled", matchIfMissing = true) - @ConditionalOnClass(name = {"org.springframework.web.servlet.function.RouterFunction"}) - static class ServletProtectionConfiguration implements InitializingBean { - - @Autowired(required = false) - List routerFunctions; - - @Autowired - ApplicationContext applicationContext; - - @Override - public void afterPropertiesSet() { - if (routerFunctions != null && !routerFunctions.isEmpty()) { - LOGGER.error("Detected the presence of webmvc RouterFunction-related beans, which may trigger the CVE-2024-38819 vulnerability. The program will soon exit."); - LOGGER.error("routerFunctions:{}: ", routerFunctions); - - ExitUtils.exit(applicationContext); - } - } - } - - @Configuration - @ConditionalOnProperty(name = "spring.cloud.tencent.security.protection.reactive.enabled", matchIfMissing = true) - @ConditionalOnClass(name = {"org.springframework.web.reactive.function.server.RouterFunction"}) - static class ReactiveProtectionConfiguration implements InitializingBean { - - @Autowired(required = false) - List routerFunctions; - - @Autowired - ApplicationContext applicationContext; - - @Override - public void afterPropertiesSet() { - if (routerFunctions != null && !routerFunctions.isEmpty()) { - LOGGER.error("Detected the presence of webflux RouterFunction-related beans, which may trigger the CVE-2024-38819 vulnerability. The program will soon exit."); - LOGGER.error("routerFunctions:{}: ", routerFunctions); - ExitUtils.exit(applicationContext); - } - } - } - -} diff --git a/spring-cloud-tencent-plugin-starters/spring-cloud-tencent-security-protection-plugin/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/spring-cloud-tencent-plugin-starters/spring-cloud-tencent-security-protection-plugin/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports deleted file mode 100644 index 778b1e84a..000000000 --- a/spring-cloud-tencent-plugin-starters/spring-cloud-tencent-security-protection-plugin/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports +++ /dev/null @@ -1 +0,0 @@ -com.tencent.cloud.plugin.protection.SecurityProtectionAutoConfiguration