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

    https://github.com/apache/drill/pull/983#discussion_r144143072
  
    --- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/DrillRoot.java 
---
    @@ -75,6 +80,29 @@ public ClusterInfo getClusterInfoJSON() {
         final DrillConfig config = dbContext.getConfig();
         final boolean userEncryptionEnabled = 
config.getBoolean(ExecConstants.USER_ENCRYPTION_SASL_ENABLED);
         final boolean bitEncryptionEnabled = 
config.getBoolean(ExecConstants.BIT_ENCRYPTION_SASL_ENABLED);
    +    // If the user is logged in and is admin user then show the admin user 
info
    +    // For all other cases the user info need-not or should-not be 
displayed
    +    OptionManager optionManager = work.getContext().getOptionManager();
    +    final boolean isUserLoggedIn = AuthDynamicFeature.isUserLoggedIn(sc);
    +    String adminUsers = isUserLoggedIn ?
    +            
ExecConstants.ADMIN_USERS_VALIDATOR.getAdminUsers(optionManager) : null;
    +    String adminUserGroups = isUserLoggedIn ?
    +            
ExecConstants.ADMIN_USER_GROUPS_VALIDATOR.getAdminUserGroups(optionManager) : 
null;
    +
    +    // separate groups by comma + space
    +    if (adminUsers != null) {
    +      String[] groups = adminUsers.split(",");
    +      adminUsers = DrillStringUtils.join(groups, ", ");
    +    }
    +
    +    // separate groups by comma + space
    +    if (adminUserGroups != null) {
    +      String[] groups = adminUserGroups.split(",");
    +      adminUserGroups = DrillStringUtils.join(groups, ", ");
    --- End diff --
    
    I pushing changes that handle ill-formatted user input


---

Reply via email to