dongjinleekr commented on a change in pull request #11430:
URL: https://github.com/apache/kafka/pull/11430#discussion_r736515669



##########
File path: 
clients/src/main/java/org/apache/kafka/common/security/JaasConfig.java
##########
@@ -50,12 +50,24 @@
     private final List<AppConfigurationEntry> configEntries;
 
     public JaasConfig(String loginContextName, String jaasConfigParams) {
+        // All characters except space, comment, quote, equal and semicolon 
are considered to be alphabetic.
+        // That is, numbers or symbols like '@' now can be a part of a word.
+        // All bytes from 0 to ' ' {@code ' '} are considered to be whitespace.
+        // '/' {@code '/'} is a comment character. '//', '/*', '*/' are also 
allowed.
+        // Single quote {@code '\u005C''} and double quote {@code '"'} are 
considered to be quote.
+        // Ends of lines are treated as white space, not as separate tokens.
         StreamTokenizer tokenizer = new StreamTokenizer(new 
StringReader(jaasConfigParams));
+        tokenizer.resetSyntax();
+        tokenizer.wordChars(32, 128); //
+        tokenizer.wordChars(128 + 32, 255);
+        tokenizer.ordinaryChar(';');
+        tokenizer.ordinaryChar('=');
+        tokenizer.whitespaceChars(0, ' ');

Review comment:
       1. It seems better to add additional comments per line what it does, 
along with the overall parsing policy on top.
   2. Of course, the latter `tokenizer.whitespaceChars(0, ' ');` has higher 
priority; i just meant to exclude all special characters in [0, 31] range with 
` tokenizer.wordChars(32, 128);`.




-- 
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: jira-unsubscr...@kafka.apache.org

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


Reply via email to