Explorar el Código

add debug items for serviceinfo

Jason Rivard hace 8 años
padre
commit
07c36d25a3
Se han modificado 34 ficheros con 151 adiciones y 103 borrados
  1. 3 3
      src/main/java/password/pwm/PwmAboutProperty.java
  2. 9 5
      src/main/java/password/pwm/bean/pub/PublicUserInfoBean.java
  3. 2 2
      src/main/java/password/pwm/health/HealthMonitor.java
  4. 6 2
      src/main/java/password/pwm/http/servlet/admin/UserDebugDataBean.java
  5. 6 1
      src/main/java/password/pwm/http/servlet/admin/UserDebugDataReader.java
  6. 4 5
      src/main/java/password/pwm/http/servlet/configmanager/DebugItemGenerator.java
  7. 1 1
      src/main/java/password/pwm/http/servlet/resource/ResourceServletService.java
  8. 1 1
      src/main/java/password/pwm/http/state/SessionStateService.java
  9. 2 2
      src/main/java/password/pwm/ldap/LdapConnectionService.java
  10. 2 0
      src/main/java/password/pwm/ldap/UserInfo.java
  11. 1 0
      src/main/java/password/pwm/ldap/UserInfoBean.java
  12. 9 0
      src/main/java/password/pwm/ldap/UserInfoReader.java
  13. 2 2
      src/main/java/password/pwm/ldap/search/UserSearchEngine.java
  14. 18 9
      src/main/java/password/pwm/svc/PwmService.java
  15. 2 2
      src/main/java/password/pwm/svc/cache/CacheService.java
  16. 3 3
      src/main/java/password/pwm/svc/event/AuditService.java
  17. 3 3
      src/main/java/password/pwm/svc/intruder/IntruderManager.java
  18. 2 2
      src/main/java/password/pwm/svc/report/ReportService.java
  19. 2 2
      src/main/java/password/pwm/svc/report/UserCacheService.java
  20. 1 1
      src/main/java/password/pwm/svc/sessiontrack/SessionTrackService.java
  21. 2 2
      src/main/java/password/pwm/svc/shorturl/UrlShortenerService.java
  22. 3 3
      src/main/java/password/pwm/svc/stats/StatisticsManager.java
  23. 3 3
      src/main/java/password/pwm/svc/token/TokenService.java
  24. 3 3
      src/main/java/password/pwm/svc/wordlist/AbstractWordlist.java
  25. 3 3
      src/main/java/password/pwm/svc/wordlist/SharedHistoryManager.java
  26. 2 2
      src/main/java/password/pwm/util/VersionChecker.java
  27. 18 16
      src/main/java/password/pwm/util/db/DatabaseService.java
  28. 2 2
      src/main/java/password/pwm/util/logging/LocalDBLogger.java
  29. 2 2
      src/main/java/password/pwm/util/operations/CrService.java
  30. 2 2
      src/main/java/password/pwm/util/operations/OtpService.java
  31. 8 3
      src/main/java/password/pwm/util/queue/EmailQueueManager.java
  32. 11 3
      src/main/java/password/pwm/util/queue/SmsQueueManager.java
  33. 1 1
      src/main/java/password/pwm/util/secure/SecureService.java
  34. 12 12
      src/main/webapp/WEB-INF/jsp/admin-user-debug.jsp

+ 3 - 3
src/main/java/password/pwm/PwmAboutProperty.java

