use of password.pwm.health.ConfigurationChecker in project pwm by pwm-project.
the class ConfigEditorServlet method restReadChangeLog.
@ActionHandler(action = "readChangeLog")
private ProcessStatus restReadChangeLog(final PwmRequest pwmRequest) throws IOException, PwmUnrecoverableException {
final ConfigManagerBean configManagerBean = getBean(pwmRequest);
final Locale locale = pwmRequest.getLocale();
final HashMap<String, Object> returnObj = new HashMap<>();
returnObj.put("html", configManagerBean.getStoredConfiguration().changeLogAsDebugString(locale, true));
returnObj.put("modified", configManagerBean.getStoredConfiguration().isModified());
try {
final ConfigurationChecker configurationChecker = new ConfigurationChecker();
final Configuration config = new Configuration(configManagerBean.getStoredConfiguration());
final List<HealthRecord> healthRecords = configurationChecker.doHealthCheck(config, pwmRequest.getLocale());
final HealthData healthData = new HealthData();
healthData.setOverall("CONFIG");
healthData.setRecords(password.pwm.ws.server.rest.bean.HealthRecord.fromHealthRecords(healthRecords, locale, config));
returnObj.put("health", healthData);
} catch (Exception e) {
LOGGER.error(pwmRequest, "error generating health records: " + e.getMessage());
}
final RestResultBean restResultBean = RestResultBean.withData(returnObj);
pwmRequest.outputJsonResult(restResultBean);
return ProcessStatus.Halt;
}
Aggregations