Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Santi2
Contributor III
Contributor III

Identify password type in a context variable

Hi,

I'm trying to identify when a context variable type is a password in a tJavaRow but I don't know how to do it. Is there a way to do it?

 

Thank you

Labels (2)
1 Solution

Accepted Solutions
Santi2
Contributor III
Contributor III
Author

Of course, I used a tJavaFlex and then a tFilterRow in order to filter the null values. I don't know which is the minor version to compile the code but it must be greater than v6.1 because the context method "getContextType(String)" doesn't exist.

 

Here it goes:

0683p000009M0JV.png

View solution in original post

11 Replies
fdenis
Master
Master

what is your use case?
Anonymous
Not applicable

There is no way to do this within a tJavaRow. However, you could simply put a pswd_ prefix on all of your password contexts and identify them that way. 

Santi2
Contributor III
Contributor III
Author

Hi Francois,

 

I'm trying to do a generic job for integrations in order to encrypt all password fields of the context. I load the variables reading a properties file in plain text and then using a tContextLoad. I want to identify which variables are passwords and encrypt them using AES to save them into a file.

 

Thanks

Anonymous
Not applicable

Are you sure this is what you want? You are keeping your data in plain text in a file and only wishing to encrypt once inside the Talend job? That seems like a bit of a strange use case. 

fdenis
Master
Master

you can re encryp all password , string,... without knowing if it's a password or e text.
for generic integration. you may have one context file specific for each environment.
so force replacemnt or context.
if you run in tos in enterprise version you did not nead it.

is Talend password encryption is not enough?
Santi2
Contributor III
Contributor III
Author

Hi rhall_2_0,

 

Nowadays I have a process that identifies from the plain text file if a specific variable is blank or not. If it is not blank, I encrypt it in AES and I save it in other file, then, I blank the value in the plain text file. On the other hand, if the value of the variable is blank in the plain text file it means that an encrypt file with the password exists. I read the encrypted file, decode the password and assign the value to the variable of context. Now, I want to convert this process into a generic detecting which variables of context are password type.

Anonymous
Not applicable

I'm afraid there is no way to identify which contexts are password contexts within the job. You *could* make use of the the .item file (which is an XML file) and look for the a contextParameter element of type "id_Password". These can be found here ....

/talendfile0683p000009MAB6.pngrocessType/context/

 

That might be a way of doing this, BUT be careful not to modify the .item files.

Santi2
Contributor III
Contributor III
Author

Hi,

 

Finally I found the way to do it, unfortunately I had issues when I tried to do it in Talend 6.1. In Talend 7 I was able to develop a Java code to identify password types using context methods.

 

Thank you for all the replies 0683p000009MACn.png

Anonymous
Not applicable

That's great. I was looking at the code for v621 and couldn't see how it was possible. Would you mind sharing your code?