diff options
author | Alexander Marsalek <amarsalek@iaik.tugraz.at> | 2020-12-15 10:01:11 +0100 |
---|---|---|
committer | Alexander Marsalek <amarsalek@iaik.tugraz.at> | 2021-01-04 14:15:55 +0100 |
commit | f9a4e026800fcf8d80a6892797eedc5426188196 (patch) | |
tree | e4ffb125e8f1d035b5aef115f94c0080c1f25319 /eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus | |
parent | f31d767bf6b8a92f7b05e030c26e43ad71cc0f20 (diff) | |
download | National_eIDAS_Gateway-f9a4e026800fcf8d80a6892797eedc5426188196.tar.gz National_eIDAS_Gateway-f9a4e026800fcf8d80a6892797eedc5426188196.tar.bz2 National_eIDAS_Gateway-f9a4e026800fcf8d80a6892797eedc5426188196.zip |
return bPk
Diffstat (limited to 'eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus')
-rw-r--r-- | eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/InitialSearchTask.java | 53 |
1 files changed, 31 insertions, 22 deletions
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 dd430cf6..fd86ab43 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 @@ -139,25 +139,28 @@ public class InitialSearchTask extends AbstractAuthServletTask { // post-process eIDAS attributes final SimpleEidasData eidData = convertSimpleMapToSimpleData(simpleAttrMap); - step2(eidData); + + String bpK = step2(eidData); + authProcessData.setGenericDataToSession(Constants.DATA_RESULT_MATCHING_BPK,bpK); } catch (final Exception e) { log.error("Initial search FAILED.", e); throw new TaskExecutionException(pendingReq, "Initial search FAILED.", e); } } - private void step2(SimpleEidasData eidData) throws TaskExecutionException { + private String step2(SimpleEidasData eidData) throws TaskExecutionException { String personIdentifier = eidData.getPseudonym(); //search in register(step 2) MergedRegisterSearchResult result = searchInZmrAndErnp(personIdentifier); if (result.getResultCount() == 0) { - step5(result, eidData); + return step5(result, eidData); } else if (result.getResultCount() == 1) { - step3(result, eidData); - } else if (result.getResultCount() > 1) { - throw new TaskExecutionException(pendingReq, "Initial search - Kitt Process necessary.", + return step3(result, eidData); + } //else if (result.getResultCount() > 1) { + throw new TaskExecutionException(pendingReq, "Initial search - Kitt Process necessary.", new ManualFixNecessaryException(personIdentifier)); - } + // } + // return null; } private SimpleEidasData convertSimpleMapToSimpleData(Map<String, Object> eidasAttrMap) @@ -191,25 +194,30 @@ public class InitialSearchTask extends AbstractAuthServletTask { return simpleEidasData; } - private void step3(MergedRegisterSearchResult result, SimpleEidasData eidData) { + private String step3(MergedRegisterSearchResult result, SimpleEidasData eidData) { //check if data from eidas authentication matches with data from register log.debug("Compare " + result + " with " + eidData); //TODO check if data matches boolean match = true; if (match) { - return; + String bpK = "102"; + return bpK; } else { - step4(result, eidData); + return step4(result, eidData); } } - private void step4(MergedRegisterSearchResult result, SimpleEidasData eidData) { + private String step4(MergedRegisterSearchResult result, + SimpleEidasData eidData) { log.debug("Update " + result + " with " + eidData); //TODO + + String bpK = "100"; + return bpK; } - private void step5(MergedRegisterSearchResult result, SimpleEidasData eidData) + private String step5(MergedRegisterSearchResult result, SimpleEidasData eidData) throws TaskExecutionException { String citizenCountry = eidData.getCitizenCountryCode(); ICountrySpecificDetailSearchProcessor foundHandler = null; @@ -224,14 +232,14 @@ public class InitialSearchTask extends AbstractAuthServletTask { } if (foundHandler == null) { //MDS search - step8(result, eidData); + return step8(result, eidData); } else { //country specific search - step6(foundHandler, result, eidData); + return step6(foundHandler, result, eidData); } } - private void step6(ICountrySpecificDetailSearchProcessor countrySpecificDetailSearchProcessor, + private String step6(ICountrySpecificDetailSearchProcessor countrySpecificDetailSearchProcessor, MergedRegisterSearchResult initialSearchResult, SimpleEidasData eidData) throws TaskExecutionException { //6 country specific search @@ -240,24 +248,25 @@ public class InitialSearchTask extends AbstractAuthServletTask { switch (countrySpecificDetailSearchResult.getResultCount()) { case 0: - step8(initialSearchResult, eidData); - break; + return step8(initialSearchResult, eidData); case 1: - step7a(initialSearchResult, countrySpecificDetailSearchResult, eidData); - break; + return step7a(initialSearchResult, countrySpecificDetailSearchResult, eidData); default://should not happen throw new TaskExecutionException(pendingReq, "Detail search - Kitt Process necessary.", new ManualFixNecessaryException(eidData)); } } - private void step7a(MergedRegisterSearchResult initialSearchResult, + private String step7a(MergedRegisterSearchResult initialSearchResult, CountrySpecificDetailSearchResult countrySpecificDetailSearchResult, SimpleEidasData eidData) { //TODO automerge log.debug("Automerge " + initialSearchResult + " with " + eidData + " " + countrySpecificDetailSearchResult); + String bpK = "103"; + return bpK; } - private void step8(MergedRegisterSearchResult initialSearchResult, SimpleEidasData eidData) { + private String step8(MergedRegisterSearchResult initialSearchResult, + SimpleEidasData eidData) { MergedRegisterSearchResult mdsSearchResult = new MergedRegisterSearchResult(); ArrayList<RegisterResult> resultsZmr = @@ -270,7 +279,7 @@ public class InitialSearchTask extends AbstractAuthServletTask { log.debug("Automerge " + initialSearchResult + " with " + eidData + " " + mdsSearchResult); //TODO - + return "105"; } private MergedRegisterSearchResult searchInZmrAndErnp(String personIdentifier) { |