sijie commented on a change in pull request #1092: Dont log ledgermetadata 
which contains password.
URL: https://github.com/apache/bookkeeper/pull/1092#discussion_r165237267
 
 

 ##########
 File path: 
bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerMetadata.java
 ##########
 @@ -336,8 +340,9 @@ LedgerMetadataFormat buildProtoFormat() {
             builder.setCtime(ctime);
         }
 
-        if (hasPassword) {
-            
builder.setDigestType(digestType).setPassword(ByteString.copyFrom(password));
 
 Review comment:
   I think it was initially for BC, because we don't put any password and 
digesttype in metadata long time ago. so when it was introduced, password and 
digesttype are added at the same time. so that was the reason why digest is 
skipped. 
   
   I am not sure what version introduced, it was probably 4.1.0 or 4.2.0. 
However I would suggest keeping the logic as same as before. 
   
   ```
   if (hasPassword) {
      builder.setDigestType(digestType);
      if (withPassword) {
          ...
      }
   }
   ```
   
   we will have a separate issues to clean up these BC related legacy code when 
we enforce EOL of releases.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to