I'm using the latest milestone release of Spring Cloud 2020.0.0 (M6) and I get the "No key was installed for encryption service" error even though I have the encrypt.key property set in bootstrap.properties. When I change the version back to Hoxton.SR9, it works.
There isn't much in the way of configuration or extra code, outside of port settings and config location. I've tried multiple milestone releases on 2020.0.0 and they all seem to have this problem, but not the previous release.
Environment: JDK 15 SpringBoot 2.4.0 SpringCloud 2020.0.0-M6
I did a bit of digging during startup and it appears as though the TextEncryptorLocator does not get loaded because of an unresolved condition @ConditionalOnBean(TextEncryptor). The startup logs seem to indicate the same thing:
SingleTextEncryptorConfiguration: Did not match: - @ConditionalOnBean (types: org.springframework.security.crypto.encrypt.TextEncryptor; SearchStrategy: all) did not find any beans of type org.springframework.security.crypto.encrypt.TextEncryptor (OnBeanCondition)
DefaultTextEncryptorConfiguration matched: - @ConditionalOnMissingBean (types: org.springframework.security.crypto.encrypt.TextEncryptor; SearchStrategy: all) did not find any beans (OnBeanCondition)
In Hoxton, I see:
SingleTextEncryptorConfiguration matched: - @ConditionalOnBean (types: org.springframework.security.crypto.encrypt.TextEncryptor; SearchStrategy: all) found bean 'defaultTextEncryptor'; @ConditionalOnMissingBean (types: org.springframework.cloud.config.server.encryption.TextEncryptorLocator; SearchStrategy: all) did not find any beans (OnBeanCondition)
and
DefaultTextEncryptorConfiguration: Did not match: - @ConditionalOnMissingBean (types: org.springframework.security.crypto.encrypt.TextEncryptor; SearchStrategy: all) found beans of type 'org.springframework.security.crypto.encrypt.TextEncryptor' defaultTextEncryptor (OnBeanCondition)
I didn't notice any differences in the auto-config logic, so I'm not sure why the behavior has changed.
Comment From: spencergibb
Is this still an issue in 2020.0.1?
Comment From: scottjungers
Verified this has been fixed in 2020.0.1