This is an automated email from the ASF dual-hosted git repository.
dockerzhang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/inlong.git
The following commit(s) were added to refs/heads/master by this push:
new 23e3e00cae [INLONG-9706][Manager] Supports jdbc verification under
multiple hosts (#9707)
23e3e00cae is described below
commit 23e3e00cae1fd120b089fca54f7440945dfe11a4
Author: fuweng11 <[email protected]>
AuthorDate: Tue Feb 20 15:31:38 2024 +0800
[INLONG-9706][Manager] Supports jdbc verification under multiple hosts
(#9707)
---
.../inlong/manager/common/consts/InlongConstants.java | 2 ++
.../inlong/manager/pojo/util/MySQLSensitiveUrlUtils.java | 13 +++++++++++--
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git
a/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/consts/InlongConstants.java
b/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/consts/InlongConstants.java
index 0f6c86056a..c3085972fd 100644
---
a/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/consts/InlongConstants.java
+++
b/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/consts/InlongConstants.java
@@ -48,6 +48,8 @@ public class InlongConstants {
public static final String EMPTY = "";
+ public static final String SHARP = "#";
+
public static final String SLASH = "/";
public static final String COLON = ":";
diff --git
a/inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/util/MySQLSensitiveUrlUtils.java
b/inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/util/MySQLSensitiveUrlUtils.java
index e155887f1e..fd80460301 100644
---
a/inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/util/MySQLSensitiveUrlUtils.java
+++
b/inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/util/MySQLSensitiveUrlUtils.java
@@ -71,6 +71,12 @@ public class MySQLSensitiveUrlUtils {
}
resultUrl = resultUrl.replaceAll(InlongConstants.REGEX_WHITESPACE,
InlongConstants.EMPTY);
+ for (String key : SENSITIVE_REPLACE_PARAM_MAP.keySet()) {
+ resultUrl = StringUtils.replaceIgnoreCase(resultUrl, key +
InlongConstants.EQUAL + "true",
+ InlongConstants.EMPTY);
+ resultUrl = StringUtils.replaceIgnoreCase(resultUrl, key +
InlongConstants.EQUAL + "yes",
+ InlongConstants.EMPTY);
+ }
if (resultUrl.contains(InlongConstants.QUESTION_MARK)) {
StringBuilder builder = new StringBuilder();
builder.append(StringUtils.substringBefore(resultUrl,
InlongConstants.QUESTION_MARK));
@@ -78,10 +84,13 @@ public class MySQLSensitiveUrlUtils {
List<String> paramList = new ArrayList<>();
String queryString = StringUtils.substringAfter(resultUrl,
InlongConstants.QUESTION_MARK);
- if (queryString.contains("#")) {
- queryString = StringUtils.substringBefore(queryString,
"#");
+ if (queryString.contains(InlongConstants.SHARP)) {
+ queryString = StringUtils.substringBefore(queryString,
InlongConstants.SHARP);
}
for (String param :
queryString.split(InlongConstants.AMPERSAND)) {
+ if (StringUtils.isBlank(param)) {
+ continue;
+ }
String key = StringUtils.substringBefore(param,
InlongConstants.EQUAL);
String value = StringUtils.substringAfter(param,
InlongConstants.EQUAL);