diff options
author | Florian Reimair <florian.reimair@iaik.tugraz.at> | 2014-01-07 15:07:32 +0100 |
---|---|---|
committer | Florian Reimair <florian.reimair@iaik.tugraz.at> | 2014-01-27 16:34:14 +0100 |
commit | 3da3836bcd77a23ca00df2bdb088e63b47cc6499 (patch) | |
tree | 3260298328682d6eed3030128082195f18dd7b8a /id/ConfigWebTool/src | |
parent | 7c39d9e0cff15a87678bf68d6d754ee1e720ca12 (diff) | |
download | moa-id-spss-3da3836bcd77a23ca00df2bdb088e63b47cc6499.tar.gz moa-id-spss-3da3836bcd77a23ca00df2bdb088e63b47cc6499.tar.bz2 moa-id-spss-3da3836bcd77a23ca00df2bdb088e63b47cc6499.zip |
mandatory field in global config
Diffstat (limited to 'id/ConfigWebTool/src')
4 files changed, 18 insertions, 21 deletions
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 695caa3fd..854334bed 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 @@ -7,13 +7,13 @@ import at.gv.egovernment.moa.id.commons.db.dao.config.AuthComponentGeneral; import at.gv.egovernment.moa.id.commons.db.dao.config.CPEPS; 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.RequestedAttributesType; import at.gv.egovernment.moa.id.commons.db.dao.config.STORK; +import at.gv.egovernment.moa.id.commons.db.dao.config.StorkAttribute; public class GeneralStorkConfig { private List<CPEPS> cpepslist; - private List<String> attributes; + private List<StorkAttribute> attributes; private int qaa; public void parse(MOAIDConfiguration config) { @@ -27,16 +27,17 @@ public class GeneralStorkConfig { if (foreign != null) { STORK stork = foreign.getSTORK(); if (stork != null) { - // deep clone to foreclose lazyloading session timeouts + // deep clone all the things + // to foreclose lazyloading session timeouts cpepslist = new ArrayList<CPEPS>(); for(CPEPS current : stork.getCPEPS()) { cpepslist.add(current); } - RequestedAttributesType tmp = stork.getRequestedAttributes(); + List<StorkAttribute> tmp = stork.getRequestedAttributes(); if(null != tmp) { - attributes = new ArrayList<String>(); - for(String current : tmp.getAttributeValue()) + attributes = new ArrayList<StorkAttribute>(); + for(StorkAttribute current : tmp) attributes.add(current); } @@ -59,17 +60,11 @@ public class GeneralStorkConfig { cpepslist = list; } - public RequestedAttributesType getRequestedAttributesType() { - RequestedAttributesType tmp = new RequestedAttributesType(); - tmp.setAttributeValue(attributes); - return tmp; - } - - public List<String> getAttributes() { + public List<StorkAttribute> getAttributes() { return attributes; } - public void setAttributes(List<String> attributes) { + public void setAttributes(List<StorkAttribute> attributes) { this.attributes = attributes; } 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 72da0b59f..1de440506 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 @@ -398,7 +398,7 @@ public class EditGeneralConfigAction extends ActionSupport oldstork = new STORK(); oldstork.setQualityAuthenticationAssuranceLevel(storkconfig.getDefaultQaa()); - oldstork.setRequestedAttributes(storkconfig.getRequestedAttributesType()); + oldstork.setRequestedAttributes(storkconfig.getAttributes()); oldstork.setCPEPS(storkconfig.getCpepslist()); dbforeign.setSTORK(oldstork); } diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/moaconfig/StorkConfigValidator.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/moaconfig/StorkConfigValidator.java index cc5d0f2c4..318b3b3e7 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/moaconfig/StorkConfigValidator.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/moaconfig/StorkConfigValidator.java @@ -5,6 +5,7 @@ import java.util.List; import org.apache.log4j.Logger; import at.gv.egovernment.moa.id.commons.db.dao.config.CPEPS; +import at.gv.egovernment.moa.id.commons.db.dao.config.StorkAttribute; import at.gv.egovernment.moa.id.configuration.data.GeneralStorkConfig; import at.gv.egovernment.moa.id.configuration.helper.LanguageHelper; import at.gv.egovernment.moa.id.configuration.validation.ValidationHelper; @@ -65,13 +66,13 @@ public class StorkConfigValidator { // check attributes if (MiscUtil.isNotEmpty(form.getAttributes())) { - for(String check : form.getAttributes()) { - if (ValidationHelper.containsPotentialCSSCharacter(check, true)) { + for(StorkAttribute check : form.getAttributes()) { + if (ValidationHelper.containsPotentialCSSCharacter(check.getName(), true)) { log.warn("default attributes contains potentail XSS characters: " + check); errors.add(LanguageHelper.getErrorString("validation.stork.requestedattributes", new Object[] {ValidationHelper.getPotentialCSSCharacter(true)} )); } - if(!check.toLowerCase().matches("^[a-z0-9]*$")) { + if(!check.getName().toLowerCase().matches("^[a-z0-9]*$")) { log.warn("default attributes do not match the requested format : " + check); errors.add(LanguageHelper.getErrorString("validation.stork.requestedattributes", new Object[] {check} )); diff --git a/id/ConfigWebTool/src/main/webapp/jsp/editMOAConfig.jsp b/id/ConfigWebTool/src/main/webapp/jsp/editMOAConfig.jsp index aff2028ac..078e5f681 100644 --- a/id/ConfigWebTool/src/main/webapp/jsp/editMOAConfig.jsp +++ b/id/ConfigWebTool/src/main/webapp/jsp/editMOAConfig.jsp @@ -245,9 +245,10 @@ <input type="button" value="<%=LanguageHelper.getGUIString("webpages.moaconfig.stork.newpeps", request) %>" onclick='newPeps();' /> <h4><%=LanguageHelper.getGUIString("webpages.moaconfig.stork.attributes.heading", request) %></h4> <table> - <tr><th>Attribute Name</th></tr> - <s:iterator value="storkconfig.attributes" var="attr" status="stat"> - <tr><td><s:textfield name="storkconfig.attributes[%{#stat.index}]"/></td> + <tr><th>Attribute Name</th><th>Mandatory</th></tr> + <s:iterator value="storkconfig.attributes" status="stat"> + <tr><td><s:textfield name="storkconfig.attributes[%{#stat.index}].name" value="%{name}"/></td> + <td><s:checkbox name="storkconfig.attributes[%{#stat.index}].mandatory" value="%{mandatory}" /></td> <td><input type="button" value="Delete" onclick='this.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode);'/></td></tr> </s:iterator> </table> |