Github user alopresto commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/1302#discussion_r96316970
  
    --- Diff: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-runtime/src/main/java/org/apache/nifi/NiFi.java
 ---
    @@ -305,39 +308,73 @@ private static String loadFormattedKey(String[] args) 
{
             String key = null;
             List<String> parsedArgs = parseArgs(args);
             // Check if args contain protection key
    -        if (parsedArgs.contains(KEY_FLAG)) {
    -            key = getKeyFromArgs(parsedArgs);
    -
    +        if (parsedArgs.contains(KEY_FILE_FLAG)) {
    +            key = getKeyFromKeyFileAndPrune(parsedArgs);
                 // Format the key (check hex validity and remove spaces)
                 key = formatHexKey(key);
    -            if (!isHexKeyValid(key)) {
    -                throw new IllegalArgumentException("The key was not 
provided in valid hex format and of the correct length");
    -            }
     
    -            return key;
    -        } else {
    -            // throw new IllegalStateException("No key provided from 
bootstrap");
    +        }
    +
    +        if (null == key) {
                 return "";
    +        } else if (!isHexKeyValid(key)) {
    +          throw new IllegalArgumentException("The key \""+key+"\" was not 
provided in valid hex format and of the correct length");
    --- End diff --
    
    I don't think it should include the value of the key in the exception. I 
understand it might be useful for debugging, but then they should connect a 
debugger. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to