diff options
author | Alexander Marsalek <amarsalek@iaik.tugraz.at> | 2020-12-16 10:47:09 +0100 |
---|---|---|
committer | Alexander Marsalek <amarsalek@iaik.tugraz.at> | 2021-01-04 14:16:19 +0100 |
commit | cbbd53e6b88682045e5b8789c46a94035be30827 (patch) | |
tree | dfcd3951f31fe94e55b83a2f26e0bdabbfa50d7f | |
parent | 3b34f664d0838ff9fb1764fb58813dd6ea83b1df (diff) | |
download | National_eIDAS_Gateway-cbbd53e6b88682045e5b8789c46a94035be30827.tar.gz National_eIDAS_Gateway-cbbd53e6b88682045e5b8789c46a94035be30827.tar.bz2 National_eIDAS_Gateway-cbbd53e6b88682045e5b8789c46a94035be30827.zip |
added country specific search classes
6 files changed, 77 insertions, 18 deletions
diff --git a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/dao/CountrySpecificDetailSearchResult.java b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/dao/CountrySpecificDetailSearchResult.java index b74172f9..6e1f8653 100644 --- a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/dao/CountrySpecificDetailSearchResult.java +++ b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/dao/CountrySpecificDetailSearchResult.java @@ -6,7 +6,7 @@ import java.util.ArrayList; public class CountrySpecificDetailSearchResult { - //TODO is the result the same as the one form the initial search? + //TODO is the result the same as the one from the initial search? ArrayList<RegisterResult> resultsZmr = new ArrayList<>(); ArrayList<RegisterResult> resultsErnb = new ArrayList<>(); diff --git a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/handler/DeSpecificDetailSearchProcessor.java b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/handler/DeSpecificDetailSearchProcessor.java new file mode 100644 index 00000000..727aa718 --- /dev/null +++ b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/handler/DeSpecificDetailSearchProcessor.java @@ -0,0 +1,32 @@ +package at.asitplus.eidas.specific.modules.auth.eidas.v2.handler; + +import at.asitplus.eidas.specific.modules.auth.eidas.v2.dao.CountrySpecificDetailSearchResult; +import at.asitplus.eidas.specific.modules.auth.eidas.v2.dao.SimpleEidasData; + +public class DeSpecificDetailSearchProcessor implements ICountrySpecificDetailSearchProcessor { + + @Override + public String getName() { + return this.getClass().getName(); + } + + @Override + public boolean canHandle(String countryCode, SimpleEidasData eidData) { + if (!countryCode.equalsIgnoreCase("de")) { + return false; + } + if (eidData.getBirthName() == null || eidData.getBirthName().isEmpty()) { + return false; + } + if (eidData.getPlaceOfBirth() == null || eidData.getPlaceOfBirth().isEmpty()) { + return false; + } + return true; + } + + @Override + public CountrySpecificDetailSearchResult search(SimpleEidasData eidData) { + //TODO + return new CountrySpecificDetailSearchResult(); + } +} diff --git a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/handler/ICountrySpecificDetailSearchProcessor.java b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/handler/ICountrySpecificDetailSearchProcessor.java index 13d9117d..8ddd79bb 100644 --- a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/handler/ICountrySpecificDetailSearchProcessor.java +++ b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/handler/ICountrySpecificDetailSearchProcessor.java @@ -36,16 +36,6 @@ public interface ICountrySpecificDetailSearchProcessor { String getName(); /** - * Get the priority of this eID Post-Processor <br> - * If more than one Post-Processor implementations can handle the eID data, the - * post-processor with the highest priority are selected. The Default-Processor - * has priority '0' - * - * @return Priority of this handler - */ - int getPriority(); - - /** * Check if this postProcessor is sensitive for a specific country. * * @param countryCode of the eID data that should be processed @@ -55,4 +45,5 @@ public interface ICountrySpecificDetailSearchProcessor { boolean canHandle(String countryCode, SimpleEidasData eidData); CountrySpecificDetailSearchResult search(SimpleEidasData eidData); + } diff --git a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/handler/ItSpecificDetailSearchProcessor.java b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/handler/ItSpecificDetailSearchProcessor.java new file mode 100644 index 00000000..bb0a5262 --- /dev/null +++ b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/handler/ItSpecificDetailSearchProcessor.java @@ -0,0 +1,29 @@ +package at.asitplus.eidas.specific.modules.auth.eidas.v2.handler; + +import at.asitplus.eidas.specific.modules.auth.eidas.v2.dao.CountrySpecificDetailSearchResult; +import at.asitplus.eidas.specific.modules.auth.eidas.v2.dao.SimpleEidasData; + +public class ItSpecificDetailSearchProcessor implements ICountrySpecificDetailSearchProcessor { + + @Override + public String getName() { + return this.getClass().getName(); + } + + @Override + public boolean canHandle(String countryCode, SimpleEidasData eidData) { + if (!countryCode.equalsIgnoreCase("it")) { + return false; + } + if (eidData.getTaxNumber() == null || eidData.getTaxNumber().isEmpty()) { + return false; + } + return true; + } + + @Override + public CountrySpecificDetailSearchResult search(SimpleEidasData eidData) { + //TODO + return new CountrySpecificDetailSearchResult(); + } +} diff --git a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/InitialSearchTask.java b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/InitialSearchTask.java index ec56a6dd..91edbaef 100644 --- a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/InitialSearchTask.java +++ b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/InitialSearchTask.java @@ -58,7 +58,6 @@ import javax.annotation.PostConstruct; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.util.ArrayList; -import java.util.Collections; import java.util.HashMap; import java.util.Iterator; import java.util.List; @@ -108,12 +107,12 @@ public class InitialSearchTask extends AbstractAuthServletTask { } - log.trace("Sorting country specific detail search services on priority ... "); - Collections.sort(handlers, (thisAuthModule, otherAuthModule) -> { - final int thisOrder = thisAuthModule.getPriority(); - final int otherOrder = otherAuthModule.getPriority(); - return thisOrder < otherOrder ? 1 : thisOrder == otherOrder ? 0 : -1; - }); + // log.trace("Sorting country specific detail search services on priority ... "); + // Collections.sort(handlers, (thisAuthModule, otherAuthModule) -> { + // final int thisOrder = thisAuthModule.getPriority(); + // final int otherOrder = otherAuthModule.getPriority(); + // return thisOrder < otherOrder ? 1 : thisOrder == otherOrder ? 0 : -1; + // }); log.info("# " + handlers.size() + " country specific detail search services are registrated"); diff --git a/eidas_modules/authmodule-eIDAS-v2/src/main/resources/eidas_v2_auth.beans.xml b/eidas_modules/authmodule-eIDAS-v2/src/main/resources/eidas_v2_auth.beans.xml index 0f6277c0..ca6eba20 100644 --- a/eidas_modules/authmodule-eIDAS-v2/src/main/resources/eidas_v2_auth.beans.xml +++ b/eidas_modules/authmodule-eIDAS-v2/src/main/resources/eidas_v2_auth.beans.xml @@ -80,6 +80,14 @@ <property name="priority" value="0" /> </bean> + <bean id="DE-Specific-Search" + class="at.asitplus.eidas.specific.modules.auth.eidas.v2.handler.DeSpecificDetailSearchProcessor"> + </bean> + + <bean id="IT-Specific-Search" + class="at.asitplus.eidas.specific.modules.auth.eidas.v2.handler.ItSpecificDetailSearchProcessor"> + </bean> + <!-- Authentication Process Tasks --> <bean id="ConnecteIDASNodeTask" class="at.asitplus.eidas.specific.modules.auth.eidas.v2.tasks.GenerateAuthnRequestTask" |