You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by govimurugan <go...@gmail.com> on 2015/04/09 00:24:47 UTC

Jsypt password encryption with Bridge property place holder

Team,

Please anybody post working config sample for password encryption with jsypt
and bridge property place holder in camel context xml.

I need to access the fields from property file in camel as well spring
config.

Thanks in Adavnce,
Murugan



--
View this message in context: http://camel.465427.n5.nabble.com/Jsypt-password-encryption-with-Bridge-property-place-holder-tp5765490.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Jsypt password encryption with Bridge property place holder

Posted by Andrew Block <an...@gmail.com>.
The BridgePropertyPlaceholderConfigurer does not currently work for properties outside the Camel context. I did test and the properties are successfully decrypted if used within the Camel Context.

A patch was just applied to close this gap of functionality and will be available in Camel 2.14.3, 2.15.2 and 2.16.0

Full details of the bug is found in the following JIRA:
https://issues.apache.org/jira/browse/CAMEL-7849 

Thanks,
Andy

-- 
Andrew Block
On April 11, 2015 at 12:49:20 AM, govimurugan (govi.murugan@gmail.com) wrote:

Thank you Andy for your response. Sorry for the late response. I was into  
another issue.  

I tried as you told, but decryption is not happening properly. I am  
getting below exception while trying to connect RabbitMQ. but it success  
with plain text password. Am I doing anything wrong or missing anything?  

in property file  
rabbitMQ.password.dev=ENC(E+HxIGnEZfuI9aLxeQoVYg==)  

camel-context xml  

<bean id="jasypt"  
class="org.apache.camel.component.jasypt.JasyptPropertiesParser">  
<property name="password" value="Secret"/>  
</bean>  

<bean id="bridgePropertyPlaceholder"  

class="org.apache.camel.spring.spi.BridgePropertyPlaceholderConfigurer">  
<property name="location" value="classpath:sql.properties"/>  
<property name="parser" ref="jasypt"/>  
</bean>  


amqp connect factory bean configuration:  
<property name="password" value="${rabbitMQ.password.dev}"/>  




--  
View this message in context: http://camel.465427.n5.nabble.com/Jsypt-password-encryption-with-Bridge-property-place-holder-tp5765490p5765614.html  
Sent from the Camel - Users mailing list archive at Nabble.com.  

Re: Jsypt password encryption with Bridge property place holder

Posted by govimurugan <go...@gmail.com>.
Thank you Andy for your response.  Sorry for the late response.  I was into
another issue.

I tried as you told,  but decryption is not happening properly.  I am
getting below exception while trying to connect RabbitMQ.  but it success
with plain text password.   Am I doing anything wrong or missing anything?

in property file
rabbitMQ.password.dev=ENC(E+HxIGnEZfuI9aLxeQoVYg==)

camel-context xml

<bean id="jasypt"
class="org.apache.camel.component.jasypt.JasyptPropertiesParser">
    <property name="password" value="Secret"/>
</bean>

 <bean id="bridgePropertyPlaceholder"
       
class="org.apache.camel.spring.spi.BridgePropertyPlaceholderConfigurer">
    <property name="location" value="classpath:sql.properties"/>
     <property name="parser" ref="jasypt"/>
  </bean>


 amqp connect factory bean configuration:
<property name="password" value="${rabbitMQ.password.dev}"/>
  



--
View this message in context: http://camel.465427.n5.nabble.com/Jsypt-password-encryption-with-Bridge-property-place-holder-tp5765490p5765614.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Jsypt password encryption with Bridge property place holder

Posted by Andrew Block <an...@gmail.com>.
Murugan,

You can use the JasyptPropertiesParser in combination to the BridgePropertyPlaceholderConfigurer similar to the following unit test example

https://github.com/apache/camel/blob/master/components/camel-jasypt/src/test/resources/org/apache/camel/component/jasypt/SpringJasyptBridgePropertiesTest.xml

- Andy

-- 
Andrew Block

On April 9, 2015 at 12:19:34 AM, govimurugan (govi.murugan@gmail.com) wrote:

Team,  

Please anybody post working config sample for password encryption with jsypt  
and bridge property place holder in camel context xml.  

I need to access the fields from property file in camel as well spring  
config.  

Thanks in Adavnce,  
Murugan  



--  
View this message in context: http://camel.465427.n5.nabble.com/Jsypt-password-encryption-with-Bridge-property-place-holder-tp5765490.html  
Sent from the Camel - Users mailing list archive at Nabble.com.