893 B
893 B
Property Guard
property-guard-spring-boot-starter is a utility that can help you protect secret values in Spring Boot configurations.
Example usage
1. Implementation this module
dependencies {
implementation(platform("com.onixbyte:devkit-bom:$devKitVersion"))
implementation("com.onixbyte:devkit-utils")
implementation("com.onixbyte:property-guard-spring-boot-starter")
}
2. Generate a secret
Use the following codes to get a random secret.
@SpringBootTest
class SpringBootApplicationTest {
@Test
void contextLoads() {
System.out.println(AesUtil.generateRandomSecret()); // Output: a 16-char long secret
}
}
Or you can write a 16-char long secret by yourself.