Compare commits

...

10 Commits

Author SHA1 Message Date
jzhao-talend
1796a156b9 chore(TPS-5390):update patch note 2022-12-01 20:06:50 +08:00
jzhao-talend
7b7c6f8d4a chore(TPS-5390):update patch note 2022-12-01 19:12:26 +08:00
jzhao-talend
5c7208bfdc chore(TPS-5390):add patch note 2022-12-01 18:48:43 +08:00
vyu-talend
92ecf8b209 fix(TPS-5390):fix codes. 2022-11-30 12:04:25 +08:00
vyu-talend
d8f90f86b0 fix(TPS-5390):fix codes. 2022-11-29 02:50:21 +08:00
vyu-talend
77f051be44 Merge branch 'maintenance/8.0' into patch/TPS-5390 2022-11-28 22:02:51 +08:00
vyu-talend
8efda3a5d7 fix(TPS-5390):fix codes. 2022-11-28 21:56:49 +08:00
vyu-talend
f911864a8a fix(TPS-5390):add migration task to xml. 2022-11-25 15:50:00 +08:00
vyu-talend
01dee98df9 fix(TPS-5390):test patch. 2022-11-24 12:14:59 +08:00
vyu-talend
8ed04db4b7 fix(TPS-5390):test patch. 2022-11-23 19:37:56 +08:00
4 changed files with 160 additions and 1 deletions

48
PATCH_RELEASE_NOTE.md Normal file
View File

@@ -0,0 +1,48 @@
---
version: 8.0.1
module: https://talend.poolparty.biz/coretaxonomy/42
product:
- https://talend.poolparty.biz/coretaxonomy/183
- https://talend.poolparty.biz/coretaxonomy/23
---
# TPS-5390
| Info | Value |
| ---------------- | ---------------- |
| Patch Name | Patch\_20221202\_TPS-5390\_v1-8.0.1 |
| Release date | 2022-12-02 |
| Target version | 20211109\_1610-8.0.1 |
| Product affected | Talend Studio |
## Introduction
This is a self-contained patch.
**NOTE**: For information on how to obtain this patch, reach out to your Support contact at Talend.
## Fixed issues
This patch contains the following fix:
- TDI-48617 [8.0.1] tFTPConnection : Sftp issue after R2022-08 jsch-0.2.1 library ( PubkeyAcceptedKeyTypes )
## Prerequisites
Consider the following requirements for your system:
- Must install Talend Studio 8.0.1 with the monthly released patch, Patch\_20220819\_R2022-08_v1-8.0.1.zip.
- Or must update the Talend Studio 8.0.1 with the URL, https://update.talend.com/Studio/8/updates/R2022-08/.
## Installation
Installation On Studio:
1. Shut down Talend studio if it is opened.
2. Extract the zip.
3. Merge the folder "plugins" and its content to "{studio}/plugins" and overwrite the existing files.
4. remove the folder "{studio}/configuration/org.eclipse.osgi".
5. Start the Talend studio.
6. Rebuild your jobs.

View File

@@ -3811,6 +3811,15 @@
name="tFtileInputJson convert USE_NASHORN to JDK_VERSION"
version="8.0.1">
</projecttask>
<projecttask
beforeLogon="false"
breaks="8.0.1"
class="org.talend.repository.model.migration.AddPubkeyAcceptedKeyTypesToFTPTPS5390"
description="Add PubkeyAcceptedKeyTypes configuration when using sftp"
id="org.talend.repository.model.migration.AddPubkeyAcceptedKeyTypesToFTPTPS5390"
name="AddPubkeyAcceptedKeyTypesToFTPTPS5390"
version="8.0.1">
</projecttask>
</extension>
<extension

View File

@@ -116,4 +116,4 @@ public class AddClientParamsToFTPTDI44761 extends AbstractJobMigrationTask {
return ExecutionResult.FAILURE;
}
}
}
}

View File

