Feature request
It is already done with Configuration (i.e. resolved) and ConfigurationProxy (i.e. user) structs. The problem is that they are coupled to each other too tight, and there is not much semantic separation. Meanwhile, Iroha does have a semantic of parsing "raw" configuration and validating it.
Resolved config should have different fields. For example, user config might have public_key and private_key fields, while the resolved configuration will only have a single key_pair. It might be worth to define two separate structures (user and resolved configs) if there is a large difference between fields.
I propose to change naming as well, to reflect the purpose clearer: UserConfig instead of ConfigurationProxy, and ResolvedConfig instead of Configuration. Or something like that.
Additionally, it will be helpful to print the resolved configuration (with sensitive data being sanitised) to DEBUG/TRACE level.
Motivation
The transformation from "user" to "resolved" is the great place for validation, deprecation warnings, default fallbacks, and any other custom logic.
Feature request
It is already done with
Configuration(i.e. resolved) andConfigurationProxy(i.e. user) structs. The problem is that they are coupled to each other too tight, and there is not much semantic separation. Meanwhile, Iroha does have a semantic of parsing "raw" configuration and validating it.Resolved config should have different fields. For example, user config might have
public_keyandprivate_keyfields, while the resolved configuration will only have a singlekey_pair. It might be worth to define two separate structures (user and resolved configs) if there is a large difference between fields.I propose to change naming as well, to reflect the purpose clearer:
UserConfiginstead ofConfigurationProxy, andResolvedConfiginstead ofConfiguration. Or something like that.Additionally, it will be helpful to print the resolved configuration (with sensitive data being sanitised) to DEBUG/TRACE level.
Motivation
The transformation from "user" to "resolved" is the great place for validation, deprecation warnings, default fallbacks, and any other custom logic.