aboutsummaryrefslogtreecommitdiff
path: root/id/moa-id-webgui
diff options
context:
space:
mode:
Diffstat (limited to 'id/moa-id-webgui')
-rw-r--r--id/moa-id-webgui/pom.xml4
-rw-r--r--id/moa-id-webgui/src/main/java/at/gv/egovernment/moa/id/config/webgui/validation/task/impl/GeneralMOAIDConfigurationTask.java128
-rw-r--r--id/moa-id-webgui/src/main/java/at/gv/egovernment/moa/id/config/webgui/validation/task/impl/GeneralSTORKConfigurationTask.java2
-rw-r--r--id/moa-id-webgui/src/main/java/at/gv/egovernment/moa/id/config/webgui/validation/task/impl/ServicesAuthenticationInformationTask.java19
4 files changed, 109 insertions, 44 deletions
diff --git a/id/moa-id-webgui/pom.xml b/id/moa-id-webgui/pom.xml
index a3b3675ef..dc592c5d9 100644
--- a/id/moa-id-webgui/pom.xml
+++ b/id/moa-id-webgui/pom.xml
@@ -3,7 +3,7 @@
<parent>
<groupId>MOA</groupId>
<artifactId>id</artifactId>
- <version>3.x</version>
+ <version>4.1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -20,7 +20,7 @@
<repository>
<id>shibboleth.internet2.edu</id>
<name>Internet2</name>
- <url>https://build.shibboleth.net/nexus/content/groups/public/</url>
+ <url>https://apps.egiz.gv.at/shibboleth_nexus/</url>
</repository>
</repositories>
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)) {