Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[INLONG-7222][Manager] Decode the MySQL JDBC URL thoroughly #7223

Merged
merged 2 commits into from
Jan 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ public class InlongConstants {

public static final String LEFT_BRACKET = "(";

public static final String PERCENT = "%";

public static final String ADMIN_USER = "admin";

public static final Integer AFFECTED_ONE_ROW = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.apache.inlong.manager.common.consts.InlongConstants;
import org.apache.inlong.manager.common.enums.ErrorCodeEnum;
import org.apache.inlong.manager.common.exceptions.BusinessException;
import org.apache.inlong.manager.common.util.JsonUtils;
Expand Down Expand Up @@ -189,7 +190,10 @@ protected static String filterSensitive(String url) {
return url;
}
try {
String resultUrl = URLDecoder.decode(url, "UTF-8");
String resultUrl = url;
while (resultUrl.contains(InlongConstants.PERCENT)) {
resultUrl = URLDecoder.decode(resultUrl, "UTF-8");
}
for (String sensitiveParam : SENSITIVE_PARAM_MAP.keySet()) {
if (StringUtils.containsIgnoreCase(resultUrl, sensitiveParam)) {
resultUrl = StringUtils.replaceIgnoreCase(resultUrl, sensitiveParam,
Expand Down