This is an automated email from the ASF dual-hosted git repository.
wenjun pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git
The following commit(s) were added to refs/heads/dev by this push:
new 4cebcce195 [Improvement-17573][UI] Update UI label & regarding
variable names & regarding upgrade script (#17666)
4cebcce195 is described below
commit 4cebcce195bcf79fb7c8f847a1d297c972058d51
Author: Shawn Li <[email protected]>
AuthorDate: Tue Nov 18 15:37:20 2025 +0800
[Improvement-17573][UI] Update UI label & regarding variable names &
regarding upgrade script (#17666)
---
docs/docs/en/guide/upgrade/incompatible.md | 4 ++++
.../sql/upgrade/3.3.3_schema/mysql/dolphinscheduler_dml.sql | 2 ++
.../upgrade/3.3.3_schema/postgresql/dolphinscheduler_dml.sql | 2 ++
.../dolphinscheduler/plugin/datasource/ssh/SSHUtils.java | 8 ++++----
.../plugin/datasource/ssh/param/SSHConnectionParam.java | 2 +-
.../plugin/datasource/ssh/param/SSHDataSourceParamDTO.java | 2 +-
.../plugin/datasource/ssh/param/SSHDataSourceProcessor.java | 6 +++---
.../plugin/datasource/ssh/SSHDataSourceProcessorTest.java | 6 +++---
.../plugin/task/remoteshell/RemoteExecutorTest.java | 2 +-
.../plugin/task/remoteshell/RemoteShellTaskTest.java | 2 +-
.../src/test/resources/3.0.0_schema/mysql_3.0.0.sql | 6 ++++++
dolphinscheduler-ui/src/service/modules/data-source/types.ts | 2 +-
dolphinscheduler-ui/src/views/datasource/list/detail.tsx | 10 +++++-----
dolphinscheduler-ui/src/views/datasource/list/use-form.ts | 10 +++++-----
14 files changed, 39 insertions(+), 25 deletions(-)
diff --git a/docs/docs/en/guide/upgrade/incompatible.md
b/docs/docs/en/guide/upgrade/incompatible.md
index 6ca21b2c0f..1c1b679d83 100644
--- a/docs/docs/en/guide/upgrade/incompatible.md
+++ b/docs/docs/en/guide/upgrade/incompatible.md
@@ -38,3 +38,7 @@ This document records the incompatible updates between each
version. You need to
* Drop unused column `other_params_json` in `t_ds_worker_group`
([#16860])(https://github.com/apache/dolphinscheduler/pull/16860)
* Remove the `Dynamic` from the `Task Plugin`
([#16482])(https://github.com/apache/dolphinscheduler/pull/16842)
+## 3.4.0
+
+* Renamed the publicKey field to privateKey in the SSH connection parameters
under the datasource configuration.
([#17666])(https://github.com/apache/dolphinscheduler/pull/17666)
+
diff --git
a/dolphinscheduler-dao/src/main/resources/sql/upgrade/3.3.3_schema/mysql/dolphinscheduler_dml.sql
b/dolphinscheduler-dao/src/main/resources/sql/upgrade/3.3.3_schema/mysql/dolphinscheduler_dml.sql
index 4a14f326b9..67ac6192f8 100644
---
a/dolphinscheduler-dao/src/main/resources/sql/upgrade/3.3.3_schema/mysql/dolphinscheduler_dml.sql
+++
b/dolphinscheduler-dao/src/main/resources/sql/upgrade/3.3.3_schema/mysql/dolphinscheduler_dml.sql
@@ -14,3 +14,5 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
+UPDATE t_ds_datasource SET connection_params = REPLACE(connection_params,
'"publicKey"', '"privateKey"') WHERE type = 17 AND connection_params LIKE
'%"publicKey"%';
diff --git
a/dolphinscheduler-dao/src/main/resources/sql/upgrade/3.3.3_schema/postgresql/dolphinscheduler_dml.sql
b/dolphinscheduler-dao/src/main/resources/sql/upgrade/3.3.3_schema/postgresql/dolphinscheduler_dml.sql
index 4a14f326b9..67ac6192f8 100644
---
a/dolphinscheduler-dao/src/main/resources/sql/upgrade/3.3.3_schema/postgresql/dolphinscheduler_dml.sql
+++
b/dolphinscheduler-dao/src/main/resources/sql/upgrade/3.3.3_schema/postgresql/dolphinscheduler_dml.sql
@@ -14,3 +14,5 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
+UPDATE t_ds_datasource SET connection_params = REPLACE(connection_params,
'"publicKey"', '"privateKey"') WHERE type = 17 AND connection_params LIKE
'%"publicKey"%';
diff --git
a/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-ssh/src/main/java/org/apache/dolphinscheduler/plugin/datasource/ssh/SSHUtils.java
b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-ssh/src/main/java/org/apache/dolphinscheduler/plugin/datasource/ssh/SSHUtils.java
index 7abb18cee8..c1ead768d4 100644
---
a/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-ssh/src/main/java/org/apache/dolphinscheduler/plugin/datasource/ssh/SSHUtils.java
+++
b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-ssh/src/main/java/org/apache/dolphinscheduler/plugin/datasource/ssh/SSHUtils.java
@@ -46,12 +46,12 @@ public class SSHUtils {
session.addPasswordIdentity(password);
}
- // add public key identity
- String publicKey = connectionParam.getPublicKey();
- if (StringUtils.isNotEmpty(publicKey)) {
+ // add private key identity
+ String privateKey = connectionParam.getPrivateKey();
+ if (StringUtils.isNotEmpty(privateKey)) {
try {
KeyPairResourceLoader loader =
SecurityUtils.getKeyPairResourceParser();
- Collection<KeyPair> keyPairCollection =
loader.loadKeyPairs(null, null, null, publicKey);
+ Collection<KeyPair> keyPairCollection =
loader.loadKeyPairs(null, null, null, privateKey);
for (KeyPair keyPair : keyPairCollection) {
session.addPublicKeyIdentity(keyPair);
}
diff --git
a/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-ssh/src/main/java/org/apache/dolphinscheduler/plugin/datasource/ssh/param/SSHConnectionParam.java
b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-ssh/src/main/java/org/apache/dolphinscheduler/plugin/datasource/ssh/param/SSHConnectionParam.java
index 06206ca030..e138f9c06e 100644
---
a/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-ssh/src/main/java/org/apache/dolphinscheduler/plugin/datasource/ssh/param/SSHConnectionParam.java
+++
b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-ssh/src/main/java/org/apache/dolphinscheduler/plugin/datasource/ssh/param/SSHConnectionParam.java
@@ -31,7 +31,7 @@ public class SSHConnectionParam implements ConnectionParam {
protected String password;
- protected String publicKey;
+ protected String privateKey;
protected String host;
diff --git
a/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-ssh/src/main/java/org/apache/dolphinscheduler/plugin/datasource/ssh/param/SSHDataSourceParamDTO.java
b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-ssh/src/main/java/org/apache/dolphinscheduler/plugin/datasource/ssh/param/SSHDataSourceParamDTO.java
index 2773b12b88..23d72c8110 100644
---
a/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-ssh/src/main/java/org/apache/dolphinscheduler/plugin/datasource/ssh/param/SSHDataSourceParamDTO.java
+++
b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-ssh/src/main/java/org/apache/dolphinscheduler/plugin/datasource/ssh/param/SSHDataSourceParamDTO.java
@@ -25,7 +25,7 @@ import lombok.Data;
@Data
public class SSHDataSourceParamDTO extends BaseDataSourceParamDTO {
- protected String publicKey;
+ protected String privateKey;
@Override
public DbType getType() {
diff --git
a/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-ssh/src/main/java/org/apache/dolphinscheduler/plugin/datasource/ssh/param/SSHDataSourceProcessor.java
b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-ssh/src/main/java/org/apache/dolphinscheduler/plugin/datasource/ssh/param/SSHDataSourceProcessor.java
index 1916edba35..75a351612a 100644
---
a/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-ssh/src/main/java/org/apache/dolphinscheduler/plugin/datasource/ssh/param/SSHDataSourceProcessor.java
+++
b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-ssh/src/main/java/org/apache/dolphinscheduler/plugin/datasource/ssh/param/SSHDataSourceProcessor.java
@@ -69,7 +69,7 @@ public class SSHDataSourceProcessor extends
AbstractDataSourceProcessor {
sshDataSourceParamDTO.setPassword(connectionParams.getPassword());
sshDataSourceParamDTO.setHost(connectionParams.getHost());
sshDataSourceParamDTO.setPort(connectionParams.getPort());
- sshDataSourceParamDTO.setPublicKey(connectionParams.getPublicKey());
+ sshDataSourceParamDTO.setPrivateKey(connectionParams.getPrivateKey());
return sshDataSourceParamDTO;
}
@@ -82,7 +82,7 @@ public class SSHDataSourceProcessor extends
AbstractDataSourceProcessor {
sshConnectionParam.setPassword(sshDataSourceParam.getPassword());
sshConnectionParam.setHost(sshDataSourceParam.getHost());
sshConnectionParam.setPort(sshDataSourceParam.getPort());
- sshConnectionParam.setPublicKey(sshDataSourceParam.getPublicKey());
+ sshConnectionParam.setPrivateKey(sshDataSourceParam.getPrivateKey());
return sshConnectionParam;
}
@@ -121,7 +121,7 @@ public class SSHDataSourceProcessor extends
AbstractDataSourceProcessor {
baseConnectionParam.getPort(),
baseConnectionParam.getUser(),
baseConnectionParam.getPassword(),
- baseConnectionParam.getPublicKey())) {
+ baseConnectionParam.getPrivateKey())) {
return sshClientWrapper.isAuth();
} catch (Exception e) {
diff --git
a/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-ssh/src/test/java/org/apache/dolphinscheduler/plugin/datasource/ssh/SSHDataSourceProcessorTest.java
b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-ssh/src/test/java/org/apache/dolphinscheduler/plugin/datasource/ssh/SSHDataSourceProcessorTest.java
index e4ffab1ec3..3efcdf7744 100644
---
a/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-ssh/src/test/java/org/apache/dolphinscheduler/plugin/datasource/ssh/SSHDataSourceProcessorTest.java
+++
b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-ssh/src/test/java/org/apache/dolphinscheduler/plugin/datasource/ssh/SSHDataSourceProcessorTest.java
@@ -38,7 +38,7 @@ public class SSHDataSourceProcessorTest {
private SSHDataSourceProcessor sshDataSourceProcessor;
private String connectJson =
-
"{\"user\":\"lucky\",\"password\":\"123456\",\"host\":\"dolphinscheduler.com\",\"port\":22,
\"publicKey\":\"ssh-rsa AAAAB\"}";
+
"{\"user\":\"lucky\",\"password\":\"123456\",\"host\":\"dolphinscheduler.com\",\"port\":22,
\"privateKey\":\"ssh-rsa AAAAB\"}";
@BeforeEach
public void init() {
@@ -77,7 +77,7 @@ public class SSHDataSourceProcessorTest {
Assertions.assertEquals("123456", sshDataSourceParamDTO.getPassword());
Assertions.assertEquals("dolphinscheduler.com",
sshDataSourceParamDTO.getHost());
Assertions.assertEquals(22, sshDataSourceParamDTO.getPort());
- Assertions.assertEquals("ssh-rsa AAAAB",
sshDataSourceParamDTO.getPublicKey());
+ Assertions.assertEquals("ssh-rsa AAAAB",
sshDataSourceParamDTO.getPrivateKey());
}
@Test
@@ -89,7 +89,7 @@ public class SSHDataSourceProcessorTest {
Assertions.assertEquals("123456", sshConnectionParam.getPassword());
Assertions.assertEquals("dolphinscheduler.com",
sshConnectionParam.getHost());
Assertions.assertEquals(22, sshConnectionParam.getPort());
- Assertions.assertEquals("ssh-rsa AAAAB",
sshConnectionParam.getPublicKey());
+ Assertions.assertEquals("ssh-rsa AAAAB",
sshConnectionParam.getPrivateKey());
}
@Test
diff --git
a/dolphinscheduler-task-plugin/dolphinscheduler-task-remoteshell/src/test/java/org/apache/dolphinscheduler/plugin/task/remoteshell/RemoteExecutorTest.java
b/dolphinscheduler-task-plugin/dolphinscheduler-task-remoteshell/src/test/java/org/apache/dolphinscheduler/plugin/task/remoteshell/RemoteExecutorTest.java
index 3cc9757ce1..1971140e09 100644
---
a/dolphinscheduler-task-plugin/dolphinscheduler-task-remoteshell/src/test/java/org/apache/dolphinscheduler/plugin/task/remoteshell/RemoteExecutorTest.java
+++
b/dolphinscheduler-task-plugin/dolphinscheduler-task-remoteshell/src/test/java/org/apache/dolphinscheduler/plugin/task/remoteshell/RemoteExecutorTest.java
@@ -52,7 +52,7 @@ import org.mockito.junit.jupiter.MockitoExtension;
public class RemoteExecutorTest {
private String connectJson =
-
"{\"user\":\"root\",\"password\":\"123456\",\"host\":\"dolphinscheduler.com\",\"port\":22,
\"publicKey\":\"ssh-rsa AAAAB\"}";
+
"{\"user\":\"root\",\"password\":\"123456\",\"host\":\"dolphinscheduler.com\",\"port\":22,
\"privateKey\":\"ssh-rsa AAAAB\"}";
SSHConnectionParam sshConnectionParam;
diff --git
a/dolphinscheduler-task-plugin/dolphinscheduler-task-remoteshell/src/test/java/org/apache/dolphinscheduler/plugin/task/remoteshell/RemoteShellTaskTest.java
b/dolphinscheduler-task-plugin/dolphinscheduler-task-remoteshell/src/test/java/org/apache/dolphinscheduler/plugin/task/remoteshell/RemoteShellTaskTest.java
index 6a41f48de2..0e6e3ab698 100644
---
a/dolphinscheduler-task-plugin/dolphinscheduler-task-remoteshell/src/test/java/org/apache/dolphinscheduler/plugin/task/remoteshell/RemoteShellTaskTest.java
+++
b/dolphinscheduler-task-plugin/dolphinscheduler-task-remoteshell/src/test/java/org/apache/dolphinscheduler/plugin/task/remoteshell/RemoteShellTaskTest.java
@@ -48,7 +48,7 @@ import org.mockito.junit.jupiter.MockitoExtension;
public class RemoteShellTaskTest {
private String connectJson =
-
"{\"user\":\"root\",\"password\":\"123456\",\"host\":\"dolphinscheduler.com\",\"port\":22,
\"publicKey\":\"ssh-rsa AAAAB\"}";
+
"{\"user\":\"root\",\"password\":\"123456\",\"host\":\"dolphinscheduler.com\",\"port\":22,
\"privateKey\":\"ssh-rsa AAAAB\"}";
SSHConnectionParam sshConnectionParam;
diff --git
a/dolphinscheduler-tools/src/test/resources/3.0.0_schema/mysql_3.0.0.sql
b/dolphinscheduler-tools/src/test/resources/3.0.0_schema/mysql_3.0.0.sql
index 5685464475..a0f4f00a5b 100644
--- a/dolphinscheduler-tools/src/test/resources/3.0.0_schema/mysql_3.0.0.sql
+++ b/dolphinscheduler-tools/src/test/resources/3.0.0_schema/mysql_3.0.0.sql
@@ -371,6 +371,12 @@ CREATE TABLE `t_ds_datasource` (
-- ----------------------------
-- Records of t_ds_datasource
-- ----------------------------
+INSERT INTO `t_ds_datasource`
+(`id`, `name`, `note`, `type`, `user_id`, `connection_params`, `create_time`,
`update_time`)
+VALUES
+(2, 'ssh_test_server', 'ssh test server', 17, 1,
+'{"user":"admin","publicKey":"-----BEGIN RSA PRIVATE
KEY-----\\nMIIEpAIBAAKCAQEA...\\n-----END RSA PRIVATE
KEY-----","host":"10.0.0.50","port":2222}',
+'2021-06-30 00:00:00', '2021-06-30 00:00:00');
-- ----------------------------
-- Table structure for t_ds_error_command
diff --git a/dolphinscheduler-ui/src/service/modules/data-source/types.ts
b/dolphinscheduler-ui/src/service/modules/data-source/types.ts
index 336d7dc861..cd6badccb4 100644
--- a/dolphinscheduler-ui/src/service/modules/data-source/types.ts
+++ b/dolphinscheduler-ui/src/service/modules/data-source/types.ts
@@ -95,7 +95,7 @@ interface IDataSource {
MSIClientId?: string
dbUser?: string
compatibleMode?: string
- publicKey?: string
+ privateKey?: string
datawarehouse?: string
accessKeyId?: string
accessKeySecret?: string
diff --git a/dolphinscheduler-ui/src/views/datasource/list/detail.tsx
b/dolphinscheduler-ui/src/views/datasource/list/detail.tsx
index d8b1cb1f9f..6f12176f79 100644
--- a/dolphinscheduler-ui/src/views/datasource/list/detail.tsx
+++ b/dolphinscheduler-ui/src/views/datasource/list/detail.tsx
@@ -166,7 +166,7 @@ const DetailModal = defineComponent({
showMode,
showDataBaseName,
showJDBCConnectParameters,
- showPublicKey,
+ showPrivateKey,
showNamespace,
showKubeConfig,
modeOptions,
@@ -739,12 +739,12 @@ const DetailModal = defineComponent({
/>
</NFormItem>
<NFormItem
- v-show={showPublicKey}
- label='PublicKey'
- path='publicKey'
+ v-show={showPrivateKey}
+ label='PrivateKey'
+ path='privateKey'
>
<NInput
- v-model={[detailForm.publicKey, 'value']}
+ v-model={[detailForm.privateKey, 'value']}
type='textarea'
autosize={{
minRows: 4
diff --git a/dolphinscheduler-ui/src/views/datasource/list/use-form.ts
b/dolphinscheduler-ui/src/views/datasource/list/use-form.ts
index e239098274..9701c79381 100644
--- a/dolphinscheduler-ui/src/views/datasource/list/use-form.ts
+++ b/dolphinscheduler-ui/src/views/datasource/list/use-form.ts
@@ -68,7 +68,7 @@ export function useForm(id?: number) {
showMode: false,
showDataBaseName: true,
showJDBCConnectParameters: true,
- showPublicKey: false,
+ showPrivateKey: false,
showNamespace: false,
showKubeConfig: false,
showAccessKeyId: false,
@@ -282,13 +282,13 @@ export function useForm(id?: number) {
state.showDataBaseName = false
state.requiredDataBase = false
state.showJDBCConnectParameters = false
- state.showPublicKey = false
+ state.showPrivateKey = false
if (type === 'DOLPHINDB') {
state.showJDBCConnectParameters = true
- state.showPublicKey = false
+ state.showPrivateKey = false
}
if (type === 'SSH') {
- state.showPublicKey = true
+ state.showPrivateKey = true
}
if (type === 'ZEPPELIN') {
state.showHost = false
@@ -327,7 +327,7 @@ export function useForm(id?: number) {
state.showDataBaseName = true
state.requiredDataBase = true
state.showJDBCConnectParameters = true
- state.showPublicKey = false
+ state.showPrivateKey = false
state.showRestEndpoint = false
state.showNamespace = false
state.showKubeConfig = false