Feature/improve server config non privacy safe setting handling (#1794)

* Move the "group" arg at the second position after "protoNumber"

To make it consistent for all settings

* Improve server config non privacy safe setting handling

---------

Co-authored-by: Mitchell Syer <Syer10@users.noreply.github.com>
This commit is contained in:
schroda
2025-11-26 03:58:00 +01:00
committed by GitHub
parent aa8d27f679
commit 9d7f54be82
5 changed files with 182 additions and 40 deletions

View File

@@ -178,6 +178,23 @@ open class ConfigManager {
userConfigFile.writeText(newUserConfigDoc.render())
getUserConfig().entrySet().forEach { internalConfig = internalConfig.withValue(it.key, it.value) }
}
fun getRedactedConfig(nonPrivacySafeKeys: List<String>): Config {
val entries =
config.entrySet().associate { entry ->
val key = entry.key
val value =
if (nonPrivacySafeKeys.any { key.split(".").getOrNull(1) == it }) {
"[REDACTED]"
} else {
entry.value.unwrapped()
}
key to value
}
return ConfigFactory.parseMap(entries)
}
}
object GlobalConfigManager : ConfigManager()