From b49ccd7d7ec1c0f0b560321b7e5559f18913ae7c Mon Sep 17 00:00:00 2001 From: Alexander Marsalek Date: Tue, 15 Dec 2020 10:01:11 +0100 Subject: return bPk --- .../auth/eidas/v2/tasks/InitialSearchTask.java | 53 +++++++++++++--------- 1 file changed, 31 insertions(+), 22 deletions(-) (limited to 'eidas_modules/authmodule-eIDAS-v2') 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 0b7ce030..bc64dc86 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 @@ -142,25 +142,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 eidasAttrMap) @@ -194,25 +197,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; @@ -227,14 +235,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 @@ -243,24 +251,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 resultsZmr = @@ -273,7 +282,7 @@ public class InitialSearchTask extends AbstractAuthServletTask { log.debug("Automerge " + initialSearchResult + " with " + eidData + " " + mdsSearchResult); //TODO - + return "105"; } private MergedRegisterSearchResult searchInZmrAndErnp(String personIdentifier) { -- cgit v1.2.3