sumangala-patki commented on a change in pull request #2845:
URL: https://github.com/apache/hadoop/pull/2845#discussion_r617231047



##########
File path: 
hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/utils/UriUtils.java
##########
@@ -73,6 +93,55 @@ public static String generateUniqueTestPath() {
     return testUniqueForkId == null ? "/test" : "/" + testUniqueForkId + 
"/test";
   }
 
+  public static String maskUrlQueryParameters(List<NameValuePair> keyValueList,
+      ArrayList<String> queryParamsForFullMask,
+      ArrayList<String> queryParamsForPartialMask) {
+    StringBuilder maskedUrl = new StringBuilder();
+    for (NameValuePair keyValuePair : keyValueList) {
+      String key = keyValuePair.getName();
+      if (key.isEmpty()) {
+        throw new IllegalArgumentException("Query param key can not be empty");
+      }
+      String value = keyValuePair.getValue();
+      maskedUrl.append(key);
+      maskedUrl.append(EQUAL);
+      if (value != null && !value.isEmpty()) { //no mask
+        if (queryParamsForFullMask.contains(key)) {
+          maskedUrl.append(MASK);
+        } else if (queryParamsForPartialMask.contains(key)) {
+          int visibleLen = Math.min(4, value.length());
+          maskedUrl.append(value, 0, visibleLen);

Review comment:
       make last 4 visible




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org

Reply via email to