Skip to content

Commit 4cebcce

Browse files
[Improvement-17573][UI] Update UI label & regarding variable names & regarding upgrade script (#17666)
1 parent 0823c2f commit 4cebcce

14 files changed

Lines changed: 39 additions & 25 deletions

File tree

‎docs/docs/en/guide/upgrade/incompatible.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,7 @@ This document records the incompatible updates between each version. You need to
3838
* Drop unused column `other_params_json` in `t_ds_worker_group` ([#16860])(https://github.com/apache/dolphinscheduler/pull/16860)
3939
* Remove the `Dynamic` from the `Task Plugin` ([#16482])(https://github.com/apache/dolphinscheduler/pull/16842)
4040

41+
## 3.4.0
42+
43+
* Renamed the publicKey field to privateKey in the SSH connection parameters under the datasource configuration. ([#17666])(https://github.com/apache/dolphinscheduler/pull/17666)
44+

‎dolphinscheduler-dao/src/main/resources/sql/upgrade/3.3.3_schema/mysql/dolphinscheduler_dml.sql‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,5 @@
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
1616
*/
17+
18+
UPDATE t_ds_datasource SET connection_params = REPLACE(connection_params, '"publicKey"', '"privateKey"') WHERE type = 17 AND connection_params LIKE '%"publicKey"%';

‎dolphinscheduler-dao/src/main/resources/sql/upgrade/3.3.3_schema/postgresql/dolphinscheduler_dml.sql‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,5 @@
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
1616
*/
17+
18+
UPDATE t_ds_datasource SET connection_params = REPLACE(connection_params, '"publicKey"', '"privateKey"') WHERE type = 17 AND connection_params LIKE '%"publicKey"%';

‎dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-ssh/src/main/java/org/apache/dolphinscheduler/plugin/datasource/ssh/SSHUtils.java‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ public static ClientSession getSession(SshClient client, SSHConnectionParam conn
4646
session.addPasswordIdentity(password);
4747
}
4848

49-
// add public key identity
50-
String publicKey = connectionParam.getPublicKey();
51-
if (StringUtils.isNotEmpty(publicKey)) {
49+
// add private key identity
50+
String privateKey = connectionParam.getPrivateKey();
51+
if (StringUtils.isNotEmpty(privateKey)) {
5252
try {
5353
KeyPairResourceLoader loader = SecurityUtils.getKeyPairResourceParser();
54-
Collection<KeyPair> keyPairCollection = loader.loadKeyPairs(null, null, null, publicKey);
54+
Collection<KeyPair> keyPairCollection = loader.loadKeyPairs(null, null, null, privateKey);
5555
for (KeyPair keyPair : keyPairCollection) {
5656
session.addPublicKeyIdentity(keyPair);
5757
}

‎dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-ssh/src/main/java/org/apache/dolphinscheduler/plugin/datasource/ssh/param/SSHConnectionParam.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public class SSHConnectionParam implements ConnectionParam {
3131

3232
protected String password;
3333

34-
protected String publicKey;
34+
protected String privateKey;
3535

3636
protected String host;
3737

‎dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-ssh/src/main/java/org/apache/dolphinscheduler/plugin/datasource/ssh/param/SSHDataSourceParamDTO.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
@Data
2626
public class SSHDataSourceParamDTO extends BaseDataSourceParamDTO {
2727

28-
protected String publicKey;
28+
protected String privateKey;
2929

3030
@Override
3131
public DbType getType() {

‎dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-ssh/src/main/java/org/apache/dolphinscheduler/plugin/datasource/ssh/param/SSHDataSourceProcessor.java‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public BaseDataSourceParamDTO createDatasourceParamDTO(String connectionJson) {
6969
sshDataSourceParamDTO.setPassword(connectionParams.getPassword());
7070
sshDataSourceParamDTO.setHost(connectionParams.getHost());
7171
sshDataSourceParamDTO.setPort(connectionParams.getPort());
72-
sshDataSourceParamDTO.setPublicKey(connectionParams.getPublicKey());
72+
sshDataSourceParamDTO.setPrivateKey(connectionParams.getPrivateKey());
7373

7474
return sshDataSourceParamDTO;
7575
}
@@ -82,7 +82,7 @@ public SSHConnectionParam createConnectionParams(BaseDataSourceParamDTO dataSour
8282
sshConnectionParam.setPassword(sshDataSourceParam.getPassword());
8383
sshConnectionParam.setHost(sshDataSourceParam.getHost());
8484
sshConnectionParam.setPort(sshDataSourceParam.getPort());
85-
sshConnectionParam.setPublicKey(sshDataSourceParam.getPublicKey());
85+
sshConnectionParam.setPrivateKey(sshDataSourceParam.getPrivateKey());
8686

8787
return sshConnectionParam;
8888
}
@@ -121,7 +121,7 @@ public boolean checkDataSourceConnectivity(ConnectionParam connectionParam) {
121121
baseConnectionParam.getPort(),
122122
baseConnectionParam.getUser(),
123123
baseConnectionParam.getPassword(),
124-
baseConnectionParam.getPublicKey())) {
124+
baseConnectionParam.getPrivateKey())) {
125125

126126
return sshClientWrapper.isAuth();
127127
} catch (Exception e) {

‎dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-ssh/src/test/java/org/apache/dolphinscheduler/plugin/datasource/ssh/SSHDataSourceProcessorTest.java‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public class SSHDataSourceProcessorTest {
3838
private SSHDataSourceProcessor sshDataSourceProcessor;
3939

4040
private String connectJson =
41-
"{\"user\":\"lucky\",\"password\":\"123456\",\"host\":\"dolphinscheduler.com\",\"port\":22, \"publicKey\":\"ssh-rsa AAAAB\"}";
41+
"{\"user\":\"lucky\",\"password\":\"123456\",\"host\":\"dolphinscheduler.com\",\"port\":22, \"privateKey\":\"ssh-rsa AAAAB\"}";
4242

4343
@BeforeEach
4444
public void init() {
@@ -77,7 +77,7 @@ void testCreateDatasourceParamDTO() {
7777
Assertions.assertEquals("123456", sshDataSourceParamDTO.getPassword());
7878
Assertions.assertEquals("dolphinscheduler.com", sshDataSourceParamDTO.getHost());
7979
Assertions.assertEquals(22, sshDataSourceParamDTO.getPort());
80-
Assertions.assertEquals("ssh-rsa AAAAB", sshDataSourceParamDTO.getPublicKey());
80+
Assertions.assertEquals("ssh-rsa AAAAB", sshDataSourceParamDTO.getPrivateKey());
8181
}
8282

8383
@Test
@@ -89,7 +89,7 @@ void testCreateConnectionParams() {
8989
Assertions.assertEquals("123456", sshConnectionParam.getPassword());
9090
Assertions.assertEquals("dolphinscheduler.com", sshConnectionParam.getHost());
9191
Assertions.assertEquals(22, sshConnectionParam.getPort());
92-
Assertions.assertEquals("ssh-rsa AAAAB", sshConnectionParam.getPublicKey());
92+
Assertions.assertEquals("ssh-rsa AAAAB", sshConnectionParam.getPrivateKey());
9393
}
9494

9595
@Test

‎dolphinscheduler-task-plugin/dolphinscheduler-task-remoteshell/src/test/java/org/apache/dolphinscheduler/plugin/task/remoteshell/RemoteExecutorTest.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
public class RemoteExecutorTest {
5353

5454
private String connectJson =
55-
"{\"user\":\"root\",\"password\":\"123456\",\"host\":\"dolphinscheduler.com\",\"port\":22, \"publicKey\":\"ssh-rsa AAAAB\"}";
55+
"{\"user\":\"root\",\"password\":\"123456\",\"host\":\"dolphinscheduler.com\",\"port\":22, \"privateKey\":\"ssh-rsa AAAAB\"}";
5656

5757
SSHConnectionParam sshConnectionParam;
5858

‎dolphinscheduler-task-plugin/dolphinscheduler-task-remoteshell/src/test/java/org/apache/dolphinscheduler/plugin/task/remoteshell/RemoteShellTaskTest.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
public class RemoteShellTaskTest {
4949

5050
private String connectJson =
51-
"{\"user\":\"root\",\"password\":\"123456\",\"host\":\"dolphinscheduler.com\",\"port\":22, \"publicKey\":\"ssh-rsa AAAAB\"}";
51+
"{\"user\":\"root\",\"password\":\"123456\",\"host\":\"dolphinscheduler.com\",\"port\":22, \"privateKey\":\"ssh-rsa AAAAB\"}";
5252

5353
SSHConnectionParam sshConnectionParam;
5454

0 commit comments

Comments
 (0)