feat(config): dev环境DB/Redis连接信息明文写入application-dev.yml, 不再走环境变量; 同步README/.env.example/设计文档

This commit is contained in:
xiaoqu
2026-09-04 14:28:53 +08:00
parent 40ac398acc
commit af23ced207
5 changed files with 29 additions and 41 deletions
@@ -11,8 +11,6 @@ import static org.junit.jupiter.api.Assertions.assertFalse;
class ConfigurationSecurityTest {
private static final Pattern PASSWORD_WITH_DEFAULT =
Pattern.compile("password:\\s*\\$\\{[^}:]+:[^}]+}");
private static final Pattern COMMITTED_AK =
Pattern.compile("xqak_[0-9a-f]{20,}");
@@ -24,11 +22,11 @@ class ConfigurationSecurityTest {
}
@Test
void devConfigurationHasNoRootUserOrPasswordDefaults() throws IOException {
String application = Files.readString(Path.of("src/main/resources/application-dev.yml"));
void baseConfigurationHasNoPlaintextPassword() throws IOException {
// dev 允许明文(内网库,与 xiaoqu-franchisee pom dev 同一惯例);公共 application.yml 不允许
String application = Files.readString(Path.of("src/main/resources/application.yml"));
assertFalse(application.contains("username: root"));
assertFalse(PASSWORD_WITH_DEFAULT.matcher(application).find());
assertFalse(application.contains("password: kaixinjiuhao"));
}
@Test