You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by ki...@apache.org on 2021/07/19 08:14:43 UTC
[dolphinscheduler] branch 1.3.7-prepare_#5737 created (now 8fdd306)
This is an automated email from the ASF dual-hosted git repository.
kirs pushed a change to branch 1.3.7-prepare_#5737
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git.
at 8fdd306 [1.3.7-prepare#5737][Datasource] datsource other param check error
This branch includes the following new commits:
new 8fdd306 [1.3.7-prepare#5737][Datasource] datsource other param check error
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[dolphinscheduler] 01/01: [1.3.7-prepare#5737][Datasource]
datsource other param check error
Posted by ki...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
kirs pushed a commit to branch 1.3.7-prepare_#5737
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git
commit 8fdd306773c92d598be6490bf034b0e8c8a7e306
Author: CalvinKirs <ki...@apache.org>
AuthorDate: Mon Jul 19 16:14:25 2021 +0800
[1.3.7-prepare#5737][Datasource] datsource other param check error
---
.../apache/dolphinscheduler/api/service/DataSourceService.java | 2 +-
.../dolphinscheduler/api/service/DataSourceServiceTest.java | 8 +++-----
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/DataSourceService.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/DataSourceService.java
index 38ffee0..c3456e2 100644
--- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/DataSourceService.java
+++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/DataSourceService.java
@@ -80,7 +80,7 @@ public class DataSourceService extends BaseService{
private static final Pattern DATABASE_PATTER = Pattern.compile("^[a-zA-Z0-9\\_\\-\\.]+$");
- private static final Pattern PARAMS_PATTER = Pattern.compile("^[a-zA-Z0-9]+$");
+ private static final Pattern PARAMS_PATTER = Pattern.compile("^[a-zA-Z0-9\\-\\_\\/]+$");
@Autowired
diff --git a/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/DataSourceServiceTest.java b/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/DataSourceServiceTest.java
index 070160d..367499a 100644
--- a/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/DataSourceServiceTest.java
+++ b/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/DataSourceServiceTest.java
@@ -102,18 +102,16 @@ public class DataSourceServiceTest {
@Test
public void buildParameterWithDecodePassword() {
PropertyUtils.setValue(Constants.DATASOURCE_ENCRYPTION_ENABLE, "true");
- String other = "{\"autoDeserialize\":\"yes\",\"allowUrlInLocalInfile\":\"true\"}";
+ String other = "{\"autoDeserialize\":\"yes\",\"allowUrlInLocalInfile\":\"true\",\"serverTimezone\":\"Asia/Shanghai\",\"queryTimeout\":\"-1\",\"characterEncoding\":\"utf8\"}";
String param = dataSourceService.buildParameter("root","test",DbType.MYSQL, "192.168.9.1", "1521", "im"
, "", "test", "123456", null, other);
- String expected = "{\"address\":\"jdbc:mysql://192.168.9.1:1521\",\"database\":\"im\",\"jdbcUrl\":\"jdbc:mysql://192.168.9.1:1521/im\","
- + "\"user\":\"test\",\"password\":\"123456\"}";
+ String expected = "{\"address\":\"jdbc:mysql://192.168.9.1:1521\",\"database\":\"im\",\"jdbcUrl\":\"jdbc:mysql://192.168.9.1:1521/im\",\"user\":\"test\",\"password\":\"123456\",\"other\":\"serverTimezone=Asia/Shanghai&queryTimeout=-1&characterEncoding=utf8\"}";
Assert.assertEquals(expected, param);
PropertyUtils.setValue(Constants.DATASOURCE_ENCRYPTION_ENABLE, "false");
param = dataSourceService.buildParameter("root","test",DbType.MYSQL, "192.168.9.1", "1521", "im"
, "", "test", "123456", null, other);
- expected = "{\"address\":\"jdbc:mysql://192.168.9.1:1521\",\"database\":\"im\",\"jdbcUrl\":\"jdbc:mysql://192.168.9.1:1521/im\","
- + "\"user\":\"test\",\"password\":\"123456\"}";
+ expected = "{\"address\":\"jdbc:mysql://192.168.9.1:1521\",\"database\":\"im\",\"jdbcUrl\":\"jdbc:mysql://192.168.9.1:1521/im\",\"user\":\"test\",\"password\":\"123456\",\"other\":\"serverTimezone=Asia/Shanghai&queryTimeout=-1&characterEncoding=utf8\"}";
Assert.assertEquals(expected, param);
}