mirror of
https://github.com/corda/corda.git
synced 2024-12-18 20:47:57 +00:00
CORDA-3240: optional node.conf property not recognized when overridden (#5505)
* CORDA-3240: optional node.conf property not recognized when overridden * CORDA-3240: address detekt issues * [NOTICK]: undo incorrectly commmented out include
This commit is contained in:
parent
5f95b54862
commit
4672c3a13c
@ -375,7 +375,7 @@ abstract class AbstractNode<S>(val configuration: NodeConfiguration,
|
||||
signedNodeInfo,
|
||||
netParams,
|
||||
keyManagementService,
|
||||
configuration.networkParameterAcceptanceSettings)
|
||||
configuration.networkParameterAcceptanceSettings!!)
|
||||
try {
|
||||
startMessagingService(rpcOps, nodeInfo, myNotaryIdentity, netParams)
|
||||
} catch (e: Exception) {
|
||||
|
@ -81,7 +81,7 @@ interface NodeConfiguration {
|
||||
|
||||
val cordappSignerKeyFingerprintBlacklist: List<String>
|
||||
|
||||
val networkParameterAcceptanceSettings: NetworkParameterAcceptanceSettings
|
||||
val networkParameterAcceptanceSettings: NetworkParameterAcceptanceSettings?
|
||||
|
||||
val blacklistedAttachmentSigningKeys: List<String>
|
||||
|
||||
|
@ -75,7 +75,8 @@ data class NodeConfigurationImpl(
|
||||
override val jmxReporterType: JmxReporterType? = Defaults.jmxReporterType,
|
||||
override val flowOverrides: FlowOverrideConfig?,
|
||||
override val cordappSignerKeyFingerprintBlacklist: List<String> = Defaults.cordappSignerKeyFingerprintBlacklist,
|
||||
override val networkParameterAcceptanceSettings: NetworkParameterAcceptanceSettings = Defaults.networkParameterAcceptanceSettings,
|
||||
override val networkParameterAcceptanceSettings: NetworkParameterAcceptanceSettings? =
|
||||
Defaults.networkParameterAcceptanceSettings,
|
||||
override val blacklistedAttachmentSigningKeys: List<String> = Defaults.blacklistedAttachmentSigningKeys
|
||||
) : NodeConfiguration {
|
||||
internal object Defaults {
|
||||
|
@ -21,6 +21,7 @@ import net.corda.node.services.config.DevModeOptions
|
||||
import net.corda.node.services.config.FlowOverride
|
||||
import net.corda.node.services.config.FlowOverrideConfig
|
||||
import net.corda.node.services.config.FlowTimeoutConfiguration
|
||||
import net.corda.node.services.config.NetworkParameterAcceptanceSettings
|
||||
import net.corda.node.services.config.NetworkServicesConfig
|
||||
import net.corda.node.services.config.NodeH2Settings
|
||||
import net.corda.node.services.config.NodeRpcSettings
|
||||
@ -143,6 +144,18 @@ internal object NetworkServicesConfigSpec : Configuration.Specification<NetworkS
|
||||
}
|
||||
}
|
||||
|
||||
internal object NetworkParameterAcceptanceSettingsSpec :
|
||||
Configuration.Specification<NetworkParameterAcceptanceSettings>("NetworkParameterAcceptanceSettings") {
|
||||
private val autoAcceptEnabled by boolean().optional().withDefaultValue(true)
|
||||
private val excludedAutoAcceptableParameters by string().listOrEmpty()
|
||||
override fun parseValid(configuration: Config): Valid<NetworkParameterAcceptanceSettings> {
|
||||
return valid(NetworkParameterAcceptanceSettings(configuration[autoAcceptEnabled],
|
||||
configuration[excludedAutoAcceptableParameters].toSet())
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
internal object CertChainPolicyConfigSpec : Configuration.Specification<CertChainPolicyConfig>("CertChainPolicyConfig") {
|
||||
private val role by string()
|
||||
|
@ -58,6 +58,9 @@ internal object V1NodeConfigurationSpec : Configuration.Specification<NodeConfig
|
||||
private val cordappDirectories by string().mapValid(::toPath).list().optional()
|
||||
private val cordappSignerKeyFingerprintBlacklist by string().list().optional().withDefaultValue(Defaults.cordappSignerKeyFingerprintBlacklist)
|
||||
private val blacklistedAttachmentSigningKeys by string().list().optional().withDefaultValue(Defaults.blacklistedAttachmentSigningKeys)
|
||||
private val networkParameterAcceptanceSettings by nested(NetworkParameterAcceptanceSettingsSpec)
|
||||
.optional()
|
||||
.withDefaultValue(Defaults.networkParameterAcceptanceSettings)
|
||||
@Suppress("unused")
|
||||
private val custom by nestedObject().optional()
|
||||
@Suppress("unused")
|
||||
@ -117,7 +120,8 @@ internal object V1NodeConfigurationSpec : Configuration.Specification<NodeConfig
|
||||
jarDirs = configuration[jarDirs],
|
||||
cordappDirectories = cordappDirectories.map { baseDirectoryPath.resolve(it) },
|
||||
cordappSignerKeyFingerprintBlacklist = configuration[cordappSignerKeyFingerprintBlacklist],
|
||||
blacklistedAttachmentSigningKeys = configuration[blacklistedAttachmentSigningKeys]
|
||||
blacklistedAttachmentSigningKeys = configuration[blacklistedAttachmentSigningKeys],
|
||||
networkParameterAcceptanceSettings = configuration[networkParameterAcceptanceSettings]
|
||||
))
|
||||
} catch (e: Exception) {
|
||||
return when (e) {
|
||||
|
Loading…
Reference in New Issue
Block a user