Skip to content
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 @@ -77,7 +77,7 @@ object DolphinToSpark {
case wds.BigIntType => LongType
case wds.FloatType => FloatType
case wds.DoubleType => DoubleType
case wds.DecimalType => DecimalType(bigDecimalPrecision, bigDecimalScale)
case wds.DecimalType(dataType, 3) => DecimalType(bigDecimalPrecision, bigDecimalScale)
case wds.DateType => DateType
// case wds.TimestampType => TimestampType
case wds.BinaryType => BinaryType
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,8 @@ public Message insertJsonInfo(@RequestBody DataSource dataSource, HttpServletReq
AESUtils.encrypt(
connectParams.get("password").toString(),
AESUtils.LINKIS_DATASOURCE_AES_KEY.getValue()));
// 标记密码已经加密
dataSource.getConnectParams().put("isEncrypt", "1");
}
insertDataSource(dataSource);
return Message.ok().data("insertId", dataSource.getId());
Expand Down Expand Up @@ -270,6 +272,19 @@ public Message updateDataSourceInJson(
dataSource.setKeyDefinitions(keyDefinitionList);

Map<String, Object> connectParams = dataSource.getConnectParams();

if (AESUtils.LINKIS_DATASOURCE_AES_SWITCH.getValue()) {
dataSource
.getConnectParams()
.replace(
"password",
AESUtils.encrypt(
connectParams.get("password").toString(),
AESUtils.LINKIS_DATASOURCE_AES_KEY.getValue()));
// 标记密码已经加密
dataSource.getConnectParams().put("isEncrypt", "1");
}

// add default value filed
keyDefinitionList.forEach(
keyDefinition -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ public static void encryptPasswordKey(
if (AESUtils.LINKIS_DATASOURCE_AES_SWITCH.getValue()) {
passwordStr =
AESUtils.encrypt(passwordStr, AESUtils.LINKIS_DATASOURCE_AES_KEY.getValue());
connectParams.put("isEncrypt", "1");
} else {
passwordStr = CryptoUtils.object2String(passwordStr);
}
Expand Down