exceptionfactory commented on a change in pull request #5206:
URL: https://github.com/apache/nifi/pull/5206#discussion_r674839421
##########
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:
Is there a reason for implementing these methods and returning `null` as
opposed to marking them as `abstract`? It seems like having a default
implementation that returns `null` could cause some confusion in other
implementations.
--
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]