@@ -200,9 +200,9 @@ public enum PwmAboutProperty {
 
         { // database info
             try {
-                final DatabaseService databaseAccessor = pwmApplication.getDatabaseService();
-                if (databaseAccessor != null) {
-                    final Map<PwmAboutProperty,String> debugData = databaseAccessor.getConnectionDebugProperties();
+                final DatabaseService databaseService = pwmApplication.getDatabaseService();
+                if (databaseService != null) {
+                    final Map<PwmAboutProperty,String> debugData = databaseService.getConnectionDebugProperties();
                     aboutMap.putAll(debugData);
                 }
             } catch (Throwable t) {

+ 9 - 5
src/main/java/password/pwm/bean/pub/PublicUserInfoBean.java

@@ -44,12 +44,16 @@ public class PublicUserInfoBean implements Serializable {
     private String userDN;
     private String ldapProfile;
     private String userID;
+    private String userGUID;
     private String userEmailAddress;
     private Instant passwordExpirationTime;
     private Instant passwordLastModifiedTime;
+    private Instant lastLoginTime;
+    private Instant accountExpirationTime;
     private boolean requiresNewPassword;
     private boolean requiresResponseConfig;
     private boolean requiresUpdateProfile;
+    private boolean requiresOtpConfig;
     private boolean requiresInteraction;
 
     private PasswordStatus passwordStatus;
@@ -69,19 +73,19 @@ public class PublicUserInfoBean implements Serializable {
         publicUserInfoBean.userDN = (userInfoBean.getUserIdentity() == null) ? "" : userInfoBean.getUserIdentity().getUserDN();
         publicUserInfoBean.ldapProfile = (userInfoBean.getUserIdentity() == null) ? "" : userInfoBean.getUserIdentity().getLdapProfileID();
         publicUserInfoBean.userID = userInfoBean.getUsername();
+        publicUserInfoBean.userGUID = publicUserInfoBean.getUserGUID();
         publicUserInfoBean.userEmailAddress = userInfoBean.getUserEmailAddress();
         publicUserInfoBean.passwordExpirationTime = userInfoBean.getPasswordExpirationTime();
         publicUserInfoBean.passwordLastModifiedTime = userInfoBean.getPasswordLastModifiedTime();
         publicUserInfoBean.passwordStatus = userInfoBean.getPasswordStatus();
+        publicUserInfoBean.accountExpirationTime = userInfoBean.getAccountExpirationTime();
+        publicUserInfoBean.lastLoginTime = userInfoBean.getLastLdapLoginTime();
 
         publicUserInfoBean.requiresNewPassword = userInfoBean.isRequiresNewPassword();
         publicUserInfoBean.requiresResponseConfig = userInfoBean.isRequiresResponseConfig();
         publicUserInfoBean.requiresUpdateProfile = userInfoBean.isRequiresUpdateProfile();
-        publicUserInfoBean.requiresInteraction = userInfoBean.isRequiresNewPassword()
-                || userInfoBean.isRequiresResponseConfig()
-                || userInfoBean.isRequiresUpdateProfile()
-                || userInfoBean.getPasswordStatus().isWarnPeriod();
-
+        publicUserInfoBean.requiresOtpConfig = userInfoBean.isRequiresOtpConfig();
+        publicUserInfoBean.requiresInteraction = userInfoBean.isRequiresInteraction();
 
         publicUserInfoBean.passwordPolicy = new HashMap<>();
         for (final PwmPasswordRule rule : PwmPasswordRule.values()) {

+ 2 - 2
src/main/java/password/pwm/health/HealthMonitor.java

@@ -230,9 +230,9 @@ public class HealthMonitor implements PwmService {
         LOGGER.trace("health check process completed (" + TimeDuration.fromCurrent(startTime).asCompactString() + ")");
     }
 
-    public ServiceInfo serviceInfo()
+    public ServiceInfoBean serviceInfo()
     {
-        return new ServiceInfo(Collections.emptyList());
+        return new ServiceInfoBean(Collections.emptyList());
     }
 
     public Map<HealthMonitorFlag, Serializable> getHealthProperties()

+ 6 - 2
src/main/java/password/pwm/http/servlet/admin/UserDebugDataBean.java

@@ -25,9 +25,10 @@ package password.pwm.http.servlet.admin;
 import lombok.Builder;
 import lombok.Getter;
 import password.pwm.Permission;
-import password.pwm.ldap.UserInfo;
+import password.pwm.bean.pub.PublicUserInfoBean;
 import password.pwm.config.profile.ProfileType;
 import password.pwm.config.profile.PwmPasswordPolicy;
+import password.pwm.ldap.UserInfo;
 
 import java.io.Serializable;
 import java.util.Map;
@@ -35,9 +36,12 @@ import java.util.Map;
 @Getter
 @Builder
 public class UserDebugDataBean implements Serializable {
-    private final UserInfo userInfo;
+    private transient UserInfo userInfo;
+
+    private final PublicUserInfoBean publicUserInfoBean;
     private final boolean passwordReadable;
     private final Map<Permission,String> permissions;
+
     private final PwmPasswordPolicy ldapPasswordPolicy;
     private final PwmPasswordPolicy configuredPasswordPolicy;
     private final Map<ProfileType,String> profiles;

+ 6 - 1
src/main/java/password/pwm/http/servlet/admin/UserDebugDataReader.java

@@ -27,7 +27,7 @@ import password.pwm.Permission;
 import password.pwm.PwmApplication;
 import password.pwm.bean.SessionLabel;
 import password.pwm.bean.UserIdentity;
-import password.pwm.ldap.UserInfo;
+import password.pwm.bean.pub.PublicUserInfoBean;
 import password.pwm.config.PwmSetting;
 import password.pwm.config.UserPermission;
 import password.pwm.config.profile.ProfileType;
@@ -36,7 +36,9 @@ import password.pwm.config.profile.PwmPasswordPolicy;
 import password.pwm.error.PwmUnrecoverableException;
 import password.pwm.ldap.LdapOperationsHelper;
 import password.pwm.ldap.LdapPermissionTester;
+import password.pwm.ldap.UserInfo;
 import password.pwm.ldap.UserInfoFactory;
+import password.pwm.util.macro.MacroMachine;
 import password.pwm.util.operations.PasswordUtility;
 
 import java.util.Collections;
@@ -76,8 +78,11 @@ public class UserDebugDataReader {
             /* disregard */
         }
 
+        final MacroMachine macroMachine = MacroMachine.forUser(pwmApplication, locale, sessionLabel, userIdentity);
+
         final UserDebugDataBean userDebugData = UserDebugDataBean.builder()
                 .userInfo(userInfo)
+                .publicUserInfoBean(PublicUserInfoBean.fromUserInfoBean(userInfo, pwmApplication.getConfig(), locale, macroMachine))
                 .permissions(permissions)
                 .profiles(profiles)
                 .ldapPasswordPolicy(ldapPasswordPolicy)

+ 4 - 5
src/main/java/password/pwm/http/servlet/configmanager/DebugItemGenerator.java

@@ -89,7 +89,7 @@ public class DebugItemGenerator {
             AboutItemGenerator.class,
             SystemEnvironmentItemGenerator.class,
             AppPropertiesItemGenerator.class,
-            InfoDebugItemGenerator.class,
+            ServicesDebugItemGenerator.class,
             HealthDebugItemGenerator.class,
             ThreadDumpDebugItemGenerator.class,
             FileInfoDebugItemGenerator.class,
@@ -127,7 +127,7 @@ public class DebugItemGenerator {
                 final String finishMsg = "completed output of " + newGeneratorItem.getFilename() + " in " + TimeDuration.fromCurrent(startTime).asCompactString();
                 LOGGER.trace(pwmRequest, finishMsg);
                 debugGeneratorLogFile.printRecord(JavaHelper.toIsoDate(new Date()),finishMsg);
-            } catch (Exception e) {
+            } catch (Throwable e) {
                 final String errorMsg = "unexpected error executing debug item output class '" + serviceClass.getName() + "', error: " + e.toString();
                 LOGGER.error(pwmRequest, errorMsg);
                 debugGeneratorLogFile.printRecord(JavaHelper.toIsoDate(new Date()),errorMsg);
@@ -287,10 +287,10 @@ public class DebugItemGenerator {
         }
     }
 
-    static class InfoDebugItemGenerator implements Generator {
+    static class ServicesDebugItemGenerator implements Generator {
         @Override
         public String getFilename() {
-            return "info.json";
+            return "services.json";
         }
 
         @Override
@@ -614,7 +614,6 @@ public class DebugItemGenerator {
         }
     }
 
-
     interface Generator {
 
         String getFilename();

+ 1 - 1
src/main/java/password/pwm/http/servlet/resource/ResourceServletService.java

@@ -146,7 +146,7 @@ public class ResourceServletService implements PwmService {
     }
 
     @Override
-    public ServiceInfo serviceInfo() {
+    public ServiceInfoBean serviceInfo() {
         return null;
     }
 

+ 1 - 1
src/main/java/password/pwm/http/state/SessionStateService.java

@@ -116,7 +116,7 @@ public class SessionStateService implements PwmService {
     }
 
     @Override
-    public ServiceInfo serviceInfo() {
+    public ServiceInfoBean serviceInfo() {
         return null;
     }
 

+ 2 - 2
src/main/java/password/pwm/ldap/LdapConnectionService.java

@@ -102,9 +102,9 @@ public class LdapConnectionService implements PwmService {
         return null;
     }
 
-    public ServiceInfo serviceInfo()
+    public ServiceInfoBean serviceInfo()
     {
-        return new ServiceInfo(Collections.singletonList(DataStorageMethod.LDAP));
+        return new ServiceInfoBean(Collections.singletonList(DataStorageMethod.LDAP));
     }
 
 

+ 2 - 0
src/main/java/password/pwm/ldap/UserInfo.java

@@ -64,6 +64,8 @@ public interface UserInfo {
 
     boolean isRequiresUpdateProfile() throws PwmUnrecoverableException;
 
+    boolean isRequiresInteraction() throws PwmUnrecoverableException;
+
     Instant getPasswordLastModifiedTime() throws PwmUnrecoverableException;
 
     String getUserEmailAddress() throws PwmUnrecoverableException;

+ 1 - 0
src/main/java/password/pwm/ldap/UserInfoBean.java

@@ -85,6 +85,7 @@ public class UserInfoBean implements UserInfo {
     private final boolean requiresResponseConfig;
     private final boolean requiresOtpConfig;
     private final boolean requiresUpdateProfile;
+    private final boolean requiresInteraction;
 
     @Builder.Default
     private Map<String,String> attributes = Collections.emptyMap();

+ 9 - 0
src/main/java/password/pwm/ldap/UserInfoReader.java

@@ -649,4 +649,13 @@ public class UserInfoReader implements UserInfo {
         return Collections.unmodifiableMap(returnMap);
     }
 
+    @Override
+    public boolean isRequiresInteraction() throws PwmUnrecoverableException
+    {
+        return selfCachedReference.isRequiresNewPassword()
+                || selfCachedReference.isRequiresResponseConfig()
+                || selfCachedReference.isRequiresUpdateProfile()
+                || selfCachedReference.isRequiresOtpConfig()
+                || selfCachedReference.getPasswordStatus().isWarnPeriod();
+    }
 }

+ 2 - 2
src/main/java/password/pwm/ldap/search/UserSearchEngine.java

@@ -127,8 +127,8 @@ public class UserSearchEngine implements PwmService {
     }
 
     @Override
-    public ServiceInfo serviceInfo() {
-        return new ServiceInfo(Collections.emptyList());
+    public ServiceInfoBean serviceInfo() {
+        return new ServiceInfoBean(Collections.emptyList());
     }
 
     public UserIdentity resolveUsername(

+ 18 - 9
src/main/java/password/pwm/svc/PwmService.java

@@ -22,6 +22,8 @@
 
 package password.pwm.svc;
 
+import lombok.AllArgsConstructor;
+import lombok.Getter;
 import password.pwm.PwmApplication;
 import password.pwm.config.option.DataStorageMethod;
 import password.pwm.error.PwmException;
@@ -29,7 +31,9 @@ import password.pwm.health.HealthRecord;
 
 import java.io.Serializable;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.List;
+import java.util.Map;
 
 /**
  * An interface for daemon/background services.  Services are initialized, shutdown and accessed via {@link PwmApplication}.  Some services
@@ -52,19 +56,24 @@ public interface PwmService {
 
     List<HealthRecord> healthCheck();
 
-    ServiceInfo serviceInfo();
+    ServiceInfoBean serviceInfo();
 
-    class ServiceInfo implements Serializable {
-        public Collection<DataStorageMethod> usedStorageMethods;
+    interface ServiceInfo {
+        Collection<DataStorageMethod> getUsedStorageMethods();
 
-        public ServiceInfo(final Collection<DataStorageMethod> usedStorageMethods)
-        {
-            this.usedStorageMethods = usedStorageMethods;
-        }
+        Map<String,String> getDebugProperties();
+    }
+
+    @Getter
+    @AllArgsConstructor
+    class ServiceInfoBean implements ServiceInfo, Serializable {
+        private final Collection<DataStorageMethod> usedStorageMethods;
+        private final Map<String,String> debugProperties;
 
-        public Collection<DataStorageMethod> getUsedStorageMethods()
+        public ServiceInfoBean(final Collection<DataStorageMethod> usedStorageMethods)
         {
-            return usedStorageMethods;
+            this.usedStorageMethods = usedStorageMethods;
+            this.debugProperties = Collections.emptyMap();
         }
     }
 }

+ 2 - 2
src/main/java/password/pwm/svc/cache/CacheService.java

@@ -97,8 +97,8 @@ public class CacheService implements PwmService {
     }
 
     @Override
-    public ServiceInfo serviceInfo() {
-        return new ServiceInfo(Collections.emptyList());
+    public ServiceInfoBean serviceInfo() {
+        return new ServiceInfoBean(Collections.emptyList());
     }
 
     public void put(final CacheKey cacheKey, final CachePolicy cachePolicy, final String payload)

+ 3 - 3
src/main/java/password/pwm/svc/event/AuditService.java

@@ -68,7 +68,7 @@ public class AuditService implements PwmService {
 
     private STATUS status = STATUS.NEW;
     private AuditSettings settings;
-    private ServiceInfo serviceInfo = new ServiceInfo(Collections.emptyList());
+    private ServiceInfoBean serviceInfo = new ServiceInfoBean(Collections.emptyList());
 
     private SyslogAuditService syslogManager;
     private ErrorInformation lastError;
@@ -146,7 +146,7 @@ public class AuditService implements PwmService {
                     return;
             }
             LOGGER.info(debugMsg);
-            serviceInfo = new ServiceInfo(Collections.singletonList(storageMethodUsed));
+            serviceInfo = new ServiceInfoBean(Collections.singletonList(storageMethodUsed));
         }
         {
             final TimeDuration maxRecordAge = new TimeDuration(pwmApplication.getConfig().readSettingAsLong(PwmSetting.EVENTS_AUDIT_MAX_AGE) * 1000);
@@ -421,7 +421,7 @@ public class AuditService implements PwmService {
         return counter;
     }
 
-    public ServiceInfo serviceInfo()
+    public ServiceInfoBean serviceInfo()
     {
         return serviceInfo;
     }

+ 3 - 3
src/main/java/password/pwm/svc/intruder/IntruderManager.java

@@ -89,7 +89,7 @@ public class IntruderManager implements Serializable, PwmService {
 
     private final Map<RecordType, RecordManager> recordManagers = new HashMap<>();
 
-    private ServiceInfo serviceInfo = new ServiceInfo(Collections.<DataStorageMethod>emptyList());
+    private ServiceInfoBean serviceInfo = new ServiceInfoBean(Collections.<DataStorageMethod>emptyList());
 
     public IntruderManager() {
         for (final RecordType recordType : RecordType.values()) {
@@ -157,7 +157,7 @@ public class IntruderManager implements Serializable, PwmService {
                     return;
             }
             LOGGER.info(debugMsg);
-            serviceInfo = new ServiceInfo(Collections.singletonList(storageMethodUsed));
+            serviceInfo = new ServiceInfoBean(Collections.singletonList(storageMethodUsed));
         }
         final RecordStore recordStore;
         {
@@ -600,7 +600,7 @@ public class IntruderManager implements Serializable, PwmService {
 
     }
 
-    public ServiceInfo serviceInfo()
+    public ServiceInfoBean serviceInfo()
     {
         return serviceInfo;
     }

+ 2 - 2
src/main/java/password/pwm/svc/report/ReportService.java

@@ -185,9 +185,9 @@ public class ReportService implements PwmService {
     }
 
     @Override
-    public ServiceInfo serviceInfo()
+    public ServiceInfoBean serviceInfo()
     {
-        return new ServiceInfo(Collections.singletonList(DataStorageMethod.LDAP));
+        return new ServiceInfoBean(Collections.singletonList(DataStorageMethod.LDAP));
     }
 
     public void executeCommand(final ReportCommand reportCommand) {

+ 2 - 2
src/main/java/password/pwm/svc/report/UserCacheService.java

@@ -153,9 +153,9 @@ public class UserCacheService implements PwmService {
         return Collections.emptyList();
     }
 
-    public ServiceInfo serviceInfo()
+    public ServiceInfoBean serviceInfo()
     {
-        return new ServiceInfo(Collections.singletonList(DataStorageMethod.LOCALDB));
+        return new ServiceInfoBean(Collections.singletonList(DataStorageMethod.LOCALDB));
     }
 
     public int size()

+ 1 - 1
src/main/java/password/pwm/svc/sessiontrack/SessionTrackService.java

@@ -80,7 +80,7 @@ public class SessionTrackService implements PwmService {
     }
 
     @Override
-    public ServiceInfo serviceInfo() {
+    public ServiceInfoBean serviceInfo() {
         return null;
     }
 

+ 2 - 2
src/main/java/password/pwm/svc/shorturl/UrlShortenerService.java

@@ -142,8 +142,8 @@ public class UrlShortenerService implements PwmService {
         return text;
     }
 
-    public ServiceInfo serviceInfo()
+    public ServiceInfoBean serviceInfo()
     {
-        return new ServiceInfo(Collections.<DataStorageMethod>emptyList());
+        return new ServiceInfoBean(Collections.<DataStorageMethod>emptyList());
     }
 }

+ 3 - 3
src/main/java/password/pwm/svc/stats/StatisticsManager.java

@@ -588,12 +588,12 @@ public class StatisticsManager implements PwmService {
         return counter;
     }
 
-    public ServiceInfo serviceInfo()
+    public ServiceInfoBean serviceInfo()
     {
         if (status() == STATUS.OPEN) {
-            return new ServiceInfo(Collections.singletonList(DataStorageMethod.LOCALDB));
+            return new ServiceInfoBean(Collections.singletonList(DataStorageMethod.LOCALDB));
         } else {
-            return new ServiceInfo(Collections.<DataStorageMethod>emptyList());
+            return new ServiceInfoBean(Collections.<DataStorageMethod>emptyList());
         }
     }
 

+ 3 - 3
src/main/java/password/pwm/svc/token/TokenService.java

@@ -102,7 +102,7 @@ public class TokenService implements PwmService {
     private TokenMachine tokenMachine;
     private long counter;
 
-    private ServiceInfo serviceInfo = new ServiceInfo(Collections.emptyList());
+    private ServiceInfoBean serviceInfo = new ServiceInfoBean(Collections.emptyList());
     private STATUS status = STATUS.NEW;
 
     private ErrorInformation errorInformation = null;
@@ -188,7 +188,7 @@ public class TokenService implements PwmService {
                 default:
                     JavaHelper.unhandledSwitchStatement(storageMethod);
             }
-            serviceInfo = new ServiceInfo(Collections.singletonList(usedStorageMethod));
+            serviceInfo = new ServiceInfoBean(Collections.singletonList(usedStorageMethod));
         } catch (PwmException e) {
             final String errorMsg = "unable to start token manager: " + e.getErrorInformation().getDetailedErrorMsg();
             final ErrorInformation newErrorInformation = new ErrorInformation(e.getError(), errorMsg);
@@ -483,7 +483,7 @@ public class TokenService implements PwmService {
         }
     }
 
-    public ServiceInfo serviceInfo()
+    public ServiceInfoBean serviceInfo()
     {
         return serviceInfo;
     }

+ 3 - 3
src/main/java/password/pwm/svc/wordlist/AbstractWordlist.java

@@ -288,12 +288,12 @@ abstract class AbstractWordlist implements Wordlist, PwmService {
         return Collections.unmodifiableList(returnList);
     }
 
-    public ServiceInfo serviceInfo()
+    public ServiceInfoBean serviceInfo()
     {
         if (status() == STATUS.OPEN) {
-            return new ServiceInfo(Collections.singletonList(DataStorageMethod.LOCALDB));
+            return new ServiceInfoBean(Collections.singletonList(DataStorageMethod.LOCALDB));
         } else {
-            return new ServiceInfo(Collections.<DataStorageMethod>emptyList());
+            return new ServiceInfoBean(Collections.<DataStorageMethod>emptyList());
         }
     }
 

+ 3 - 3
src/main/java/password/pwm/svc/wordlist/SharedHistoryManager.java

@@ -427,12 +427,12 @@ public class SharedHistoryManager implements PwmService {
         private boolean caseInsensitive;
     }
 
-    public ServiceInfo serviceInfo()
+    public ServiceInfoBean serviceInfo()
     {
         if (status == STATUS.OPEN) {
-            return new ServiceInfo(Collections.singletonList(DataStorageMethod.LOCALDB));
+            return new ServiceInfoBean(Collections.singletonList(DataStorageMethod.LOCALDB));
         } else {
-            return new ServiceInfo(Collections.<DataStorageMethod>emptyList());
+            return new ServiceInfoBean(Collections.<DataStorageMethod>emptyList());
         }
     }
 }

+ 2 - 2
src/main/java/password/pwm/util/VersionChecker.java

@@ -283,8 +283,8 @@ public class VersionChecker implements PwmService {
         }
     }
 
-    public ServiceInfo serviceInfo()
+    public ServiceInfoBean serviceInfo()
     {
-        return new ServiceInfo(Collections.<DataStorageMethod>emptyList());
+        return new ServiceInfoBean(Collections.<DataStorageMethod>emptyList());
     }
 }

+ 18 - 16
src/main/java/password/pwm/util/db/DatabaseService.java

@@ -84,10 +84,12 @@ public class DatabaseService implements PwmService
     private STATUS status = STATUS.NEW;
 
     private AtomicLoopIntIncrementer slotIncrementer;
-    private Map<Integer,DatabaseAccessorImpl> accessors = new ConcurrentHashMap<>();
+    private final Map<Integer,DatabaseAccessorImpl> accessors = new ConcurrentHashMap<>();
 
     private ScheduledExecutorService executorService;
 
+    private final Map<PwmAboutProperty,String> debugInfo = new LinkedHashMap<>();
+
     private volatile boolean initialized = false;
 
 
@@ -140,6 +142,9 @@ public class DatabaseService implements PwmService
                 clearCurrentAccessors();
 
                 final Connection connection = openConnection(dbConfiguration);
+                updateDebugProperties(connection);
+                LOGGER.debug("established initial connection to " + dbConfiguration.getConnectionString() + ", properties: " + JsonUtil.serializeMap(this.debugInfo));
+
                 for (final DatabaseTable table : DatabaseTable.values()) {
                     DatabaseUtil.initTable(connection, table, dbConfiguration);
                 }
@@ -257,12 +262,16 @@ public class DatabaseService implements PwmService
 
 
     @Override
-    public ServiceInfo serviceInfo()
+    public ServiceInfoBean serviceInfo()
     {
+        final Map<String,String> debugProperties = new LinkedHashMap<>();
+        for (final PwmAboutProperty pwmAboutProperty : debugInfo.keySet()) {
+            debugProperties.put(pwmAboutProperty.name(), debugInfo.get(pwmAboutProperty));
+        }
         if (status() == STATUS.OPEN) {
-            return new ServiceInfo(Collections.singletonList(DataStorageMethod.DB));
+            return new ServiceInfoBean(Collections.singletonList(DataStorageMethod.DB), debugProperties);
         } else {
-            return new ServiceInfo(Collections.emptyList());
+            return new ServiceInfoBean(Collections.emptyList(), debugProperties);
         }
     }
 
@@ -300,8 +309,7 @@ public class DatabaseService implements PwmService
             }
 
             final Connection connection = driver.connect(connectionURL, connectionProperties);
-            final Map<PwmAboutProperty,String> debugProps = getConnectionDebugProperties(connection);
-            LOGGER.debug("connected to database " + connectionURL + ", properties: " + JsonUtil.serializeMap(debugProps));
+            LOGGER.debug("connected to database " + connectionURL);
 
             connection.setAutoCommit(false);
             return connection;
@@ -334,14 +342,10 @@ public class DatabaseService implements PwmService
     }
 
     public Map<PwmAboutProperty,String> getConnectionDebugProperties() {
-        if (!initialized) {
-            return Collections.emptyMap();
-        }
-        final Connection connection = accessors.get(0).getConnection();
-        return getConnectionDebugProperties(connection);
+        return Collections.unmodifiableMap(debugInfo);
     }
 
-    private static Map<PwmAboutProperty,String> getConnectionDebugProperties(final Connection connection) {
+    private void updateDebugProperties(final Connection connection) {
         if (connection != null) {
             try {
                 final Map<PwmAboutProperty,String> returnObj = new LinkedHashMap<>();
@@ -350,12 +354,12 @@ public class DatabaseService implements PwmService
                 returnObj.put(PwmAboutProperty.database_driverVersion, databaseMetaData.getDriverVersion());
                 returnObj.put(PwmAboutProperty.database_databaseProductName, databaseMetaData.getDatabaseProductName());
                 returnObj.put(PwmAboutProperty.database_databaseProductVersion, databaseMetaData.getDatabaseProductVersion());
-                return Collections.unmodifiableMap(returnObj);
+                debugInfo.clear();
+                debugInfo.putAll(Collections.unmodifiableMap(returnObj));
             } catch (SQLException e) {
                 LOGGER.error("error reading jdbc meta data: " + e.getMessage());
             }
         }
-        return Collections.emptyMap();
     }
 
     void setLastError(final ErrorInformation lastError)
@@ -363,8 +367,6 @@ public class DatabaseService implements PwmService
         this.lastError = lastError;
     }
 
-
-
     private class ConnectionMonitor implements Runnable {
         @Override
         public void run()

+ 2 - 2
src/main/java/password/pwm/util/logging/LocalDBLogger.java

@@ -427,9 +427,9 @@ public class LocalDBLogger implements PwmService {
         return String.valueOf(this.getStoredEventCount()) + " / " + maxEvents + " (" + numberFormat.format(percentFull) + "%)";
     }
 
-    public ServiceInfo serviceInfo()
+    public ServiceInfoBean serviceInfo()
     {
-        return new ServiceInfo(Collections.singletonList(DataStorageMethod.LOCALDB));
+        return new ServiceInfoBean(Collections.singletonList(DataStorageMethod.LOCALDB));
     }
 
 }

+ 2 - 2
src/main/java/password/pwm/util/operations/CrService.java

@@ -565,11 +565,11 @@ public class CrService implements PwmService {
     }
 
     @Override
-    public ServiceInfo serviceInfo()
+    public ServiceInfoBean serviceInfo()
     {
         final LinkedHashSet<DataStorageMethod> usedStorageMethods = new LinkedHashSet<>();
         usedStorageMethods.addAll(pwmApplication.getConfig().helper().getCrReadPreference());
         usedStorageMethods.addAll(pwmApplication.getConfig().helper().getCrWritePreference());
-        return new ServiceInfo(Collections.unmodifiableList(new ArrayList(usedStorageMethods)));
+        return new ServiceInfoBean(Collections.unmodifiableList(new ArrayList(usedStorageMethods)));
     }
 }

+ 2 - 2
src/main/java/password/pwm/util/operations/OtpService.java

@@ -413,9 +413,9 @@ public class OtpService implements PwmService {
         return settings;
     }
 
-    public ServiceInfo serviceInfo()
+    public ServiceInfoBean serviceInfo()
     {
-        return new ServiceInfo(Collections.<DataStorageMethod>emptyList());
+        return new ServiceInfoBean(Collections.<DataStorageMethod>emptyList());
     }
 
     private static String readGuidIfNeeded(

+ 8 - 3
src/main/java/password/pwm/util/queue/EmailQueueManager.java

@@ -66,6 +66,7 @@ import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Date;
 import java.util.HashMap;
+import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Properties;
@@ -141,11 +142,15 @@ public class EmailQueueManager implements PwmService {
     }
 
     @Override
-    public ServiceInfo serviceInfo() {
+    public ServiceInfoBean serviceInfo() {
+        final Map<String,String> debugItems = new LinkedHashMap<>();
+        if (workQueueProcessor != null) {
+            debugItems.putAll(workQueueProcessor.debugInfo());
+        }
         if (status() == STATUS.OPEN) {
-            return new ServiceInfo(Collections.singletonList(DataStorageMethod.LOCALDB));
+            return new ServiceInfoBean(Collections.singletonList(DataStorageMethod.LOCALDB), debugItems);
         } else {
-            return new ServiceInfo(Collections.emptyList());
+            return new ServiceInfoBean(Collections.emptyList(), debugItems);
         }
     }
 

+ 11 - 3
src/main/java/password/pwm/util/queue/SmsQueueManager.java

@@ -34,6 +34,7 @@ import password.pwm.PwmApplication;
 import password.pwm.bean.SmsItemBean;
 import password.pwm.config.Configuration;
 import password.pwm.config.PwmSetting;
+import password.pwm.config.option.DataStorageMethod;
 import password.pwm.error.ErrorInformation;
 import password.pwm.error.PwmError;
 import password.pwm.error.PwmException;
@@ -256,11 +257,18 @@ public class SmsQueueManager implements PwmService {
     }
 
     @Override
-    public ServiceInfo serviceInfo() {
-        return null;
+    public ServiceInfoBean serviceInfo() {
+        final Map<String,String> debugItems = new LinkedHashMap<>();
+        if (workQueueProcessor != null) {
+            debugItems.putAll(workQueueProcessor.debugInfo());
+        }
+        if (status() == STATUS.OPEN) {
+            return new ServiceInfoBean(Collections.singletonList(DataStorageMethod.LOCALDB), debugItems);
+        } else {
+            return new ServiceInfoBean(Collections.emptyList(), debugItems);
+        }
     }
 
-
     private List<String> splitMessage(final String input) {
         final int size = (int)pwmApplication.getConfig().readSettingAsLong(PwmSetting.SMS_MAX_TEXT_LENGTH);
 

+ 1 - 1
src/main/java/password/pwm/util/secure/SecureService.java

@@ -78,7 +78,7 @@ public class SecureService implements PwmService {
     }
 
     @Override
-    public ServiceInfo serviceInfo() {
+    public ServiceInfoBean serviceInfo() {
         return null;
     }
 

+ 12 - 12
src/main/webapp/WEB-INF/jsp/admin-user-debug.jsp

@@ -23,7 +23,7 @@
 <%@ page import="com.novell.ldapchai.cr.Challenge" %>
 <%@ page import="password.pwm.Permission" %>
 <%@ page import="password.pwm.bean.ResponseInfoBean" %>
-<%@ page import="password.pwm.ldap.UserInfo" %>
+<%@ page import="password.pwm.bean.pub.PublicUserInfoBean" %>
 <%@ page import="password.pwm.config.profile.ChallengeProfile" %>
 <%@ page import="password.pwm.config.profile.ProfileType" %>
 <%@ page import="password.pwm.config.profile.PwmPasswordPolicy" %>
@@ -68,7 +68,7 @@
                 <button type="submit" class="btn">Download</button>
             </form>
         </div>
-        <% final UserInfo userInfo = userDebugDataBean.getUserInfo(); %>
+        <% final PublicUserInfoBean userInfo = userDebugDataBean.getPublicUserInfoBean(); %>
         <% if (userInfo != null) { %>
         <table>
             <tr>
@@ -76,19 +76,19 @@
             </tr>
             <tr>
                 <td class="key">UserDN</td>
-                <td><%=JspUtility.freindlyWrite(pageContext, userInfo.getUserIdentity().getUserDN())%></td>
+                <td><%=JspUtility.freindlyWrite(pageContext, userInfo.getUserDN())%></td>
             </tr>
             <tr>
                 <td class="key">Ldap Profile</td>
-                <td><%=JspUtility.freindlyWrite(pageContext, userInfo.getUserIdentity().getLdapProfileID())%></td>
+                <td><%=JspUtility.freindlyWrite(pageContext, userInfo.getLdapProfile())%></td>
             </tr>
             <tr>
                 <td class="key">Username</td>
-                <td><%=JspUtility.freindlyWrite(pageContext, userInfo.getUsername())%></td>
+                <td><%=JspUtility.freindlyWrite(pageContext, userInfo.getUserID())%></td>
             </tr>
             <tr>
                 <td class="key"><%=PwmConstants.PWM_APP_NAME%> GUID</td>
-                <td><%=JspUtility.freindlyWrite(pageContext, userInfo.getUserGuid())%></td>
+                <td><%=JspUtility.freindlyWrite(pageContext, userInfo.getUserGUID())%></td>
             </tr>
         </table>
         <br/>
@@ -98,7 +98,7 @@
             </tr>
             <tr>
                 <td class="key">Last Login Time</td>
-                <td><%=JspUtility.freindlyWrite(pageContext, userInfo.getLastLdapLoginTime())%></td>
+                <td><%=JspUtility.freindlyWrite(pageContext, userInfo.getPasswordLastModifiedTime())%></td>
             </tr>
             <tr>
                 <td class="key">Account Expiration Time</td>
@@ -118,11 +118,11 @@
             </tr>
             <tr>
                 <td class="key">Phone Number</td>
-                <td><%=JspUtility.freindlyWrite(pageContext, userInfo.getUserSmsNumber())%></td>
+                <td><%=JspUtility.freindlyWrite(pageContext, userDebugDataBean.getUserInfo().getUserSmsNumber())%></td>
             </tr>
             <tr>
                 <td class="key">Username</td>
-                <td><%=JspUtility.freindlyWrite(pageContext, userInfo.getUsername())%></td>
+                <td><%=JspUtility.freindlyWrite(pageContext, userInfo.getUserID())%></td>
             </tr>
             <tr>
                 <td class="key">
@@ -242,7 +242,7 @@
             <tr>
                 <td colspan="10" class="title">Password Policy</td>
             </tr>
-            <% PwmPasswordPolicy userPolicy = userInfo.getPasswordPolicy(); %>
+            <% PwmPasswordPolicy userPolicy = userDebugDataBean.getUserInfo().getPasswordPolicy(); %>
             <% if (userPolicy != null) { %>
             <% PwmPasswordPolicy configPolicy = userDebugDataBean.getConfiguredPasswordPolicy(); %>
             <% PwmPasswordPolicy ldapPolicy = userDebugDataBean.getLdapPasswordPolicy(); %>
@@ -289,7 +289,7 @@
             <tr>
                 <td colspan="10" class="title">Stored Responses</td>
             </tr>
-            <% final ResponseInfoBean responseInfoBean = userInfo.getResponseInfoBean(); %>
+            <% final ResponseInfoBean responseInfoBean = userDebugDataBean.getUserInfo().getResponseInfoBean(); %>
             <% if (responseInfoBean == null) { %>
             <tr>
                 <td>Stored Responses</td>
@@ -378,7 +378,7 @@
             <tr>
                 <td colspan="10" class="title">Challenge Profile</td>
             </tr>
-            <% final ChallengeProfile challengeProfile = userInfo.getChallengeProfile(); %>
+            <% final ChallengeProfile challengeProfile = userDebugDataBean.getUserInfo().getChallengeProfile(); %>
             <% if (challengeProfile == null) { %>
             <tr>
                 <td>Assigned Profile</td>