You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2020/04/20 17:33:58 UTC

[GitHub] [hadoop-ozone] cku328 commented on a change in pull request #812: HDDS-3161. Block illegal characters when creating keys.

cku328 commented on a change in pull request #812:
URL: https://github.com/apache/hadoop-ozone/pull/812#discussion_r411562681



##########
File path: hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/client/HddsClientUtils.java
##########
@@ -196,6 +196,27 @@ public static void verifyResourceName(String... resourceNames) {
     }
   }
 
+  /**
+   * verifies that key name is a valid name.
+   *
+   * @param keyName key name to be validated
+   *
+   * @throws IllegalArgumentException
+   */
+  public static void verifyKeyName(String keyName) {
+    if (keyName == null) {
+      throw new IllegalArgumentException("Key name is null");
+    }
+    String regex = "^[^^{}<>^?%~#`\\[\\]\\|\\\\(\\x80-\\xff)]$";

Review comment:
       Thanks, I've moved the regex to OzoneConsts and explained it.




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org