diff options
author | Thomas Lenz <tlenz@iaik.tugraz.at> | 2016-05-30 13:11:16 +0200 |
---|---|---|
committer | Thomas Lenz <tlenz@iaik.tugraz.at> | 2016-05-30 13:11:16 +0200 |
commit | 26363c01da4887fe3252941e12afc32dbf1f9854 (patch) | |
tree | 554ab74ca38899a49b35372f137bc7f495c6f79f /id/moa-id-webgui | |
parent | a387d8d75d7f0e1c8032765cf7428728b8e0d70e (diff) | |
download | moa-id-spss-26363c01da4887fe3252941e12afc32dbf1f9854.tar.gz moa-id-spss-26363c01da4887fe3252941e12afc32dbf1f9854.tar.bz2 moa-id-spss-26363c01da4887fe3252941e12afc32dbf1f9854.zip |
fix problem with MOA-ID-configuration GUI and SecurityLayer Templates in legacy mode
Diffstat (limited to 'id/moa-id-webgui')
2 files changed, 41 insertions, 4 deletions
diff --git a/id/moa-id-webgui/src/main/java/at/gv/egovernment/moa/id/config/webgui/validation/MOAIDConfigurationValidator.java b/id/moa-id-webgui/src/main/java/at/gv/egovernment/moa/id/config/webgui/validation/MOAIDConfigurationValidator.java index 42ef0e1e6..2bb33a9d7 100644 --- a/id/moa-id-webgui/src/main/java/at/gv/egovernment/moa/id/config/webgui/validation/MOAIDConfigurationValidator.java +++ b/id/moa-id-webgui/src/main/java/at/gv/egovernment/moa/id/config/webgui/validation/MOAIDConfigurationValidator.java @@ -22,19 +22,19 @@ */ package at.gv.egovernment.moa.id.config.webgui.validation; +import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; -import java.util.ServiceLoader; import java.util.Map.Entry; +import java.util.ServiceLoader; import java.util.Set; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; -import at.gv.egiz.components.configuration.api.Configuration; import at.gv.egovernment.moa.id.commons.config.MOAIDConfigurationConstants; import at.gv.egovernment.moa.id.commons.config.persistence.MOAIDConfiguration; import at.gv.egovernment.moa.id.commons.utils.KeyValueUtils; @@ -243,10 +243,11 @@ public class MOAIDConfigurationValidator { groupEl.getKey(), MOAIDConfigurationConstants.PREFIX_MOAID)); - //add or update key/value pairs from users with module or task specific information + //add or update key/value pairs from users with module or task specific information + List<String> taskDelete = new ArrayList<String>(); Map<String, String> toBeAdded = module.postProcessing( KeyValueUtils.removePrefixFromKeys(groupEl.getValue(), groupEl.getKey()), - deleted, + taskDelete, dbconfig); if (toBeAdded != null) { toBeAdded = KeyValueUtils.makeKeysAbsolut(toBeAdded, groupEl.getKey(), MOAIDConfigurationConstants.PREFIX_MOAID); @@ -261,6 +262,23 @@ public class MOAIDConfigurationValidator { } } + //make delete elements absolute + if (!taskDelete.isEmpty()) { + Iterator<String> delInterator = taskDelete.iterator(); + while (delInterator.hasNext()) { + String delKey = delInterator.next(); + if (!delKey.startsWith(MOAIDConfigurationConstants.PREFIX_MOAID)) { + deleted.add(groupEl.getKey() + KeyValueUtils.KEY_DELIMITER + delKey ); + + } else { + deleted.add(delKey); + + } + + } + + } + } private void keyValueClassification(Iterator<Entry<String, String>> config, Map<String, Map<String,String>> result) { diff --git a/id/moa-id-webgui/src/main/java/at/gv/egovernment/moa/id/config/webgui/validation/task/impl/ServicesAuthenticationInformationTask.java b/id/moa-id-webgui/src/main/java/at/gv/egovernment/moa/id/config/webgui/validation/task/impl/ServicesAuthenticationInformationTask.java index 8e8feefe0..1819c5c2b 100644 --- a/id/moa-id-webgui/src/main/java/at/gv/egovernment/moa/id/config/webgui/validation/task/impl/ServicesAuthenticationInformationTask.java +++ b/id/moa-id-webgui/src/main/java/at/gv/egovernment/moa/id/config/webgui/validation/task/impl/ServicesAuthenticationInformationTask.java @@ -89,6 +89,25 @@ public class ServicesAuthenticationInformationTask extends AbstractTaskValidator } + String isLegacyModeActive = input.get(MOAIDConfigurationConstants.SERVICE_AUTH_BKU_TEMPLATE_LEGACY); + if (MiscUtil.isNotEmpty(isLegacyModeActive) && Boolean.parseBoolean(isLegacyModeActive)) { + if (!input.containsKey(MOAIDConfigurationConstants.SERVICE_AUTH_BKU_TEMPLATE_FIRST_VALUE)) + keysToDelete.add(MOAIDConfigurationConstants.SERVICE_AUTH_BKU_TEMPLATE_FIRST_VALUE); + + if (!input.containsKey(MOAIDConfigurationConstants.SERVICE_AUTH_BKU_TEMPLATE_SECOND_VALUE)) + keysToDelete.add(MOAIDConfigurationConstants.SERVICE_AUTH_BKU_TEMPLATE_SECOND_VALUE); + + if (!input.containsKey(MOAIDConfigurationConstants.SERVICE_AUTH_BKU_TEMPLATE_THIRD_VALUE)) + keysToDelete.add(MOAIDConfigurationConstants.SERVICE_AUTH_BKU_TEMPLATE_THIRD_VALUE); + + } else { + keysToDelete.add(MOAIDConfigurationConstants.SERVICE_AUTH_BKU_TEMPLATE_FIRST_VALUE); + keysToDelete.add(MOAIDConfigurationConstants.SERVICE_AUTH_BKU_TEMPLATE_SECOND_VALUE); + keysToDelete.add(MOAIDConfigurationConstants.SERVICE_AUTH_BKU_TEMPLATE_THIRD_VALUE); + + } + + if (newConfigValues.isEmpty()) return null; else |