Skip to content

convertPropertyValue (for reading encrypted values) not working [SPR-14001] #18574

Closed

Description

@spring-projects-issues

Alireza Fattahi opened SPR-14001 and commented

As mentioned in http://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/beans/factory/config/PropertyResourceConfigurer.html:

the convertPropertyValue method has been documented as:

Convert the given property value from the properties source to the value which should be applied.
The default implementation simply returns the original value. Can be overridden in subclasses, for example to detect encrypted values and decrypt them accordingly.

So instead of using:

<context:property-placeholder location="classpath:/configs/*.properties,classpath:/configs/bsi/*-config.properties" />

I used this:

<bean class="foo.bar.security.DecryptPropertyConfigurer">
   <property name="locations">
       <list>
           <value>classpath:/configs/*.properties</value>
           <value>classpath:/configs/bsi/*-config.properties</value>
       </list>
   </property>  
   </bean>

an the new PropertySourcesPlaceholderConfigurer is defined as:

public class DecryptPropertyConfigurer extends PropertySourcesPlaceholderConfigurer {

    @Override
    protected String convertPropertyValue(String originalValue){
        //for some properties, do some conversions
    }

}

The convert method is never called. Am I missing some thing our this is a bug?!


Affects: 4.2.4

Issue Links:

Activity

  1. added
    type: bug
    status: waiting-for-triage
    in: core
    and removed
    type: bug
    on Jan 11, 2019
  2. added
    status: bulk-closed
    and removed
    status: waiting-for-triage
    on Jan 11, 2019
  3. spring-projects-issues commented on Jan 12, 2019

    @spring-projects-issues
    CollaboratorAuthor

    Bulk closing outdated, unresolved issues. Please, reopen if still relevant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: corestatus: bulk-closed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions