aboutsummaryrefslogtreecommitdiff
path: root/eidas_modules/authmodule-eIDAS-v2
diff options
context:
space:
mode:
Diffstat (limited to 'eidas_modules/authmodule-eIDAS-v2')
-rw-r--r--eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/dao/CountrySpecificDetailSearchResult.java32
-rw-r--r--eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/ernb/DummyErnbClient.java11
-rw-r--r--eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/ernb/IErnbClient.java6
-rw-r--r--eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/handler/DeSpecificDetailSearchProcessor.java30
-rw-r--r--eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/handler/ICountrySpecificDetailSearchProcessor.java4
-rw-r--r--eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/handler/ItSpecificDetailSearchProcessor.java28
-rw-r--r--eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/InitialSearchTask.java5
-rw-r--r--eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/zmr/DummyZmrClient.java11
-rw-r--r--eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/zmr/IZmrClient.java6
9 files changed, 88 insertions, 45 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
deleted file mode 100644
index 6e1f8653..00000000
--- a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/dao/CountrySpecificDetailSearchResult.java
+++ /dev/null
@@ -1,32 +0,0 @@
-package at.asitplus.eidas.specific.modules.auth.eidas.v2.dao;
-
-import at.asitplus.eidas.specific.modules.auth.eidas.v2.exception.WorkflowException;
-
-import java.util.ArrayList;
-
-public class CountrySpecificDetailSearchResult {
-
- //TODO is the result the same as the one from the initial search?
- ArrayList<RegisterResult> resultsZmr = new ArrayList<>();
- ArrayList<RegisterResult> resultsErnb = new ArrayList<>();
-
- public int getResultCount() {
- return resultsZmr.size() + resultsErnb.size();
- }
-
- /**
- * Verfies that there is only one match and retunrs the bpk.
- * @return bpk bpk of the match
- * @throws WorkflowException if multiple results have been found
- */
- public String getBpk() throws WorkflowException {
- if (getResultCount() != 1) {
- throw new WorkflowException("getResultCount() != 1");
- }
- if (resultsZmr.size() == 1) {
- return resultsZmr.get(0).getBpk();
- } else {
- return resultsErnb.get(0).getBpk();
- }
- }
-}
diff --git a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/ernb/DummyErnbClient.java b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/ernb/DummyErnbClient.java
index 8b2379bf..7e926c8e 100644
--- a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/ernb/DummyErnbClient.java
+++ b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/ernb/DummyErnbClient.java
@@ -26,6 +26,17 @@ public class DummyErnbClient implements IErnbClient {
return resultEmpty();//TODO will I only receive matches where all three values match perfectly?
}
+ @Override
+ public ArrayList<RegisterResult> searchDeSpecific(String givenName, String familyName, String dateOfBirth,
+ String birthPlace, String birthName) {
+ return resultEmpty();//TODO
+ }
+
+ @Override
+ public ArrayList<RegisterResult> searchItSpecific(String txNumber) {
+ return resultEmpty();//TODO
+ }
+
private ArrayList<RegisterResult> resultEmpty() {
return new ArrayList<RegisterResult>();//Nobody found
}
diff --git a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/ernb/IErnbClient.java b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/ernb/IErnbClient.java
index 4873b939..f8a41cfe 100644
--- a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/ernb/IErnbClient.java
+++ b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/ernb/IErnbClient.java
@@ -9,4 +9,10 @@ public interface IErnbClient {
ArrayList<RegisterResult> searchWithPersonIdentifer(String personIdentifer);
ArrayList<RegisterResult> searchWithMds(String givenName, String familyName, String dateOfBirth);
+
+ ArrayList<RegisterResult> searchDeSpecific(String givenName, String familyName, String dateOfBirth,
+ String birthPlace, String birthName);
+
+ ArrayList<RegisterResult> searchItSpecific(String txNumber);
+
}
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
index 727aa718..9fa13fe8 100644
--- 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
@@ -1,10 +1,22 @@
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.MergedRegisterSearchResult;
+import at.asitplus.eidas.specific.modules.auth.eidas.v2.dao.RegisterResult;
import at.asitplus.eidas.specific.modules.auth.eidas.v2.dao.SimpleEidasData;
+import at.asitplus.eidas.specific.modules.auth.eidas.v2.ernb.IErnbClient;
+import at.asitplus.eidas.specific.modules.auth.eidas.v2.zmr.IZmrClient;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import java.util.ArrayList;
public class DeSpecificDetailSearchProcessor implements ICountrySpecificDetailSearchProcessor {
+ @Autowired
+ private IErnbClient ernbClient;
+
+ @Autowired
+ private IZmrClient zmrClient;
+
@Override
public String getName() {
return this.getClass().getName();
@@ -25,8 +37,18 @@ public class DeSpecificDetailSearchProcessor implements ICountrySpecificDetailSe
}
@Override
- public CountrySpecificDetailSearchResult search(SimpleEidasData eidData) {
- //TODO
- return new CountrySpecificDetailSearchResult();
+ public MergedRegisterSearchResult search(SimpleEidasData eidData) {
+ MergedRegisterSearchResult searchResult = new MergedRegisterSearchResult();
+
+ ArrayList<RegisterResult> resultsZmr =
+ zmrClient.searchDeSpecific(eidData.getGivenName(), eidData.getFamilyName(), eidData.getDateOfBirth(),
+ eidData.getPlaceOfBirth(), eidData.getBirthName());
+ searchResult.setResultsZmr(resultsZmr);
+
+ ArrayList<RegisterResult> resultsErnb =
+ ernbClient.searchDeSpecific(eidData.getGivenName(), eidData.getFamilyName(), eidData.getDateOfBirth(),
+ eidData.getPlaceOfBirth(), eidData.getBirthName());
+ searchResult.setResultsErnb(resultsErnb);
+ return searchResult;
}
}
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 8ddd79bb..887aef4a 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
@@ -23,7 +23,7 @@
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.MergedRegisterSearchResult;
import at.asitplus.eidas.specific.modules.auth.eidas.v2.dao.SimpleEidasData;
public interface ICountrySpecificDetailSearchProcessor {
@@ -44,6 +44,6 @@ public interface ICountrySpecificDetailSearchProcessor {
*/
boolean canHandle(String countryCode, SimpleEidasData eidData);
- CountrySpecificDetailSearchResult search(SimpleEidasData eidData);
+ MergedRegisterSearchResult 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
index bb0a5262..e3b9e702 100644
--- 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
@@ -1,10 +1,22 @@
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.MergedRegisterSearchResult;
+import at.asitplus.eidas.specific.modules.auth.eidas.v2.dao.RegisterResult;
import at.asitplus.eidas.specific.modules.auth.eidas.v2.dao.SimpleEidasData;
+import at.asitplus.eidas.specific.modules.auth.eidas.v2.ernb.IErnbClient;
+import at.asitplus.eidas.specific.modules.auth.eidas.v2.zmr.IZmrClient;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import java.util.ArrayList;
public class ItSpecificDetailSearchProcessor implements ICountrySpecificDetailSearchProcessor {
+ @Autowired
+ private IErnbClient ernbClient;
+
+ @Autowired
+ private IZmrClient zmrClient;
+
@Override
public String getName() {
return this.getClass().getName();
@@ -22,8 +34,16 @@ public class ItSpecificDetailSearchProcessor implements ICountrySpecificDetailSe
}
@Override
- public CountrySpecificDetailSearchResult search(SimpleEidasData eidData) {
- //TODO
- return new CountrySpecificDetailSearchResult();
+ public MergedRegisterSearchResult search(SimpleEidasData eidData) {
+ MergedRegisterSearchResult searchResult = new MergedRegisterSearchResult();
+
+ ArrayList<RegisterResult> resultsZmr =
+ zmrClient.searchItSpecific(eidData.getTaxNumber());
+ searchResult.setResultsZmr(resultsZmr);
+
+ ArrayList<RegisterResult> resultsErnb =
+ ernbClient.searchItSpecific(eidData.getTaxNumber());
+ searchResult.setResultsErnb(resultsErnb);
+ return searchResult;
}
}
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 2a5b9a23..9df24e9f 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
@@ -43,7 +43,6 @@ import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import at.asitplus.eidas.specific.modules.auth.eidas.v2.Constants;
-import at.asitplus.eidas.specific.modules.auth.eidas.v2.dao.CountrySpecificDetailSearchResult;
import at.asitplus.eidas.specific.modules.auth.eidas.v2.dao.MergedRegisterSearchResult;
import at.asitplus.eidas.specific.modules.auth.eidas.v2.dao.RegisterResult;
import at.asitplus.eidas.specific.modules.auth.eidas.v2.dao.SimpleEidasData;
@@ -249,7 +248,7 @@ public class InitialSearchTask extends AbstractAuthServletTask {
MergedRegisterSearchResult initialSearchResult, SimpleEidasData eidData)
throws TaskExecutionException {
//6 country specific search
- CountrySpecificDetailSearchResult countrySpecificDetailSearchResult =
+ MergedRegisterSearchResult countrySpecificDetailSearchResult =
countrySpecificDetailSearchProcessor.search(eidData);
switch (countrySpecificDetailSearchResult.getResultCount()) {
@@ -264,7 +263,7 @@ public class InitialSearchTask extends AbstractAuthServletTask {
}
private String step7a(MergedRegisterSearchResult initialSearchResult,
- CountrySpecificDetailSearchResult countrySpecificDetailSearchResult,
+ MergedRegisterSearchResult countrySpecificDetailSearchResult,
SimpleEidasData eidData) throws TaskExecutionException {
//TODO automerge
log.debug("Automerge " + initialSearchResult + " with " + eidData + " " + countrySpecificDetailSearchResult);
diff --git a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/zmr/DummyZmrClient.java b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/zmr/DummyZmrClient.java
index 9a7cc9b3..343651f7 100644
--- a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/zmr/DummyZmrClient.java
+++ b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/zmr/DummyZmrClient.java
@@ -26,6 +26,17 @@ public class DummyZmrClient implements IZmrClient {
return resultEmpty();//TODO will I only receive matches where all three values match perfectly?
}
+ @Override
+ public ArrayList<RegisterResult> searchDeSpecific(String givenName, String familyName, String dateOfBirth,
+ String birthPlace, String birthName) {
+ return resultEmpty();//TODO
+ }
+
+ @Override
+ public ArrayList<RegisterResult> searchItSpecific(String txNumber) {
+ return resultEmpty();//TODO
+ }
+
private ArrayList<RegisterResult> resultEmpty() {
return new ArrayList<RegisterResult>();//Nobody found
}
diff --git a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/zmr/IZmrClient.java b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/zmr/IZmrClient.java
index 1f7e4949..018122ea 100644
--- a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/zmr/IZmrClient.java
+++ b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/zmr/IZmrClient.java
@@ -9,4 +9,10 @@ public interface IZmrClient {
ArrayList<RegisterResult> searchWithPersonIdentifer(String personIdentifer);
ArrayList<RegisterResult> searchWithMds(String givenName, String familyName, String dateOfBirth);
+
+ ArrayList<RegisterResult> searchDeSpecific(String givenName, String familyName, String dateOfBirth,
+ String birthPlace, String birthName);
+
+ ArrayList<RegisterResult> searchItSpecific(String txNumber);
+
}