lordgamez commented on code in PR #1868:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1868#discussion_r1802613505
##########
extensions/standard-processors/tests/unit/FlowJsonTests.cpp:
##########
@@ -1028,4 +1028,124 @@ TEST_CASE("NiFi flow json can use alternative
targetUris field") {
REQUIRE(port->getProperty("Port UUID") ==
"00000000-0000-0000-0000-000000000005");
}
+
+TEST_CASE("Test parameters in controller services") {
+ ConfigurationTestController test_controller;
+ auto context = test_controller.getContext();
+ auto encrypted_parameter_value =
minifi::utils::crypto::property_encryption::encrypt("secret1!!1!",
*context.sensitive_values_encryptor);
+ auto encrypted_sensitive_property_value =
minifi::utils::crypto::property_encryption::encrypt("#{my_value_1}",
*context.sensitive_values_encryptor);
+ core::flow::AdaptiveConfiguration json_config(context);
+
+ static const std::string CONFIG_JSON =
+ fmt::format(R"(
+{{
+ "parameterContexts": [
+ {{
+ "identifier": "721e10b7-8e00-3188-9a27-476cca376978",
+ "name": "my-context",
+ "description": "my parameter context",
+ "parameters": [
+ {{
+ "name": "my_value_1",
+ "description": "",
+ "sensitive": true,
+ "value": "{}"
+ }},
+ {{
+ "name": "my_value_2",
+ "description": "",
+ "sensitive": false,
+ "value": "/opt/secrets/private-key.pem"
+ }}
+ ]
+ }}
+ ],
+ "rootGroup": {{
+ "name": "MiNiFi Flow",
+ "processors": [],
+ "controllerServices": [{{
+ "identifier": "a00f8722-2419-44ee-929c-ad68644ad557",
+ "name": "SSLContextService",
+ "type": "org.apache.nifi.minifi.controllers.SSLContextService",
+ "properties": {{
+ "Passphrase": "{}",
+ "Private Key": "#{{my_value_2}}",
+ "Use System Cert Store": "true"
+ }}
+ }}],
+ "parameterContextName": "my-context"
+ }}
+}})", encrypted_parameter_value, encrypted_sensitive_property_value);
Review Comment:
Updated in a9a1ad9d4b2bc4b20d2b937828ac2ec39cc8185c
--
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]