diff options
Diffstat (limited to 'id/ConfigWebTool')
7 files changed, 81 insertions, 23 deletions
diff --git a/id/ConfigWebTool/ConfigurationInterface.iml b/id/ConfigWebTool/ConfigurationInterface.iml index bb7e047b2..20f45337e 100644 --- a/id/ConfigWebTool/ConfigurationInterface.iml +++ b/id/ConfigWebTool/ConfigurationInterface.iml @@ -57,7 +57,7 @@ <orderEntry type="library" name="Maven: iaik.prod:iaik_moa:1.5" level="project" /> <orderEntry type="library" name="Maven: jaxen:jaxen:1.0-FCS" level="project" /> <orderEntry type="library" name="Maven: saxpath:saxpath:1.0-FCS" level="project" /> - <orderEntry type="library" name="Maven: joda-time:joda-time:1.6.2" level="project" /> + <orderEntry type="library" name="Maven: joda-time:joda-time:2.2" level="project" /> <orderEntry type="library" name="Maven: org.jvnet.hyperjaxb3:hyperjaxb3-ejb-runtime:0.5.6" level="project" /> <orderEntry type="library" name="Maven: commons-lang:commons-lang:2.6" level="project" /> <orderEntry type="library" name="Maven: org.jvnet.jaxb2_commons:jaxb2-basics-runtime:0.6.2" level="project" /> diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/GeneralMOAIDConfig.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/GeneralMOAIDConfig.java index e16020782..08ea9f233 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/GeneralMOAIDConfig.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/GeneralMOAIDConfig.java @@ -113,6 +113,7 @@ public class GeneralMOAIDConfig { private static Map<String, String> chainigmodelist; private String trustedCACerts = null; + private String defaultBKUOnline = ""; private String defaultBKULocal = "https://127.0.0.1:3496/https-security-layer-request"; diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/GeneralStorkConfig.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/GeneralStorkConfig.java index 980aa4731..8b78c62a3 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/GeneralStorkConfig.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/GeneralStorkConfig.java @@ -31,14 +31,18 @@ import at.gv.egovernment.moa.id.commons.db.dao.config.ForeignIdentities; import at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration; import at.gv.egovernment.moa.id.commons.db.dao.config.STORK; import at.gv.egovernment.moa.id.commons.db.dao.config.StorkAttribute; +import org.apache.log4j.Logger; public class GeneralStorkConfig { private List<CPEPS> cpepslist; private List<StorkAttribute> attributes; private int qaa; + private static final Logger log = Logger.getLogger(GeneralStorkConfig.class); + + public void parse(MOAIDConfiguration config) { + log.error("STARTED STORK CONFIG"); - public void parse(MOAIDConfiguration config) { if (config != null) { AuthComponentGeneral auth = config.getAuthComponentGeneral(); diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OASTORKConfig.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OASTORKConfig.java index 9a65e4ab5..929a3673c 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OASTORKConfig.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OASTORKConfig.java @@ -24,6 +24,7 @@ package at.gv.egovernment.moa.id.configuration.data.oa; import java.util.ArrayList; import java.util.List; + import at.gv.egovernment.moa.id.commons.db.ConfigurationDBRead; import at.gv.egovernment.moa.id.commons.db.dao.config.AttributeProviderPlugin; import at.gv.egovernment.moa.id.commons.db.dao.config.AuthComponentOA; @@ -31,6 +32,7 @@ import at.gv.egovernment.moa.id.commons.db.dao.config.OASTORK; import at.gv.egovernment.moa.id.commons.db.dao.config.OAStorkAttribute; import at.gv.egovernment.moa.id.commons.db.dao.config.OnlineApplication; import at.gv.egovernment.moa.id.commons.db.dao.config.StorkAttribute; +import at.gv.egovernment.moa.logging.Logger; import at.gv.egovernment.moa.id.protocols.stork2.AttributeProviderFactory; public class OASTORKConfig { @@ -66,6 +68,7 @@ public class OASTORKConfig { // prepare attribute helper list attributes = new ArrayList<AttributeHelper>(); + try { for(StorkAttribute current : ConfigurationDBRead.getMOAIDConfiguration().getAuthComponentGeneral().getForeignIdentities().getSTORK().getAttributes()) { AttributeHelper tmp = null; @@ -89,6 +92,9 @@ public class OASTORKConfig { // Sorry. if (attributeProviderPlugins.isEmpty()) attributeProviderPlugins.add(new AttributeProviderPlugin()); + } catch (NullPointerException ex) { + Logger.error("Nullpointerexception encountered in Configurationinterface"); + } } } } diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditGeneralConfigAction.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditGeneralConfigAction.java index c9e834662..989641f36 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditGeneralConfigAction.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditGeneralConfigAction.java @@ -23,12 +23,7 @@ package at.gv.egovernment.moa.id.configuration.struts.action; import java.math.BigInteger; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Date; -import java.util.List; -import java.util.Map; -import java.util.Set; +import java.util.*; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -96,7 +91,8 @@ public class EditGeneralConfigAction extends ActionSupport private String formID; public String loadConfig() { - HttpSession session = request.getSession(); + + HttpSession session = request.getSession(); if (session == null) { log.info("No http Session found."); return Constants.STRUTS_ERROR; @@ -113,8 +109,16 @@ public class EditGeneralConfigAction extends ActionSupport moaconfig.parse(dbconfig); storkconfig = new GeneralStorkConfig(); storkconfig.parse(dbconfig); - - ConfigurationDBUtils.closeSession(); + + if (moaconfig == null) { + log.error("MOA configuration is null"); + } + + if (storkconfig == null) { + log.error("Stork configuration is null"); + } + + ConfigurationDBUtils.closeSession(); formID = Random.nextRandom(); session.setAttribute(Constants.SESSION_FORMID, formID); @@ -133,7 +137,7 @@ public class EditGeneralConfigAction extends ActionSupport log.info("No http Session found."); return Constants.STRUTS_ERROR; } - + Object authUserObj = session.getAttribute(Constants.SESSION_AUTH); authUser = (AuthenticatedUser) authUserObj; @@ -161,7 +165,7 @@ public class EditGeneralConfigAction extends ActionSupport errors.addAll(new StorkConfigValidator().validate(storkconfig)); if (errors.size() > 0) { - log.info("General MOA-ID configuration has some erros."); + log.info("General MOA-ID configuration has some errors."); for (String el : errors) addActionError(el); @@ -198,7 +202,24 @@ public class EditGeneralConfigAction extends ActionSupport } private String saveFormToDatabase() { - + + log.debug("Saving form to database"); + log.error("Saving form to db"); + log.info("SV frm db"); + + for (Object obj : Collections.list(request.getParameterNames())) { + log.error(" PARAM: " + obj.toString()); + } + for (Object obj : Collections.list(request.getSession().getAttributeNames())) { + log.error(" SES PARAM: " + obj.toString()); + } + + try { + log.error(" ASSERTION " + moaconfig.getTimeoutAssertion()); + } catch (Exception ex) { + ex.printStackTrace(); + } + MOAIDConfiguration oldconfig = ConfigurationDBRead.getMOAIDConfiguration(); AuthComponentGeneral oldauth = null; if (oldconfig != null) { @@ -269,7 +290,8 @@ public class EditGeneralConfigAction extends ActionSupport dbauthgeneral.setTrustManagerRevocationChecking(moaconfig.isTrustmanagerrevocationcheck()); - + + Protocols dbprotocols = dbauth.getProtocols(); if (dbprotocols == null) { dbprotocols = new Protocols(); @@ -412,6 +434,7 @@ public class EditGeneralConfigAction extends ActionSupport // } DefaultBKUs dbbkus = dbconfig.getDefaultBKUs(); + if (dbbkus == null) { dbbkus = new DefaultBKUs(); dbconfig.setDefaultBKUs(dbbkus); @@ -475,16 +498,28 @@ public class EditGeneralConfigAction extends ActionSupport //TODO: Set STORK Config!!! if (oldauth != null) { - ForeignIdentities oldforeign = oldauth.getForeignIdentities(); + ForeignIdentities oldforeign = oldauth.getForeignIdentities(); if (oldforeign != null) { STORK oldstork = oldforeign.getSTORK(); - if (oldstork != null) - oldstork = new STORK(); + if (oldstork == null) + oldstork = new STORK(); + try { + log.error("QAAAA " + storkconfig.getDefaultQaa()); oldstork.setQualityAuthenticationAssuranceLevel(storkconfig.getDefaultQaa()); oldstork.setAttributes(storkconfig.getAttributes()); oldstork.setCPEPS(storkconfig.getCpepslist()); dbforeign.setSTORK(oldstork); + } catch (Exception e) { + e.printStackTrace(); + } + + try{ + log.error("CPEPS LIST: " + storkconfig.getCpepslist().size() ); + log.error("CPEPS 1:" + storkconfig.getCpepslist().get(0).getCountryCode() +storkconfig.getCpepslist().get(0).getURL()); + } catch (Exception ex) { + ex.printStackTrace(); + } } } @@ -626,6 +661,7 @@ public class EditGeneralConfigAction extends ActionSupport */ public void setMoaconfig(GeneralMOAIDConfig moaconfig) { this.moaconfig = moaconfig; + log.error("MOA CONFIG SET"); } /** @@ -644,6 +680,7 @@ public class EditGeneralConfigAction extends ActionSupport */ public void setStorkconfig(GeneralStorkConfig storkconfig) { this.storkconfig = storkconfig; + log.error("STORK CONFIG SET"); } /** @@ -659,8 +696,8 @@ public class EditGeneralConfigAction extends ActionSupport public void setFormID(String formID) { this.formID = formID; } - - + + } diff --git a/id/ConfigWebTool/src/main/webapp/js/common.js b/id/ConfigWebTool/src/main/webapp/js/common.js index 45f40f5b8..5fbbdafd1 100644 --- a/id/ConfigWebTool/src/main/webapp/js/common.js +++ b/id/ConfigWebTool/src/main/webapp/js/common.js @@ -221,7 +221,12 @@ function oaOnLoad() { function newPeps() { var target = $(document.getElementById("stork_pepslist").getElementsByTagName("tr")).last()[0]; var clone = target.cloneNode(true); - var lastindex = parseInt(clone.innerHTML.match(/name="storkconfig.cpepslist\[(\d)/)[1]); + try { + var lastindex = parseInt(clone.innerHTML.match(/name="storkconfig.cpepslist\[(\d)/)[1]); + } catch (err) { + + var lastindex = 1; + } var nextindex = lastindex + 1; clone.innerHTML = clone.innerHTML.replace(/name="storkconfig.cpepslist\[\d/g, 'name="storkconfig.cpepslist[' + nextindex); clone.innerHTML = clone.innerHTML.replace(/(.*" value=").*?(".*)/g, '$1$2'); diff --git a/id/ConfigWebTool/src/main/webapp/jsp/editMOAConfig.jsp b/id/ConfigWebTool/src/main/webapp/jsp/editMOAConfig.jsp index de5e4841b..bdafdd40a 100644 --- a/id/ConfigWebTool/src/main/webapp/jsp/editMOAConfig.jsp +++ b/id/ConfigWebTool/src/main/webapp/jsp/editMOAConfig.jsp @@ -242,14 +242,19 @@ key="webpages.moaconfig.stork.qaa.default" labelposition="left" /> <h4><%=LanguageHelper.getGUIString("webpages.moaconfig.stork.pepslist", request) %></h4> - <table id="stork_pepslist"> + <table id="stork_pepslist"> <tr><th>Country Shortcode</th><th>PEPS URL</th> <s:iterator value="storkconfig.cpepslist" status="stat"> <tr><td><s:textfield name="storkconfig.cpepslist[%{#stat.index}].countryCode" value="%{countryCode}" cssClass="textfield_short"/></td> <td><s:textfield name="storkconfig.cpepslist[%{#stat.index}].URL" value="%{URL}" cssClass="textfield_long"/></td> <td><input type="button" value="<%=LanguageHelper.getGUIString("webpages.moaconfig.stork.removepeps", request) %>" onclick='this.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode);'/></td></tr> </s:iterator> - </table> + <s:if test="%{storkconfig.cpepslist == null}"> + <tr><td><s:textfield name="storkconfig.cpepslist[0].countryCode" value="CC" cssClass="textfield_short"/></td> + <td><s:textfield name="storkconfig.cpepslist[0].URL" value="http://" cssClass="textfield_long"/></td> + <td><input type="button" value="<%=LanguageHelper.getGUIString("webpages.moaconfig.stork.removepeps", request) %>" onclick='this.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode);'/></td></tr> + </s:if> + </table> <input type="button" value="<%=LanguageHelper.getGUIString("webpages.moaconfig.stork.newpeps", request) %>" onclick='newPeps();' /> <h4><%=LanguageHelper.getGUIString("webpages.moaconfig.stork.attributes.heading", request) %></h4> <table id="stork_attributelist"> |