exceptionfactory commented on code in PR #6367:
URL: https://github.com/apache/nifi/pull/6367#discussion_r964143317
##########
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ExecuteStreamCommand.java:
##########
@@ -419,14 +420,21 @@ public void onTrigger(ProcessContext context, final
ProcessSession session) thro
}
return 0;
});
- for ( final PropertyDescriptor descriptor : propertyDescriptors) {
-
args.add(context.getProperty(descriptor.getName()).evaluateAttributeExpressions(inputFlowFile).getValue());
+ for (final PropertyDescriptor descriptor : propertyDescriptors) {
+ if (descriptor.isSensitive()) {
+ String value =
context.getProperty(descriptor.getName()).evaluateAttributeExpressions(inputFlowFile).getValue();
+ String maskedValue = IntStream.rangeClosed(0,
value.length()).mapToObj(i -> "*").collect(Collectors.joining());
Review Comment:
Thanks for providing these details @ravinarayansingh.
This actually highlights a mismatch between the mock framework and runtime
behavior. The `TestRunner.setProperty()` method does not use the
`PropertyDescriptor` object directly, but instead calls `getProperty()` on the
component to determine the canonical `PropertyDescriptor`. This delegates to
the `getSupportedDynamicPropertyDescriptor()` method, which does not indicate
sensitive status, aligning with the behavior you are observing.
The runtime `StandardProcessContext` uses a wrapping object called
`ProcessorNode`, extending `AbstractComponentNode`, which tracks the
user-defined sensitive status.
It looks like it is necessary to evaluate and improve the mock framework in
a separate issue.
--
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]