aboutsummaryrefslogtreecommitdiff
path: root/id/ConfigWebTool/src/main/java/at/gv
diff options
context:
space:
mode:
authorThomas Lenz <tlenz@iaik.tugraz.at>2016-01-22 13:16:39 +0100
committerThomas Lenz <tlenz@iaik.tugraz.at>2016-01-22 13:16:39 +0100
commit27be6ee27f530e9abca5d83d7464a8b80e182f41 (patch)
tree7ad38e347bb1e6f3e10a5f3b09290fe1f52266e4 /id/ConfigWebTool/src/main/java/at/gv
parentd10d2341ec4839e81b14e4eec27b29d2e64ce813 (diff)
downloadmoa-id-spss-27be6ee27f530e9abca5d83d7464a8b80e182f41.tar.gz
moa-id-spss-27be6ee27f530e9abca5d83d7464a8b80e182f41.tar.bz2
moa-id-spss-27be6ee27f530e9abca5d83d7464a8b80e182f41.zip
fix some problems with configuration validation in moa-id-configuration
Diffstat (limited to 'id/ConfigWebTool/src/main/java/at/gv')
-rw-r--r--id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/GeneralMOAIDConfig.java22
-rw-r--r--id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditGeneralConfigAction.java14
-rw-r--r--id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/moaconfig/MOAConfigValidator.java13
3 files changed, 42 insertions, 7 deletions
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 820a07318..95af93af3 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
@@ -56,6 +56,7 @@ import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.VerifyAuthBlock
import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.VerifyIdentityLink;
import at.gv.egovernment.moa.id.commons.utils.KeyValueUtils;
import at.gv.egovernment.moa.id.configuration.Constants;
+import at.gv.egovernment.moa.id.configuration.config.ConfigurationProvider;
import at.gv.egovernment.moa.id.configuration.data.pvp2.ContactForm;
import at.gv.egovernment.moa.util.MiscUtil;
@@ -135,6 +136,26 @@ public class GeneralMOAIDConfig {
for (int i=0; i<values.length; i++) {
chainigmodelist.put(values[i].value(), values[i].value());
}
+
+ try {
+ ConfigurationProvider config = ConfigurationProvider.getInstance();
+ if (config != null) {
+ MOAIDConfiguration dbconfig = config.getDbRead().getMOAIDConfiguration();
+ List<TransformsInfoType> authBlockTrans = dbconfig.getAuthComponentGeneral().getSecurityLayer().getTransformsInfo();
+
+ if (authBlockTrans != null && !authBlockTrans.isEmpty()) {
+ if (secLayerTransformation == null)
+ secLayerTransformation = new HashMap<String, byte[]>();
+ for (TransformsInfoType el : authBlockTrans)
+ secLayerTransformation.put(el.getFilename(), el.getTransformation());
+
+ }
+ }
+
+ } catch (Exception e) {
+
+ }
+
}
public void parse(MOAIDConfiguration config) {
@@ -840,6 +861,7 @@ public class GeneralMOAIDConfig {
* @return the secLayerTransformation
*/
public Map<String, byte[]> getSecLayerTransformation() {
+
return secLayerTransformation;
}
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 3871fe6e1..504b598c0 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,8 +23,11 @@
package at.gv.egovernment.moa.id.configuration.struts.action;
import java.math.BigInteger;
-import java.util.*;
-
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.Logger;
@@ -181,7 +184,12 @@ public class EditGeneralConfigAction extends BasicAction {
String error = saveFormToDatabase();
if (error != null) {
log.warn("General MOA-ID config can not be stored in Database");
- addActionError(error);
+
+ //set new formID
+ formID = Random.nextRandom();
+ session.setAttribute(Constants.SESSION_FORMID, formID);
+
+ addActionError(error);
return Constants.STRUTS_ERROR_VALIDATION;
}
diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/moaconfig/MOAConfigValidator.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/moaconfig/MOAConfigValidator.java
index dac25ad60..d4e8e957d 100644
--- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/moaconfig/MOAConfigValidator.java
+++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/moaconfig/MOAConfigValidator.java
@@ -28,7 +28,6 @@ import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
-import java.util.Map;
import javax.servlet.http.HttpServletRequest;
@@ -40,8 +39,6 @@ import at.gv.egovernment.moa.id.configuration.Constants;
import at.gv.egovernment.moa.id.configuration.data.GeneralMOAIDConfig;
import at.gv.egovernment.moa.id.configuration.data.pvp2.ContactForm;
import at.gv.egovernment.moa.id.configuration.helper.LanguageHelper;
-import at.gv.egovernment.moa.id.configuration.helper.StringHelper;
-import at.gv.egovernment.moa.id.configuration.validation.CompanyNumberValidator;
import at.gv.egovernment.moa.util.Base64Utils;
import at.gv.egovernment.moa.util.MiscUtil;
@@ -417,7 +414,7 @@ public class MOAConfigValidator {
- if (form.getFileUploadFileName() != null) {
+ if (form.getFileUploadFileName() != null && !form.getFileUploadFileName().isEmpty()) {
HashMap<String, byte[]> map = new HashMap<String, byte[]>();
for (int i=0; i<form.getFileUploadFileName().size(); i++) {
String filename = form.getFileUploadFileName().get(i);
@@ -442,7 +439,15 @@ public class MOAConfigValidator {
}
}
}
+
form.setSecLayerTransformation(map);
+
+ } else {
+ if (form.getSecLayerTransformation() == null) {
+ log.info("AuthBlock Transformation file is empty");
+ errors.add(LanguageHelper.getErrorString("validation.general.slrequest.file.empty", request));
+
+ }
}