brusdev commented on a change in pull request #3851:
URL: https://github.com/apache/activemq-artemis/pull/3851#discussion_r753278803



##########
File path: 
artemis-commons/src/main/java/org/apache/activemq/artemis/utils/DefaultSensitiveStringCodec.java
##########
@@ -188,6 +208,16 @@ public String encode(String secret) throws Exception {
          BigInteger n = new BigInteger(encoding);
          return n.toString(16);
       }
+
+      @Override
+      public boolean verify(char[] inputValue, String storedValue) {
+         try {
+            return Objects.equals(storedValue, 
encode(String.valueOf(inputValue)));

Review comment:
       Looking existing encode/decode methods of SensitiveDataCodec<T> 
interface with Object args, I think they were deigned to encode/decode 
different sensitive object types to type T. So IMO the type T is to define the 
outputs not the inputs in the original design. I used the Object args for the 
compare method to keep the original design of the interface.
   
   While SensitiveDataCodec.verify(char[], T) is fine if T is String, it could 
not work well when T is not String.




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