From 666af23c67871d301fe188420440e48075b7ee3c Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Tue, 6 Aug 2024 13:49:27 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-114392=20FR-FBP=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E6=9C=AC=E5=9C=B0=E8=AE=BE=E8=AE=A1=E9=80=82=E9=85=8D=20?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E8=BF=9E=E6=8E=A5=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 3 ++- .../datapane/preview/ConnectionInfoBeanHelper.java | 10 +++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index 268fdbc456..b7a3488762 100644 --- a/build.gradle +++ b/build.gradle @@ -83,6 +83,7 @@ allprojects { // 门户 implementation 'com.fr.portal:fine-portal:' + apiVersion implementation 'com.fr.portal:fine-portal-api:' + apiVersion + implementation 'com.fr.portal:fine-portal-datasource:' + carinaVersion // cbb implementation 'com.fr.essential:fine-essential:' + cbbVersion implementation 'com.fr.cbb:fine-universal-skeleton:' + cbbVersion @@ -98,6 +99,7 @@ allprojects { implementation 'com.fr.auth:fine-auth:' + apiVersion implementation 'com.fr.auth:fine-auth-api:' + apiVersion // lic + implementation 'com.fr.license:fine-license:' + apiVersion implementation 'com.fr.license:fine-license-api:' + apiVersion // cluster implementation 'com.fr.cluster:fine-cluster-api:' + apiVersion @@ -116,7 +118,6 @@ allprojects { implementation 'io.socket:socket.io-client:0.7.0' implementation('com.fr.third:fine-third:' + frVersion) { exclude group: "com.fr.cbb", module: "fine-cbb" } implementation 'com.fr.core:fine-core:' + frDevVersion - implementation 'com.fr.activator:fine-activator:' + frVersion implementation 'com.fr.datasource:fine-datasource-api:' + fdlVersion implementation 'com.fr.datasource:fine-datasource-core:' + fdlVersion implementation 'com.fr.datasource:fine-datasource-web:' + fdlVersion diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/ConnectionInfoBeanHelper.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/ConnectionInfoBeanHelper.java index 571becabf4..f35932e0e9 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/ConnectionInfoBeanHelper.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/ConnectionInfoBeanHelper.java @@ -19,10 +19,10 @@ import com.fr.decision.webservice.bean.datasource.JDBCConnectionBean; import com.fr.decision.webservice.utils.DecisionServiceConstants; import com.fr.decision.webservice.v10.datasource.connection.processor.impl.ConnectionProcessorFactory; import com.fr.decision.webservice.v10.datasource.connection.processor.impl.JDBCConnectionProcessor; -import com.fr.security.encryption.transmission.TransmissionEncryptors; +import com.fr.security.encryption.transmission.TransmissionEncryptionManager; import com.fr.stable.StringUtils; import com.fr.third.fasterxml.jackson.databind.ObjectMapper; - +import com.fr.workspace.server.repository.WorkplaceConstants; /** * 数据连接传输工具类 * @@ -95,7 +95,7 @@ public class ConnectionInfoBeanHelper { .user(jdbcConnection.getUser()) .driver(jdbcConnection.getDriver()) // 关键中的关键,由设计器发出的请求如果要携带密码,不能传明文,必须必须必须传加密后的密码 - .password(withPassword ? TransmissionEncryptors.getInstance().encrypt(jdbcConnection.getPassword()) : DecisionServiceConstants.DEFAULT_PASSWORD) + .password(withPassword ? encrypt(jdbcConnection.getPassword()) : DecisionServiceConstants.DEFAULT_PASSWORD) .schema(jdbcConnection.getSchema()) .url(jdbcConnection.getURL()) .creator(jdbcConnection.getCreator()) @@ -126,4 +126,8 @@ public class ConnectionInfoBeanHelper { .verifyCa(jdbcConnection.getSsl().getSslType() == SslType.NORMAL && ((NormalSsl) jdbcConnection.getSsl()).isVerifyCa()); } + private static String encrypt(String password) { + return TransmissionEncryptionManager.getInstance().getEncryption(WorkplaceConstants.getEncryptionMode()).encrypt(password, WorkplaceConstants.getEncryptionKey()); + } + }