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

    https://github.com/apache/storm/pull/838#discussion_r45655066
  
    --- Diff: storm-core/src/jvm/backtype/storm/security/auth/AuthUtils.java ---
    @@ -276,4 +312,39 @@ public static String get(Configuration configuration, 
String section, String key
             }
             return null;
         }
    +
    +    private static final String USERNAME = "username";
    +    private static final String PASSWORD = "password";
    +
    +    public static String makeDigestPayload(Configuration login_config, 
String config_section) {
    +        String username = null;
    +        String password = null;
    +        try {
    +            Map<String, ?> results = AuthUtils.PullConfig(login_config, 
config_section);
    +            username = (String)results.get(USERNAME);
    +            password = (String)results.get(PASSWORD);
    +        }
    +        catch (Exception e) {
    +            LOG.error("Failed to pull username/password out of jaas conf", 
e);
    +        }
    +
    +        if(username == null || password == null) {
    +            return null;
    +        }
    +
    +        try {
    +            MessageDigest digest = MessageDigest.getInstance("SHA-512");
    +            byte[] output = digest.digest((username + ":" + 
password).getBytes());
    +
    +            StringBuilder builder = new StringBuilder();
    +            for(byte b : output) {
    +            builder.append(String.format("%02x", b));
    --- End diff --
    
    Check indent under `for`


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to