martinzink commented on code in PR #2063:
URL: https://github.com/apache/nifi-minifi-cpp/pull/2063#discussion_r2541083779
##########
core-framework/include/core/VariableRegistry.h:
##########
@@ -40,53 +44,37 @@ class VariableRegistryImpl : public virtual
VariableRegistry {
~VariableRegistryImpl() override = default;
- bool getConfigurationProperty(const std::string &property, std::string
&value) const override {
- auto prop = variable_registry_.find(property);
- if (prop != variable_registry_.end()) {
- value = prop->second;
- return true;
+ [[nodiscard]] std::optional<std::string> getConfigurationProperty(const
std::string_view key) const override {
+ const auto it = variable_registry_.find(key);
+ if (it == variable_registry_.end()) {
+ return std::nullopt;
}
- return false;
+ return it->second;
}
protected:
void loadVariableRegistry() {
- std::string registry_values;
-
- auto options = configuration_->getConfiguredKeys();
- std::string white_list_opt = "minifi.variable.registry.whitelist",
white_list;
- std::string black_list_opt = "minifi.variable.registry.blacklist",
black_list;
+ gsl_Assert(configuration_);
+ auto options =
configuration_->get(Configuration::minifi_variable_registry_whitelist)
+ .transform([](std::string&& list) { return
utils::string::split(std::move(list), ","); })
+ .value_or(configuration_->getConfiguredKeys());
Review Comment:
Currently that works as I would expect it so if you were to explicitly set
the whitelist to be empty then nothing is whitelisted so no config value is
exposed.
I've also just checked and this is also how it operated before the refactor.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]