CORDA-1277 Remove double quotes from keys in reference.conf

CORDA-1277 Remove double quotes from keys in reference.conf
This commit is contained in:
Andrzej Grzesik 2018-03-29 09:15:30 +01:00 committed by GitHub
commit 2863f8403b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 27 additions and 7 deletions

View File

@ -34,6 +34,8 @@ from the previous milestone release.
* Introduced a placeholder for custom properties within ``node.conf``; the property key is "custom".
* Property keys with double quotes (e.g. `"key"`) in ``node.conf`` are no longer allowed, for rationale refer to :doc:`corda-configuration-file`.
* java.math.BigInteger serialization support added.
* java.security.cert.CRLReason added to the default Whitelist.

View File

@ -22,6 +22,15 @@ Format
The Corda configuration file uses the HOCON format which is superset of JSON. Please visit
`<https://github.com/typesafehub/config/blob/master/HOCON.md>`_ for further details.
Please do NOT use double quotes (``"``) in configuration keys.
Node setup will log `Config files should not contain \" in property names. Please fix: [key]` as error
when it founds double quotes around keys.
This prevents configuration errors when mixing keys containing ``.`` wrapped with double quotes and without them
e.g.:
The property `"dataSourceProperties.dataSourceClassName" = "val"` in ``reference.conf``
would be not overwritten by the property `dataSourceProperties.dataSourceClassName = "val2"` in ``node.conf``.
Defaults
--------
A set of default configuration options are loaded from the built-in resource file ``/node/src/main/resources/reference.conf``.

View File

@ -3,9 +3,9 @@ keyStorePassword : "cordacadevpass"
trustStorePassword : "trustpass"
dataSourceProperties : {
dataSourceClassName : org.h2.jdbcx.JdbcDataSource
"dataSource.url" : "jdbc:h2:file:"${baseDirectory}"/persistence"
"dataSource.user" : sa
"dataSource.password" : ""
dataSource.url : "jdbc:h2:file:"${baseDirectory}"/persistence"
dataSource.user : sa
dataSource.password : ""
}
p2pAddress : "my-corda-node:10002"
rpcSettings = {

View File

@ -35,7 +35,16 @@ object ConfigHelper {
.withFallback(appConfig)
.withFallback(defaultConfig)
.resolve()
log.info("Config:\n${finalConfig.root().render(ConfigRenderOptions.defaults())}")
val entrySet = finalConfig.entrySet().filter { entry -> entry.key.contains("\"") }
for (mutableEntry in entrySet) {
val key = mutableEntry.key
log.error("Config files should not contain \" in property names. Please fix: ${key}")
}
return finalConfig
}
}

View File

@ -4,9 +4,9 @@ keyStorePassword = "cordacadevpass"
trustStorePassword = "trustpass"
dataSourceProperties = {
dataSourceClassName = org.h2.jdbcx.JdbcDataSource
"dataSource.url" = "jdbc:h2:file:"${baseDirectory}"/persistence;DB_CLOSE_ON_EXIT=FALSE;LOCK_TIMEOUT=10000;WRITE_DELAY=100;AUTO_SERVER_PORT="${h2port}
"dataSource.user" = sa
"dataSource.password" = ""
dataSource.url = "jdbc:h2:file:"${baseDirectory}"/persistence;DB_CLOSE_ON_EXIT=FALSE;LOCK_TIMEOUT=10000;WRITE_DELAY=100;AUTO_SERVER_PORT="${h2port}
dataSource.user = sa
dataSource.password = ""
}
database = {
transactionIsolationLevel = "REPEATABLE_READ"