Skip to content

Commit

Permalink
[INLONG-7421][Manager] Add encoding check to the MySQL JDBC URL in My…
Browse files Browse the repository at this point in the history
…SQLDataNode (#7422)
  • Loading branch information
fuweng11 committed Feb 24, 2023
1 parent 34a7e8f commit 1ec9289
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.apache.inlong.manager.common.enums.ErrorCodeEnum;
import org.apache.inlong.manager.common.exceptions.BusinessException;
import org.apache.inlong.manager.common.util.JsonUtils;
import org.apache.inlong.manager.pojo.sink.mysql.MySQLSinkDTO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -77,6 +78,6 @@ public static String convertToJdbcurl(String url) {
if (StringUtils.isNotBlank(jdbcUrl) && !jdbcUrl.startsWith(MYSQL_JDBC_PREFIX)) {
jdbcUrl = MYSQL_JDBC_PREFIX + jdbcUrl;
}
return jdbcUrl;
return MySQLSinkDTO.filterSensitive(jdbcUrl);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

package org.apache.inlong.manager.pojo.sink.mysql;

import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Strings;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
Expand Down Expand Up @@ -217,8 +216,7 @@ public static String setDbNameToUrl(String jdbcUrl, String databaseName) {
* @param url str may have some sensitive params
* @return str without sensitive param
*/
@VisibleForTesting
protected static String filterSensitive(String url) {
public static String filterSensitive(String url) {
if (StringUtils.isBlank(url)) {
return url;
}
Expand Down

0 comments on commit 1ec9289

Please sign in to comment.