Skip to content

Commit

Permalink
Fix #96: Switched to com.melloware Jasypt for Java8+ support.
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware committed Dec 3, 2018
1 parent 184d375 commit 5e81467
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public StringEncryptor stringEncryptor() {
config.setPoolSize("1");
config.setProviderName("SunJCE");
config.setSaltGeneratorClassName("org.jasypt.salt.RandomSaltGenerator");
config.setIvGeneratorClassName("org.jasypt.salt.NoOpIVGenerator");
config.setStringOutputType("base64");
encryptor.setConfig(config);
return encryptor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public StringEncryptor stringEncryptor() {
config.setPoolSize("1");
config.setProviderName("SunJCE");
config.setSaltGeneratorClassName("org.jasypt.salt.RandomSaltGenerator");
config.setIvGeneratorClassName("org.jasypt.salt.NoOpIVGenerator");
config.setStringOutputType("base64");
encryptor.setConfig(config);
return encryptor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public MyEncryptablePropertyResolver(String password) {
config.setPoolSize(1);
config.setProviderName("SunJCE");
config.setSaltGeneratorClassName("org.jasypt.salt.RandomSaltGenerator");
config.setIvGeneratorClassName("org.jasypt.salt.NoOpIVGenerator");
config.setStringOutputType("base64");
encryptor.setConfig(config);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public MyEncryptablePropertyResolver(char[] password) {
config.setPoolSize(1);
config.setProviderName("SunJCE");
config.setSaltGeneratorClassName("org.jasypt.salt.RandomSaltGenerator");
config.setIvGeneratorClassName("org.jasypt.salt.NoOpIVGenerator");
config.setStringOutputType("base64");
encryptor.setConfig(config);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ jasypt:
bean: encryptorBean
password: ${JASYPT_ENCRYPTOR_PASSWORD:}

username: uli
test.user: uli
#password: ENC(nrmZtkF7T0kjG/VodDvBw93Ct8EgjCA+)
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ public class NoPasswordDemoApplicationTest {

@Test
public void testUsername() {
Assert.assertEquals("uli", environment.getProperty("username"));
Assert.assertEquals("uli", environment.getProperty("test.user"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ static public StringEncryptor stringEncryptor() {
config.setPoolSize("1");
config.setProviderName("SunJCE");
config.setSaltGeneratorClassName("org.jasypt.salt.RandomSaltGenerator");
config.setIvGeneratorClassName("org.jasypt.salt.NoOpIVGenerator");
config.setStringOutputType("base64");
encryptor.setConfig(config);
return encryptor;
Expand Down
8 changes: 1 addition & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@
<java.version>1.8</java.version>
<spring.boot.version>2.1.0.RELEASE</spring.boot.version>
<spring.cloud.version>Finchley.RELEASE</spring.cloud.version>
<jasypt.version>1.9.2</jasypt.version>
<maven.compiler.version>3.7.0</maven.compiler.version>
<start-class>Application</start-class>
<jasypt.spring.boot.version>2.1.0</jasypt.spring.boot.version>
<jasypt.spring.boot.version>2.1.1-SNAPSHOT</jasypt.spring.boot.version>
</properties>

<modules>
Expand Down Expand Up @@ -130,11 +129,6 @@
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring.boot.version}</version>
</dependency>
<dependency>
<groupId>org.jasypt</groupId>
<artifactId>jasypt</artifactId>
<version>${jasypt.version}</version>
</dependency>
<dependency>
<groupId>com.github.ulisesbocchio</groupId>
<artifactId>jasypt-spring-boot</artifactId>
Expand Down

3 comments on commit 5e81467

@apacheshine
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

springboot 1.5 and jaspyt-spring-boot-starter 1.9. use own encryptor named @bean("jasyptStringEncryptor") but not work and another way is too . why ?

@apacheshine
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

error info missing jaspyt.encryptor.password

@melloware
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.