Return-Path: X-Original-To: apmail-camel-issues-archive@minotaur.apache.org Delivered-To: apmail-camel-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 34C1311CAD for ; Tue, 23 Sep 2014 02:48:34 +0000 (UTC) Received: (qmail 80606 invoked by uid 500); 23 Sep 2014 02:48:34 -0000 Delivered-To: apmail-camel-issues-archive@camel.apache.org Received: (qmail 80572 invoked by uid 500); 23 Sep 2014 02:48:33 -0000 Mailing-List: contact issues-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list issues@camel.apache.org Received: (qmail 80562 invoked by uid 99); 23 Sep 2014 02:48:33 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Sep 2014 02:48:33 +0000 Date: Tue, 23 Sep 2014 02:48:33 +0000 (UTC) From: "Camel Guy (JIRA)" To: issues@camel.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CAMEL-7849) Encrypted properties inside and outside MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CAMEL-7849?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14144233#comment-14144233 ] Camel Guy commented on CAMEL-7849: ---------------------------------- The Camel documentation for Jasypt reads like the examples work for both ${} and {}. It took me about 24 solid working hours to figure this out. This could just be a documentation problem. However, the downside is the additional CPU/memory overhead caused by loading the same .properties files multiple times. In my code, I load two properties files. Not a huge problem. The real problem is that this isn't as easy as it should be. My real use case involves restlet realms. I want to encrypt user passwords. I also want to encrypt JDBC passwords. Therefore, I very much need ${} to work. > Encrypted properties inside and outside > ------------------------------------------------------ > > 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 > Assignee: Willem Jiang > Priority: Minor > > {noformat} > File default.properties contains an entry like: key=ENC(..) > The following Camel Spring DSL snippet decrypts the > property value inside via {{key}} but does > not decrypt it outside of the via ${key}: > > > > "org.apache.camel.spring.spi.BridgePropertyPlaceholderConfigurer"> > > > classpath:default.properties > > > > In order to get ${} to decrypt, first I remove all of the above. > Then I add jasypt dependencies to pom.xml: > > org.jasypt > jasypt > lite > 1.9.2 > > > org.jasypt > jasypt-spring3 > 1.9.2 > > And add the following to Camel Spring DSL: > class="org.jasypt.encryption.pbe.config.EnvironmentStringPBEConfig"> > > > > class="org.jasypt.encryption.pbe.StandardPBEStringEncryptor"> > > > 'org.jasypt.spring3.properties.EncryptablePropertyPlaceholderConfigurer'> > > > > classpath:default.properties > > > "org.apache.camel.component.jasypt.JasyptPropertiesParser"> > > > > > propertiesParserRef="jasypt" > location="classpath:default.properties"/> > This is the only solution that I could discover. Using BridgePropertyPlaceholder > didn't work. must be used inside . > {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)