From 16645606a6e2e6c1b00b2b20ef0373e2c81f7f4a Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Wed, 8 Feb 2017 14:44:26 +0100 Subject: update eIDAS node configuration to allow more then on configuration for the same country code. Country codes can be extended by a suffix like NL and NL-Test. Both generates a Authn. request for NL but there are two entries in citizen country selector and maybe two different service URLs --- .../id/configuration/validation/moaconfig/StorkConfigValidator.java | 2 +- id/ConfigWebTool/src/main/webapp/css/index.css | 5 +++++ id/ConfigWebTool/src/main/webapp/jsp/editMOAConfig.jsp | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) (limited to 'id/ConfigWebTool/src') diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/moaconfig/StorkConfigValidator.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/moaconfig/StorkConfigValidator.java index ed2c2f903..8e8020d75 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/moaconfig/StorkConfigValidator.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/moaconfig/StorkConfigValidator.java @@ -43,7 +43,7 @@ public class StorkConfigValidator { errors.add(LanguageHelper.getErrorString("validation.stork.cpeps.cc", new Object[] {ValidationHelper.getPotentialCSSCharacter(false)}, request )); } - if(!check.toLowerCase().matches("^[a-z][a-z]$")) { + if(!check.toLowerCase().matches("(^[a-z][a-z]$)|(^[a-z][a-z]-[a-z]*)")) { log.warn("CPEPS config countrycode does not comply to ISO 3166-2 : " + check); errors.add(LanguageHelper.getErrorString("validation.stork.cpeps.cc", new Object[] {check}, request )); diff --git a/id/ConfigWebTool/src/main/webapp/css/index.css b/id/ConfigWebTool/src/main/webapp/css/index.css index 80ccf93be..aa83e0c2b 100644 --- a/id/ConfigWebTool/src/main/webapp/css/index.css +++ b/id/ConfigWebTool/src/main/webapp/css/index.css @@ -375,6 +375,11 @@ div .wwgrp br { } +.textfield_PEPS_CC { + width: 70px; + +} + .textfield_middle { width: 100px; diff --git a/id/ConfigWebTool/src/main/webapp/jsp/editMOAConfig.jsp b/id/ConfigWebTool/src/main/webapp/jsp/editMOAConfig.jsp index 6694a4273..6892535a1 100644 --- a/id/ConfigWebTool/src/main/webapp/jsp/editMOAConfig.jsp +++ b/id/ConfigWebTool/src/main/webapp/jsp/editMOAConfig.jsp @@ -296,7 +296,7 @@ - + @@ -307,7 +307,7 @@ - + " onclick='this.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode);'/> -- cgit v1.2.3 From d6f9f64e29d986df48f3c7d8a1bb9df4cb5f7095 Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Wed, 8 Feb 2017 16:57:45 +0100 Subject: add additional validation of eIDAS country target for bPK calculation --- .../id/configuration/validation/oa/OATargetConfigValidation.java | 9 +++++++++ .../src/main/resources/applicationResources_de.properties | 1 + .../src/main/resources/applicationResources_en.properties | 1 + 3 files changed, 11 insertions(+) (limited to 'id/ConfigWebTool/src') diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/oa/OATargetConfigValidation.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/oa/OATargetConfigValidation.java index 650553ab3..9cb3ce700 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/oa/OATargetConfigValidation.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/oa/OATargetConfigValidation.java @@ -74,6 +74,15 @@ public class OATargetConfigValidation { log.info("Not valid CompanyNumber"); errors.add(LanguageHelper.getErrorString("validation.general.identificationnumber.fn.valid", request)); } + + } else if (form.getIdentificationType().equals(Constants.IDENIFICATIONTYPE_EIDAS)) { + String[] test = check.split("\\+"); + if (test.length < 2) { + log.info("Not valid eIDAS Target"); + errors.add(LanguageHelper.getErrorString("validation.general.identificationnumber.eidas.valid", request)); + + } + } } diff --git a/id/ConfigWebTool/src/main/resources/applicationResources_de.properties b/id/ConfigWebTool/src/main/resources/applicationResources_de.properties index fe1dac063..d75403575 100644 --- a/id/ConfigWebTool/src/main/resources/applicationResources_de.properties +++ b/id/ConfigWebTool/src/main/resources/applicationResources_de.properties @@ -480,6 +480,7 @@ validation.general.identificationtype.valid=Der Identifikationstype wird nicht u validation.general.identificationnumber.empty=Im privatwirtschaftlichen Bereich ist eine Identifikationsnummer erforderlich. validation.general.identificationnumber.valid=Die Identifikationsnummer f\u00FCr den privatwirtschaftlichen Bereich enth\u00E4lt nicht erlaubte Zeichen. Folgende Zeichen sind nicht erlaubt\: {0} validation.general.identificationnumber.fn.valid=Die Firmenbuchnummer hat kein g\u00FCltiges Format. +validation.general.identificationnumber.eidas.valid=Der eIDAS-Node Target hat kein g\u00FCltiges Format. (z.B. AT+NL) validation.general.oaidentifier.empty=Es wurde kein eindeutiger Identifier f\u00FCr die Online-Applikation angegeben. validation.general.oaidentifier.valid=Der eindeutige Identifier f\u00FCr die Online-Applikation ist keine g\u00FCltige URL. validation.general.oaidentifier.notunique=Der gew\u00E4hlte eindeutige Identifier ist bereits vorhanden (kollision mit {0}). Eine Eintragung der Online-Applikation ist nicht m\u00F6glich. diff --git a/id/ConfigWebTool/src/main/resources/applicationResources_en.properties b/id/ConfigWebTool/src/main/resources/applicationResources_en.properties index 126bba7c9..708cc605e 100644 --- a/id/ConfigWebTool/src/main/resources/applicationResources_en.properties +++ b/id/ConfigWebTool/src/main/resources/applicationResources_en.properties @@ -478,6 +478,7 @@ validation.general.identificationtype.valid=The identification type is not suppo validation.general.identificationnumber.empty=The identification number is necessary for private sector. validation.general.identificationnumber.valid=The identification number for the private sector contains forbidden characters. The following characters are not allowed\: {0} validation.general.identificationnumber.fn.valid=The identification number has invalid format. +validation.general.identificationnumber.eidas.valid=The eIDAS-node identification number has invalid format. (e.g. AT+NL) validation.general.oaidentifier.empty=There is no unique identifier for the Online-Application provided. validation.general.oaidentifier.valid=The unique identifier for the Online-Application is not valid URL. validation.general.oaidentifier.notunique=The selected unique identifier is already available (collision with {0}). Registration of the Online-Application was not possible. -- cgit v1.2.3 From a90e70cf7beb2fe596185309b0e9c305af08c045 Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Thu, 9 Feb 2017 15:33:11 +0100 Subject: update eIDAS node target validator --- .../id/configuration/validation/oa/OATargetConfigValidation.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'id/ConfigWebTool/src') diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/oa/OATargetConfigValidation.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/oa/OATargetConfigValidation.java index 9cb3ce700..0062beb96 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/oa/OATargetConfigValidation.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/oa/OATargetConfigValidation.java @@ -24,6 +24,8 @@ package at.gv.egovernment.moa.id.configuration.validation.oa; import java.util.ArrayList; import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import javax.servlet.http.HttpServletRequest; @@ -76,8 +78,9 @@ public class OATargetConfigValidation { } } else if (form.getIdentificationType().equals(Constants.IDENIFICATIONTYPE_EIDAS)) { - String[] test = check.split("\\+"); - if (test.length < 2) { + Pattern pattern = Pattern.compile("[A-Z,a-z]{2}\\+[A-Z,a-z]{2}"); + Matcher matcher = pattern.matcher(check); + if (!matcher.matches()) { log.info("Not valid eIDAS Target"); errors.add(LanguageHelper.getErrorString("validation.general.identificationnumber.eidas.valid", request)); -- cgit v1.2.3