aboutsummaryrefslogtreecommitdiff
path: root/id/ConfigWebTool/src/main/java/at
diff options
context:
space:
mode:
Diffstat (limited to 'id/ConfigWebTool/src/main/java/at')
-rw-r--r--id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/Constants.java4
-rw-r--r--id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/config/ConfigurationProvider.java2
-rw-r--r--id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/GeneralMOAIDConfig.java1
-rw-r--r--id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/GeneralStorkConfig.java6
-rw-r--r--id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OASTORKConfig.java6
-rw-r--r--id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditGeneralConfigAction.java73
6 files changed, 70 insertions, 22 deletions
diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/Constants.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/Constants.java
index 7a9d91a5d..b963890af 100644
--- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/Constants.java
+++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/Constants.java
@@ -71,7 +71,9 @@ public class Constants {
public static final String MOA_CONFIG_BUSINESSSERVICE = "businessService";
public static final String MOA_CONFIG_PROTOCOL_SAML1 = "id_saml1";
public static final String MOA_CONFIG_PROTOCOL_PVP2 = "id_pvp2x";
-
+ public static final String MOA_CONFIG_PROTOCOL_STORK2 = "id_stork2";
+
+
public static final String DEFAULT_LOCALBKU_URL = "https://127.0.0.1:3496/https-security-layer-request";
public static final String DEFAULT_HANDYBKU_URL = "https://www.handy-signatur.at/mobile/https-security-layer-request/default.aspx";
diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/config/ConfigurationProvider.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/config/ConfigurationProvider.java
index 692990fa9..c4db5a76d 100644
--- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/config/ConfigurationProvider.java
+++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/config/ConfigurationProvider.java
@@ -92,7 +92,7 @@ public class ConfigurationProvider {
configFileName = System.getProperty(SYSTEM_PROP_CONFIG);
if (configFileName == null) {
- throw new ConfigurationException("config.01");
+ throw new ConfigurationException("config.05");
}
// determine the directory of the root config file
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 d81d03780..f56ad4604 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
@@ -115,6 +115,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 da07b10b0..c35bff633 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
@@ -31,6 +31,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;
public class OASTORKConfig {
@@ -65,6 +66,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;
@@ -76,7 +78,9 @@ public class OASTORKConfig {
tmp = new AttributeHelper(current);
attributes.add(tmp);
- }
+ } } 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 67750e765..5dccf965d 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;
@@ -97,7 +92,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;
@@ -114,8 +110,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);
@@ -134,7 +138,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;
@@ -162,7 +166,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);
@@ -199,7 +203,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) {
@@ -262,7 +283,8 @@ public class EditGeneralConfigAction extends ActionSupport
dbauthgeneral.setTrustManagerRevocationChecking(moaconfig.isTrustmanagerrevocationcheck());
-
+
+
Protocols dbprotocols = dbauth.getProtocols();
if (dbprotocols == null) {
dbprotocols = new Protocols();
@@ -405,6 +427,7 @@ public class EditGeneralConfigAction extends ActionSupport
// }
DefaultBKUs dbbkus = dbconfig.getDefaultBKUs();
+
if (dbbkus == null) {
dbbkus = new DefaultBKUs();
dbconfig.setDefaultBKUs(dbbkus);
@@ -468,16 +491,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();
+ }
}
}
@@ -619,6 +654,7 @@ public class EditGeneralConfigAction extends ActionSupport
*/
public void setMoaconfig(GeneralMOAIDConfig moaconfig) {
this.moaconfig = moaconfig;
+ log.error("MOA CONFIG SET");
}
/**
@@ -637,6 +673,7 @@ public class EditGeneralConfigAction extends ActionSupport
*/
public void setStorkconfig(GeneralStorkConfig storkconfig) {
this.storkconfig = storkconfig;
+ log.error("STORK CONFIG SET");
}
/**
@@ -652,8 +689,8 @@ public class EditGeneralConfigAction extends ActionSupport
public void setFormID(String formID) {
this.formID = formID;
}
-
-
+
+
}