diff options
author | Thomas Lenz <tlenz@iaik.tugraz.at> | 2015-07-23 13:07:22 +0200 |
---|---|---|
committer | Thomas Lenz <tlenz@iaik.tugraz.at> | 2015-07-23 13:07:22 +0200 |
commit | 2e67bfacc4c1827bcdc37eac04a2a8d870ee20cd (patch) | |
tree | 1c022dac40a705528713b5025b21f816579f937d /id/server/idserverlib/src | |
parent | bb8b42c45c9d59138e068cd630c744adb0a76d0a (diff) | |
download | moa-id-spss-2e67bfacc4c1827bcdc37eac04a2a8d870ee20cd.tar.gz moa-id-spss-2e67bfacc4c1827bcdc37eac04a2a8d870ee20cd.tar.bz2 moa-id-spss-2e67bfacc4c1827bcdc37eac04a2a8d870ee20cd.zip |
update revisions-log functionality
Diffstat (limited to 'id/server/idserverlib/src')
7 files changed, 75 insertions, 7 deletions
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/advancedlogging/MOAIDEventConstants.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/advancedlogging/MOAIDEventConstants.java index 9e9fd2bff..da3608caa 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/advancedlogging/MOAIDEventConstants.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/advancedlogging/MOAIDEventConstants.java @@ -59,6 +59,7 @@ public interface MOAIDEventConstants extends EventConstants { public static final int AUTHPROCESS_SSO_ASK_USER_FINISHED = 4007; public static final int AUTHPROCESS_INTERFEDERATION = 4008; public static final int AUTHPROCESS_INTERFEDERATION_REVEIVED = 4009; + public static final int AUTHPROCESS_INTERFEDERATION_IDP = 4010; public static final int AUTHPROCESS_BKUSELECTION_INIT = 4110; public static final int AUTHPROCESS_BKUTYPE_SELECTED = 4111; @@ -72,12 +73,13 @@ public interface MOAIDEventConstants extends EventConstants { public static final int AUTHPROCESS_FOREIGN_SZRGW_CONNECTED = 4224; public static final int AUTHPROCESS_FOREIGN_SZRGW_RECEIVED = 4225; - public static final int AUTHPROCESS_MANDATE_SERVICE_REQUESTED = 4330; + public static final int AUTHPROCESS_MANDATE_SERVICE_REQUESTED = 4300; public static final int AUTHPROCESS_MANDATE_REDIRECT = 4301; public static final int AUTHPROCESS_MANDATE_RECEIVED = 4302; public static final int AUTHPROCESS_PEPS_REQUESTED = 4400; public static final int AUTHPROCESS_PEPS_RECEIVED = 4401; + public static final int AUTHPROCESS_PEPS_IDL_RECEIVED = 4402; //person information public static final int PERSONAL_INFORMATION_PROF_REPRESENTATIVE_BPK = 5000; diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/advancedlogging/MOAReversionLogger.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/advancedlogging/MOAReversionLogger.java index e73aa8df1..b2eda4d78 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/advancedlogging/MOAReversionLogger.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/advancedlogging/MOAReversionLogger.java @@ -30,6 +30,8 @@ import com.google.common.primitives.Ints; import at.gv.e_government.reference.namespace.mandates._20040701_.Mandate; import at.gv.egovernment.moa.id.auth.data.IdentityLink; +import at.gv.egovernment.moa.id.config.ConfigurationException; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; import at.gv.egovernment.moa.id.config.auth.IOAAuthParameters; import at.gv.egovernment.moa.id.moduls.IRequest; import at.gv.egovernment.moa.id.util.client.mis.simple.MISMandate; @@ -49,7 +51,6 @@ public class MOAReversionLogger { MOAIDEventConstants.SESSION_CREATED, MOAIDEventConstants.SESSION_DESTROYED, MOAIDEventConstants.SESSION_ERROR, - MOAIDEventConstants.SESSION_IP, MOAIDEventConstants.TRANSACTION_CREATED, MOAIDEventConstants.TRANSACTION_DESTROYED, MOAIDEventConstants.TRANSACTION_ERROR, @@ -64,8 +65,9 @@ public class MOAReversionLogger { MOAIDEventConstants.AUTHPROCESS_IDL_VALIDATED, MOAIDEventConstants.AUTHPROCESS_CERTIFICATE_VALIDATED, MOAIDEventConstants.AUTHPROCESS_AUTHBLOCK_VALIDATED, - MOAIDEventConstants.PERSONAL_INFORMATION_USERNAME_HASH - + MOAIDEventConstants.AUTHPROCESS_SSO, + MOAIDEventConstants.AUTHPROCESS_INTERFEDERATION, + MOAIDEventConstants.AUTHPROCESS_STORK_REQUESTED ); public static synchronized MOAReversionLogger getInstance() { @@ -246,6 +248,16 @@ public class MOAReversionLogger { } public List<Integer> getDefaulttReversionsLoggingEventCodes() { + try { + List<Integer> configuredDefaultEventCodes = AuthConfigurationProviderFactory.getInstance().getDefaultRevisionsLogEventCodes(); + if (configuredDefaultEventCodes != null) + return configuredDefaultEventCodes; + + } catch (ConfigurationException e) { + Logger.error("Access to configuration FAILED.", e); + + } + return defaultEventCodes; } diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/SSOSendAssertionServlet.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/SSOSendAssertionServlet.java index 495c4ca5b..d116f473c 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/SSOSendAssertionServlet.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/SSOSendAssertionServlet.java @@ -30,12 +30,16 @@ import javax.servlet.http.HttpServletResponse; import org.apache.commons.lang.StringEscapeUtils; +import at.gv.egovernment.moa.id.advancedlogging.MOAIDEventConstants; +import at.gv.egovernment.moa.id.advancedlogging.MOAReversionLogger; import at.gv.egovernment.moa.id.auth.builder.DataURLBuilder; import at.gv.egovernment.moa.id.auth.data.AuthenticationSession; import at.gv.egovernment.moa.id.auth.exception.AuthenticationException; import at.gv.egovernment.moa.id.auth.exception.WrongParametersException; import at.gv.egovernment.moa.id.commons.db.ex.MOADatabaseException; +import at.gv.egovernment.moa.id.moduls.IRequest; import at.gv.egovernment.moa.id.moduls.ModulUtils; +import at.gv.egovernment.moa.id.moduls.RequestStorage; import at.gv.egovernment.moa.id.moduls.SSOManager; import at.gv.egovernment.moa.id.storage.AuthenticationSessionStoreage; import at.gv.egovernment.moa.id.util.ParamValidatorUtils; @@ -127,7 +131,12 @@ public class SSOSendAssertionServlet extends AuthServlet{ moaSessionID = AuthenticationSessionStoreage.getMOASessionSSOID(ssoId); AuthenticationSession moasession = AuthenticationSessionStoreage.getSession(moaSessionID); AuthenticationSessionStoreage.setAuthenticated(moaSessionID, true); - + + //log event + String pendingRequestID = AuthenticationSessionStoreage.getPendingRequestID(moaSessionID); + IRequest pendingReq = RequestStorage.getPendingRequest(pendingRequestID); + MOAReversionLogger.getInstance().logEvent(pendingReq, MOAIDEventConstants.AUTHPROCESS_SSO_ASK_USER_FINISHED); + String redirectURL = new DataURLBuilder().buildDataURL(moasession.getAuthURL(), ModulUtils.buildAuthURL(module, action, id), ""); diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfiguration.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfiguration.java index ebe08b615..d8f1a28c5 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfiguration.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfiguration.java @@ -137,6 +137,13 @@ public interface AuthConfiguration extends ConfigurationProvider{ */ Map<String, String> getConfigurationWithWildCard(String key); + /** + * Get configured default revisions-log event codes which should be logged + * + * @return {List<Integer>} if event codes or null + */ + List<Integer> getDefaultRevisionsLogEventCodes(); + @Deprecated public boolean isHTTPAuthAllowed(); } diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/PropertyBasedAuthConfigurationProvider.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/PropertyBasedAuthConfigurationProvider.java index a151d6dbe..7418f2e35 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/PropertyBasedAuthConfigurationProvider.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/PropertyBasedAuthConfigurationProvider.java @@ -4,7 +4,6 @@ import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; -import java.math.BigInteger; import java.net.MalformedURLException; import java.net.URI; import java.util.ArrayList; @@ -1029,4 +1028,36 @@ public class PropertyBasedAuthConfigurationProvider extends ConfigurationProvide return Boolean.valueOf(prop); } + /* (non-Javadoc) + * @see at.gv.egovernment.moa.id.config.auth.AuthConfiguration#getDefaultRevisionsLogEventCodes() + */ + @Override + public List<Integer> getDefaultRevisionsLogEventCodes() { + try { + String eventcodes = configuration.getStringValue(MOAIDConfigurationConstants.GENERAL_REVERSION_LOGS_EVENTCODES); + if (MiscUtil.isNotEmpty(eventcodes)) { + String[] codes = eventcodes.split(","); + List<Integer> result = new ArrayList<Integer>(); + for (String el : codes) { + try { + result.add(Integer.parseInt(el)); + + } catch (NumberFormatException e) { + Logger.warn("EventCode: " + el + " is not a valid Integer."); + + } + } + + if (!result.isEmpty()) + return result; + + } + + } catch (at.gv.egiz.components.configuration.api.ConfigurationException e) { + Logger.error("Error during revisions-code load operationen." , e); + } + + return null; + } + } diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/entrypoints/DispatcherServlet.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/entrypoints/DispatcherServlet.java index 45eecec84..217efe927 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/entrypoints/DispatcherServlet.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/entrypoints/DispatcherServlet.java @@ -286,7 +286,7 @@ public class DispatcherServlet extends AuthServlet{ //log information for security and process reversion MOAReversionLogger.getInstance().logEvent(MOAIDEventConstants.SESSION_CREATED, uniqueSessionIdentifier); MOAReversionLogger.getInstance().logEvent(MOAIDEventConstants.TRANSACTION_CREATED, protocolRequestID); - MOAReversionLogger.getInstance().logEvent(uniqueSessionIdentifier, protocolRequestID, MOAIDEventConstants.SESSION_IP, req.getRemoteAddr()); + MOAReversionLogger.getInstance().logEvent(uniqueSessionIdentifier, protocolRequestID, MOAIDEventConstants.TRANSACTION_IP, req.getRemoteAddr()); protocolRequest = info.preProcess(req, resp, action, uniqueSessionIdentifier, protocolRequestID); @@ -450,6 +450,9 @@ public class DispatcherServlet extends AuthServlet{ if (tryperform) MOAReversionLogger.getInstance().logEvent(protocolRequest.getOnlineApplicationConfiguration(), protocolRequest, MOAIDEventConstants.AUTHPROCESS_FINISHED); + else + MOAReversionLogger.getInstance().logEvent(protocolRequest.getOnlineApplicationConfiguration(), + protocolRequest, MOAIDEventConstants.AUTHPROTOCOL_TYPE, protocolRequest.requestedModule()); if (protocolRequest.forceAuth()) { if (!tryperform) { diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/moduls/AuthenticationManager.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/moduls/AuthenticationManager.java index f3c40707e..afc0d8451 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/moduls/AuthenticationManager.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/moduls/AuthenticationManager.java @@ -532,6 +532,10 @@ public class AuthenticationManager extends MOAIDAuthConstants { //build and send request without an error requiredLocalAuthentication = false; + MOAReversionLogger.getInstance().logEvent(target.getOnlineApplicationConfiguration(), + target, MOAIDEventConstants.AUTHPROCESS_INTERFEDERATION_IDP, idpEntity.getEntityID()); + + } else { Logger.warn("Requested IDP " + target.getRequestedIDP() + " does not support POST or Redirect Binding."); |