[
https://issues.apache.org/jira/browse/CAMEL-7849?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Camel Guy updated CAMEL-7849:
-----------------------------
Description:
{noformat}
I have a properties file named default.properties that contains and entry like:
key=ENC(..)
The following decrypts correctly inside <camelContext> via {{key}} but does not
decrypt it
outside of the <camelContext> via ${key}:
<bean id="jasypt"
class="org.apache.camel.component.jasypt.JasyptPropertiesParser">
<property name="password" value="sysenv:PROPERTIES_KEY"/>
</bean>
<bean id="bridgePropertyPlaceholder"
class="org.apache.camel.spring.spi.BridgePropertyPlaceholderConfigurer">
<property name="locations" >
<list>
<value>classpath:default.properties</value>
</list></property>
<property name='parser' ref='jasypt'/>
</bean>
In order to get ${} to work properly, I must do this after adding jasypt
dependencies to my project POM:
<bean id="environmentVariablesConfiguration"
class="org.jasypt.encryption.pbe.config.EnvironmentStringPBEConfig">
<property name="algorithm" value="PBEWithMD5AndDES" />
<property name="passwordEnvName" value="PROPERTIES_KEY" />
</bean>
<bean id="configurationEncryptor"
class="org.jasypt.encryption.pbe.StandardPBEStringEncryptor">
<property name="config" ref="environmentVariablesConfiguration" />
</bean>
<bean id="propertyConfigurer"
class='org.jasypt.spring3.properties.EncryptablePropertyPlaceholderConfigurer'>
<constructor-arg ref="configurationEncryptor"/>
<property name="locations" >
<list>
<value>classpath:default.properties</value>
</list></property>
</bean>
<bean id="jasypt"
class="org.apache.camel.component.jasypt.JasyptPropertiesParser">
<property name="password" value="sysenv:PROPERTIES_KEY"/>
</bean>
<!-- And inside the camelContext... -->
<camelContext xmlns="http://camel.apache.org/schema/spring">
<propertyPlaceholder id="properties"
propertiesParserRef="jasypt"
location="classpath:default.properties"/>
The second example is the only solution I could find. Using
BridgePropertyPlaceholder did
not work, so I had to to use <propertyPlaceholder> inside <camelContext>.
{noformat}
was:
{noformat}
I have a properties file named default.properties that contains and entry like:
key=ENC(..)
The following decrypts correctly inside <camelContext> via {{key}} but does not
decrypt it
outside of the <camelContext> via ${key}:
<bean id="jasypt"
class="org.apache.camel.component.jasypt.JasyptPropertiesParser">
<property name="password" value="sysenv:PROPERTIES_KEY"/>
</bean>
<bean id="bridgePropertyPlaceholder"
class="org.apache.camel.spring.spi.BridgePropertyPlaceholderConfigurer">
<property name="locations" >
<list>
<value>classpath:default.properties</value>
</list></property>
<property name='parser' ref='jasypt'/>
</bean>
In order to get ${} to work properly, I must do this after adding jasypt to my
project POM:
<bean id="environmentVariablesConfiguration"
class="org.jasypt.encryption.pbe.config.EnvironmentStringPBEConfig">
<property name="algorithm" value="PBEWithMD5AndDES" />
<property name="passwordEnvName" value="PROPERTIES_KEY" />
</bean>
<bean id="configurationEncryptor"
class="org.jasypt.encryption.pbe.StandardPBEStringEncryptor">
<property name="config" ref="environmentVariablesConfiguration" />
</bean>
<bean id="propertyConfigurer"
class='org.jasypt.spring3.properties.EncryptablePropertyPlaceholderConfigurer'>
<constructor-arg ref="configurationEncryptor"/>
<property name="locations" >
<list>
<value>classpath:default.properties</value>
</list></property>
</bean>
<bean id="jasypt"
class="org.apache.camel.component.jasypt.JasyptPropertiesParser">
<property name="password" value="sysenv:PROPERTIES_KEY"/>
</bean>
<!-- And inside the camelContext... -->
<camelContext xmlns="http://camel.apache.org/schema/spring">
<propertyPlaceholder id="properties"
propertiesParserRef="jasypt"
location="classpath:default.properties"/>
The second example is the only solution I could find. Using
BridgePropertyPlaceholder did
not work, so I had to to use <propertyPlaceholder> inside <camelContext>.
{noformat}
> Encrypted properties inside and outside <camelContext>
> ------------------------------------------------------
>
> Key: CAMEL-7849
> URL: https://issues.apache.org/jira/browse/CAMEL-7849
> Project: Camel
> Issue Type: Bug
> Affects Versions: 2.13.2, 2.14.0
> Reporter: Camel Guy
> Priority: Minor
>
> {noformat}
> I have a properties file named default.properties that contains and entry
> like:
> key=ENC(..)
> The following decrypts correctly inside <camelContext> via {{key}} but does
> not decrypt it
> outside of the <camelContext> via ${key}:
> <bean id="jasypt"
> class="org.apache.camel.component.jasypt.JasyptPropertiesParser">
> <property name="password" value="sysenv:PROPERTIES_KEY"/>
> </bean>
> <bean id="bridgePropertyPlaceholder"
> class="org.apache.camel.spring.spi.BridgePropertyPlaceholderConfigurer">
> <property name="locations" >
> <list>
> <value>classpath:default.properties</value>
> </list></property>
> <property name='parser' ref='jasypt'/>
> </bean>
> In order to get ${} to work properly, I must do this after adding jasypt
> dependencies to my project POM:
> <bean id="environmentVariablesConfiguration"
> class="org.jasypt.encryption.pbe.config.EnvironmentStringPBEConfig">
> <property name="algorithm" value="PBEWithMD5AndDES" />
> <property name="passwordEnvName" value="PROPERTIES_KEY" />
> </bean>
> <bean id="configurationEncryptor"
> class="org.jasypt.encryption.pbe.StandardPBEStringEncryptor">
> <property name="config" ref="environmentVariablesConfiguration" />
> </bean>
> <bean id="propertyConfigurer"
> class='org.jasypt.spring3.properties.EncryptablePropertyPlaceholderConfigurer'>
> <constructor-arg ref="configurationEncryptor"/>
> <property name="locations" >
> <list>
> <value>classpath:default.properties</value>
> </list></property>
> </bean>
> <bean id="jasypt"
> class="org.apache.camel.component.jasypt.JasyptPropertiesParser">
> <property name="password" value="sysenv:PROPERTIES_KEY"/>
> </bean>
> <!-- And inside the camelContext... -->
> <camelContext xmlns="http://camel.apache.org/schema/spring">
> <propertyPlaceholder id="properties"
> propertiesParserRef="jasypt"
> location="classpath:default.properties"/>
> The second example is the only solution I could find. Using
> BridgePropertyPlaceholder did
> not work, so I had to to use <propertyPlaceholder> inside <camelContext>.
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)