Compare commits
2 Commits
patch/TPS-
...
dgrygorenk
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7f7b94db5c | ||
|
|
b68fb44342 |
@@ -5,13 +5,13 @@ product:
|
||||
- https://talend.poolparty.biz/coretaxonomy/23
|
||||
---
|
||||
|
||||
# TPS-3315
|
||||
# TPS-4124
|
||||
|
||||
| Info | Value |
|
||||
| ---------------- | ---------------- |
|
||||
| Patch Name | Patch\_20190812_TPS-3315\_v1-7.2.1 |
|
||||
| Release Date | 2019-08-12 |
|
||||
| Target Version | Talend-Studio-20190620\_1446-V7.2.1 |
|
||||
| Patch Name | Patch\_20200615\_TPS-4124\_v1-7.2.1 |
|
||||
| Release Date | 2020-06-15 |
|
||||
| Target Version | 20190620\_1446-V7.2.1 |
|
||||
| Product affected | Talend Studio |
|
||||
|
||||
## Introduction
|
||||
@@ -24,7 +24,7 @@ This is a self-contained patch.
|
||||
|
||||
This patch contains the following fixes:
|
||||
|
||||
- TPS-3315 [7.2.1] Additional JDBC Parameter exposes the password when using a context variable of password type (TDI-42721)
|
||||
- TPS-4124 [7.2.1] ClassCastException with tLibraryLoad's Dynamics Libs in Java 11 (TDI-44305)
|
||||
|
||||
## Prerequisites
|
||||
|
||||
@@ -32,7 +32,6 @@ Consider the following requirements for your system:
|
||||
|
||||
- Talend Studio 7.2.1 must be installed.
|
||||
|
||||
|
||||
## Installation
|
||||
|
||||
### Installing the patch using Software update
|
||||
@@ -64,46 +63,4 @@ Backup the Affected files list below. Uninstall the patch by restore the backup
|
||||
|
||||
The following files are installed by this patch:
|
||||
|
||||
- {Talend\_Studio\_path}/plugins/org.talend.designer.components.localprovider\_7.2.1.20190614\_0309/components/tELTMSSqlMap/tELTMSSqlMap\_main.javajet
|
||||
- {Talend\_Studio\_path}/plugins/org.talend.designer.components.localprovider\_7.2.1.20190614\_0309/components/tELTMysqlMap/tELTMysqlMap\_main.javajet
|
||||
- {Talend\_Studio\_path}/plugins/org.talend.designer.components.localprovider\_7.2.1.20190614\_0309/components/tELTOracleMap/tELTOracleMap\_main.javajet
|
||||
- {Talend\_Studio\_path}/plugins/org.talend.designer.components.localprovider\_7.2.1.20190614\_0309/components/templates/DB/CheckContextPassword.javajet
|
||||
- {Talend\_Studio\_path}/plugins/org.talend.designer.components.localprovider\_7.2.1.20190614\_0309/components/tMSSqlBulkExec/tMSSqlBulkExec\_begin.javajet
|
||||
- {Talend\_Studio\_path}/plugins/org.talend.designer.components.localprovider\_7.2.1.20190614\_0309/components/tMSSqlConnection/tMSSqlConnection\_begin.javajet
|
||||
- {Talend\_Studio\_path}/plugins/org.talend.designer.components.localprovider\_7.2.1.20190614\_0309/components/tMSSqlInput/tMSSqlInput\_begin.javajet
|
||||
- {Talend\_Studio\_path}/plugins/org.talend.designer.components.localprovider\_7.2.1.20190614\_0309/components/tMSSqlOutput/tMSSqlOutput\_begin.javajet
|
||||
- {Talend\_Studio\_path}/plugins/org.talend.designer.components.localprovider\_7.2.1.20190614\_0309/components/tMSSqlRow/tMSSqlRow\_begin.javajet
|
||||
- {Talend\_Studio\_path}/plugins/org.talend.designer.components.localprovider\_7.2.1.20190614\_0309/components/tMSSqlSCD/tMSSqlSCD\_begin.javajet
|
||||
- {Talend\_Studio\_path}/plugins/org.talend.designer.components.localprovider\_7.2.1.20190614\_0309/components/tMSSqlSP/tMSSqlSP\_begin.javajet
|
||||
- {Talend\_Studio\_path}/plugins/org.talend.designer.components.localprovider\_7.2.1.20190614\_0309/components/tMysqlBulkExec/tMysqlBulkExec\_begin.javajet
|
||||
- {Talend\_Studio\_path}/plugins/org.talend.designer.components.localprovider\_7.2.1.20190614\_0309/components/tMysqlConnection/tMysqlConnection\_begin.javajet
|
||||
- {Talend\_Studio\_path}/plugins/org.talend.designer.components.localprovider\_7.2.1.20190614\_0309/components/tMysqlInput/tMysqlInput\_begin.javajet
|
||||
- {Talend\_Studio\_path}/plugins/org.talend.designer.components.localprovider\_7.2.1.20190614\_0309/components/tMysqlOutput/tMysqlOutput\_begin.javajet
|
||||
- {Talend\_Studio\_path}/plugins/org.talend.designer.components.localprovider\_7.2.1.20190614\_0309/components/tMysqlRow/tMysqlRow\_begin.javajet
|
||||
- {Talend\_Studio\_path}/plugins/org.talend.designer.components.localprovider\_7.2.1.20190614\_0309/components/tMysqlSCD/tMysqlSCD\_begin.javajet
|
||||
- {Talend\_Studio\_path}/plugins/org.talend.designer.components.localprovider\_7.2.1.20190614\_0309/components/tMysqlSCDELT/tMysqlSCDELT\_begin.javajet
|
||||
- {Talend\_Studio\_path}/plugins/org.talend.designer.components.localprovider\_7.2.1.20190614\_0309/components/tMysqlSP/tMysqlSP\_begin.javajet
|
||||
- {Talend\_Studio\_path}/plugins/org.talend.designer.components.localprovider\_7.2.1.20190614\_0309/components/tOracleBulkExec/tOracleBulkExec\_begin.javajet
|
||||
- {Talend\_Studio\_path}/plugins/org.talend.designer.components.localprovider\_7.2.1.20190614\_0309/components/tOracleConnection/tOracleConnection\_begin.javajet
|
||||
- {Talend\_Studio\_path}/plugins/org.talend.designer.components.localprovider\_7.2.1.20190614\_0309/components/tOracleInput/tOracleInput\_begin.javajet
|
||||
- {Talend\_Studio\_path}/plugins/org.talend.designer.components.localprovider\_7.2.1.20190614\_0309/components/tOracleOutput/tOracleOutput\_begin.javajet
|
||||
- {Talend\_Studio\_path}/plugins/org.talend.designer.components.localprovider\_7.2.1.20190614\_0309/components/tOracleRow/tOracleRow\_begin.javajet
|
||||
- {Talend\_Studio\_path}/plugins/org.talend.designer.components.localprovider\_7.2.1.20190614\_0309/components/tOracleSCD/tOracleSCD\_begin.javajet
|
||||
- {Talend\_Studio\_path}/plugins/org.talend.designer.components.localprovider\_7.2.1.20190614\_0309/components/tOracleSCDELT/tOracleSCDELT\_begin.javajet
|
||||
- {Talend\_Studio\_path}/plugins/org.talend.designer.components.localprovider\_7.2.1.20190614\_0309/components/tOracleSP/tOracleSP\_begin.javajet
|
||||
- {Talend\_Studio\_path}/plugins/org.talend.designer.components.localprovider\_7.2.1.20190614\_0309/components/tRedshiftBulkExec/tRedshiftBulkExec\_begin.javajet
|
||||
- {Talend\_Studio\_path}/plugins/org.talend.designer.components.localprovider\_7.2.1.20190614\_0309/components/tRedshiftConnection/tRedshiftConnection\_begin.javajet
|
||||
- {Talend\_Studio\_path}/plugins/org.talend.designer.components.localprovider\_7.2.1.20190614\_0309/components/tRedshiftInput/tRedshiftInput\_begin.javajet
|
||||
- {Talend\_Studio\_path}/plugins/org.talend.designer.components.localprovider\_7.2.1.20190614\_0309/components/tRedshiftOutput/tRedshiftOutput\_begin.javajet
|
||||
- {Talend\_Studio\_path}/plugins/org.talend.designer.components.localprovider\_7.2.1.20190614\_0309/components/tRedshiftRow/tRedshiftRow\_begin.javajet
|
||||
- {Talend\_Studio\_path}/plugins/org.talend.designer.components.localprovider\_7.2.1.20190614\_0309/components/tRedshiftUnload/tRedshiftUnload\_begin.javajet
|
||||
- {Talend\_Studio\_path}/plugins/org.talend.designer.components.tdqprovider\_7.2.1.20190614\_0245/components/tMSSqlInvalidRows/tMSSqlInvalidRows\_begin.javajet
|
||||
- {Talend\_Studio\_path}/plugins/org.talend.designer.components.tdqprovider\_7.2.1.20190614\_0245/components/tMSSqlValidRows/tMSSqlValidRows\_begin.javajet
|
||||
- {Talend\_Studio\_path}/plugins/org.talend.designer.components.tdqprovider\_7.2.1.20190614\_0245/components/tMySQLInvalidRows/tMySQLInvalidRows\_begin.javajet
|
||||
- {Talend\_Studio\_path}/plugins/org.talend.designer.components.tdqprovider\_7.2.1.20190614\_0245/components/tMySQLValidRows/tMySQLValidRows\_begin.javajet
|
||||
- {Talend\_Studio\_path}/plugins/org.talend.designer.components.tdqprovider\_7.2.1.20190614\_0245/components/tOracleInvalidRows/tOracleInvalidRows\_begin.javajet
|
||||
- {Talend\_Studio\_path}/plugins/org.talend.designer.components.tdqprovider\_7.2.1.20190614\_0245/components/tOracleValidRows/tOracleValidRows\_begin.javajet
|
||||
- {Talend\_Studio\_path}/plugins/org.talend.designer.components.tisprovider\_7.2.1.20190614\_0242/components/tMSSqlCDC/tMSSqlCDC\_begin.javajet
|
||||
- {Talend\_Studio\_path}/plugins/org.talend.designer.components.tisprovider\_7.2.1.20190614\_0242/components/tMysqlCDC/tMysqlCDC\_begin.javajet
|
||||
- {Talend\_Studio\_path}/plugins/org.talend.designer.components.tisprovider\_7.2.1.20190614\_0242/components/tOracleCDC/tOracleCDC\_begin.javajet
|
||||
- {Talend\_Studio\_path}/plugins/org.talend.designer.components.tisprovider\_7.2.1.20190614\_0242/components/tOracleCDCOutput/tOracleCDCOutput\_begin.javajet
|
||||
- {Talend\_Studio\_path}/plugins/org.talend.designer.components.localprovider\_7.2.1.20190614\_0309/components/tLibraryLoad/tLibraryLoad\_begin.javajet
|
||||
@@ -1,6 +1,6 @@
|
||||
<%@ jet
|
||||
imports="
|
||||
org.talend.core.model.process.ElementParameterParser
|
||||
|
||||
org.talend.designer.codegen.config.CodeGeneratorArgument
|
||||
java.util.List
|
||||
org.talend.core.model.process.IConnection
|
||||
@@ -16,7 +16,6 @@
|
||||
java.util.HashSet
|
||||
"
|
||||
%>
|
||||
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/DB/CheckContextPassword.javajet"%>
|
||||
<%
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<%@ jet
|
||||
imports="
|
||||
org.talend.core.model.process.ElementParameterParser
|
||||
|
||||
org.talend.designer.codegen.config.CodeGeneratorArgument
|
||||
|
||||
java.util.List
|
||||
@@ -17,7 +17,6 @@
|
||||
java.util.HashSet
|
||||
"
|
||||
%>
|
||||
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/DB/CheckContextPassword.javajet"%>
|
||||
<%
|
||||
|
||||
|
||||
|
||||
@@ -18,56 +18,8 @@
|
||||
"
|
||||
%>
|
||||
<%
|
||||
//TPS-3315
|
||||
org.talend.designer.codegen.config.CodeGeneratorArgument codeGenArgument_pwdCheck = (org.talend.designer.codegen.config.CodeGeneratorArgument)argument;
|
||||
org.talend.core.model.process.INode node_pwdCheck = (org.talend.core.model.process.INode)codeGenArgument_pwdCheck.getArgument();
|
||||
boolean useExistingConnection_pwdCheck = "true".equalsIgnoreCase(ElementParameterParser.getValue(node_pwdCheck,"__USE_EXISTING_CONNECTION__"));
|
||||
if(!useExistingConnection_pwdCheck) {
|
||||
String user_pwdCheck = ElementParameterParser.getValue(node_pwdCheck, "__USER__");
|
||||
String dbhost_pwdCheck = ElementParameterParser.getValue(node_pwdCheck, "__HOST__");
|
||||
String dbport_pwdCheck = ElementParameterParser.getValue(node_pwdCheck, "__PORT__");
|
||||
String dbname_pwdCheck = ElementParameterParser.getValue(node_pwdCheck, "__DBNAME__");
|
||||
String dbproperties_pwdCheck = ElementParameterParser.getValue(node_pwdCheck, "__PROPERTIES__");
|
||||
String localServiceName_pwdCheck = ElementParameterParser.getValue(node_pwdCheck, "__LOCAL_SERVICE_NAME__");
|
||||
final class ValueChecker {
|
||||
|
||||
public boolean checkValueForPassword(String inputValue, org.talend.core.model.process.IContext context) {
|
||||
if(null == inputValue) {
|
||||
return false;
|
||||
}
|
||||
java.util.List<String> parsed = new java.util.ArrayList<String>();
|
||||
String value = inputValue.trim();
|
||||
while(org.talend.core.model.utils.ContextParameterUtils.containContextVariables(value)) {
|
||||
String nonQuoteStr = org.talend.core.utils.TalendQuoteUtils.filterQuote(value);
|
||||
String contextVar = org.talend.core.model.utils.ContextParameterUtils.getVariableFromCode(nonQuoteStr);
|
||||
parsed.add(contextVar);
|
||||
String curValue = org.talend.core.model.utils.ContextParameterUtils.JAVA_NEW_CONTEXT_PREFIX + contextVar;
|
||||
int index = value.indexOf(curValue);
|
||||
if(index != -1) {
|
||||
value = value.substring(index + curValue.length(), value.length());
|
||||
}
|
||||
}
|
||||
for(String parsedParam : parsed) {
|
||||
org.talend.core.model.process.IContextParameter param = context.getContextParameter(parsedParam);
|
||||
if(org.talend.core.model.utils.ContextParameterUtils.isPasswordType(param)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
ValueChecker checker = new ValueChecker();
|
||||
org.talend.core.model.process.IContext context_pwdCheck = node_pwdCheck.getProcess().getContextManager().getDefaultContext();
|
||||
if(checker.checkValueForPassword(dbhost_pwdCheck, context_pwdCheck) || checker.checkValueForPassword(dbport_pwdCheck, context_pwdCheck) || checker.checkValueForPassword(dbname_pwdCheck, context_pwdCheck) || checker.checkValueForPassword(dbproperties_pwdCheck, context_pwdCheck) || checker.checkValueForPassword(localServiceName_pwdCheck, context_pwdCheck)) {
|
||||
%>
|
||||
if(true) {
|
||||
throw new RuntimeException("Password context variable is used in plain text field!");
|
||||
}
|
||||
<%
|
||||
}
|
||||
}
|
||||
//
|
||||
|
||||
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
DbMapComponent node = (DbMapComponent) codeGenArgument.getArgument();
|
||||
boolean stats = codeGenArgument.isStatistics();
|
||||
|
||||
@@ -17,17 +17,19 @@
|
||||
|
||||
<% if(hotLibs!=null&&hotLibs.size() > 0){%>
|
||||
|
||||
java.net.URLClassLoader sysloader_<%=cid %> = (java.net.URLClassLoader) ClassLoader.getSystemClassLoader();
|
||||
java.lang.reflect.Method method_<%=cid %> = java.net.URLClassLoader.class.getDeclaredMethod("addURL", new Class[] { java.net.URL.class });
|
||||
method_<%=cid %>.setAccessible(true);
|
||||
String[] libPaths_<%=cid %> = new String[] { <% for(Map<String, String> item : hotLibs) {%> <%=item.get("LIBPATH") %>, <%}%> };
|
||||
|
||||
String[] libPaths_<%=cid %> = new String[] { <% for(Map<String, String> item : hotLibs){%> <%=item.get("LIBPATH") %>, <%}%> };
|
||||
for(String lib_<%=cid %>:libPaths_<%=cid %> ){
|
||||
java.util.List<java.net.URL> libURL_<%=cid %> = new java.util.ArrayList<>();
|
||||
|
||||
for(String lib_<%=cid %>:libPaths_<%=cid %>) {
|
||||
String separator_<%=cid %> = System.getProperty("path.separator");
|
||||
String[] jarFiles_<%=cid %> = lib_<%=cid %>.split(separator_<%=cid %>);
|
||||
for(String jarFile_<%=cid %>:jarFiles_<%=cid %>){
|
||||
method_<%=cid %>.invoke(sysloader_<%=cid %>, new Object[] { new java.io.File(jarFile_<%=cid %>).toURL() });
|
||||
for(String jarFile_<%=cid %> : jarFiles_<%=cid %>) {
|
||||
libURL_<%=cid %>.add( new java.io.File(jarFile_<%=cid %>).toURI().toURL() );
|
||||
}
|
||||
}
|
||||
|
||||
java.net.URL[] libURLArray_<%=cid %> = libURL_<%=cid %>.toArray(new java.net.URL[] {});
|
||||
ClassLoader threadClassLoader_<%=cid %> = Thread.currentThread().getContextClassLoader();
|
||||
java.net.URLClassLoader newthreadClassLoader_<%=cid %> = new java.net.URLClassLoader(libURLArray_<%=cid %>, threadClassLoader_<%=cid %>);
|
||||
Thread.currentThread().setContextClassLoader(newthreadClassLoader_<%=cid %>);
|
||||
<%}%>
|
||||
|
||||
@@ -15,7 +15,6 @@ imports="
|
||||
skeleton="../templates/db_output_bulk.skeleton"
|
||||
%>
|
||||
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/Log4j/DBLogUtil.javajet"%>
|
||||
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/DB/CheckContextPassword.javajet"%>
|
||||
<%
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
INode node = (INode)codeGenArgument.getArgument();
|
||||
|
||||
@@ -6,7 +6,6 @@ imports="
|
||||
"
|
||||
%>
|
||||
<%@ include file="../templates/DB/HelpClass/HelpClass.javajet"%>
|
||||
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/DB/CheckContextPassword.javajet"%>
|
||||
<%
|
||||
class ConnectionUtil extends DefaultConnectionUtil{
|
||||
|
||||
|
||||
@@ -13,7 +13,6 @@ imports="
|
||||
"
|
||||
%>
|
||||
<%@ include file="../templates/DB/Input/HelpClass.javajet"%>
|
||||
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/DB/CheckContextPassword.javajet"%>
|
||||
<%
|
||||
|
||||
class DBInputBeginUtil extends DefaultDBInputUtil{
|
||||
|
||||
@@ -17,7 +17,6 @@ imports="
|
||||
skeleton="../templates/db_output_bulk.skeleton"
|
||||
%>
|
||||
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/Log4j/DBLogUtil.javajet"%>
|
||||
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/DB/CheckContextPassword.javajet"%>
|
||||
<%
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
INode node = (INode)codeGenArgument.getArgument();
|
||||
|
||||
@@ -6,7 +6,6 @@ imports="
|
||||
"
|
||||
%>
|
||||
<%@ include file="../templates/DB/Row/HelpClass.javajet"%>
|
||||
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/DB/CheckContextPassword.javajet"%>
|
||||
<%
|
||||
|
||||
class DBRowBeginUtil extends DefaultDBRowUtil{
|
||||
|
||||
@@ -18,7 +18,6 @@ imports="
|
||||
skeleton="../templates/slowly_change_dimension.skeleton"
|
||||
%>
|
||||
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/Log4j/DBLogUtil.javajet"%>
|
||||
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/DB/CheckContextPassword.javajet"%>
|
||||
<%
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
INode node = (INode) codeGenArgument.getArgument();
|
||||
|
||||
@@ -9,7 +9,6 @@ imports="
|
||||
"
|
||||
%>
|
||||
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/Log4j/DBLogUtil.javajet"%>
|
||||
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/DB/CheckContextPassword.javajet"%>
|
||||
<%
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
INode node = (INode) codeGenArgument.getArgument();
|
||||
|
||||
@@ -14,7 +14,6 @@ imports="
|
||||
skeleton="../templates/db_output_bulk.skeleton"
|
||||
%>
|
||||
<%@ include file="../templates/Log4j/Log4jDBConnUtil.javajet"%>
|
||||
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/DB/CheckContextPassword.javajet"%>
|
||||
<%
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
INode node = (INode)codeGenArgument.getArgument();
|
||||
|
||||
@@ -6,7 +6,6 @@ imports="
|
||||
"
|
||||
%>
|
||||
<%@ include file="../templates/DB/HelpClass/HelpClass.javajet"%>
|
||||
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/DB/CheckContextPassword.javajet"%>
|
||||
<%
|
||||
class ConnectionUtil extends DefaultConnectionUtil{
|
||||
|
||||
|
||||
@@ -13,7 +13,6 @@ imports="
|
||||
"
|
||||
%>
|
||||
<%@ include file="../templates/DB/Input/HelpClass.javajet"%>
|
||||
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/DB/CheckContextPassword.javajet"%>
|
||||
<%
|
||||
|
||||
class DBInputBeginUtil extends DefaultDBInputUtil{
|
||||
|
||||
@@ -17,7 +17,6 @@ imports="
|
||||
skeleton="../templates/db_output_bulk.skeleton"
|
||||
%>
|
||||
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/Log4j/DBLogUtil.javajet"%>
|
||||
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/DB/CheckContextPassword.javajet"%>
|
||||
<%
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
INode node = (INode)codeGenArgument.getArgument();
|
||||
|
||||
@@ -6,7 +6,6 @@ imports="
|
||||
"
|
||||
%>
|
||||
<%@ include file="../templates/DB/Row/HelpClass.javajet"%>
|
||||
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/DB/CheckContextPassword.javajet"%>
|
||||
<%
|
||||
|
||||
class DBRowBeginUtil extends DefaultDBRowUtil{
|
||||
|
||||
@@ -16,7 +16,7 @@ imports="
|
||||
"
|
||||
skeleton="../templates/slowly_change_dimension.skeleton"
|
||||
%>
|
||||
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/DB/CheckContextPassword.javajet"%>
|
||||
|
||||
<%
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
INode node = (INode) codeGenArgument.getArgument();
|
||||
|
||||
@@ -14,7 +14,7 @@ imports="
|
||||
"
|
||||
skeleton="../templates/db_output_bulk.skeleton"
|
||||
%>
|
||||
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/DB/CheckContextPassword.javajet"%>
|
||||
|
||||
<%
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
INode node = (INode)codeGenArgument.getArgument();
|
||||
|
||||
@@ -8,7 +8,6 @@ imports="
|
||||
"
|
||||
%>
|
||||
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/Log4j/DBLogUtil.javajet"%>
|
||||
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/DB/CheckContextPassword.javajet"%>
|
||||
<%
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
INode node = (INode) codeGenArgument.getArgument();
|
||||
|
||||
@@ -18,7 +18,6 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
%>
|
||||
|
||||
<%@ include file="../templates/Log4j/Log4jDBConnUtil.javajet"%>
|
||||
|
||||
<%
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
INode node = (INode)codeGenArgument.getArgument();
|
||||
@@ -97,57 +96,6 @@ String url_<%=cid%> = null;
|
||||
int deletedCount_<%=cid%>=0;
|
||||
<%
|
||||
boolean useExistingConnection = "true".equalsIgnoreCase(ElementParameterParser.getValue(node,"__USE_EXISTING_CONNECTION__"));
|
||||
|
||||
//TPS-3315
|
||||
org.talend.designer.codegen.config.CodeGeneratorArgument codeGenArgument_pwdCheck = (org.talend.designer.codegen.config.CodeGeneratorArgument)argument;
|
||||
org.talend.core.model.process.INode node_pwdCheck = (org.talend.core.model.process.INode)codeGenArgument_pwdCheck.getArgument();
|
||||
boolean useExistingConnection_pwdCheck = "true".equalsIgnoreCase(ElementParameterParser.getValue(node_pwdCheck,"__USE_EXISTING_CONNECTION__"));
|
||||
if(!useExistingConnection_pwdCheck) {
|
||||
String user_pwdCheck = ElementParameterParser.getValue(node_pwdCheck, "__USER__");
|
||||
String dbhost_pwdCheck = ElementParameterParser.getValue(node_pwdCheck, "__HOST__");
|
||||
String dbport_pwdCheck = ElementParameterParser.getValue(node_pwdCheck, "__PORT__");
|
||||
String dbname_pwdCheck = ElementParameterParser.getValue(node_pwdCheck, "__DBNAME__");
|
||||
String dbproperties_pwdCheck = ElementParameterParser.getValue(node_pwdCheck, "__PROPERTIES__");
|
||||
String localServiceName_pwdCheck = ElementParameterParser.getValue(node_pwdCheck, "__LOCAL_SERVICE_NAME__");
|
||||
final class ValueChecker {
|
||||
|
||||
public boolean checkValueForPassword(String inputValue, org.talend.core.model.process.IContext context) {
|
||||
if(null == inputValue) {
|
||||
return false;
|
||||
}
|
||||
java.util.List<String> parsed = new java.util.ArrayList<String>();
|
||||
String value = inputValue.trim();
|
||||
while(org.talend.core.model.utils.ContextParameterUtils.containContextVariables(value)) {
|
||||
String nonQuoteStr = org.talend.core.utils.TalendQuoteUtils.filterQuote(value);
|
||||
String contextVar = org.talend.core.model.utils.ContextParameterUtils.getVariableFromCode(nonQuoteStr);
|
||||
parsed.add(contextVar);
|
||||
String curValue = org.talend.core.model.utils.ContextParameterUtils.JAVA_NEW_CONTEXT_PREFIX + contextVar;
|
||||
int index = value.indexOf(curValue);
|
||||
if(index != -1) {
|
||||
value = value.substring(index + curValue.length(), value.length());
|
||||
}
|
||||
}
|
||||
for(String parsedParam : parsed) {
|
||||
org.talend.core.model.process.IContextParameter param = context.getContextParameter(parsedParam);
|
||||
if(org.talend.core.model.utils.ContextParameterUtils.isPasswordType(param)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
ValueChecker checker = new ValueChecker();
|
||||
org.talend.core.model.process.IContext context_pwdCheck = node_pwdCheck.getProcess().getContextManager().getDefaultContext();
|
||||
if(checker.checkValueForPassword(dbhost_pwdCheck, context_pwdCheck) || checker.checkValueForPassword(dbport_pwdCheck, context_pwdCheck) || checker.checkValueForPassword(dbname_pwdCheck, context_pwdCheck) || checker.checkValueForPassword(dbproperties_pwdCheck, context_pwdCheck) || checker.checkValueForPassword(localServiceName_pwdCheck, context_pwdCheck)) {
|
||||
%>
|
||||
if(true) {
|
||||
throw new RuntimeException("Password context variable is used in plain text field!");
|
||||
}
|
||||
<%
|
||||
}
|
||||
}
|
||||
//
|
||||
if(useExistingConnection) {
|
||||
String connection = ElementParameterParser.getValue(node,"__CONNECTION__");
|
||||
String conn = "conn_" + connection;
|
||||
|
||||
@@ -7,56 +7,6 @@ imports="
|
||||
%>
|
||||
<%@ include file="../templates/DB/HelpClass/HelpClass.javajet"%>
|
||||
<%
|
||||
//TPS-3315
|
||||
org.talend.designer.codegen.config.CodeGeneratorArgument codeGenArgument_pwdCheck = (org.talend.designer.codegen.config.CodeGeneratorArgument)argument;
|
||||
org.talend.core.model.process.INode node_pwdCheck = (org.talend.core.model.process.INode)codeGenArgument_pwdCheck.getArgument();
|
||||
boolean useExistingConnection_pwdCheck = "true".equalsIgnoreCase(ElementParameterParser.getValue(node_pwdCheck,"__USE_EXISTING_CONNECTION__"));
|
||||
if(!useExistingConnection_pwdCheck) {
|
||||
String user_pwdCheck = ElementParameterParser.getValue(node_pwdCheck, "__USER__");
|
||||
String dbhost_pwdCheck = ElementParameterParser.getValue(node_pwdCheck, "__HOST__");
|
||||
String dbport_pwdCheck = ElementParameterParser.getValue(node_pwdCheck, "__PORT__");
|
||||
String dbname_pwdCheck = ElementParameterParser.getValue(node_pwdCheck, "__DBNAME__");
|
||||
String dbproperties_pwdCheck = ElementParameterParser.getValue(node_pwdCheck, "__PROPERTIES__");
|
||||
String localServiceName_pwdCheck = ElementParameterParser.getValue(node_pwdCheck, "__LOCAL_SERVICE_NAME__");
|
||||
final class ValueChecker {
|
||||
|
||||
public boolean checkValueForPassword(String inputValue, org.talend.core.model.process.IContext context) {
|
||||
if(null == inputValue) {
|
||||
return false;
|
||||
}
|
||||
java.util.List<String> parsed = new java.util.ArrayList<String>();
|
||||
String value = inputValue.trim();
|
||||
while(org.talend.core.model.utils.ContextParameterUtils.containContextVariables(value)) {
|
||||
String nonQuoteStr = org.talend.core.utils.TalendQuoteUtils.filterQuote(value);
|
||||
String contextVar = org.talend.core.model.utils.ContextParameterUtils.getVariableFromCode(nonQuoteStr);
|
||||
parsed.add(contextVar);
|
||||
String curValue = org.talend.core.model.utils.ContextParameterUtils.JAVA_NEW_CONTEXT_PREFIX + contextVar;
|
||||
int index = value.indexOf(curValue);
|
||||
if(index != -1) {
|
||||
value = value.substring(index + curValue.length(), value.length());
|
||||
}
|
||||
}
|
||||
for(String parsedParam : parsed) {
|
||||
org.talend.core.model.process.IContextParameter param = context.getContextParameter(parsedParam);
|
||||
if(org.talend.core.model.utils.ContextParameterUtils.isPasswordType(param)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
ValueChecker checker = new ValueChecker();
|
||||
org.talend.core.model.process.IContext context_pwdCheck = node_pwdCheck.getProcess().getContextManager().getDefaultContext();
|
||||
if(checker.checkValueForPassword(dbhost_pwdCheck, context_pwdCheck) || checker.checkValueForPassword(dbport_pwdCheck, context_pwdCheck) || checker.checkValueForPassword(dbname_pwdCheck, context_pwdCheck) || checker.checkValueForPassword(dbproperties_pwdCheck, context_pwdCheck) || checker.checkValueForPassword(localServiceName_pwdCheck, context_pwdCheck)) {
|
||||
%>
|
||||
if(true) {
|
||||
throw new RuntimeException("Password context variable is used in plain text field!");
|
||||
}
|
||||
<%
|
||||
}
|
||||
}
|
||||
//
|
||||
class ConnectionUtil extends DefaultConnectionUtil{
|
||||
|
||||
public void beforeComponentProcess(INode node){
|
||||
|
||||
@@ -14,56 +14,6 @@ imports="
|
||||
%>
|
||||
<%@ include file="../templates/DB/Input/HelpClass.javajet"%>
|
||||
<%
|
||||
//TPS-3315
|
||||
org.talend.designer.codegen.config.CodeGeneratorArgument codeGenArgument_pwdCheck = (org.talend.designer.codegen.config.CodeGeneratorArgument)argument;
|
||||
org.talend.core.model.process.INode node_pwdCheck = (org.talend.core.model.process.INode)codeGenArgument_pwdCheck.getArgument();
|
||||
boolean useExistingConnection_pwdCheck = "true".equalsIgnoreCase(ElementParameterParser.getValue(node_pwdCheck,"__USE_EXISTING_CONNECTION__"));
|
||||
if(!useExistingConnection_pwdCheck) {
|
||||
String user_pwdCheck = ElementParameterParser.getValue(node_pwdCheck, "__USER__");
|
||||
String dbhost_pwdCheck = ElementParameterParser.getValue(node_pwdCheck, "__HOST__");
|
||||
String dbport_pwdCheck = ElementParameterParser.getValue(node_pwdCheck, "__PORT__");
|
||||
String dbname_pwdCheck = ElementParameterParser.getValue(node_pwdCheck, "__DBNAME__");
|
||||
String dbproperties_pwdCheck = ElementParameterParser.getValue(node_pwdCheck, "__PROPERTIES__");
|
||||
String localServiceName_pwdCheck = ElementParameterParser.getValue(node_pwdCheck, "__LOCAL_SERVICE_NAME__");
|
||||
final class ValueChecker {
|
||||
|
||||
public boolean checkValueForPassword(String inputValue, org.talend.core.model.process.IContext context) {
|
||||
if(null == inputValue) {
|
||||
return false;
|
||||
}
|
||||
java.util.List<String> parsed = new java.util.ArrayList<String>();
|
||||
String value = inputValue.trim();
|
||||
while(org.talend.core.model.utils.ContextParameterUtils.containContextVariables(value)) {
|
||||
String nonQuoteStr = org.talend.core.utils.TalendQuoteUtils.filterQuote(value);
|
||||
String contextVar = org.talend.core.model.utils.ContextParameterUtils.getVariableFromCode(nonQuoteStr);
|
||||
parsed.add(contextVar);
|
||||
String curValue = org.talend.core.model.utils.ContextParameterUtils.JAVA_NEW_CONTEXT_PREFIX + contextVar;
|
||||
int index = value.indexOf(curValue);
|
||||
if(index != -1) {
|
||||
value = value.substring(index + curValue.length(), value.length());
|
||||
}
|
||||
}
|
||||
for(String parsedParam : parsed) {
|
||||
org.talend.core.model.process.IContextParameter param = context.getContextParameter(parsedParam);
|
||||
if(org.talend.core.model.utils.ContextParameterUtils.isPasswordType(param)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
ValueChecker checker = new ValueChecker();
|
||||
org.talend.core.model.process.IContext context_pwdCheck = node_pwdCheck.getProcess().getContextManager().getDefaultContext();
|
||||
if(checker.checkValueForPassword(dbhost_pwdCheck, context_pwdCheck) || checker.checkValueForPassword(dbport_pwdCheck, context_pwdCheck) || checker.checkValueForPassword(dbname_pwdCheck, context_pwdCheck) || checker.checkValueForPassword(dbproperties_pwdCheck, context_pwdCheck) || checker.checkValueForPassword(localServiceName_pwdCheck, context_pwdCheck)) {
|
||||
%>
|
||||
if(true) {
|
||||
throw new RuntimeException("Password context variable is used in plain text field!");
|
||||
}
|
||||
<%
|
||||
}
|
||||
}
|
||||
//
|
||||
class DBInputBeginUtil extends DefaultDBInputUtil{
|
||||
|
||||
private INode node = null;
|
||||
|
||||
@@ -51,56 +51,6 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
boolean createGeometryColumns = ("true").equals(ElementParameterParser.getValue(node,"__GEOMETRY_COLUMNS__"));
|
||||
boolean useExistingConnection = "true".equals(ElementParameterParser.getValue(node,"__USE_EXISTING_CONNECTION__"));
|
||||
String connection = ElementParameterParser.getValue(node,"__CONNECTION__");
|
||||
//TPS-3315
|
||||
org.talend.designer.codegen.config.CodeGeneratorArgument codeGenArgument_pwdCheck = (org.talend.designer.codegen.config.CodeGeneratorArgument)argument;
|
||||
org.talend.core.model.process.INode node_pwdCheck = (org.talend.core.model.process.INode)codeGenArgument_pwdCheck.getArgument();
|
||||
boolean useExistingConnection_pwdCheck = "true".equalsIgnoreCase(ElementParameterParser.getValue(node_pwdCheck,"__USE_EXISTING_CONNECTION__"));
|
||||
if(!useExistingConnection_pwdCheck) {
|
||||
String user_pwdCheck = ElementParameterParser.getValue(node_pwdCheck, "__USER__");
|
||||
String dbhost_pwdCheck = ElementParameterParser.getValue(node_pwdCheck, "__HOST__");
|
||||
String dbport_pwdCheck = ElementParameterParser.getValue(node_pwdCheck, "__PORT__");
|
||||
String dbname_pwdCheck = ElementParameterParser.getValue(node_pwdCheck, "__DBNAME__");
|
||||
String dbproperties_pwdCheck = ElementParameterParser.getValue(node_pwdCheck, "__PROPERTIES__");
|
||||
String localServiceName_pwdCheck = ElementParameterParser.getValue(node_pwdCheck, "__LOCAL_SERVICE_NAME__");
|
||||
final class ValueChecker {
|
||||
|
||||
public boolean checkValueForPassword(String inputValue, org.talend.core.model.process.IContext context) {
|
||||
if(null == inputValue) {
|
||||
return false;
|
||||
}
|
||||
java.util.List<String> parsed = new java.util.ArrayList<String>();
|
||||
String value = inputValue.trim();
|
||||
while(org.talend.core.model.utils.ContextParameterUtils.containContextVariables(value)) {
|
||||
String nonQuoteStr = org.talend.core.utils.TalendQuoteUtils.filterQuote(value);
|
||||
String contextVar = org.talend.core.model.utils.ContextParameterUtils.getVariableFromCode(nonQuoteStr);
|
||||
parsed.add(contextVar);
|
||||
String curValue = org.talend.core.model.utils.ContextParameterUtils.JAVA_NEW_CONTEXT_PREFIX + contextVar;
|
||||
int index = value.indexOf(curValue);
|
||||
if(index != -1) {
|
||||
value = value.substring(index + curValue.length(), value.length());
|
||||
}
|
||||
}
|
||||
for(String parsedParam : parsed) {
|
||||
org.talend.core.model.process.IContextParameter param = context.getContextParameter(parsedParam);
|
||||
if(org.talend.core.model.utils.ContextParameterUtils.isPasswordType(param)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
ValueChecker checker = new ValueChecker();
|
||||
org.talend.core.model.process.IContext context_pwdCheck = node_pwdCheck.getProcess().getContextManager().getDefaultContext();
|
||||
if(checker.checkValueForPassword(dbhost_pwdCheck, context_pwdCheck) || checker.checkValueForPassword(dbport_pwdCheck, context_pwdCheck) || checker.checkValueForPassword(dbname_pwdCheck, context_pwdCheck) || checker.checkValueForPassword(dbproperties_pwdCheck, context_pwdCheck) || checker.checkValueForPassword(localServiceName_pwdCheck, context_pwdCheck)) {
|
||||
%>
|
||||
if(true) {
|
||||
throw new RuntimeException("Password context variable is used in plain text field!");
|
||||
}
|
||||
<%
|
||||
}
|
||||
}
|
||||
//
|
||||
|
||||
String rejectConnName = null;
|
||||
List<? extends IConnection> rejectConns = node.getOutgoingConnections("REJECT");
|
||||
|
||||
@@ -6,58 +6,8 @@ imports="
|
||||
"
|
||||
%>
|
||||
<%@ include file="../templates/DB/Row/HelpClass.javajet"%>
|
||||
|
||||
<%
|
||||
//TPS-3315
|
||||
org.talend.designer.codegen.config.CodeGeneratorArgument codeGenArgument_pwdCheck = (org.talend.designer.codegen.config.CodeGeneratorArgument)argument;
|
||||
org.talend.core.model.process.INode node_pwdCheck = (org.talend.core.model.process.INode)codeGenArgument_pwdCheck.getArgument();
|
||||
boolean useExistingConnection_pwdCheck = "true".equalsIgnoreCase(ElementParameterParser.getValue(node_pwdCheck,"__USE_EXISTING_CONNECTION__"));
|
||||
if(!useExistingConnection_pwdCheck) {
|
||||
String user_pwdCheck = ElementParameterParser.getValue(node_pwdCheck, "__USER__");
|
||||
String dbhost_pwdCheck = ElementParameterParser.getValue(node_pwdCheck, "__HOST__");
|
||||
String dbport_pwdCheck = ElementParameterParser.getValue(node_pwdCheck, "__PORT__");
|
||||
String dbname_pwdCheck = ElementParameterParser.getValue(node_pwdCheck, "__DBNAME__");
|
||||
String dbproperties_pwdCheck = ElementParameterParser.getValue(node_pwdCheck, "__PROPERTIES__");
|
||||
String localServiceName_pwdCheck = ElementParameterParser.getValue(node_pwdCheck, "__LOCAL_SERVICE_NAME__");
|
||||
final class ValueChecker {
|
||||
|
||||
public boolean checkValueForPassword(String inputValue, org.talend.core.model.process.IContext context) {
|
||||
if(null == inputValue) {
|
||||
return false;
|
||||
}
|
||||
java.util.List<String> parsed = new java.util.ArrayList<String>();
|
||||
String value = inputValue.trim();
|
||||
while(org.talend.core.model.utils.ContextParameterUtils.containContextVariables(value)) {
|
||||
String nonQuoteStr = org.talend.core.utils.TalendQuoteUtils.filterQuote(value);
|
||||
String contextVar = org.talend.core.model.utils.ContextParameterUtils.getVariableFromCode(nonQuoteStr);
|
||||
parsed.add(contextVar);
|
||||
String curValue = org.talend.core.model.utils.ContextParameterUtils.JAVA_NEW_CONTEXT_PREFIX + contextVar;
|
||||
int index = value.indexOf(curValue);
|
||||
if(index != -1) {
|
||||
value = value.substring(index + curValue.length(), value.length());
|
||||
}
|
||||
}
|
||||
for(String parsedParam : parsed) {
|
||||
org.talend.core.model.process.IContextParameter param = context.getContextParameter(parsedParam);
|
||||
if(org.talend.core.model.utils.ContextParameterUtils.isPasswordType(param)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
ValueChecker checker = new ValueChecker();
|
||||
org.talend.core.model.process.IContext context_pwdCheck = node_pwdCheck.getProcess().getContextManager().getDefaultContext();
|
||||
if(checker.checkValueForPassword(dbhost_pwdCheck, context_pwdCheck) || checker.checkValueForPassword(dbport_pwdCheck, context_pwdCheck) || checker.checkValueForPassword(dbname_pwdCheck, context_pwdCheck) || checker.checkValueForPassword(dbproperties_pwdCheck, context_pwdCheck) || checker.checkValueForPassword(localServiceName_pwdCheck, context_pwdCheck)) {
|
||||
%>
|
||||
if(true) {
|
||||
throw new RuntimeException("Password context variable is used in plain text field!");
|
||||
}
|
||||
<%
|
||||
}
|
||||
}
|
||||
//
|
||||
|
||||
class DBRowBeginUtil extends DefaultDBRowUtil{
|
||||
|
||||
public void beforeComponentProcess(INode node){
|
||||
|
||||
@@ -18,56 +18,6 @@ skeleton="../templates/slowly_change_dimension.skeleton"
|
||||
%>
|
||||
|
||||
<%
|
||||
//TPS-3315
|
||||
org.talend.designer.codegen.config.CodeGeneratorArgument codeGenArgument_pwdCheck = (org.talend.designer.codegen.config.CodeGeneratorArgument)argument;
|
||||
org.talend.core.model.process.INode node_pwdCheck = (org.talend.core.model.process.INode)codeGenArgument_pwdCheck.getArgument();
|
||||
boolean useExistingConnection_pwdCheck = "true".equalsIgnoreCase(ElementParameterParser.getValue(node_pwdCheck,"__USE_EXISTING_CONNECTION__"));
|
||||
if(!useExistingConnection_pwdCheck) {
|
||||
String user_pwdCheck = ElementParameterParser.getValue(node_pwdCheck, "__USER__");
|
||||
String dbhost_pwdCheck = ElementParameterParser.getValue(node_pwdCheck, "__HOST__");
|
||||
String dbport_pwdCheck = ElementParameterParser.getValue(node_pwdCheck, "__PORT__");
|
||||
String dbname_pwdCheck = ElementParameterParser.getValue(node_pwdCheck, "__DBNAME__");
|
||||
String dbproperties_pwdCheck = ElementParameterParser.getValue(node_pwdCheck, "__PROPERTIES__");
|
||||
String localServiceName_pwdCheck = ElementParameterParser.getValue(node_pwdCheck, "__LOCAL_SERVICE_NAME__");
|
||||
final class ValueChecker {
|
||||
|
||||
public boolean checkValueForPassword(String inputValue, org.talend.core.model.process.IContext context) {
|
||||
if(null == inputValue) {
|
||||
return false;
|
||||
}
|
||||
java.util.List<String> parsed = new java.util.ArrayList<String>();
|
||||
String value = inputValue.trim();
|
||||
while(org.talend.core.model.utils.ContextParameterUtils.containContextVariables(value)) {
|
||||
String nonQuoteStr = org.talend.core.utils.TalendQuoteUtils.filterQuote(value);
|
||||
String contextVar = org.talend.core.model.utils.ContextParameterUtils.getVariableFromCode(nonQuoteStr);
|
||||
parsed.add(contextVar);
|
||||
String curValue = org.talend.core.model.utils.ContextParameterUtils.JAVA_NEW_CONTEXT_PREFIX + contextVar;
|
||||
int index = value.indexOf(curValue);
|
||||
if(index != -1) {
|
||||
value = value.substring(index + curValue.length(), value.length());
|
||||
}
|
||||
}
|
||||
for(String parsedParam : parsed) {
|
||||
org.talend.core.model.process.IContextParameter param = context.getContextParameter(parsedParam);
|
||||
if(org.talend.core.model.utils.ContextParameterUtils.isPasswordType(param)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
ValueChecker checker = new ValueChecker();
|
||||
org.talend.core.model.process.IContext context_pwdCheck = node_pwdCheck.getProcess().getContextManager().getDefaultContext();
|
||||
if(checker.checkValueForPassword(dbhost_pwdCheck, context_pwdCheck) || checker.checkValueForPassword(dbport_pwdCheck, context_pwdCheck) || checker.checkValueForPassword(dbname_pwdCheck, context_pwdCheck) || checker.checkValueForPassword(dbproperties_pwdCheck, context_pwdCheck) || checker.checkValueForPassword(localServiceName_pwdCheck, context_pwdCheck)) {
|
||||
%>
|
||||
if(true) {
|
||||
throw new RuntimeException("Password context variable is used in plain text field!");
|
||||
}
|
||||
<%
|
||||
}
|
||||
}
|
||||
//
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
INode node = (INode) codeGenArgument.getArgument();
|
||||
String cid = node.getUniqueName();
|
||||
|
||||
@@ -14,57 +14,8 @@ imports="
|
||||
"
|
||||
skeleton="../templates/db_output_bulk.skeleton"
|
||||
%>
|
||||
|
||||
<%
|
||||
//TPS-3315
|
||||
org.talend.designer.codegen.config.CodeGeneratorArgument codeGenArgument_pwdCheck = (org.talend.designer.codegen.config.CodeGeneratorArgument)argument;
|
||||
org.talend.core.model.process.INode node_pwdCheck = (org.talend.core.model.process.INode)codeGenArgument_pwdCheck.getArgument();
|
||||
boolean useExistingConnection_pwdCheck = "true".equalsIgnoreCase(ElementParameterParser.getValue(node_pwdCheck,"__USE_EXISTING_CONNECTION__"));
|
||||
if(!useExistingConnection_pwdCheck) {
|
||||
String user_pwdCheck = ElementParameterParser.getValue(node_pwdCheck, "__USER__");
|
||||
String dbhost_pwdCheck = ElementParameterParser.getValue(node_pwdCheck, "__HOST__");
|
||||
String dbport_pwdCheck = ElementParameterParser.getValue(node_pwdCheck, "__PORT__");
|
||||
String dbname_pwdCheck = ElementParameterParser.getValue(node_pwdCheck, "__DBNAME__");
|
||||
String dbproperties_pwdCheck = ElementParameterParser.getValue(node_pwdCheck, "__PROPERTIES__");
|
||||
String localServiceName_pwdCheck = ElementParameterParser.getValue(node_pwdCheck, "__LOCAL_SERVICE_NAME__");
|
||||
final class ValueChecker {
|
||||
|
||||
public boolean checkValueForPassword(String inputValue, org.talend.core.model.process.IContext context) {
|
||||
if(null == inputValue) {
|
||||
return false;
|
||||
}
|
||||
java.util.List<String> parsed = new java.util.ArrayList<String>();
|
||||
String value = inputValue.trim();
|
||||
while(org.talend.core.model.utils.ContextParameterUtils.containContextVariables(value)) {
|
||||
String nonQuoteStr = org.talend.core.utils.TalendQuoteUtils.filterQuote(value);
|
||||
String contextVar = org.talend.core.model.utils.ContextParameterUtils.getVariableFromCode(nonQuoteStr);
|
||||
parsed.add(contextVar);
|
||||
String curValue = org.talend.core.model.utils.ContextParameterUtils.JAVA_NEW_CONTEXT_PREFIX + contextVar;
|
||||
int index = value.indexOf(curValue);
|
||||
if(index != -1) {
|
||||
value = value.substring(index + curValue.length(), value.length());
|
||||
}
|
||||
}
|
||||
for(String parsedParam : parsed) {
|
||||
org.talend.core.model.process.IContextParameter param = context.getContextParameter(parsedParam);
|
||||
if(org.talend.core.model.utils.ContextParameterUtils.isPasswordType(param)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
ValueChecker checker = new ValueChecker();
|
||||
org.talend.core.model.process.IContext context_pwdCheck = node_pwdCheck.getProcess().getContextManager().getDefaultContext();
|
||||
if(checker.checkValueForPassword(dbhost_pwdCheck, context_pwdCheck) || checker.checkValueForPassword(dbport_pwdCheck, context_pwdCheck) || checker.checkValueForPassword(dbname_pwdCheck, context_pwdCheck) || checker.checkValueForPassword(dbproperties_pwdCheck, context_pwdCheck) || checker.checkValueForPassword(localServiceName_pwdCheck, context_pwdCheck)) {
|
||||
%>
|
||||
if(true) {
|
||||
throw new RuntimeException("Password context variable is used in plain text field!");
|
||||
}
|
||||
<%
|
||||
}
|
||||
}
|
||||
//
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
INode node = (INode)codeGenArgument.getArgument();
|
||||
String cid = node.getUniqueName();
|
||||
|
||||
@@ -7,57 +7,8 @@ imports="
|
||||
java.util.Map
|
||||
"
|
||||
%>
|
||||
|
||||
<%
|
||||
//TPS-3315
|
||||
org.talend.designer.codegen.config.CodeGeneratorArgument codeGenArgument_pwdCheck = (org.talend.designer.codegen.config.CodeGeneratorArgument)argument;
|
||||
org.talend.core.model.process.INode node_pwdCheck = (org.talend.core.model.process.INode)codeGenArgument_pwdCheck.getArgument();
|
||||
boolean useExistingConnection_pwdCheck = "true".equalsIgnoreCase(ElementParameterParser.getValue(node_pwdCheck,"__USE_EXISTING_CONNECTION__"));
|
||||
if(!useExistingConnection_pwdCheck) {
|
||||
String user_pwdCheck = ElementParameterParser.getValue(node_pwdCheck, "__USER__");
|
||||
String dbhost_pwdCheck = ElementParameterParser.getValue(node_pwdCheck, "__HOST__");
|
||||
String dbport_pwdCheck = ElementParameterParser.getValue(node_pwdCheck, "__PORT__");
|
||||
String dbname_pwdCheck = ElementParameterParser.getValue(node_pwdCheck, "__DBNAME__");
|
||||
String dbproperties_pwdCheck = ElementParameterParser.getValue(node_pwdCheck, "__PROPERTIES__");
|
||||
String localServiceName_pwdCheck = ElementParameterParser.getValue(node_pwdCheck, "__LOCAL_SERVICE_NAME__");
|
||||
final class ValueChecker {
|
||||
|
||||
public boolean checkValueForPassword(String inputValue, org.talend.core.model.process.IContext context) {
|
||||
if(null == inputValue) {
|
||||
return false;
|
||||
}
|
||||
java.util.List<String> parsed = new java.util.ArrayList<String>();
|
||||
String value = inputValue.trim();
|
||||
while(org.talend.core.model.utils.ContextParameterUtils.containContextVariables(value)) {
|
||||
String nonQuoteStr = org.talend.core.utils.TalendQuoteUtils.filterQuote(value);
|
||||
String contextVar = org.talend.core.model.utils.ContextParameterUtils.getVariableFromCode(nonQuoteStr);
|
||||
parsed.add(contextVar);
|
||||
String curValue = org.talend.core.model.utils.ContextParameterUtils.JAVA_NEW_CONTEXT_PREFIX + contextVar;
|
||||
int index = value.indexOf(curValue);
|
||||
if(index != -1) {
|
||||
value = value.substring(index + curValue.length(), value.length());
|
||||
}
|
||||
}
|
||||
for(String parsedParam : parsed) {
|
||||
org.talend.core.model.process.IContextParameter param = context.getContextParameter(parsedParam);
|
||||
if(org.talend.core.model.utils.ContextParameterUtils.isPasswordType(param)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
ValueChecker checker = new ValueChecker();
|
||||
org.talend.core.model.process.IContext context_pwdCheck = node_pwdCheck.getProcess().getContextManager().getDefaultContext();
|
||||
if(checker.checkValueForPassword(dbhost_pwdCheck, context_pwdCheck) || checker.checkValueForPassword(dbport_pwdCheck, context_pwdCheck) || checker.checkValueForPassword(dbname_pwdCheck, context_pwdCheck) || checker.checkValueForPassword(dbproperties_pwdCheck, context_pwdCheck) || checker.checkValueForPassword(localServiceName_pwdCheck, context_pwdCheck)) {
|
||||
%>
|
||||
if(true) {
|
||||
throw new RuntimeException("Password context variable is used in plain text field!");
|
||||
}
|
||||
<%
|
||||
}
|
||||
}
|
||||
//
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
INode node = (INode) codeGenArgument.getArgument();
|
||||
String cid = node.getUniqueName();
|
||||
|
||||
@@ -14,7 +14,6 @@ imports="
|
||||
skeleton="../templates/db_output_bulk.skeleton"
|
||||
%>
|
||||
<%@ include file="../templates/Log4j/Log4jDBConnUtil.javajet"%>
|
||||
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/DB/CheckContextPassword.javajet"%>
|
||||
<%
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
INode node = (INode)codeGenArgument.getArgument();
|
||||
|
||||
@@ -6,7 +6,6 @@ imports="
|
||||
"
|
||||
%>
|
||||
<%@ include file="../templates/DB/HelpClass/HelpClass.javajet"%>
|
||||
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/DB/CheckContextPassword.javajet"%>
|
||||
<%
|
||||
class ConnectionUtil extends DefaultConnectionUtil{
|
||||
|
||||
|
||||
@@ -13,7 +13,6 @@ imports="
|
||||
"
|
||||
%>
|
||||
<%@ include file="../templates/DB/Input/HelpClass.javajet"%>
|
||||
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/DB/CheckContextPassword.javajet"%>
|
||||
<%
|
||||
|
||||
class DBInputBeginUtil extends DefaultDBInputUtil{
|
||||
|
||||
@@ -16,7 +16,6 @@ imports="
|
||||
skeleton="../templates/db_output_bulk.skeleton"
|
||||
%>
|
||||
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/Log4j/DBLogUtil.javajet"%>
|
||||
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/DB/CheckContextPassword.javajet"%>
|
||||
<%
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
INode node = (INode)codeGenArgument.getArgument();
|
||||
|
||||
@@ -8,7 +8,6 @@ imports="
|
||||
"
|
||||
%>
|
||||
<%@ include file="../templates/DB/Row/HelpClass.javajet"%>
|
||||
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/DB/CheckContextPassword.javajet"%>
|
||||
<%
|
||||
|
||||
class DBRowBeginUtil extends DefaultDBRowUtil{
|
||||
|
||||
@@ -14,7 +14,6 @@ imports="
|
||||
"
|
||||
%>
|
||||
<%@ include file="../templates/Log4j/Log4jDBConnUtil.javajet"%>
|
||||
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/DB/CheckContextPassword.javajet"%>
|
||||
<%
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
INode node = (INode)codeGenArgument.getArgument();
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
<%@jet%>
|
||||
<%
|
||||
org.talend.designer.codegen.config.CodeGeneratorArgument codeGenArgument_pwdCheck = (org.talend.designer.codegen.config.CodeGeneratorArgument)argument;
|
||||
org.talend.core.model.process.INode node_pwdCheck = (org.talend.core.model.process.INode)codeGenArgument_pwdCheck.getArgument();
|
||||
boolean useExistingConnection_pwdCheck = "true".equalsIgnoreCase(ElementParameterParser.getValue(node_pwdCheck,"__USE_EXISTING_CONNECTION__"));
|
||||
if(!useExistingConnection_pwdCheck) {
|
||||
String dbhost_pwdCheck = ElementParameterParser.getValue(node_pwdCheck, "__HOST__");
|
||||
String dbuser_pwdCheck = ElementParameterParser.getValue(node_pwdCheck, "__USER__");
|
||||
String dbport_pwdCheck = ElementParameterParser.getValue(node_pwdCheck, "__PORT__");
|
||||
String dbname_pwdCheck = ElementParameterParser.getValue(node_pwdCheck, "__DBNAME__");
|
||||
String dbproperties_pwdCheck = ElementParameterParser.getValue(node_pwdCheck, "__PROPERTIES__");
|
||||
final class ValueChecker {
|
||||
|
||||
public boolean checkValueForPassword(String inputValue, org.talend.core.model.process.IContext context) {
|
||||
if(null == inputValue) {
|
||||
return false;
|
||||
}
|
||||
java.util.List<String> parsed = new java.util.ArrayList<String>();
|
||||
String value = inputValue.trim();
|
||||
while(org.talend.core.model.utils.ContextParameterUtils.containContextVariables(value)) {
|
||||
String nonQuoteStr = org.talend.core.utils.TalendQuoteUtils.filterQuote(value);
|
||||
String contextVar = org.talend.core.model.utils.ContextParameterUtils.getVariableFromCode(nonQuoteStr);
|
||||
parsed.add(contextVar);
|
||||
String curValue = org.talend.core.model.utils.ContextParameterUtils.JAVA_NEW_CONTEXT_PREFIX + contextVar;
|
||||
int index = value.indexOf(curValue);
|
||||
if(index != -1) {
|
||||
value = value.substring(index + curValue.length(), value.length());
|
||||
}
|
||||
}
|
||||
for(String parsedParam : parsed) {
|
||||
org.talend.core.model.process.IContextParameter param = context.getContextParameter(parsedParam);
|
||||
if(org.talend.core.model.utils.ContextParameterUtils.isPasswordType(param)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
ValueChecker checker = new ValueChecker();
|
||||
org.talend.core.model.process.IContext context_pwdCheck = node_pwdCheck.getProcess().getContextManager().getDefaultContext();
|
||||
if(checker.checkValueForPassword(dbhost_pwdCheck, context_pwdCheck) || checker.checkValueForPassword(dbport_pwdCheck, context_pwdCheck) || checker.checkValueForPassword(dbname_pwdCheck, context_pwdCheck) || checker.checkValueForPassword(dbproperties_pwdCheck, context_pwdCheck) || checker.checkValueForPassword(dbuser_pwdCheck, context_pwdCheck)) {
|
||||
%>
|
||||
if(true) {
|
||||
throw new RuntimeException("Password context variable is used in plain text field!");
|
||||
}
|
||||
<%
|
||||
}
|
||||
}
|
||||
%>
|
||||
Reference in New Issue
Block a user