gresockj commented on a change in pull request #5206:
URL: https://github.com/apache/nifi/pull/5206#discussion_r675033934



##########
File path: 
nifi-commons/nifi-sensitive-property-provider/src/main/java/org/apache/nifi/properties/AbstractSensitivePropertyProvider.java
##########
@@ -47,4 +47,34 @@ public String getName() {
     public String getIdentifierKey() {
         return getProtectionScheme().getIdentifier();
     }
+
+    @Override
+    public String protect(final String unprotectedValue, final 
ProtectedPropertyContext context) throws SensitivePropertyProtectionException {
+        return protect(unprotectedValue);
+    }
+
+    @Override
+    public String unprotect(final String protectedValue, final 
ProtectedPropertyContext context) throws SensitivePropertyProtectionException {
+        return unprotect(protectedValue);
+    }
+
+    /**
+     * Allows implementing classes to provide an implementation that does not 
require a context.
+     * @param unprotectedValue The unprotected value
+     * @return The protected value
+     * @throws SensitivePropertyProtectionException If there was a problem 
protecting the value
+     */
+    protected String protect(final String unprotectedValue) throws 
SensitivePropertyProtectionException {
+        return null;
+    }
+
+    /**
+     * Allows implementing classes to provide an implementation that does not 
require a context.
+     * @param protectedValue The protected value
+     * @return The unprotected value
+     * @throws SensitivePropertyProtectionException If there was a problem 
unprotecting the value
+     */
+    protected String unprotect(final String protectedValue) throws 
SensitivePropertyProtectionException {
+        return null;
+    }

Review comment:
       On further consideration, due to the potential complexity of clearly 
distinguishing between 1-arg and 2-arg versions of these methods, I decided to 
revert the 1-arg change.  My thinking is that it will be simpler in the long 
run for all SPPs to use the 2-arg methods and each SPP implementation can 
decide whether it wants to use the context or not.




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