From 45a57230c1bad7f5d67e1148d604273b575fb805 Mon Sep 17 00:00:00 2001 From: VIacheslavKlimov Date: Tue, 22 Jul 2025 12:40:57 +0300 Subject: [PATCH] Upgrade versions of most libraries; refactor dependency management --- application/pom.xml | 4 +- .../ThingsboardSecurityConfiguration.java | 20 +- .../SslCredentialsWebServerCustomizer.java | 38 +- pom.xml | 611 +----------------- 4 files changed, 60 insertions(+), 613 deletions(-) diff --git a/application/pom.xml b/application/pom.xml index e2faa21929..f4d1235a64 100644 --- a/application/pom.xml +++ b/application/pom.xml @@ -186,8 +186,8 @@ jjwt - org.freemarker - freemarker + org.springframework.boot + spring-boot-starter-freemarker commons-io diff --git a/application/src/main/java/org/thingsboard/server/config/ThingsboardSecurityConfiguration.java b/application/src/main/java/org/thingsboard/server/config/ThingsboardSecurityConfiguration.java index 93cf9da8e0..2fbc89a84d 100644 --- a/application/src/main/java/org/thingsboard/server/config/ThingsboardSecurityConfiguration.java +++ b/application/src/main/java/org/thingsboard/server/config/ThingsboardSecurityConfiguration.java @@ -26,9 +26,7 @@ import org.springframework.context.annotation.Configuration; import org.springframework.core.annotation.Order; import org.springframework.http.HttpHeaders; import org.springframework.security.authentication.AuthenticationManager; -import org.springframework.security.authentication.DefaultAuthenticationEventPublisher; -import org.springframework.security.config.annotation.ObjectPostProcessor; -import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; +import org.springframework.security.authentication.ProviderManager; import org.springframework.security.config.annotation.method.configuration.EnableMethodSecurity; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; @@ -183,15 +181,12 @@ public class ThingsboardSecurityConfiguration { } @Bean - public AuthenticationManager authenticationManager(ObjectPostProcessor objectPostProcessor) throws Exception { - DefaultAuthenticationEventPublisher eventPublisher = objectPostProcessor - .postProcess(new DefaultAuthenticationEventPublisher()); - var auth = new AuthenticationManagerBuilder(objectPostProcessor); - auth.authenticationEventPublisher(eventPublisher); - auth.authenticationProvider(restAuthenticationProvider); - auth.authenticationProvider(jwtAuthenticationProvider); - auth.authenticationProvider(refreshTokenAuthenticationProvider); - return auth.build(); + public AuthenticationManager authenticationManager() { + return new ProviderManager(List.of( + restAuthenticationProvider, + jwtAuthenticationProvider, + refreshTokenAuthenticationProvider + )); } @Autowired @@ -265,4 +260,5 @@ public class ThingsboardSecurityConfiguration { return new CorsFilter(source); } } + } diff --git a/common/transport/transport-api/src/main/java/org/thingsboard/server/common/transport/config/ssl/SslCredentialsWebServerCustomizer.java b/common/transport/transport-api/src/main/java/org/thingsboard/server/common/transport/config/ssl/SslCredentialsWebServerCustomizer.java index 0884208aee..6c73bb03de 100644 --- a/common/transport/transport-api/src/main/java/org/thingsboard/server/common/transport/config/ssl/SslCredentialsWebServerCustomizer.java +++ b/common/transport/transport-api/src/main/java/org/thingsboard/server/common/transport/config/ssl/SslCredentialsWebServerCustomizer.java @@ -20,14 +20,17 @@ import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; import org.springframework.boot.autoconfigure.web.ServerProperties; import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.boot.ssl.SslBundle; +import org.springframework.boot.ssl.SslBundles; +import org.springframework.boot.ssl.SslStoreBundle; import org.springframework.boot.web.server.Ssl; -import org.springframework.boot.web.server.SslStoreProvider; import org.springframework.boot.web.server.WebServerFactoryCustomizer; import org.springframework.boot.web.servlet.server.ConfigurableServletWebServerFactory; import org.springframework.context.annotation.Bean; import org.springframework.stereotype.Component; -import java.security.KeyStore; +import java.util.List; +import java.util.function.Consumer; @Component @ConditionalOnExpression("'${spring.main.web-environment:true}'=='true' && '${server.ssl.enabled:false}'=='true'") @@ -43,6 +46,9 @@ public class SslCredentialsWebServerCustomizer implements WebServerFactoryCustom @Qualifier("httpServerSslCredentials") private SslCredentialsConfig httpServerSslCredentialsConfig; + @Autowired + SslBundles sslBundles; + private final ServerProperties serverProperties; public SslCredentialsWebServerCustomizer(ServerProperties serverProperties) { @@ -56,16 +62,32 @@ public class SslCredentialsWebServerCustomizer implements WebServerFactoryCustom ssl.setKeyAlias(sslCredentials.getKeyAlias()); ssl.setKeyPassword(sslCredentials.getKeyPassword()); factory.setSsl(ssl); - factory.setSslStoreProvider(new SslStoreProvider() { + factory.setSslBundles(sslBundles); + } + + @Bean + public SslBundles sslBundles() { + SslStoreBundle storeBundle = SslStoreBundle.of( + httpServerSslCredentialsConfig.getCredentials().getKeyStore(), + httpServerSslCredentialsConfig.getCredentials().getKeyPassword(), + null + ); + return new SslBundles() { @Override - public KeyStore getKeyStore() { - return sslCredentials.getKeyStore(); + public SslBundle getBundle(String name) { + return SslBundle.of(storeBundle); } @Override - public KeyStore getTrustStore() { - return null; + public List getBundleNames() { + return List.of("default"); } - }); + + @Override + public void addBundleUpdateHandler(String name, Consumer handler) { + // no-op + } + }; } + } diff --git a/pom.xml b/pom.xml index 27de67d218..552250421c 100755 --- a/pom.xml +++ b/pom.xml @@ -38,65 +38,35 @@ ${project.name} /var/log/${pkg.name} /usr/share/${pkg.name} - 3.0.0 - 4.0.2 + 3.4.7 2.4.0-b180830.0359 - 4.0.5 - 10.1.42 - 2.5.2 - 3.2.12 - 3.2.12 - 3.2.12 - 6.1.21 - 6.2.11 - 6.3.9 5.1.5 0.12.5 - 2.0.17 - 2.24.3 - 1.5.6 0.10 4.17.0 4.2.25 5.0.4 33.1.0-jre - 3.1.8 - 3.14.0 - 1.16.1 2.16.1 1.3.1 1.10.0 - 5.3.1 - 5.2.4 4.5.14 - 4.4.16 2.12.7 - 2.17.2 - 2.17.2 - 1.7.0 4.4.0 1.5.6 0.6.12 3.12.1 2.0.0-M15 - 2.10.1 - 2.3.32 2.0.1 5.6.0 3.9.3 3.25.5 - 1.63.0 + 1.68.1 1.2.8 - 1.18.32 + 1.18.38 1.2.5 1.2.5 - 4.1.119.Final - 2.0.65.Final - 1.1.18 - 1.0.4 - 3.6.12 1.7.1 - 5.21.0 3.2.5 3.4.0 2.4.0TB @@ -105,11 +75,9 @@ 1.19.0 1.78.1 2.0.1 - 42.7.7 org/thingsboard/server/gen/**/*, org/thingsboard/server/extensions/core/plugin/telemetry/gen/**/* - 8.13.2 0.4.5 15.4 4.0.2 - 3.0.2 1.7.5 3.8.0 - 2.9.0 1.1.0 2.38.0 1.24 @@ -152,23 +116,17 @@ 0.27.0 1.7.0 - 4.2.1 2.7.3 1.5.6 - 5.10.5 5.15.0 1.3.0 1.2.7 5.0.0 7.10.1 - 3.25.3 - 5.4.0 - 2.2 - 1.20.4 - 1.0.1 + 1.20.6 + 1.0.2 1.12 - 4.19.1 5.8.0 2.27.0 2.12.0 @@ -935,6 +893,21 @@ + + org.springframework.boot + spring-boot-dependencies + ${spring-boot.version} + pom + import + + + dev.langchain4j + langchain4j-bom + ${langchain4j.version} + pom + import + + org.thingsboard netty-mqtt @@ -1150,100 +1123,11 @@ test-jar test - - jakarta.annotation - jakarta.annotation-api - ${jakarta-annotation.version} - - - jakarta.xml.bind - jakarta.xml.bind-api - ${jakarta.xml.bind-api.version} - javax.xml.bind jaxb-api ${javax.xml.bind-api.version} - - org.glassfish.jaxb - jaxb-runtime - ${jaxb-runtime.version} - - - org.apache.tomcat.embed - tomcat-embed-core - ${tomcat.version} - - - org.apache.tomcat.embed - tomcat-embed-el - ${tomcat.version} - - - org.apache.tomcat.embed - tomcat-embed-websocket - ${tomcat.version} - - - - net.minidev - json-smart - ${net.minidev.json-smart} - - - - org.springframework.boot - spring-boot-starter - ${spring-boot.version} - - - org.springframework.boot - spring-boot-starter-security - ${spring-boot.version} - - - org.springframework.security - spring-security-oauth2-client - ${spring-security.version} - - - org.springframework.security - spring-security-oauth2-jose - ${spring-security.version} - - - - org.springframework.security - spring-security-config - ${spring-security.version} - - - org.springframework.security - spring-security-web - ${spring-security.version} - - - - org.springframework - spring-core - ${spring.version} - - - org.springframework.boot - spring-boot-starter-web - ${spring-boot.version} - - - org.springframework.boot - spring-boot-starter-websocket - ${spring-boot.version} - - - org.springframework.boot - spring-boot-autoconfigure - ${spring-boot.version} - org.springframework.boot spring-boot-starter-test @@ -1256,72 +1140,11 @@ - - org.springframework.boot - spring-boot-starter-data-jpa - ${spring-boot.version} - - - org.springframework.data - spring-data-commons - ${spring-data.version} - - - org.springframework.boot - spring-boot-starter-webflux - ${spring-boot.version} - - - io.projectreactor.netty - reactor-netty-http - ${reactor-netty.version} - - - org.reactivestreams - reactive-streams - ${reactive-streams.version} - - - io.projectreactor - reactor-core - ${reactor-core.version} - org.apache.kafka kafka-clients ${kafka.version} - - org.postgresql - postgresql - ${postgresql.driver.version} - - - org.springframework - spring-context - ${spring.version} - - - org.springframework - spring-context-support - ${spring.version} - - - org.springframework - spring-tx - ${spring.version} - - - org.springframework - spring-web - ${spring.version} - - - org.springframework.security - spring-security-test - ${spring-security.version} - test - com.github.springtestdbunit spring-test-dbunit @@ -1333,11 +1156,6 @@ jjwt ${jjwt.version} - - org.freemarker - freemarker - ${freemarker.version} - org.yaml snakeyaml @@ -1348,11 +1166,6 @@ antlr ${antlr.version} - - com.rabbitmq - amqp-client - ${rabbitmq.version} - com.sun.mail jakarta.mail @@ -1380,150 +1193,16 @@ - - com.jayway.jsonpath - json-path - ${json-path.version} - - - com.jayway.jsonpath - json-path-assert - ${json-path.version} - test - - - io.netty - netty-all - ${netty.version} - - - io.netty - netty-tcnative-boringssl-static - ${netty-tcnative.version} - - - io.netty - netty-tcnative-classes - ${netty-tcnative.version} - - - io.netty - netty-buffer - ${netty.version} - - - io.netty - netty-codec - ${netty.version} - - - io.netty - netty-codec-dns - ${netty.version} - - - io.netty - netty-codec-http - ${netty.version} - - - io.netty - netty-codec-http2 - ${netty.version} - - - io.netty - netty-codec-mqtt - ${netty.version} - - - io.netty - netty-codec-socks - ${netty.version} - - - io.netty - netty-common - ${netty.version} - - - io.netty - netty-handler - ${netty.version} - - - io.netty - netty-handler-proxy - ${netty.version} - - - io.netty - netty-resolver - ${netty.version} - - - io.netty - netty-resolver-dns - ${netty.version} - - - io.netty - netty-resolver-dns-classes-macos - ${netty.version} - io.netty netty-resolver-dns-native-macos - ${netty.version} - - - io.netty - netty-resolver-dns-native-macos - ${netty.version} osx-x86_64 - - io.netty - netty-transport - ${netty.version} - - - io.netty - netty-transport-classes-epoll - ${netty.version} - - - io.netty - netty-transport-classes-kqueue - ${netty.version} - - - io.netty - netty-transport-native-epoll - ${netty.version} - - - io.netty - netty-transport-native-epoll - ${netty.version} - linux-x86_64 - - - io.netty - netty-transport-native-kqueue - ${netty.version} - io.netty netty-transport-native-kqueue - ${netty.version} osx-x86_64 - - io.netty - netty-transport-native-unix-common - ${netty.version} - com.datastax.oss java-driver-core @@ -1539,21 +1218,11 @@ metrics-jmx ${metrics.version} - - org.apache.commons - commons-lang3 - ${commons-lang3.version} - commons-io commons-io ${commons-io.version} - - commons-codec - commons-codec - ${commons-codec.version} - commons-logging commons-logging @@ -1564,16 +1233,6 @@ commons-csv ${commons-csv.version} - - org.apache.httpcomponents.client5 - httpclient5 - ${apache-httpclient5.version} - - - org.apache.httpcomponents.core5 - httpcore5 - ${apache-httpcore5.version} - org.apache.httpcomponents httpclient @@ -1585,66 +1244,11 @@ - - org.apache.httpcomponents - httpcore - ${apache-httpcore.version} - joda-time joda-time ${joda-time.version} - - com.fasterxml.jackson.core - jackson-databind - ${jackson-databind.version} - - - com.fasterxml.jackson.core - jackson-core - ${jackson.version} - - - com.fasterxml.jackson.core - jackson-annotations - ${jackson.version} - - - com.fasterxml.jackson.dataformat - jackson-dataformat-cbor - ${jackson.version} - - - com.fasterxml.jackson.dataformat - jackson-dataformat-yaml - ${jackson.version} - - - com.fasterxml.jackson.datatype - jackson-datatype-jdk8 - ${jackson.version} - - - com.fasterxml.jackson.datatype - jackson-datatype-joda - ${jackson.version} - - - com.fasterxml.jackson.datatype - jackson-datatype-jsr310 - ${jackson.version} - - - com.fasterxml.jackson.module - jackson-module-parameter-names - ${jackson.version} - - - com.fasterxml - classmate - ${fasterxml-classmate.version} - com.auth0 java-jwt @@ -1699,61 +1303,11 @@ scandium ${californium.version} - - com.google.code.gson - gson - ${gson.version} - - - org.slf4j - slf4j-api - ${slf4j.version} - - - org.slf4j - log4j-over-slf4j - ${slf4j.version} - - - org.slf4j - jul-to-slf4j - ${slf4j.version} - - - org.apache.logging.log4j - log4j-api - ${log4j.version} - - - org.apache.logging.log4j - log4j-core - ${log4j.version} - - - org.apache.logging.log4j - log4j-to-slf4j - ${log4j.version} - - - ch.qos.logback - logback-core - ${logback.version} - - - ch.qos.logback - logback-classic - ${logback.version} - com.google.guava guava ${guava.version} - - com.github.ben-manes.caffeine - caffeine - ${caffeine.version} - com.google.protobuf protobuf-java @@ -1849,12 +1403,6 @@ tbel ${tbel.version} - - org.springframework - spring-test - ${spring.version} - test - io.takari.junit takari-cpsuite @@ -1872,42 +1420,12 @@ cassandra-all ${cassandra-all.version} - - org.junit.vintage - junit-vintage-engine - ${jupiter.version} - test - - - org.hamcrest - hamcrest-core - - - org.testng testng ${testng.version} test - - org.assertj - assertj-core - ${assertj.version} - test - - - io.rest-assured - rest-assured - ${rest-assured.version} - test - - - org.seleniumhq.selenium - selenium-java - ${selenium.version} - test - io.github.bonigarcia webdrivermanager @@ -1926,18 +1444,6 @@ ${allure-maven.version} test - - org.hamcrest - hamcrest - ${hamcrest.version} - test - - - org.awaitility - awaitility - ${awaitility.version} - test - org.dbunit dbunit @@ -1995,40 +1501,6 @@ bcprov-ext-jdk18on ${bouncycastle.version} - - org.testcontainers - cassandra - ${testcontainers.version} - test - - - org.testcontainers - postgresql - ${testcontainers.version} - test - - - org.testcontainers - jdbc - ${testcontainers.version} - test - - - org.testcontainers - hivemq - ${testcontainers.version} - test - - - org.springframework.data - spring-data-redis - ${spring-data-redis.version} - - - org.springframework.integration - spring-integration-redis - ${spring-redis.version} - redis.clients jedis @@ -2042,17 +1514,6 @@ exe provided - - org.elasticsearch.client - elasticsearch-rest-client - ${elasticsearch.version} - - - commons-logging - commons-logging - - - org.javadelight delight-nashorn-sandbox @@ -2181,21 +1642,6 @@ ${java-websocket.version} test - - org.springframework.boot - spring-boot-starter-actuator - ${spring-boot.version} - - - io.micrometer - micrometer-core - ${micrometer.version} - - - io.micrometer - micrometer-registry-prometheus - ${micrometer.version} - org.thingsboard protobuf-dynamic @@ -2225,11 +1671,6 @@ - - org.hibernate.validator - hibernate-validator - ${hibernate-validator.version} - io.hypersistence hypersistence-utils-hibernate-63 @@ -2240,11 +1681,6 @@ jakarta.el ${jakarta.el.version} - - jakarta.validation - jakarta.validation-api - ${jakarta.validation-api.version} - org.owasp.antisamy antisamy @@ -2437,13 +1873,6 @@ threetenbp ${threetenbp.version} - - dev.langchain4j - langchain4j-bom - ${langchain4j.version} - pom - import -