From a60b99e926ccd5c18baa36144922a94835819777 Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Tue, 16 Aug 2016 07:08:26 +0200 Subject: change STORK QAA to eIDAS LoA --- .../task/impl/GeneralSTORKConfigurationTask.java | 15 ++++++++------- .../task/impl/ServicesAuthenticationSTORKTask.java | 22 ++++++---------------- 2 files changed, 14 insertions(+), 23 deletions(-) (limited to 'id/moa-id-webgui/src/main/java/at/gv/egovernment') diff --git a/id/moa-id-webgui/src/main/java/at/gv/egovernment/moa/id/config/webgui/validation/task/impl/GeneralSTORKConfigurationTask.java b/id/moa-id-webgui/src/main/java/at/gv/egovernment/moa/id/config/webgui/validation/task/impl/GeneralSTORKConfigurationTask.java index 8a1a2925b..6d1dafd6c 100644 --- a/id/moa-id-webgui/src/main/java/at/gv/egovernment/moa/id/config/webgui/validation/task/impl/GeneralSTORKConfigurationTask.java +++ b/id/moa-id-webgui/src/main/java/at/gv/egovernment/moa/id/config/webgui/validation/task/impl/GeneralSTORKConfigurationTask.java @@ -37,6 +37,7 @@ import org.slf4j.LoggerFactory; import at.gv.egiz.components.configuration.api.Configuration; import at.gv.egiz.components.configuration.api.ConfigurationException; +import at.gv.egovernment.moa.id.commons.MOAIDConstants; import at.gv.egovernment.moa.id.commons.config.MOAIDConfigurationConstants; import at.gv.egovernment.moa.id.commons.utils.KeyValueUtils; import at.gv.egovernment.moa.id.commons.validation.ValidationHelper; @@ -185,20 +186,20 @@ public static final List KEYWHITELIST; // check qaa try { - int qaa = Integer.valueOf(input.get(KeyValueUtils.removePrefixFromKey(MOAIDConfigurationConstants.GENERAL_AUTH_STORK_QAA, MOAIDConfigurationConstants.PREFIX_MOAID_GENERAL))); - if(1 > qaa && 4 < qaa) { - log.warn("QAA is out of range : " + qaa); + String eIDAS_LOA = input.get(KeyValueUtils.removePrefixFromKey(MOAIDConfigurationConstants.GENERAL_AUTH_STORK_QAA, MOAIDConfigurationConstants.PREFIX_MOAID_GENERAL)); + if (!MOAIDConstants.ALLOWED_eIDAS_LOA.contains(eIDAS_LOA)) { + log.warn("eIDAS LoA is not allowed : " + eIDAS_LOA); errors.add(new ValidationObjectIdentifier( MOAIDConfigurationConstants.GENERAL_AUTH_STORK_QAA, - "STORK - QAA Level", + "eIDAS - LoA Level", LanguageHelper.getErrorString("validation.stork.qaa.outofrange", - new Object[] {qaa}))); + new Object[] {eIDAS_LOA}))); } } catch (Exception e) { - log.warn("STORK QAA can not parsed : " + input.get(MOAIDConfigurationConstants.GENERAL_AUTH_STORK_QAA)); + log.warn("eIDAS LoA can not parsed : " + input.get(MOAIDConfigurationConstants.GENERAL_AUTH_STORK_QAA)); errors.add(new ValidationObjectIdentifier( MOAIDConfigurationConstants.GENERAL_AUTH_STORK_QAA, - "STORK - QAA Level", + "eIDAS - LoA Level", LanguageHelper.getErrorString("validation.stork.qaa.outofrange", new Object[] {input.get(MOAIDConfigurationConstants.GENERAL_AUTH_STORK_QAA)}))); diff --git a/id/moa-id-webgui/src/main/java/at/gv/egovernment/moa/id/config/webgui/validation/task/impl/ServicesAuthenticationSTORKTask.java b/id/moa-id-webgui/src/main/java/at/gv/egovernment/moa/id/config/webgui/validation/task/impl/ServicesAuthenticationSTORKTask.java index 087334c4b..7f5e93ff9 100644 --- a/id/moa-id-webgui/src/main/java/at/gv/egovernment/moa/id/config/webgui/validation/task/impl/ServicesAuthenticationSTORKTask.java +++ b/id/moa-id-webgui/src/main/java/at/gv/egovernment/moa/id/config/webgui/validation/task/impl/ServicesAuthenticationSTORKTask.java @@ -37,6 +37,7 @@ import org.slf4j.LoggerFactory; import at.gv.egiz.components.configuration.api.Configuration; import at.gv.egiz.components.configuration.api.ConfigurationException; +import at.gv.egovernment.moa.id.commons.MOAIDConstants; import at.gv.egovernment.moa.id.commons.config.MOAIDConfigurationConstants; import at.gv.egovernment.moa.id.commons.utils.KeyValueUtils; import at.gv.egovernment.moa.id.config.webgui.exception.ConfigurationTaskValidationException; @@ -253,26 +254,15 @@ public class ServicesAuthenticationSTORKTask extends AbstractTaskValidator imple // check qaa String qaaString = input.get(MOAIDConfigurationConstants.SERVICE_AUTH_STORK_MINQAALEVEL); - if (MiscUtil.isNotEmpty(qaaString)) { - try { - int qaa = Integer.parseInt(qaaString); - if(1 > qaa && 4 < qaa) { - log.warn("QAA is out of range : " + qaa); - errors.add(new ValidationObjectIdentifier( - MOAIDConfigurationConstants.SERVICE_AUTH_STORK_MINQAALEVEL, - "STORK - minimal QAA level", - LanguageHelper.getErrorString("validation.stork.qaa.outofrange", - new Object[] {qaa}))); - } - - } catch (NumberFormatException e) { - log.warn("QAA level is not a number: " + qaaString); + if (MiscUtil.isNotEmpty(qaaString)) { + if (!MOAIDConstants.ALLOWED_eIDAS_LOA.contains(qaaString)) { + log.warn("eIDAS-LoA is not allowed: " + qaaString); errors.add(new ValidationObjectIdentifier( MOAIDConfigurationConstants.SERVICE_AUTH_STORK_MINQAALEVEL, - "STORK - minimal QAA level", + "eIDAS - LoA is not allowed", LanguageHelper.getErrorString("validation.stork.qaa.outofrange", new Object[] {qaaString}))); - } + } } if (!errors.isEmpty()) -- cgit v1.2.3