ulisesbocchio / jasypt-spring-boot

Jasypt integration for Spring boot
MIT License
2.91k stars 522 forks source link

jasypt-spring-boot-starter 2.1.1 spring.profiles.active Unable to load #133

Closed yonghao9531 closed 4 years ago

yonghao9531 commented 5 years ago

jasypt-spring-boot-starter 2.1.1 spring.profiles.active Unable to load bootstrap.yml spring: profiles: active: dev,redis application-redis.yml spring: redis: password: ENC(UEey4QnMF1P1VVwIWGkTug==)

RedisSystemException, Error in execution; nested exception is io.lettuce.core.RedisCommandExecutionException: NOAUTH Authentication required

yuanjinyong commented 5 years ago

I used Spring cloud Finchley.SR3, have this issue too.

This issue is cause by jasypt-spring-boot have conflict with spring-cloud-context-2.0.3.RELEASE. In spring-cloud-context-2.0.3.RELEASE, have the follow change: org\springframework\cloud\bootstrap\BootstrapApplicationListener.java

public void add(PropertySource<?> source) {
            if (source instanceof EnumerablePropertySource 
                    && !this.names.contains(source.getName())) {
                this.sources.addPropertySource(source);
                this.names.add(source.getName());
            }
        }

to

public void add(PropertySource<?> source) {
            // Only add map property sources added by boot, see gh-476
            if (source instanceof OriginTrackedMapPropertySource 
                    && !this.names.contains(source.getName())) {
                this.sources.addPropertySource(source);
                this.names.add(source.getName());
            }
        }

And after use jasypt, the "PropertySource<?> source" instance will be "com.ulisesbocchio.jasyptspringboot.wrapper.EncryptableMapPropertySourceWrapper", it is an intance of EnumerablePropertySource, but not an intance of OriginTrackedMapPropertySource.

OriginTrackedMapPropertySource is a final class, it can not be extended by EncryptableMapPropertySourceWrapper.

ulisesbocchio commented 5 years ago

Thanks @yuanjinyong will add encryptable equivalent on next release

ulisesbocchio commented 4 years ago

this should be solved in 3.0.0

yuanjinyong commented 4 years ago

@ulisesbocchio Need update Spring Cloud to Greenwich.SR3?

WilliamShoww commented 1 year ago

this should be solved in 3.0.0

3.0.0 can be use with SB Hoxton.SR9 version?

cctvckl commented 10 months ago

has this been solved?