diff options
author | Thomas Lenz <tlenz@iaik.tugraz.at> | 2019-12-13 10:13:05 +0100 |
---|---|---|
committer | Thomas Lenz <tlenz@iaik.tugraz.at> | 2019-12-13 10:13:05 +0100 |
commit | 6fc2e600055d4737ce94d8a012eb3764bd7e93c8 (patch) | |
tree | 56aebaaac2c87458ebfd798a2c66f95718e1dd4e /id/moa-id-webgui/src | |
parent | de2e45024694c7eb5e033bc6b1bcb90f5f499b07 (diff) | |
parent | bea0d19650b5fbbb48fcda0f39ef3a93d6cf6f1f (diff) | |
download | moa-id-spss-6fc2e600055d4737ce94d8a012eb3764bd7e93c8.tar.gz moa-id-spss-6fc2e600055d4737ce94d8a012eb3764bd7e93c8.tar.bz2 moa-id-spss-6fc2e600055d4737ce94d8a012eb3764bd7e93c8.zip |
Merge branch 'current_development' into development_preview
# Conflicts:
# id/history.txt
# id/server/modules/moa-id-modul-citizencard_authentication/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java
# pom.xml
Diffstat (limited to 'id/moa-id-webgui/src')
3 files changed, 107 insertions, 42 deletions
diff --git a/id/moa-id-webgui/src/main/java/at/gv/egovernment/moa/id/config/webgui/validation/task/impl/GeneralMOAIDConfigurationTask.java b/id/moa-id-webgui/src/main/java/at/gv/egovernment/moa/id/config/webgui/validation/task/impl/GeneralMOAIDConfigurationTask.java index a28b762af..06e53bf53 100644 --- a/id/moa-id-webgui/src/main/java/at/gv/egovernment/moa/id/config/webgui/validation/task/impl/GeneralMOAIDConfigurationTask.java +++ b/id/moa-id-webgui/src/main/java/at/gv/egovernment/moa/id/config/webgui/validation/task/impl/GeneralMOAIDConfigurationTask.java @@ -78,6 +78,7 @@ public class GeneralMOAIDConfigurationTask extends AbstractTaskValidator impleme temp.add(KeyValueUtils.removePrefixFromKey(MOAIDConfigurationConstants.GENERAL_AUTH_SERVICES_OVS_URL, MOAIDConfigurationConstants.PREFIX_MOAID_GENERAL)); temp.add(KeyValueUtils.removePrefixFromKey(MOAIDConfigurationConstants.GENERAL_AUTH_SERVICES_CENTRAL_EIDASNODE_URL, MOAIDConfigurationConstants.PREFIX_MOAID_GENERAL)); temp.add(KeyValueUtils.removePrefixFromKey(MOAIDConfigurationConstants.GENERAL_AUTH_SERVICES_ELGA_MANDATE_SERVICE_URL, MOAIDConfigurationConstants.PREFIX_MOAID_GENERAL)); + temp.add(KeyValueUtils.removePrefixFromKey(MOAIDConfigurationConstants.GENERAL_AUTH_SERVICES_EID_SYSTEM_SERVICE_URL, MOAIDConfigurationConstants.PREFIX_MOAID_GENERAL)); temp.add(KeyValueUtils.removePrefixFromKey(MOAIDConfigurationConstants.GENERAL_AUTH_SSO_AUTHBLOCK_TEXT, MOAIDConfigurationConstants.PREFIX_MOAID_GENERAL)); temp.add(KeyValueUtils.removePrefixFromKey(MOAIDConfigurationConstants.GENERAL_AUTH_SSO_SERVICENAME, MOAIDConfigurationConstants.PREFIX_MOAID_GENERAL)); temp.add(KeyValueUtils.removePrefixFromKey(MOAIDConfigurationConstants.GENERAL_AUTH_SSO_TARGET, MOAIDConfigurationConstants.PREFIX_MOAID_GENERAL)); @@ -284,14 +285,28 @@ public class GeneralMOAIDConfigurationTask extends AbstractTaskValidator impleme } } } + + check = input.get(KeyValueUtils.removePrefixFromKey(MOAIDConfigurationConstants.GENERAL_AUTH_SERVICES_EID_SYSTEM_SERVICE_URL, getKeyPrefix())); + if (MiscUtil.isNotEmpty(check)) { + String[] misURLs = check.split(","); + for (String el : misURLs) { + if (MiscUtil.isNotEmpty(el) && !ValidationHelper.validateURL(StringUtils.chomp(el.trim()))) { + log.info("Not valid E-ID System Service URL"); + errors.add(new ValidationObjectIdentifier( + MOAIDConfigurationConstants.GENERAL_AUTH_SERVICES_EID_SYSTEM_SERVICE_URL, + "E-ID System", + LanguageHelper.getErrorString("validation.general.eidsystem.valid", new Object[]{el}))); + } + } + } check = input.get(KeyValueUtils.removePrefixFromKey(MOAIDConfigurationConstants.GENERAL_AUTH_MOASP_AUTHBLOCK_TRANSFORM, getKeyPrefix())); if (MiscUtil.isEmpty(check)) { log.info("Empty MoaspssAuthTransformation"); - errors.add(new ValidationObjectIdentifier( - MOAIDConfigurationConstants.GENERAL_AUTH_MOASP_AUTHBLOCK_TRANSFORM, - "MOA-SP - AuthBlocktransformation", - LanguageHelper.getErrorString("validation.general.moasp.auth.transformation.empty"))); +// errors.add(new ValidationObjectIdentifier( +// MOAIDConfigurationConstants.GENERAL_AUTH_MOASP_AUTHBLOCK_TRANSFORM, +// "MOA-SP - AuthBlocktransformation", +// LanguageHelper.getErrorString("validation.general.moasp.auth.transformation.empty"))); } else { if (ValidationHelper.containsNotValidCharacter(check, false)) { log.info("IdentityLinkSigners is not valid: " + check); @@ -307,10 +322,10 @@ public class GeneralMOAIDConfigurationTask extends AbstractTaskValidator impleme check = input.get(KeyValueUtils.removePrefixFromKey(MOAIDConfigurationConstants.GENERAL_AUTH_MOASP_TRUSTPROFILE_AUTHBLOCK_PROD, getKeyPrefix())); if (MiscUtil.isEmpty(check)) { log.info("Empty MOA-SP/SS Authblock TrustProfile"); - errors.add(new ValidationObjectIdentifier( - MOAIDConfigurationConstants.GENERAL_AUTH_MOASP_TRUSTPROFILE_AUTHBLOCK_PROD, - "MOA-SP - TrustProfile AuthBlock", - LanguageHelper.getErrorString("validation.general.moasp.auth.trustprofile.empty"))); +// errors.add(new ValidationObjectIdentifier( +// MOAIDConfigurationConstants.GENERAL_AUTH_MOASP_TRUSTPROFILE_AUTHBLOCK_PROD, +// "MOA-SP - TrustProfile AuthBlock", +// LanguageHelper.getErrorString("validation.general.moasp.auth.trustprofile.empty"))); } else { if (ValidationHelper.containsNotValidCharacter(check, false)) { log.info("Authblock TrustProfile is not valid: " +check); @@ -325,10 +340,10 @@ public class GeneralMOAIDConfigurationTask extends AbstractTaskValidator impleme check = input.get(KeyValueUtils.removePrefixFromKey(MOAIDConfigurationConstants.GENERAL_AUTH_MOASP_TRUSTPROFILE_IDL_PROD, getKeyPrefix())); if (MiscUtil.isEmpty(check)) { log.info("Empty MOA-SP/SS IdentityLink TrustProfile"); - errors.add(new ValidationObjectIdentifier( - MOAIDConfigurationConstants.GENERAL_AUTH_MOASP_TRUSTPROFILE_IDL_PROD, - "MOA-SP - TrustProfile IdL", - LanguageHelper.getErrorString("validation.general.moasp.idl.trustprofile.empty"))); +// errors.add(new ValidationObjectIdentifier( +// MOAIDConfigurationConstants.GENERAL_AUTH_MOASP_TRUSTPROFILE_IDL_PROD, +// "MOA-SP - TrustProfile IdL", +// LanguageHelper.getErrorString("validation.general.moasp.idl.trustprofile.empty"))); } else { if (ValidationHelper.containsNotValidCharacter(check, false)) { log.info("IdentityLink TrustProfile is not valid: " +check); @@ -343,10 +358,10 @@ public class GeneralMOAIDConfigurationTask extends AbstractTaskValidator impleme check = input.get(KeyValueUtils.removePrefixFromKey(MOAIDConfigurationConstants.GENERAL_AUTH_MOASP_TRUSTPROFILE_AUTHBLOCK_TEST, getKeyPrefix())); if (MiscUtil.isEmpty(check)) { log.info("Empty MOA-SP/SS Test-Authblock TrustProfile"); - errors.add(new ValidationObjectIdentifier( - MOAIDConfigurationConstants.GENERAL_AUTH_MOASP_TRUSTPROFILE_AUTHBLOCK_PROD, - "MOA-SP - Test-TrustProfile AuthBlock", - LanguageHelper.getErrorString("validation.general.moasp.auth.trustprofile.test.empty"))); +// errors.add(new ValidationObjectIdentifier( +// MOAIDConfigurationConstants.GENERAL_AUTH_MOASP_TRUSTPROFILE_AUTHBLOCK_PROD, +// "MOA-SP - Test-TrustProfile AuthBlock", +// LanguageHelper.getErrorString("validation.general.moasp.auth.trustprofile.test.empty"))); } else { if (ValidationHelper.containsNotValidCharacter(check, false)) { log.info("Authblock Test-TrustProfile is not valid: " +check); @@ -361,10 +376,10 @@ public class GeneralMOAIDConfigurationTask extends AbstractTaskValidator impleme check = input.get(KeyValueUtils.removePrefixFromKey(MOAIDConfigurationConstants.GENERAL_AUTH_MOASP_TRUSTPROFILE_IDL_TEST, getKeyPrefix())); if (MiscUtil.isEmpty(check)) { log.info("Empty MOA-SP/SS Test-IdentityLink TrustProfile"); - errors.add(new ValidationObjectIdentifier( - MOAIDConfigurationConstants.GENERAL_AUTH_MOASP_TRUSTPROFILE_IDL_PROD, - "MOA-SP - Test-TrustProfile IdL", - LanguageHelper.getErrorString("validation.general.moasp.idl.trustprofile.test.empty"))); +// errors.add(new ValidationObjectIdentifier( +// MOAIDConfigurationConstants.GENERAL_AUTH_MOASP_TRUSTPROFILE_IDL_PROD, +// "MOA-SP - Test-TrustProfile IdL", +// LanguageHelper.getErrorString("validation.general.moasp.idl.trustprofile.test.empty"))); } else { if (ValidationHelper.containsNotValidCharacter(check, false)) { log.info("IdentityLink Test-TrustProfile is not valid: " +check); @@ -380,10 +395,10 @@ public class GeneralMOAIDConfigurationTask extends AbstractTaskValidator impleme check = input.get(KeyValueUtils.removePrefixFromKey(MOAIDConfigurationConstants.GENERAL_DEFAULTS_TEMPLATES_HANDY, getKeyPrefix())); if (MiscUtil.isEmpty(check)) { log.info("Empty SLRequestTemplate Handy-BKU"); - errors.add(new ValidationObjectIdentifier( - MOAIDConfigurationConstants.GENERAL_DEFAULTS_TEMPLATES_HANDY, - "Default SL-Templates - Handy", - LanguageHelper.getErrorString("validation.general.slrequest.handy.empty"))); +// errors.add(new ValidationObjectIdentifier( +// MOAIDConfigurationConstants.GENERAL_DEFAULTS_TEMPLATES_HANDY, +// "Default SL-Templates - Handy", +// LanguageHelper.getErrorString("validation.general.slrequest.handy.empty"))); } else { if (ValidationHelper.isNotValidIdentityLinkSigner(check)) { log.info("SLRequestTemplate Handy-BKU is not valid"); @@ -397,10 +412,10 @@ public class GeneralMOAIDConfigurationTask extends AbstractTaskValidator impleme check = input.get(KeyValueUtils.removePrefixFromKey(MOAIDConfigurationConstants.GENERAL_DEFAULTS_TEMPLATES_LOCAL, getKeyPrefix())); if (MiscUtil.isEmpty(check)) { log.info("Empty SLRequestTemplate local BKU"); - errors.add(new ValidationObjectIdentifier( - MOAIDConfigurationConstants.GENERAL_DEFAULTS_TEMPLATES_LOCAL, - "Default SL-Templates - Local", - LanguageHelper.getErrorString("validation.general.slrequest.local.empty"))); +// errors.add(new ValidationObjectIdentifier( +// MOAIDConfigurationConstants.GENERAL_DEFAULTS_TEMPLATES_LOCAL, +// "Default SL-Templates - Local", +// LanguageHelper.getErrorString("validation.general.slrequest.local.empty"))); } else { if (ValidationHelper.isNotValidIdentityLinkSigner(check)) { log.info("SLRequestTemplate local BKU is not valid"); @@ -414,10 +429,10 @@ public class GeneralMOAIDConfigurationTask extends AbstractTaskValidator impleme check = input.get(KeyValueUtils.removePrefixFromKey(MOAIDConfigurationConstants.GENERAL_DEFAULTS_TEMPLATES_THIRD, getKeyPrefix())); if (MiscUtil.isEmpty(check)) { log.info("Empty SLRequestTemplate Online-BKU"); - errors.add(new ValidationObjectIdentifier( - MOAIDConfigurationConstants.GENERAL_DEFAULTS_TEMPLATES_THIRD, - "Default SL-Templates - Online ", - LanguageHelper.getErrorString("validation.general.slrequest.online.empty"))); +// errors.add(new ValidationObjectIdentifier( +// MOAIDConfigurationConstants.GENERAL_DEFAULTS_TEMPLATES_THIRD, +// "Default SL-Templates - Online ", +// LanguageHelper.getErrorString("validation.general.slrequest.online.empty"))); } else { if (ValidationHelper.isNotValidIdentityLinkSigner(check)) { log.info("SLRequestTemplate Online-BKU is not valid"); @@ -531,10 +546,10 @@ public class GeneralMOAIDConfigurationTask extends AbstractTaskValidator impleme check = input.get(KeyValueUtils.removePrefixFromKey(MOAIDConfigurationConstants.GENERAL_AUTH_AUTHBLOCK_TRANSFORMATION_BASE64, getKeyPrefix())); if (MiscUtil.isEmpty(check) || check.equals(MOAIDConfigurationConstants.WEBGUI_EMPTY_ELEMENT)) { log.info("AuthBlock Transformation file is empty"); - errors.add(new ValidationObjectIdentifier( - MOAIDConfigurationConstants.GENERAL_AUTH_AUTHBLOCK_TRANSFORMATION_BASE64, - "AuthBlock - Transformation", - LanguageHelper.getErrorString("validation.general.slrequest.file.empty"))); +// errors.add(new ValidationObjectIdentifier( +// MOAIDConfigurationConstants.GENERAL_AUTH_AUTHBLOCK_TRANSFORMATION_BASE64, +// "AuthBlock - Transformation", +// LanguageHelper.getErrorString("validation.general.slrequest.file.empty"))); } @@ -711,7 +726,7 @@ public class GeneralMOAIDConfigurationTask extends AbstractTaskValidator impleme //normalize CSV of SZR-GW service URLs String szrgwServiceURLs = input.get(KeyValueUtils.removePrefixFromKey(MOAIDConfigurationConstants.GENERAL_AUTH_SERVICES_ELGA_MANDATE_SERVICE_URL, getKeyPrefix())); - List<String> currentSzrgwServiceURLs = KeyValueUtils.getListOfCSVValues(dbconfig.getStringValue(MOAIDConfigurationConstants.GENERAL_AUTH_SERVICES_CENTRAL_EIDASNODE_URL)); + List<String> currentSzrgwServiceURLs = KeyValueUtils.getListOfCSVValues(dbconfig.getStringValue(MOAIDConfigurationConstants.GENERAL_AUTH_SERVICES_ELGA_MANDATE_SERVICE_URL)); if (MiscUtil.isNotEmpty(szrgwServiceURLs)) { String normalizedSzrgwServiceURLs = KeyValueUtils.normalizeCSVValueString(szrgwServiceURLs); if (!normalizedSzrgwServiceURLs .equals(szrgwServiceURLs)) { @@ -740,6 +755,45 @@ public class GeneralMOAIDConfigurationTask extends AbstractTaskValidator impleme keysToDelete.add(service); } } + + + //normalize CSV of SZR-GW service URLs + String eidServiceURLs = input.get(KeyValueUtils.removePrefixFromKey(MOAIDConfigurationConstants.GENERAL_AUTH_SERVICES_EID_SYSTEM_SERVICE_URL, getKeyPrefix())); + List<String> currenteidServiceURLs = KeyValueUtils.getListOfCSVValues(dbconfig.getStringValue(MOAIDConfigurationConstants.GENERAL_AUTH_SERVICES_EID_SYSTEM_SERVICE_URL)); + if (MiscUtil.isNotEmpty(eidServiceURLs)) { + String normalizedeidServiceURLs = KeyValueUtils.normalizeCSVValueString(eidServiceURLs); + if (!normalizedeidServiceURLs.equals(eidServiceURLs)) { + newConfigValues.put(MOAIDConfigurationConstants.GENERAL_AUTH_SERVICES_EID_SYSTEM_SERVICE_URL, normalizedeidServiceURLs); + log.debug("Change key: " + MOAIDConfigurationConstants.GENERAL_AUTH_SERVICES_EID_SYSTEM_SERVICE_URL + + " from value: " + input.get(MOAIDConfigurationConstants.GENERAL_AUTH_SERVICES_EID_SYSTEM_SERVICE_URL) + + " to value: " + normalizedeidServiceURLs); + } + + //check if service URLs are removed + for (String el : KeyValueUtils.getListOfCSVValues(eidServiceURLs)) { + if (currenteidServiceURLs.contains(el)) + currenteidServiceURLs.remove(el); + } + + } else if (!currenteidServiceURLs.isEmpty() && MiscUtil.isEmpty(eidServiceURLs)) { + keysToDelete.add(MOAIDConfigurationConstants.GENERAL_AUTH_SERVICES_EID_SYSTEM_SERVICE_URL); + + } + + //update OA configuration + if (!currenteidServiceURLs.isEmpty()) { + String[] servicesOAs = dbconfig.findConfigurationId( + MOAIDConfigurationConstants.PREFIX_MOAID_SERVICES_OA + + ".%." + + MOAIDConfigurationConstants.SERVICE_EXTERNAL_EID_SYSTEM_SERVICE_URL); + for (String service : servicesOAs) { + String spElgaService = dbconfig.getStringValue(service); + if (MiscUtil.isNotEmpty(spElgaService) && + currentSzrgwServiceURLs.contains(spElgaService)) + keysToDelete.add(service); + } + } + } catch (ConfigurationException e) { log.error("Configuration is not accessable!", e); 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 4567afcba..8556348ba 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 @@ -187,7 +187,7 @@ public static final List<String> KEYWHITELIST; // check qaa try { String eIDAS_LOA = input.get(KeyValueUtils.removePrefixFromKey(MOAIDConfigurationConstants.GENERAL_AUTH_STORK_QAA, MOAIDConfigurationConstants.PREFIX_MOAID_GENERAL)); - if (!MOAIDConstants.ALLOWED_eIDAS_LOA.contains(eIDAS_LOA)) { + if (eIDAS_LOA != null && !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, 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 98aa4cd66..0d2fb0690 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 @@ -158,10 +158,10 @@ public class ServicesAuthenticationInformationTask extends AbstractTaskValidator check = input.get(MOAIDConfigurationConstants.SERVICE_AUTH_BKU_KEYBOXIDENTIFIER); if (MiscUtil.isEmpty(check)) { log.info("Empty KeyBoxIdentifier"); - errors.add(new ValidationObjectIdentifier( - MOAIDConfigurationConstants.SERVICE_AUTH_BKU_THIRD, - "BKU - KeyBoxIdentifier", - LanguageHelper.getErrorString("validation.general.keyboxidentifier.empty"))); +// errors.add(new ValidationObjectIdentifier( +// MOAIDConfigurationConstants.SERVICE_AUTH_BKU_THIRD, +// "BKU - KeyBoxIdentifier", +// LanguageHelper.getErrorString("validation.general.keyboxidentifier.empty"))); } else { if (!MOAIDConfigurationConstants.ALLOWED_KEYBOXIDENTIFIER.contains(check)) { @@ -269,6 +269,17 @@ public class ServicesAuthenticationInformationTask extends AbstractTaskValidator LanguageHelper.getErrorString("validation.general.elga.mandateservice.valid", new Object[]{check}))); } + + check = input.get(MOAIDConfigurationConstants.SERVICE_EXTERNAL_EID_SYSTEM_SERVICE_URL); + if (MiscUtil.isNotEmpty(check) && + !ValidationHelper.validateURL(check)) { + log.info("Not valid ELGA Service URL"); + errors.add(new ValidationObjectIdentifier( + MOAIDConfigurationConstants.SERVICE_EXTERNAL_EID_SYSTEM_SERVICE_URL, + "E-ID System", + LanguageHelper.getErrorString("validation.general.eidsystem.valid", new Object[]{check}))); + } + check = input.get(MOAIDConfigurationConstants.SERVICE_EXTERNAL_CENTRAL_EIDASNODE_SERVICE_URL); if (MiscUtil.isNotEmpty(check) && !ValidationHelper.validateURL(check)) { |