@@ -0,0 +1,102 @@
package org.talend.repository.model.migration;
import java.util.*;
import org.eclipse.emf.common.util.EList;
import org.talend.commons.ui.runtime.exception.ExceptionHandler;
import org.talend.core.language.ECodeLanguage;
import org.talend.core.model.components.ComponentUtilities;
import org.talend.core.model.components.ModifyComponentsAction;
import org.talend.core.model.components.conversions.IComponentConversion;
import org.talend.core.model.components.filters.IComponentFilter;
import org.talend.core.model.components.filters.NameComponentFilter;
import org.talend.core.model.migration.AbstractJobMigrationTask;
import org.talend.core.model.properties.Item;
import org.talend.designer.core.model.utils.emf.talendfile.*;
public class AddPubkeyAcceptedKeyTypesToFTPTPS5390 extends AbstractJobMigrationTask {
/*
* (non-Javadoc)
*
* @see org.talend.migration.IMigrationTask#getOrder()
*/
public Date getOrder() {
GregorianCalendar gc = new GregorianCalendar(2022, 10, 24, 11, 0, 0);
return gc.getTime();
}
/*
* (non-Javadoc)
*
* @seeorg.talend.core.model.migration.AbstractJobMigrationTask#executeOnProcess(org.talend.core.model.properties.
* ProcessItem)
*/
@Override
public ExecutionResult execute(Item item) {
ProcessType processType = getProcessType(item);
if (getProject().getLanguage() != ECodeLanguage.JAVA || processType == null) {
return ExecutionResult.NOTHING_TO_DO;
}
String[] componentsName = new String[] { "tFTPConnection","tFTPDelete","tFTPFileExist","tFTPFileList",
"tFTPFileProperties","tFTPGet","tFTPPut","tFTPRename","tFTPTruncate" };
try {
boolean modified = false;
for (int i = 0; i < componentsName.length; i++) {
IComponentFilter filter = new NameComponentFilter(componentsName[i]);
modified |= ModifyComponentsAction.searchAndModify(item, processType, filter,
Arrays.<IComponentConversion> asList(new IComponentConversion() {
public void transform(NodeType node) {
String useExistConnection = ComponentUtilities.getNodePropertyValue(node, "USE_EXISTING_CONNECTION");
boolean ifConfigClient = "true".equals(ComponentUtilities.getNodePropertyValue(node, "CONFIG_CLIENT"));
boolean useSFTP = "true".equals(ComponentUtilities.getNodePropertyValue(node, "SFTP"));
if (useSFTP && (useExistConnection == null || "false". equals(useExistConnection)) && ifConfigClient) {
final ElementParameterType client_parameters = ComponentUtilities.getNodeProperty(node, "CLIENT_PARAMETERS");
boolean ifHasKey = false;
final EList configurations = client_parameters.getElementValue();
final Iterator iterator = configurations.iterator();
while (iterator.hasNext()){
final ElementValueType next = (ElementValueType)iterator.next();
if(next.getValue().trim().equalsIgnoreCase("\"PubkeyAcceptedKeyTypes\"")){
ifHasKey = true;
}
}
if (!ifHasKey) {
TalendFileFactory fileFact = TalendFileFactory.eINSTANCE;
ElementValueType elementKey = fileFact.createElementValueType();
elementKey.setElementRef("PARAMETER"); //$NON-NLS-1$
elementKey.setValue("\"PubkeyAcceptedKeyTypes\"");
configurations.add(elementKey);
ElementValueType elementValue = fileFact.createElementValueType();
elementValue.setElementRef("VALUE"); //$NON-NLS-1$
elementValue.setValue("\"ssh-rsa\"");
configurations.add(elementValue);
ComponentUtilities.setNodeProperty(node, "CLIENT_PARAMETERS", configurations);
}
}
}
}));
}
if (modified) {
return ExecutionResult.SUCCESS_NO_ALERT;
} else {
return ExecutionResult.NOTHING_TO_DO;
}
} catch (Exception e) {
ExceptionHandler.process(e);
return ExecutionResult.FAILURE;
}
}
}