use of com.evolveum.midpoint.security.api.HttpConnectionInformation in project midpoint by Evolveum.
the class SecurityHelper method storeConnectionEnvironment.
private void storeConnectionEnvironment(AuditEventRecord record, ConnectionEnvironment connEnv) {
record.setChannel(connEnv.getChannel());
record.setSessionIdentifier(connEnv.getSessionId());
HttpConnectionInformation connInfo = connEnv.getConnectionInformation();
if (connInfo != null) {
record.setRemoteHostAddress(connInfo.getRemoteHostAddress());
record.setHostIdentifier(connInfo.getLocalHostName());
}
}
use of com.evolveum.midpoint.security.api.HttpConnectionInformation in project midpoint by Evolveum.
the class MidpointFunctionsImpl method getPublicHttpUrlPattern.
private String getPublicHttpUrlPattern() {
SystemConfigurationType systemConfiguration;
try {
systemConfiguration = modelInteractionService.getSystemConfiguration(getCurrentResult());
} catch (ObjectNotFoundException | SchemaException e) {
LOGGER.error("Error while getting system configuration. ", e);
return null;
}
if (systemConfiguration == null) {
LOGGER.trace("No system configuration defined. Skipping link generation.");
return null;
}
String host = null;
HttpConnectionInformation connectionInf = SecurityUtil.getCurrentConnectionInformation();
if (connectionInf != null) {
host = connectionInf.getServerName();
}
String publicHttpUrlPattern = SystemConfigurationTypeUtil.getPublicHttpUrlPattern(systemConfiguration, host);
if (StringUtils.isBlank(publicHttpUrlPattern)) {
LOGGER.error("No patern defined. It can break link generation.");
}
return publicHttpUrlPattern;
}
Aggregations