Skip to content

Commit

Permalink
[INLONG-9706][Manager] Supports jdbc verification under multiple hosts (
Browse files Browse the repository at this point in the history
  • Loading branch information
fuweng11 committed Feb 20, 2024
1 parent 2a2265a commit 23e3e00
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ":";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,26 @@ public static String filterSensitive(String url) {
}
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));
builder.append(InlongConstants.QUESTION_MARK);

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);

Expand Down

0 comments on commit 23e3e00

Please sign in to comment.