Encrypting a property in a property file being read via archaius - netflix-archaius

I have a use case where I need to encrypt some a property in my config.properties file which is read via archaius. Is there a way I can achieve this ?

Related

How to add custom properties in Apache NiFi and read them on the fly without up down nifi

Like I add some properties in custom-properties file. Now I want to read these custom properties without up down Apache NiFi.
content in custom.properties
sourcepath=/home/ist/s
destination=/home/ist/d
I want to read these properties without up-down NiFi to perform action like get, put.
As of NiFi 1.4.0, you can set a sort of Variable Registry on a process group (NIFI-4224). If you right-click on a process group and choose "Variables", you can set key/value pairs that you can use without having to start and stop NiFi.

How to encrypt server.ssl.key-store-password value and use it in SpringBoot

I would like to know is there anyway we can encrypt the server.ssl.key-store-password value and store it in application.properties file instead of storing it in plain text.
i couldn't find any documentation on this. Any help on this is highly appreciated.
Thanks in advance.
Spring allows you to encrypt the properties file but the key for that encryption needs to be kept somewhere. This answer suggest keeping them in environment variables and points to a guide about how to encrypt them if you still want to.
You can use "jasypt-spring-boot-starter" for your need. All you to need to do are the following steps.
Download the "jasypt-spring-boot-starter" from maven central repo.
com.github.ulisesbocchio
jasypt-spring-boot-starter
x.x.x
In your Spring Boot start file where the "#SpringBootApplication" annotation is located, just include "#EnableEncryptableProperties". A point to note here is that once you place encryptable properties annotation on the main start file, all the property files of your application will be loaded and scanned by Jaspyt module for any property value that is marked starting with "ENC".
In your "application.properties" file there are few more configurations that needed to be added like below (all these are defaults and you can change these according to your requirement):
jasypt.encryptor.password=<Some password for encryption>
jasypt.encryptor.algorithm=PBEWITHHMACSHA256ANDAES_128
jasypt.encryptor.key-obtention-iterations=1000
jasypt.encryptor.pool-size=1
jasypt.encryptor.salt-generator-classname=org.jasypt.salt.RandomSaltGenerator
jasypt.encryptor.iv-generator-classname=org.jasypt.iv.RandomIvGenerator
jasypt.encryptor.string-output-type=base64
Once you are done with the above steps, now you can place your encrypted property value under the ENC(). Jasypt will scan values which are enclosed in ENC() and will try to decrypt the value.
For e.g.
spring.datasource.password=ENC(tHe0atcRsE+uOTxt2GmFYPXNHREch9R/12qD082gw7vv6bby5Rk)

Open file with VB.NET application (How does my project know which file is being opened?)

I am in the process of making a simple image viewer in VB.NET. I want to be able to open an image with my application. How does VB.NET receive the URL of the file that the user is trying to open?
Seems simple but without knowing key terms, my Google searches are returning completely the wrong things!
You want to inspect the Environment.CommandLine Property
This property provides access to the program name and any arguments specified on the command line when the current process was started.
The program name can include path information, but is not required to do so. Use the GetCommandLineArgs method to retrieve the command-line information parsed and stored in an array of strings.

Mule Studio: Mule Flow: Use of File

Within my flow - I am trying to read username pwd from a file based on a key sent by the user.
Question:
Does Mule allow to read data from the file (it can contain set of
user keys and every key will have a uname/pwd
What connector to use it?
To read a single file, you can use the Mule Requester Module.
<mulerequester:request resource="file://${my.filename}"/>
to read a file can use file inbound, the payload after file inbound will be the content of the file
There is a lot of documentation that shows users different ways to read a properties file in Mule flows.
Here are three approaches on how you can do this:
Reading a properties file using ${Key} expression
Reading a properties file using ![p[‘Key’]] expression
Reading a properties file using p() function from DataWeave

How to specify linqtohql.generatorsregistry property in XML configuration file

It is not possible to specify linqtohql.generatorsregistry in session-factory section of NHibernate xml configuration file because the configuration file is not valid then. Where the property should be set in xml if not there? According to xsd of the configuration file there is not any other place where to put it.
I have been doing information gathering on this problem and I have no definite answer but here is what I got:
I am not sure this is possible based on: https://groups.google.com/forum/#!topic/nhusers/eUt7PRWOeAI
Rather than try to get this working in the config file, I tried the ISessionFactory and this seem to work: https://stackoverflow.com/a/6271616/178550