exceptionfactory commented on code in PR #8853:
URL: https://github.com/apache/nifi/pull/8853#discussion_r1606948281


##########
nifi-api/src/main/java/org/apache/nifi/components/PropertyDescriptor.java:
##########
@@ -719,6 +720,15 @@ public boolean isSensitive() {
         return sensitive;
     }
 
+    // Pattern to match a parameter reference i.e. "#{anything}"
+    private static final Pattern PARAMETER_REFERENCE = 
Pattern.compile("^#\\{.*}$");
+
+    public static boolean isSensitiveValueSafeToDisplay(String value) {
+        // If the value is a parameter reference, then it is safe to display 
the parameter name.
+        // A parameter name is safe to display to users because the sensitive 
info is stored in the parameter value.
+        return value != null && PARAMETER_REFERENCE.matcher(value).matches();
+    }

Review Comment:
   This information should not be part of the `nifi-api` because the 
persistence strategy is specific to the framework implementation.



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