mirror of
https://github.com/corda/corda.git
synced 2025-04-12 05:40:48 +00:00
Merge pull request #6245 from corda/EG-1991-ConfigHelper-update
EG-1991 Ignore warning for CORDA environment variables in all caps
This commit is contained in:
commit
bd657fad65
@ -36,6 +36,7 @@ object ConfigHelper {
|
||||
private const val UPPERCASE_PROPERTY_PREFIX = "CORDA."
|
||||
|
||||
private val log = LoggerFactory.getLogger(javaClass)
|
||||
@Suppress("LongParameterList")
|
||||
fun loadConfig(baseDirectory: Path,
|
||||
configFile: Path = baseDirectory / "node.conf",
|
||||
allowMissingConfig: Boolean = false,
|
||||
@ -88,7 +89,15 @@ object ConfigHelper {
|
||||
return ConfigFactory.parseMap(
|
||||
toProperties()
|
||||
.mapKeys {
|
||||
var newKey = (it.key as String)
|
||||
val original = it.key as String
|
||||
|
||||
// Reject environment variable that are in all caps
|
||||
// since these cannot be properties.
|
||||
if (original == original.toUpperCase()){
|
||||
return@mapKeys original
|
||||
}
|
||||
|
||||
var newKey = original
|
||||
.replace('_', '.')
|
||||
.replace(UPPERCASE_PROPERTY_PREFIX, CORDA_PROPERTY_PREFIX)
|
||||
|
||||
@ -175,4 +184,4 @@ fun MutualSslConfiguration.configureDevKeyAndTrustStores(myLegalName: CordaX500N
|
||||
else -> throw IllegalArgumentException("CryptoService not supported.")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user