diff options
author | Thomas Lenz <thomas.lenz@egiz.gv.at> | 2014-03-26 10:34:01 +0100 |
---|---|---|
committer | Thomas Lenz <thomas.lenz@egiz.gv.at> | 2014-03-26 10:34:01 +0100 |
commit | fbb4e4346e7f8cd5a910f72a12272c0ea3b6ba32 (patch) | |
tree | db36b880ce134f9ecf7949a8dbb6d8f778b7307f /id | |
parent | 897b70a6787b39c653746160714b4ee92d32186a (diff) | |
parent | cce52b9d46fc9e9f13c388362c4ca229b7a053b1 (diff) | |
download | moa-id-spss-fbb4e4346e7f8cd5a910f72a12272c0ea3b6ba32.tar.gz moa-id-spss-fbb4e4346e7f8cd5a910f72a12272c0ea3b6ba32.tar.bz2 moa-id-spss-fbb4e4346e7f8cd5a910f72a12272c0ea3b6ba32.zip |
Merge branch 'inbound_stork_config_target_countries_per_OA' of https://gitlab.iaik.tugraz.at/afitzek/moa-idspss.git into moa2_0_tlenz
Diffstat (limited to 'id')
7 files changed, 67 insertions, 22 deletions
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 d5355a421..9eca86976 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 @@ -28,6 +28,7 @@ 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; +import at.gv.egovernment.moa.id.commons.db.dao.config.CPEPS; 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; @@ -48,6 +49,8 @@ public class OASTORKConfig { private boolean vidpEnabled = false; private List<AttributeProviderPlugin> attributeProviderPlugins = new ArrayList<AttributeProviderPlugin>(); private boolean requireConsent = false; + private List<String> citizenCountries; + private List<String> enabledCitizenCountries; public OASTORKConfig() { @@ -72,6 +75,15 @@ public class OASTORKConfig { // if there is no configuration available for the OA, get the default qaa level setQaa(ConfigurationDBRead.getMOAIDConfiguration().getAuthComponentGeneral().getForeignIdentities().getSTORK().getQualityAuthenticationAssuranceLevel()); } + + // fetch available citizen countries + citizenCountries = new ArrayList<String>(); + for(CPEPS current : ConfigurationDBRead.getMOAIDConfiguration().getAuthComponentGeneral().getForeignIdentities().getSTORK().getCPEPS()) { + citizenCountries.add(current.getCountryCode()); + } + enabledCitizenCountries = new ArrayList<String>(); + for(CPEPS current : config.getCPEPS()) + enabledCitizenCountries.add(current.getCountryCode()); // prepare attribute helper list attributes = new ArrayList<AttributeHelper>(); @@ -153,6 +165,27 @@ public class OASTORKConfig { this.attributes = attributes; } + public List<String> getAvailableCitizenCountries() { + return citizenCountries; + } + + public List<String> getEnabledCitizenCountries() { + return enabledCitizenCountries; + } + + public void setEnabledCitizenCountries(List<String> update) { + enabledCitizenCountries = update; + } + + public List<CPEPS> getEnabledCPEPS() { + List<CPEPS> result = new ArrayList<CPEPS>(); + for(CPEPS current : ConfigurationDBRead.getMOAIDConfiguration().getAuthComponentGeneral().getForeignIdentities().getSTORK().getCPEPS()) { + if(enabledCitizenCountries.contains(current.getCountryCode())) + result.add(current); + } + return result; + } + public List<String> getAvailableAttributeProviderPlugins() { return AttributeProviderFactory.getAvailablePlugins(); } diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditOAAction.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditOAAction.java index 78747eca6..0ff60a656 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditOAAction.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditOAAction.java @@ -1043,6 +1043,7 @@ public class EditOAAction extends ActionSupport implements ServletRequestAware, stork.setVidpEnabled(storkOA.isVidpEnabled()); stork.setRequireConsent(storkOA.isRequireConsent()); stork.setAttributeProviders(storkOA.getAttributeProviderPlugins()); + stork.setCPEPS(storkOA.getEnabledCPEPS()); try { if (newentry) { diff --git a/id/ConfigWebTool/src/main/webapp/jsp/editOAGeneral.jsp b/id/ConfigWebTool/src/main/webapp/jsp/editOAGeneral.jsp index d5396d06e..ebdacc7a7 100644 --- a/id/ConfigWebTool/src/main/webapp/jsp/editOAGeneral.jsp +++ b/id/ConfigWebTool/src/main/webapp/jsp/editOAGeneral.jsp @@ -388,6 +388,8 @@ name="storkOA.qaa" key="webpages.moaconfig.stork.qaa" labelposition="left" /> + <h4><%=LanguageHelper.getGUIString("webpages.oaconfig.stork.enabledcpeps", request) %></h4> + <s:checkboxlist name="storkOA.enabledCitizenCountries" list="storkOA.availableCitizenCountries" value="storkOA.enabledCitizenCountries" /> <h4><%=LanguageHelper.getGUIString("webpages.oaconfig.stork.attributes.header", request) %></h4> <table> <tr><th><%=LanguageHelper.getGUIString("webpages.oaconfig.stork.attributes.used", request) %></th> @@ -747,4 +749,4 @@ <jsp:include page="snippets/footer.jsp"></jsp:include> </body> -</html>
\ No newline at end of file +</html> diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/LoginFormBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/LoginFormBuilder.java index ff3b7b170..c244b64e9 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/LoginFormBuilder.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/LoginFormBuilder.java @@ -34,6 +34,8 @@ import java.net.URISyntaxException; import org.apache.commons.io.IOUtils; +import at.gv.egovernment.moa.id.commons.db.ConfigurationDBRead; +import at.gv.egovernment.moa.id.commons.db.dao.config.CPEPS; import at.gv.egovernment.moa.id.config.ConfigurationException; import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; import at.gv.egovernment.moa.id.config.auth.OAAuthParameter; @@ -56,6 +58,7 @@ public class LoginFormBuilder { private static String BKU_LOCAL = "#LOCAL#"; public static String CONTEXTPATH = "#CONTEXTPATH#"; private static String MOASESSIONID = "#SESSIONID#"; + private static String PEPSLIST = "#PEPSLIST#"; private static String SERVLET = CONTEXTPATH+"/GenerateIframeTemplate"; @@ -147,6 +150,15 @@ public class LoginFormBuilder { value = value.replace(CONTEXTPATH, contextpath); value = value.replace(MOASESSIONID, moaSessionID); + if (oaParam.isShowStorkLogin()) { + String pepslist = ""; + for (CPEPS current : oaParam.getPepsList()) + // check if master config has changed... + if(ConfigurationDBRead.getMOAIDConfiguration().getAuthComponentGeneral().getForeignIdentities().getSTORK().getCPEPS().contains(current)) + pepslist += "<option value=" + current.getCountryCode() + ">" + current.getCountryCode() + "</option>\n"; + value = value.replace(PEPSLIST, pepslist); + } + value = FormBuildUtils.customiceLayoutBKUSelection(value, oaParam.isShowMandateCheckBox(), oaParam.isOnlyMandateAllowed(), diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/OAAuthParameter.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/OAAuthParameter.java index d16e85084..492770aad 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/OAAuthParameter.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/OAAuthParameter.java @@ -55,6 +55,7 @@ import at.gv.egovernment.moa.id.commons.db.dao.config.AttributeProviderPlugin; import at.gv.egovernment.moa.id.commons.db.dao.config.AuthComponentOA; import at.gv.egovernment.moa.id.commons.db.dao.config.BKUSelectionCustomizationType; import at.gv.egovernment.moa.id.commons.db.dao.config.BKUURLS; +import at.gv.egovernment.moa.id.commons.db.dao.config.CPEPS; import at.gv.egovernment.moa.id.commons.db.dao.config.IdentificationNumber; import at.gv.egovernment.moa.id.commons.db.dao.config.Mandates; import at.gv.egovernment.moa.id.commons.db.dao.config.MandatesProfileNameItem; @@ -398,9 +399,9 @@ public byte[] getSendAssertionTemplate() { return null; } - - - +public List<CPEPS> getPepsList() { + return new ArrayList<CPEPS>(oa_auth.getOASTORK().getCPEPS()); +} } diff --git a/id/server/idserverlib/src/main/resources/resources/templates/loginFormFull.html b/id/server/idserverlib/src/main/resources/resources/templates/loginFormFull.html index b9d3eafa7..ef070b8eb 100644 --- a/id/server/idserverlib/src/main/resources/resources/templates/loginFormFull.html +++ b/id/server/idserverlib/src/main/resources/resources/templates/loginFormFull.html @@ -815,17 +815,7 @@ <h2 id="tabheader" class="dunkel">Home Country Selection</h2> <p> <select name="cccSelection" id="cccSelection" size="1" style="width: 120px; margin-right: 5px;" > - <option value="BE">België/Belgique</option> - <option value="EE">Eesti</option> - <option value="ES">España</option> - <option value="IS">Ísland</option> - <option value="IT">Italia</option> - <option value="LI">Liechtenstein</option> - <option value="LT">Lithuania</option> - <option value="PT">Portugal</option> - <option value="SI">Slovenija</option> - <option value="FI">Suomi</option> - <option value="SE">Sverige</option> + #PEPSLIST# </select> <button name="bkuButton" type="button" onClick="storkClicked();">Proceed</button> <a href="info_stork.html" target="_blank" class="infobutton" style="color:#FFF">i</a> @@ -853,4 +843,4 @@ </div> </div> </body> -</html>
\ No newline at end of file +</html> diff --git a/id/server/moa-id-commons/src/main/resources/config/moaid_config_2.0.xsd b/id/server/moa-id-commons/src/main/resources/config/moaid_config_2.0.xsd index af827210f..d7f48e51a 100644 --- a/id/server/moa-id-commons/src/main/resources/config/moaid_config_2.0.xsd +++ b/id/server/moa-id-commons/src/main/resources/config/moaid_config_2.0.xsd @@ -884,12 +884,18 @@ <xsd:element name="OA_STORK"> <xsd:complexType> <xsd:sequence> - <xsd:element name="StorkLogonEnabled" type="xsd:boolean" default="true"/> - <xsd:element ref="Qaa" minOccurs="0" maxOccurs="1"/> - <xsd:element ref="OAAttributes" minOccurs="0" maxOccurs="unbounded"/> - <xsd:element name="VidpEnabled" type="xsd:boolean" default="false"/> - <xsd:element ref="AttributeProviders" minOccurs="0" maxOccurs="unbounded"/> - <xsd:element name="requireConsent" type="xsd:boolean" default="true"/> + <xsd:element name="StorkLogonEnabled" type="xsd:boolean" + default="true" /> + <xsd:element ref="Qaa" minOccurs="0" maxOccurs="1" /> + <xsd:element ref="OAAttributes" minOccurs="0" + maxOccurs="unbounded" /> + <xsd:element name="VidpEnabled" type="xsd:boolean" + default="false" /> + <xsd:element ref="AttributeProviders" minOccurs="0" + maxOccurs="unbounded" /> + <xsd:element name="requireConsent" type="xsd:boolean" + default="true" /> + <xsd:element ref="C-PEPS" maxOccurs="unbounded"/> </xsd:sequence> </xsd:complexType> </xsd:element> |