From dfbc4c61bcf13000d79e9e295866d0fa6bb8013b Mon Sep 17 00:00:00 2001 From: dlandiak Date: Tue, 19 Mar 2024 18:54:46 +0200 Subject: [PATCH] user password should not contain whitespace, changed default subscription color for WS --- .../service/security/system/DefaultSystemSecurityService.java | 3 +++ .../thingsboard/mqtt/broker/common/util/BrokerConstants.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/application/src/main/java/org/thingsboard/mqtt/broker/service/security/system/DefaultSystemSecurityService.java b/application/src/main/java/org/thingsboard/mqtt/broker/service/security/system/DefaultSystemSecurityService.java index 86f831dc3..99c6b77ec 100644 --- a/application/src/main/java/org/thingsboard/mqtt/broker/service/security/system/DefaultSystemSecurityService.java +++ b/application/src/main/java/org/thingsboard/mqtt/broker/service/security/system/DefaultSystemSecurityService.java @@ -67,6 +67,9 @@ public void validatePassword(String password) throws DataValidationException { if (password.length() <= 5) { throw new DataValidationException("Password should be longer than 5 characters!"); } + if (org.springframework.util.StringUtils.containsWhitespace(password)) { + throw new DataValidationException("Password should not contain whitespaces!"); + } } @Override diff --git a/common/util/src/main/java/org/thingsboard/mqtt/broker/common/util/BrokerConstants.java b/common/util/src/main/java/org/thingsboard/mqtt/broker/common/util/BrokerConstants.java index 5f378ca01..7119731a6 100644 --- a/common/util/src/main/java/org/thingsboard/mqtt/broker/common/util/BrokerConstants.java +++ b/common/util/src/main/java/org/thingsboard/mqtt/broker/common/util/BrokerConstants.java @@ -128,5 +128,5 @@ public class BrokerConstants { public static final String WEB_SOCKET_DEFAULT_SUBSCRIPTION_TOPIC_FILTER = "sensors/#"; public static final int WEB_SOCKET_DEFAULT_SUBSCRIPTION_QOS = 1; - public static final String WEB_SOCKET_DEFAULT_SUBSCRIPTION_COLOR = "#FF5733"; + public static final String WEB_SOCKET_DEFAULT_SUBSCRIPTION_COLOR = "#34920C"; }