diff options
Diffstat (limited to 'id/moa-id-webgui/src/main/java/at')
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 |