Closed Comven closed 6 years ago
I second this. the 1.17 does not work as expected. 1.16 works as per instructions.
Alright might be a regression. Let me take a look
same question it doesn't work with spring cloud environment if version is 1.17 (1.16 is fine) but it could work without spring cloud
same issue in cloud env with 1.17 wait for solution
can you guys please provide a code sample where it doesn't work? I tested every single module from the sample projects against jasypt-spring-boot 1.17 and Spring Boot Versions 1.5.10, 2.0.0.M2 and 2.0.0.M7 I found no errors.
@EnableEurekaServer
@SpringBootApplication
public class EurekaServerApplication {
public static void main(String[] args) {
ApplicationContext ctx = SpringApplication.run(EurekaServerApplication.class, args);
}
}
spring:
application:
name: eurekaServer
eureka:
instance:
hostname: localhost
client:
registerWithEureka: false
fetchRegistry: false
serviceUrl:
defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/
jasypt:
encryptor:
password: chinesevory@163.com
security:
basic:
enabled: true
user:
name: ENC(sHV0EyVQChGylv+ca+1v5A==)
password: ENC(ik738nnCouT/li3/h8+zPeo2NY4ghxwz1axI216qlpg=)
--server.port=8761 --eureka.server.enable-self-preservation=false
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.10.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<spring-cloud.version>Edgware.RELEASE</spring-cloud.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-eureka-server</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>com.github.ulisesbocchio</groupId>
<artifactId>jasypt-spring-boot-starter</artifactId>
<!-- it doesn't work with spring cloud environment if version is 1.17 -->
<version>1.16</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
When i run it at spring-cloud environment with default configuration,I can‘t find the log like this
Encryptor config not found for property jasypt.encryptor.algorithm, using default value: PBEWithMD5AndDES Encryptor config not found for property jasypt.encryptor.keyObtentionIterations, using default value: 1000 Encryptor config not found for property jasypt.encryptor.poolSize, using default value: 1 Encryptor config not found for property jasypt.encryptor.providerName, using default value: null Encryptor config not found for property jasypt.encryptor.saltGeneratorClassname, using default value: org.jasypt.salt.RandomSaltGenerator Encryptor config not found for property jasypt.encryptor.stringOutputType, using default value: base64
unless i add @EnableEncryptableProperties .
@Comven The same situation. if add @EnableEncryptableProperties, it worked fine.
I find a way can work fine,where use 1.17 version,the parameter wich we want to decrypt must be configured at bootstrap.properties instead of application.properties. if we configure it at application.properties, it will decrypt fail. It's not reasonable. please have a look! @ulisesbocchio.
Just released 1.18, please validate the fix when It's available in maven central and let me know
@Comven @wangyanrui @qrqhuang can any of you guys validate the fix please?
@ulisesbocchio 1.18 works fine! Thanks!
It runs perfectly.
Awesome! Thanks guys!
I use starter of version 1.17 with spring-cloud,it not auto configure ,unless @EnableEncryptableProperties was configured,but when I use 1.16,it worked fine。Is there anything wrong?