From be411ba3e668eb86f87c0d8a021989d97b63c7a3 Mon Sep 17 00:00:00 2001 From: Thomas <> Date: Wed, 2 Mar 2022 13:10:39 +0100 Subject: chore(ernp): update ERnP REST API to v1.5.1 --- .../auth/eidas/v2/clients/ernp/ErnpRestClient.java | 25 ++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'eidas_modules/authmodule-eIDAS-v2/src/main/java/at') diff --git a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/clients/ernp/ErnpRestClient.java b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/clients/ernp/ErnpRestClient.java index 3822da01..45a4010b 100644 --- a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/clients/ernp/ErnpRestClient.java +++ b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/clients/ernp/ErnpRestClient.java @@ -62,6 +62,7 @@ import at.asitplus.eidas.specific.modules.auth.eidas.v2.exception.ErnpRestCommun import at.asitplus.eidas.specific.modules.auth.eidas.v2.exception.WorkflowException; import at.asitplus.eidas.specific.modules.auth.eidas.v2.utils.VersionHolder; import at.gv.bmi.namespace.zmr_su.base._20040201_.ServiceFault; +import at.gv.bmi.namespace.zmr_su.zmr._20040201.EidasSuchdatenType; import at.gv.bmi.namespace.zmr_su.zmr._20040201.PersonSuchenRequest; import at.gv.egiz.eaaf.core.api.idp.IConfiguration; import at.gv.egiz.eaaf.core.exceptions.EaafAuthenticationException; @@ -142,7 +143,7 @@ public class ErnpRestClient implements IErnpClient { personSuchen.setSuchoptionen(generateSearchParameters()); personSuchen.setBegruendung(PROCESS_SEARCH_PERSONAL_IDENTIFIER); final Suchdaten searchInfos = new Suchdaten(); - searchInfos.setEidas(eidasInfos); + searchInfos.setEidas(Arrays.asList(eidasInfos)); personSuchen.setSuchdaten(searchInfos); // request ERnP @@ -429,9 +430,11 @@ public class ErnpRestClient implements IErnpClient { searchInfos.setVorname(personSearchDao.getNatuerlichePerson().getPersonenName().getVorname()); searchInfos.setGeburtsdatum(buildErnpBirthday(personSearchDao.getNatuerlichePerson().getGeburtsdatum())); - //TODO: search eIDAS has to be a LIST!!!!!! - SuchEidas eidasInfos = new SuchEidas(); - searchInfos.setEidas(eidasInfos); + // map all eIDAS documents into ERnP format + searchInfos.setEidas(personSearchDao.getEidasSuchdaten().stream() + .map(el -> buildErnpEidasDocument(el)) + .collect(Collectors.toList())); + return searchInfos; } @@ -668,6 +671,20 @@ public class ErnpRestClient implements IErnpClient { } + /** + * Map eIDAS search-data from ZMR model into ERnP model. + * + * @param daten eIDAS document as ZMR model + * @return the same eIDAS document as an ERnP model + */ + private SuchEidas buildErnpEidasDocument(EidasSuchdatenType daten) { + return new SuchEidas() + .art(daten.getEidasArt()) + .wert(daten.getEidasWert()) + .staatscode2(daten.getStaatscode2()); + } + + /** * Build AT specific Date String 'yyyy-MM-dd' from ERnP birthday representation. * -- cgit v1.2.3