From 5eb2500909f82759d114f910ca37393e3f8639ba Mon Sep 17 00:00:00 2001 From: Florian Reimair Date: Tue, 25 Mar 2014 15:34:05 +0100 Subject: list available CPEPS countries in OA config --- .../moa/id/configuration/data/oa/OASTORKConfig.java | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'id/ConfigWebTool/src/main/java/at') 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..c9d4fc2ee 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,7 @@ public class OASTORKConfig { private boolean vidpEnabled = false; private List attributeProviderPlugins = new ArrayList(); private boolean requireConsent = false; + private List citizenCountries; public OASTORKConfig() { @@ -72,6 +74,11 @@ 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(ConfigurationDBRead.getMOAIDConfiguration().getAuthComponentGeneral().getForeignIdentities().getSTORK().getCPEPS()); + + // prepare attribute helper list attributes = new ArrayList(); @@ -153,6 +160,10 @@ public class OASTORKConfig { this.attributes = attributes; } + public List getAvailableCitizenCountries() { + return citizenCountries; + } + public List getAvailableAttributeProviderPlugins() { return AttributeProviderFactory.getAvailablePlugins(); } -- cgit v1.2.3 From 489f9404bf0f37692946e992614c5515d1af935d Mon Sep 17 00:00:00 2001 From: Florian Reimair Date: Tue, 25 Mar 2014 16:27:19 +0100 Subject: selection gets reported to config --- .../id/configuration/data/oa/OASTORKConfig.java | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'id/ConfigWebTool/src/main/java/at') 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 c9d4fc2ee..12d7faac6 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 @@ -49,7 +49,8 @@ public class OASTORKConfig { private boolean vidpEnabled = false; private List attributeProviderPlugins = new ArrayList(); private boolean requireConsent = false; - private List citizenCountries; + private List citizenCountries; + private List enabledCitizenCountries; public OASTORKConfig() { @@ -76,9 +77,12 @@ public class OASTORKConfig { } // fetch available citizen countries - citizenCountries = new ArrayList(ConfigurationDBRead.getMOAIDConfiguration().getAuthComponentGeneral().getForeignIdentities().getSTORK().getCPEPS()); - - +// citizenCountries = new ArrayList(ConfigurationDBRead.getMOAIDConfiguration().getAuthComponentGeneral().getForeignIdentities().getSTORK().getCPEPS()); + citizenCountries = new ArrayList(); + for(CPEPS current : ConfigurationDBRead.getMOAIDConfiguration().getAuthComponentGeneral().getForeignIdentities().getSTORK().getCPEPS()) { + citizenCountries.add(current.getCountryCode()); + } + enabledCitizenCountries = new ArrayList(citizenCountries.subList(2, 4)); // prepare attribute helper list attributes = new ArrayList(); @@ -160,10 +164,18 @@ public class OASTORKConfig { this.attributes = attributes; } - public List getAvailableCitizenCountries() { + public List getAvailableCitizenCountries() { return citizenCountries; } + public List getEnabledCitizenCountries() { + return enabledCitizenCountries; + } + + public void setEnabledCitizenCountries(List update) { + enabledCitizenCountries = update; + } + public List getAvailableAttributeProviderPlugins() { return AttributeProviderFactory.getAvailablePlugins(); } -- cgit v1.2.3 From 0925ae4c43b9eddfa6815c57b4e041d48600efea Mon Sep 17 00:00:00 2001 From: Florian Reimair Date: Tue, 25 Mar 2014 16:39:46 +0100 Subject: persist cpeps per oa config --- .../egovernment/moa/id/configuration/data/oa/OASTORKConfig.java | 9 +++++++++ .../moa/id/configuration/struts/action/EditOAAction.java | 1 + 2 files changed, 10 insertions(+) (limited to 'id/ConfigWebTool/src/main/java/at') 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 12d7faac6..482c7a13b 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 @@ -176,6 +176,15 @@ public class OASTORKConfig { enabledCitizenCountries = update; } + public List getEnabledCPEPS() { + List result = new ArrayList(); + for(CPEPS current : ConfigurationDBRead.getMOAIDConfiguration().getAuthComponentGeneral().getForeignIdentities().getSTORK().getCPEPS()) { + if(enabledCitizenCountries.contains(current.getCountryCode())) + result.add(current); + } + return result; + } + public List 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) { -- cgit v1.2.3 From 8e6117d85cb13bacdbf11c74340bc529155fdf53 Mon Sep 17 00:00:00 2001 From: Florian Reimair Date: Tue, 25 Mar 2014 16:40:07 +0100 Subject: read cpeps per oa config from database --- .../gv/egovernment/moa/id/configuration/data/oa/OASTORKConfig.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'id/ConfigWebTool/src/main/java/at') 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 482c7a13b..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 @@ -77,12 +77,13 @@ public class OASTORKConfig { } // fetch available citizen countries -// citizenCountries = new ArrayList(ConfigurationDBRead.getMOAIDConfiguration().getAuthComponentGeneral().getForeignIdentities().getSTORK().getCPEPS()); citizenCountries = new ArrayList(); for(CPEPS current : ConfigurationDBRead.getMOAIDConfiguration().getAuthComponentGeneral().getForeignIdentities().getSTORK().getCPEPS()) { citizenCountries.add(current.getCountryCode()); } - enabledCitizenCountries = new ArrayList(citizenCountries.subList(2, 4)); + enabledCitizenCountries = new ArrayList(); + for(CPEPS current : config.getCPEPS()) + enabledCitizenCountries.add(current.getCountryCode()); // prepare attribute helper list attributes = new ArrayList(); -- cgit v1.2.3