Copilot commented on code in PR #2204:
URL: https://github.com/apache/nifi-minifi-cpp/pull/2204#discussion_r3467738019


##########
encrypt-config/EncryptConfig.cpp:
##########
@@ -180,22 +198,23 @@ void 
EncryptConfig::writeEncryptionKeyToBootstrapFile(const std::string& encrypt
 }
 
 void EncryptConfig::encryptSensitiveValuesInMinifiProperties() const {
-  EncryptionKeys keys = getEncryptionKeys(ENCRYPTION_KEY_PROPERTY_NAME);
+  const auto base_properties_file = propertiesFilePath();
+  const std::vector<std::string> sensitive_properties = 
getSensitiveProperties(base_properties_file);
+  const EncryptionKeys keys = getEncryptionKeys(ENCRYPTION_KEY_PROPERTY_NAME);

Review Comment:
   encryptSensitiveValuesInMinifiProperties() now calls 
getSensitiveProperties() before validating that the base minifi.properties 
exists. Because PropertiesImpl::loadConfigureFile() can create the file if it’s 
missing, this can silently create an empty properties file and proceed 
(potentially also generating/writing a new bootstrap key) instead of failing 
fast as before. Please restore the explicit existence check for the base 
properties file before calling getSensitiveProperties().



-- 
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]

Reply via email to