Ignore warning for CORDA environment variables in all caps

This commit is contained in:
john.buckle@r3.com 2020-05-13 09:51:35 +08:00
parent fbf0bd9bd9
commit c3ea2c1470

View File

@ -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,13 @@ object ConfigHelper {
return ConfigFactory.parseMap(
toProperties()
.mapKeys {
var newKey = (it.key as String)
val original = it.key as String
if (original == original.toUpperCase()){
return@mapKeys original
}
var newKey = original
.replace('_', '.')
.replace(UPPERCASE_PROPERTY_PREFIX, CORDA_PROPERTY_PREFIX)
@ -175,4 +182,4 @@ fun MutualSslConfiguration.configureDevKeyAndTrustStores(myLegalName: CordaX500N
else -> throw IllegalArgumentException("CryptoService not supported.")
}
}
}
}