fgerlits commented on code in PR #1708:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1708#discussion_r1427928523
##########
libminifi/src/core/FlowConfiguration.cpp:
##########
@@ -174,4 +180,21 @@ std::shared_ptr<core::controller::ControllerServiceNode>
FlowConfiguration::crea
return controllerServicesNode;
}
+std::string FlowConfiguration::decryptProperty(const std::string&
encrypted_value) const {
+ static constexpr std::string_view WrapperBegin = "enc{";
+ static constexpr std::string_view WrapperEnd = "}";
+
+ if (!(encrypted_value.starts_with(WrapperBegin) &&
encrypted_value.ends_with(WrapperEnd))) {
+ // this is normal: sensitive properties come from the C2 server in
cleartext over TLS
+ return encrypted_value;
+ }
+
+ const std::string unwrapped_value =
encrypted_value.substr(WrapperBegin.size(), encrypted_value.length() -
(WrapperBegin.size() + WrapperEnd.size()));
+ return sensitive_properties_encryptor_.decrypt(unwrapped_value);
Review Comment:
I have changed this and a few of the related functions to take a
`string_view` argument in 38b383ab2e4810505116a11c2a3c5e06b77f9243
--
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]