From 802816a345059aa04c779cde246fd6cb2a2967fe Mon Sep 17 00:00:00 2001 From: Thomas <> Date: Mon, 26 Jul 2021 10:33:21 +0200 Subject: update ZMR client WSDL to new version and refactor code to new API --- .../auth/eidas/v2/clients/zmr/ZmrSoapClient.java | 24 ++++++------- .../handler/DeSpecificDetailSearchProcessor.java | 2 +- .../eidas/v2/tasks/GenerateAuthnRequestTask.java | 27 ++++++++------- .../zmr_client/xsd/allgemein/BasTabelleAbfrage.xsd | 19 +++++++++- .../wsdl/zmr_client/xsd/zmr/ErnpAbfrage.xsd | 40 +++++++++++++++++++--- .../wsdl/zmr_client/xsd/zmr/Personensuche.xsd | 2 +- .../xsd/zmr/entities/EidasIdentitaet.xsd | 27 ++++++++------- 7 files changed, 96 insertions(+), 45 deletions(-) (limited to 'eidas_modules/authmodule-eIDAS-v2/src') diff --git a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/clients/zmr/ZmrSoapClient.java b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/clients/zmr/ZmrSoapClient.java index c5f01392..29914e21 100644 --- a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/clients/zmr/ZmrSoapClient.java +++ b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/clients/zmr/ZmrSoapClient.java @@ -125,9 +125,9 @@ public class ZmrSoapClient extends AbstractSoapClient implements IZmrClient { final PersonSuchenRequest searchPersonReq = new PersonSuchenRequest(); req.setPersonSuchenRequest(searchPersonReq); final EidasSuchdatenType eidasInfos = new EidasSuchdatenType(); - searchPersonReq.setEidasSuchdaten(eidasInfos); + searchPersonReq.getEidasSuchdaten().add(eidasInfos); eidasInfos.setEidasArt(Constants.eIDAS_ATTRURN_PERSONALIDENTIFIER); - eidasInfos.setEidasNummer(personPseudonym); + eidasInfos.setEidasWert(personPseudonym); // set work-flow client information req.setWorkflowInfoClient(generateWorkFlowInfos(PROCESS_SEARCH_PERSONAL_IDENTIFIER, null)); @@ -583,8 +583,8 @@ public class ZmrSoapClient extends AbstractSoapClient implements IZmrClient { String eidasAttrurnPersonalidentifier) { return person.getEidasIdentitaet().stream() .filter(el -> eidasAttrurnPersonalidentifier.equals(el.getEidasArt()) - && el.getStaatscode3().equals(citizenCountryCode)) - .map(el -> el.getDokumentNummer()) + && el.getStaatscode2().equals(citizenCountryCode)) + .map(el -> el.getEidasWert()) .collect(Collectors.toList()); } @@ -603,9 +603,9 @@ public class ZmrSoapClient extends AbstractSoapClient implements IZmrClient { String eidasAttrurnPersonalidentifier) { return person.getEidasIdentitaet().stream() .filter(el -> eidasAttrurnPersonalidentifier.equals(el.getEidasArt()) - && el.getStaatscode3().equals(citizenCountryCode)) + && el.getStaatscode2().equals(citizenCountryCode)) .findFirst() - .map(el -> el.getDokumentNummer()) + .map(el -> el.getEidasWert()) .orElse(null); } @@ -701,30 +701,30 @@ public class ZmrSoapClient extends AbstractSoapClient implements IZmrClient { // check if eIDAS attribute is already includes an eIDAS-Document boolean alreadyExist = zmrPersonToKitt.getEidasIdentitaet().stream() - .filter(el -> el.getDokumentNummer().equals(attrValue) + .filter(el -> el.getEidasWert().equals(attrValue) && el.getEidasArt().equals(attrName) - && el.getStaatscode3().equals(citizenCountryCode)) + && el.getStaatscode2().equals(citizenCountryCode)) .findAny() .isPresent(); if (!alreadyExist) { // check eIDAS documents already contains a document with this pair of country-code and attribute-name Optional oneDocWithNameExists = zmrPersonToKitt.getEidasIdentitaet().stream() - .filter(el -> el.getStaatscode3().equals(citizenCountryCode) + .filter(el -> el.getStaatscode2().equals(citizenCountryCode) && el.getEidasArt().equals(attrName)) .findAny(); if (!allowMoreThanOneEntry && oneDocWithNameExists.isPresent() - && !oneDocWithNameExists.get().getDokumentNummer().equals(attrValue)) { + && !oneDocWithNameExists.get().getEidasWert().equals(attrValue)) { log.warn("eIDAS document: {} already exists for country: {} but attribute-value does not match. " + "Skip update process because no multi-value allowed for this ... ", attrName, citizenCountryCode); } else { EidasIdentitaetAnlageType eidasDocToAdd = new EidasIdentitaetAnlageType(); - eidasDocToAdd.setStaatscode3(citizenCountryCode); + eidasDocToAdd.setStaatscode2(citizenCountryCode); eidasDocToAdd.setEidasArt(attrName); - eidasDocToAdd.setEidasNummer(attrValue); + eidasDocToAdd.setEidasWert(attrValue); log.info("Add eIDAS document: {} for country: {} to ZMR person", attrName, citizenCountryCode); result.add(eidasDocToAdd); 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 471cb115..b7fb25ea 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 @@ -63,7 +63,7 @@ public class DeSpecificDetailSearchProcessor implements CountrySpecificDetailSea //TODO: how we can search for more than one eIDAS attribute as a Set EidasSuchdatenType eidasInfos = new EidasSuchdatenType(); - req.setEidasSuchdaten(eidasInfos); + req.getEidasSuchdaten().add(eidasInfos); return req; diff --git a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/GenerateAuthnRequestTask.java b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/GenerateAuthnRequestTask.java index da9c8174..2b3fabd9 100644 --- a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/GenerateAuthnRequestTask.java +++ b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/GenerateAuthnRequestTask.java @@ -23,6 +23,20 @@ package at.asitplus.eidas.specific.modules.auth.eidas.v2.tasks; +import java.io.IOException; +import java.util.UUID; + +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.commons.lang3.StringUtils; +import org.jetbrains.annotations.NotNull; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.ApplicationContext; +import org.springframework.stereotype.Component; +import org.springframework.web.util.UriComponentsBuilder; + import at.asitplus.eidas.specific.connector.MsConnectorEventCodes; import at.asitplus.eidas.specific.connector.MsEidasNodeConstants; import at.asitplus.eidas.specific.connector.gui.StaticGuiBuilderConfiguration; @@ -48,18 +62,6 @@ import eu.eidas.specificcommunication.SpecificCommunicationDefinitionBeanNames; import eu.eidas.specificcommunication.exception.SpecificCommunicationException; import eu.eidas.specificcommunication.protocol.SpecificCommunicationService; import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang3.StringUtils; -import org.jetbrains.annotations.NotNull; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.ApplicationContext; -import org.springframework.stereotype.Component; -import org.springframework.web.util.UriComponentsBuilder; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.UUID; /** @@ -249,6 +251,7 @@ public class GenerateAuthnRequestTask extends AbstractAuthServletTask { final UriComponentsBuilder redirectUrl = UriComponentsBuilder.fromHttpUrl(forwardUrl); redirectUrl.queryParam(EidasParameterKeys.TOKEN.toString(), tokenBase64); response.sendRedirect(redirectUrl.build().encode().toString()); + } private void sendPost(HttpServletRequest request, HttpServletResponse response, String tokenBase64, String forwardUrl) diff --git a/eidas_modules/authmodule-eIDAS-v2/src/main/resources/wsdl/zmr_client/xsd/allgemein/BasTabelleAbfrage.xsd b/eidas_modules/authmodule-eIDAS-v2/src/main/resources/wsdl/zmr_client/xsd/allgemein/BasTabelleAbfrage.xsd index 4c2387d7..ca78a990 100644 --- a/eidas_modules/authmodule-eIDAS-v2/src/main/resources/wsdl/zmr_client/xsd/allgemein/BasTabelleAbfrage.xsd +++ b/eidas_modules/authmodule-eIDAS-v2/src/main/resources/wsdl/zmr_client/xsd/allgemein/BasTabelleAbfrage.xsd @@ -19,6 +19,7 @@ Aenderungshistorie: + @@ -51,6 +52,7 @@ Aenderungshistorie: + @@ -152,6 +154,22 @@ Aenderungshistorie: + + + + Ein SMI.RELIGIONCODE Eintrag mit den fürs ZMR3 relevanten Feldern + + + + + + + + + + + + @@ -172,5 +190,4 @@ Aenderungshistorie: - \ No newline at end of file diff --git a/eidas_modules/authmodule-eIDAS-v2/src/main/resources/wsdl/zmr_client/xsd/zmr/ErnpAbfrage.xsd b/eidas_modules/authmodule-eIDAS-v2/src/main/resources/wsdl/zmr_client/xsd/zmr/ErnpAbfrage.xsd index db36e0d5..12ecd771 100644 --- a/eidas_modules/authmodule-eIDAS-v2/src/main/resources/wsdl/zmr_client/xsd/zmr/ErnpAbfrage.xsd +++ b/eidas_modules/authmodule-eIDAS-v2/src/main/resources/wsdl/zmr_client/xsd/zmr/ErnpAbfrage.xsd @@ -29,6 +29,7 @@ Author(s): Richard Mayrhofer xmayrh2 + @@ -36,6 +37,33 @@ Author(s): Richard Mayrhofer xmayrh2 + + + + + + + + + + + + + + + + + + + + + + Geburtsdatum, simple type for dates (union), which may omit day and/or month + + + + + @@ -43,13 +71,13 @@ Author(s): Richard Mayrhofer xmayrh2 + - @@ -146,16 +174,18 @@ Author(s): Richard Mayrhofer xmayrh2 - + + + - + - + - + \ No newline at end of file diff --git a/eidas_modules/authmodule-eIDAS-v2/src/main/resources/wsdl/zmr_client/xsd/zmr/Personensuche.xsd b/eidas_modules/authmodule-eIDAS-v2/src/main/resources/wsdl/zmr_client/xsd/zmr/Personensuche.xsd index 31606d6f..a501ba1f 100644 --- a/eidas_modules/authmodule-eIDAS-v2/src/main/resources/wsdl/zmr_client/xsd/zmr/Personensuche.xsd +++ b/eidas_modules/authmodule-eIDAS-v2/src/main/resources/wsdl/zmr_client/xsd/zmr/Personensuche.xsd @@ -50,7 +50,7 @@ Aenderungshistorie: - + diff --git a/eidas_modules/authmodule-eIDAS-v2/src/main/resources/wsdl/zmr_client/xsd/zmr/entities/EidasIdentitaet.xsd b/eidas_modules/authmodule-eIDAS-v2/src/main/resources/wsdl/zmr_client/xsd/zmr/entities/EidasIdentitaet.xsd index cd07bd8a..361c0c95 100644 --- a/eidas_modules/authmodule-eIDAS-v2/src/main/resources/wsdl/zmr_client/xsd/zmr/entities/EidasIdentitaet.xsd +++ b/eidas_modules/authmodule-eIDAS-v2/src/main/resources/wsdl/zmr_client/xsd/zmr/entities/EidasIdentitaet.xsd @@ -20,9 +20,9 @@ Author(s): Richard Mayrhofer - + - + @@ -35,9 +35,9 @@ Author(s): Richard Mayrhofer - + - + @@ -52,9 +52,9 @@ Author(s): Richard Mayrhofer - + - + @@ -69,16 +69,17 @@ Author(s): Richard Mayrhofer - + + - + - - + + @@ -87,16 +88,16 @@ Author(s): Richard Mayrhofer - + - + - + -- cgit v1.2.3