From 9da6640b1aa6ffd60866a6f34ea92f70ada1a3e6 Mon Sep 17 00:00:00 2001 From: Thomas <> Date: Fri, 7 Oct 2022 16:57:46 +0200 Subject: feat(matching): check ZMR and ERnP response if enities are closed ZMR and ERnP always return the latest version of an entity. However, that latest version can also have status closed and in that case the entity is not valid any more. --- .../auth/eidas/v2/clients/ernp/ErnpRestClient.java | 80 ++- .../auth/eidas/v2/clients/zmr/ZmrSoapClient.java | 80 ++- .../eidas/v2/handler/AbstractEidProcessor.java | 2 +- .../test/clients/ErnpRestClientProductionTest.java | 68 +++ .../eidas/v2/test/clients/ErnpRestClientTest.java | 71 +++ .../v2/test/clients/ZmrClientProductionTest.java | 54 ++ .../auth/eidas/v2/test/clients/ZmrClientTest.java | 158 +++++ ...1_search_with_personalId_closed_entry_resp.json | 44 ++ ..._with_personalId_not_yet_closed_entry_resp.json | 44 ++ .../5_search_with_mds_multi_with_closed_resp.json | 124 ++++ ...arch_with_personalId_only_resp_closed_entry.xml | 291 ++++++++++ ...th_personalId_only_resp_closed_entry_future.xml | 291 ++++++++++ ...sonalId_only_resp_moreThanOne_closed_entity.xml | 641 +++++++++++++++++++++ 13 files changed, 1921 insertions(+), 27 deletions(-) create mode 100644 modules/authmodule-eIDAS-v2/src/test/resources/data/ernp/1_search_with_personalId_closed_entry_resp.json create mode 100644 modules/authmodule-eIDAS-v2/src/test/resources/data/ernp/1_search_with_personalId_not_yet_closed_entry_resp.json create mode 100644 modules/authmodule-eIDAS-v2/src/test/resources/data/ernp/5_search_with_mds_multi_with_closed_resp.json create mode 100644 modules/authmodule-eIDAS-v2/src/test/resources/data/zmr/search_with_personalId_only_resp_closed_entry.xml create mode 100644 modules/authmodule-eIDAS-v2/src/test/resources/data/zmr/search_with_personalId_only_resp_closed_entry_future.xml create mode 100644 modules/authmodule-eIDAS-v2/src/test/resources/data/zmr/search_with_personalId_only_resp_moreThanOne_closed_entity.xml diff --git a/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/clients/ernp/ErnpRestClient.java b/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/clients/ernp/ErnpRestClient.java index a847a519..feb2853a 100644 --- a/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/clients/ernp/ErnpRestClient.java +++ b/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/clients/ernp/ErnpRestClient.java @@ -3,6 +3,7 @@ package at.asitplus.eidas.specific.modules.auth.eidas.v2.clients.ernp; import java.io.IOException; import java.text.MessageFormat; import java.time.LocalDate; +import java.time.LocalDateTime; import java.time.OffsetDateTime; import java.util.Arrays; import java.util.Collection; @@ -417,30 +418,79 @@ public class ErnpRestClient implements IErnpClient { "Find more-than-one ERnP entry with search criteria that has to be unique", true); } else { - return Arrays.asList(mapErnpResponseToRegisterResult(persons.get(0), citizenCountryCode)); + RegisterResult activeResult = mapErnpResponseToRegisterResult(persons.get(0), citizenCountryCode); + if (activeResult == null) { + log.error("ERnP entry, which was selected by matching, looks already closed. " + + "Automated operations on closed entries not supported my matching"); + throw new WorkflowException(processStepFiendlyname, + "ERnP entry, which was selected by matching, is not active any more.", true); + + } + + return Arrays.asList(activeResult); } } - @Nonnull + + + /** + * Process a single Person data-set from ERnP. + * + * @param personEl Person data-set from ERnP + * @param citizenCountryCode Country-Code of the citizen + * @return Simplified register result, or null if the person data-set is not active anymore + * @throws EaafAuthenticationException In case of a validation error + */ + @Nullable private RegisterResult mapErnpResponseToRegisterResult(@Nonnull Person person, @Nonnull String citizenCountryCode) { - // build result - return RegisterResult.builder() - .pseudonym(selectAllEidasDocument(person, citizenCountryCode, - EidasConstants.eIDAS_ATTRURN_PERSONALIDENTIFIER)) - .familyName(person.getPersonendaten().getFamilienname()) - .givenName(person.getPersonendaten().getVorname()) - .dateOfBirth(getTextualBirthday(person.getPersonendaten().getGeburtsdatum())) - .bpk(person.getPersonendaten().getBpkZp()) - .placeOfBirth(selectSingleEidasDocument(person, citizenCountryCode, - EidasConstants.eIDAS_ATTRURN_PLACEOFBIRTH)) - .birthName(selectSingleEidasDocument(person, citizenCountryCode, - EidasConstants.eIDAS_ATTRURN_BIRTHNAME)) - .build(); + + if (checkIfPersonIsActive(person)) { + // build result + return RegisterResult.builder() + .pseudonym(selectAllEidasDocument(person, citizenCountryCode, + EidasConstants.eIDAS_ATTRURN_PERSONALIDENTIFIER)) + .familyName(person.getPersonendaten().getFamilienname()) + .givenName(person.getPersonendaten().getVorname()) + .dateOfBirth(getTextualBirthday(person.getPersonendaten().getGeburtsdatum())) + .bpk(person.getPersonendaten().getBpkZp()) + .placeOfBirth(selectSingleEidasDocument(person, citizenCountryCode, + EidasConstants.eIDAS_ATTRURN_PLACEOFBIRTH)) + .birthName(selectSingleEidasDocument(person, citizenCountryCode, + EidasConstants.eIDAS_ATTRURN_BIRTHNAME)) + .build(); + + } else { + log.debug("Entity is not valid anymore. Skip it ... "); + return null; + + } } + private boolean checkIfPersonIsActive(Person person) { + if (person.getGueltigBis() != null) { + LocalDateTime validTo = person.getGueltigBis().toLocalDateTime(); + LocalDateTime now = LocalDateTime.now(); + if (validTo.isBefore(now)) { + log.warn("Enity was valid to: {}, but now its: {}. Ignore that entry", validTo, now); + return false; + + } else { + log.debug("Entity has a 'validTo' element, but it is in the future."); + + } + + } else { + log.trace("Entity has no 'validTo' element. Therefore it should be valid"); + + } + + return true; + } + + private Suchdaten mapCountrySpecificSearchData(PersonSuchenRequest personSearchDao) { final Suchdaten searchInfos = new Suchdaten(); searchInfos.setFamilienname(personSearchDao.getNatuerlichePerson().getPersonenName().getFamilienname()); diff --git a/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/clients/zmr/ZmrSoapClient.java b/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/clients/zmr/ZmrSoapClient.java index 904afc37..444bd4e7 100644 --- a/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/clients/zmr/ZmrSoapClient.java +++ b/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/clients/zmr/ZmrSoapClient.java @@ -3,6 +3,7 @@ package at.asitplus.eidas.specific.modules.auth.eidas.v2.clients.zmr; import java.math.BigInteger; import java.net.URL; import java.text.MessageFormat; +import java.time.LocalDateTime; import java.util.Arrays; import java.util.Collection; import java.util.Collections; @@ -33,6 +34,7 @@ import at.asitplus.eidas.specific.modules.auth.eidas.v2.exception.ZmrCommunicati import at.asitplus.eidas.specific.modules.auth.eidas.v2.utils.VersionHolder; import at.asitplus.eidas.specific.modules.core.eidas.EidasConstants; import at.gv.bmi.namespace.zmr_su.base._20040201.ClientInfoType; +import at.gv.bmi.namespace.zmr_su.base._20040201.EntityErgebnisReferenzType; import at.gv.bmi.namespace.zmr_su.base._20040201.Organisation; import at.gv.bmi.namespace.zmr_su.base._20040201.RequestType; import at.gv.bmi.namespace.zmr_su.base._20040201.ResponseType; @@ -78,6 +80,7 @@ public class ZmrSoapClient extends AbstractSoapClient implements IZmrClient { private static final String ERROR_MATCHING_01 = "module.eidasauth.matching.01"; private static final String ERROR_MATCHING_02 = "module.eidasauth.matching.02"; + private static final String ERROR_MATCHING_04 = "module.eidasauth.matching.04"; private static final String ERROR_MATCHING_99 = "module.eidasauth.matching.99"; private static final String LOGMSG_MISSING_CONFIG = "Missing configuration with key: {0}"; @@ -556,29 +559,84 @@ public class ZmrSoapClient extends AbstractSoapClient implements IZmrClient { "Find more-than-one ZMR entry with search criteria that has to be unique", true); } else { - return Arrays.asList(processPersonResult(personErgebnisSatz.get(0), citizenCountryCode)); + RegisterResult activeResult = processPersonResult(personErgebnisSatz.get(0), citizenCountryCode); + if (activeResult == null) { + log.error("ZMR entry, which was selected by matching, looks already closed. " + + "Automated operations on closed entries not supported my matching"); + throw new WorkflowException(processStepFiendlyname, + "ZMR entry, which was selected by matching, is not active any more.", true); + + } + return Arrays.asList(activeResult); } } - @Nonnull + /** + * Process a single Person data-set from ZMR. + * + * @param personEl Person data-set from ZMR + * @param citizenCountryCode Country-Code of the citizen + * @return Simplified register result, or null if the person data-set is not active anymore + * @throws EaafAuthenticationException In case of a validation error + */ + @Nullable private RegisterResult processPersonResult( @Nonnull PersonErgebnisSatzType personEl, @Nonnull String citizenCountryCode) + throws EaafAuthenticationException { + PersonErgebnisType latestPersonResult = extractLatestPersonResult(personEl); + + // check if person was not closed already + if (checkIfPersonIsActive(latestPersonResult)) { + return mapZmrResponseToRegisterResult(latestPersonResult, citizenCountryCode); + + } else { + log.debug("Entity is not valid anymore. Skip it ... "); + return null; + + } + } + + @Nonnull + private PersonErgebnisType extractLatestPersonResult(PersonErgebnisSatzType personEl) throws EaafAuthenticationException { // TODO: maybe check on 'null' if ERnP data is also allowed - log.debug("Find #{} data sets in person information", - personEl.getPersonendaten().getPersonErgebnis().size()); - - if (personEl.getPersonendaten().getPersonErgebnis().size() > 1) { - log.error("Find more than on PersoenErgebnis in Personendaten."); + log.debug("Find #{} data sets in person information", personEl.getPersonendaten().getPersonErgebnis().size()); + if (personEl.getPersonendaten().getPersonErgebnis().size() == 0) { + log.error("Find no PersoenErgebnis in Personendaten from ZMR."); + throw new EaafAuthenticationException(ERROR_MATCHING_04, null); + + } else if (personEl.getPersonendaten().getPersonErgebnis().size() > 1) { + log.error("Find more than on PersoenErgebnis in Personendaten from ZMR."); + //TODO: select latest entry in case of historic information throw new EaafAuthenticationException(ERROR_MATCHING_02, null); + } else { + return personEl.getPersonendaten().getPersonErgebnis().get(0); + + } + } + + private boolean checkIfPersonIsActive(PersonErgebnisType latestPersonResult) { + EntityErgebnisReferenzType entityRef = latestPersonResult.getEntityErgebnisReferenz(); + if (entityRef.getBis() != null) { + LocalDateTime validTo = entityRef.getBis().toGregorianCalendar().toZonedDateTime().toLocalDateTime(); + LocalDateTime now = LocalDateTime.now(); + if (validTo.isBefore(now)) { + log.warn("Enity was valid to: {}, but now its: {}. Ignore that entry", validTo, now); + return false; + + } else { + log.debug("Entity has a 'validTo' element, but it is in the future."); + + } + } else { - return mapZmrResponseToRegisterResult( - personEl.getPersonendaten().getPersonErgebnis().get(0), citizenCountryCode); - + log.trace("Entity has no 'validTo' element. Therefore it should be valid"); + } - + + return true; } @Nonnull diff --git a/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/handler/AbstractEidProcessor.java b/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/handler/AbstractEidProcessor.java index 8716f80d..61d5ded2 100644 --- a/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/handler/AbstractEidProcessor.java +++ b/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/handler/AbstractEidProcessor.java @@ -253,7 +253,7 @@ public abstract class AbstractEidProcessor implements INationalEidProcessor { } } else { - log.debug("Map " + spConfig.getAreaSpecificTargetIdentifier() + " to 'PrivateSector'"); + log.debug("Map {} to 'PrivateSector'", spConfig.getAreaSpecificTargetIdentifier()); authnRequestBuilder.spType(SpType.PRIVATE.getValue()); // TODO: switch to RequesterId in further version diff --git a/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/clients/ErnpRestClientProductionTest.java b/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/clients/ErnpRestClientProductionTest.java index 59cf4520..b834eb23 100644 --- a/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/clients/ErnpRestClientProductionTest.java +++ b/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/clients/ErnpRestClientProductionTest.java @@ -436,6 +436,74 @@ public class ErnpRestClientProductionTest { checkErnpResult(resp.getPersonResult().get(0), eidasDataFirst, 1); } + + @Test + @SneakyThrows + public void personWasWrongClosedByGovernment() { + final String personalIdentifierFirst = "eidasmatcherclosed19770707_01"; + final String cc = "XZ"; + final SimpleEidasData eidasDataFirst = SimpleEidasData.builder() + .citizenCountryCode(cc) + .familyName("EidasMatcher") + .givenName("Closed") + .dateOfBirth("1977-07-07") + .personalIdentifier(cc + "/AT/" + personalIdentifierFirst) + .pseudonym(personalIdentifierFirst) + .build(); + + // search with personalId + ErnpRegisterResult resp = client.searchWithPersonIdentifier(personalIdentifierFirst, cc); + + // validate state + assertNotNull("no ERnP response", resp); + assertEquals("wrong resp size", 1, resp.getPersonResult().size()); + //checkErnpResult(resp.getPersonResult().get(0), eidasDataFirst, 1); + + + // start update process + ErnpRegisterResult update = client.update(resp.getPersonResult().get(0), eidasDataFirst); + + // validate state + assertNotNull("no ERnP response", update); + assertEquals("wrong resp size", 1, update.getPersonResult().size()); + checkErnpResult(update.getPersonResult().get(0), eidasDataFirst, 1); + + } + + + @Test + @SneakyThrows + public void personWasClosedByGovernment() { + final String personalIdentifierFirst = "eidasmatcherclosed19740404_01"; + final String cc = "XZ"; + final SimpleEidasData eidasDataFirst = SimpleEidasData.builder() + .citizenCountryCode(cc) + .familyName("EidasMatcher") + .givenName("Closed") + .dateOfBirth("1974-04-04") + .personalIdentifier(cc + "/AT/" + personalIdentifierFirst) + .pseudonym(personalIdentifierFirst) + .build(); + + // search with personalId + ErnpRegisterResult respPersonal = client.searchWithPersonIdentifier(personalIdentifierFirst, cc); + + // search with mds + ErnpRegisterResult respMds = client.searchWithMds(eidasDataFirst.getGivenName(), + eidasDataFirst.getFamilyName(), eidasDataFirst.getDateOfBirth(), cc); + + + // validate state + assertNotNull("no ERnP response", respPersonal); + assertEquals("wrong resp size", 1, respPersonal.getPersonResult().size()); + //checkErnpResult(resp.getPersonResult().get(0), eidasDataFirst, 1); + + + assertNotNull("no ERnP response", respMds); + assertEquals("wrong resp size", 1, respMds.getPersonResult().size()); + + } + @Test @SneakyThrows diff --git a/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/clients/ErnpRestClientTest.java b/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/clients/ErnpRestClientTest.java index a9e10de6..9404b5a5 100644 --- a/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/clients/ErnpRestClientTest.java +++ b/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/clients/ErnpRestClientTest.java @@ -294,6 +294,31 @@ public class ErnpRestClientTest { } + @Test + @SneakyThrows + public void searchWithMdsMultiResultAndClosedEntry() { + final String cc = "CZ"; + final SimpleEidasData eidasDataFirst = generateRandomEidasData(cc); + + // set ERnP response + mockWebServer.enqueue(new MockResponse().setResponseCode(200) + .setBody(IOUtils.toString( + ErnpRestClientTest.class.getResourceAsStream("/data/ernp/5_search_with_mds_multi_with_closed_resp.json"), + "UTF-8")) + .setHeader("Content-Type", "application/json;charset=utf-8")); + + // execute operation + ErnpRegisterResult resp = client.searchWithMds(eidasDataFirst.getGivenName(), eidasDataFirst.getFamilyName(), eidasDataFirst.getDateOfBirth(), cc); + + // validate state + mockWebServer.takeRequest(); + assertNotNull("no ERnP response", resp); + assertEquals("wrong resp size", 2, resp.getPersonResult().size()); + + } + + + @Test @SneakyThrows public void searchWithPersonalIdNoResponse() { @@ -364,6 +389,52 @@ public class ErnpRestClientTest { } + @Test + @SneakyThrows + public void searchWithPersonalIdGetClosedEntry() { + final String cc = "XZ"; + final SimpleEidasData eidasDataFirst = generateRandomEidasData(cc); + + // set ERnP response + mockWebServer.enqueue(new MockResponse().setResponseCode(200) + .setBody(IOUtils.toString( + ErnpRestClientTest.class.getResourceAsStream( + "/data/ernp/1_search_with_personalId_closed_entry_resp.json"), + "UTF-8")) + .setHeader("Content-Type", "application/json;charset=utf-8")); + + // execute operation + EidasSAuthenticationException error = assertThrows("wrong Exception", EidasSAuthenticationException.class, + () -> client.searchWithPersonIdentifier(eidasDataFirst.getPseudonym(), cc)); + assertEquals("wrong errorCode", "module.eidasauth.matching.03", error.getErrorId()); + mockWebServer.takeRequest(); + + } + + @Test + @SneakyThrows + public void searchWithPersonalIdNotYetClosed() { + final String cc = "DE"; + final SimpleEidasData eidasDataFirst = generateRandomEidasData(cc); + + // set ERnP response + mockWebServer.enqueue(new MockResponse().setResponseCode(200) + .setBody(IOUtils.toString( + ErnpRestClientTest.class.getResourceAsStream( + "/data/ernp/1_search_with_personalId_not_yet_closed_entry_resp.json"), + "UTF-8")) + .setHeader("Content-Type", "application/json;charset=utf-8")); + + // execute operation + ErnpRegisterResult resp = client.searchWithPersonIdentifier(eidasDataFirst.getPseudonym(), cc); + + // validate state + mockWebServer.takeRequest(); + assertNotNull("no ERnP response", resp); + assertEquals("wrong resp size", 1, resp.getPersonResult().size()); + + } + @Test @SneakyThrows public void searchWithPersonalIdSingleResult() { diff --git a/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/clients/ZmrClientProductionTest.java b/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/clients/ZmrClientProductionTest.java index af1867e7..0e45cb61 100644 --- a/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/clients/ZmrClientProductionTest.java +++ b/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/clients/ZmrClientProductionTest.java @@ -21,6 +21,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import at.asitplus.eidas.specific.modules.auth.eidas.v2.clients.zmr.ZmrSoapClient; import at.asitplus.eidas.specific.modules.auth.eidas.v2.clients.zmr.ZmrSoapClient.ZmrRegisterResult; +import at.asitplus.eidas.specific.modules.auth.eidas.v2.controller.AdresssucheController.AdresssucheOutput; import at.asitplus.eidas.specific.modules.auth.eidas.v2.dao.SimpleEidasData; import at.asitplus.eidas.specific.modules.auth.eidas.v2.exception.EidasSAuthenticationException; import at.asitplus.eidas.specific.modules.auth.eidas.v2.utils.LoggingHandler; @@ -63,7 +64,44 @@ public class ZmrClientProductionTest { } + @Test + public void searchWithMdsOnlyEidasData() throws EidasSAuthenticationException { + + final ZmrRegisterResult result = client.searchWithMds(null, + "Ingun", "Walch", "1972-12-11", + "IT"); + + assertNotNull("ZMR response", result); + assertNotNull("ZMR processId", result.getProcessId()); + assertNotNull("ZMR personResult", result.getPersonResult()); + assertEquals("personResult size", 1, result.getPersonResult().size()); + + } + @Ignore + @Test + public void searchWithRecidenceEidasData() throws EidasSAuthenticationException { + + AdresssucheOutput addressData = AdresssucheOutput.builder() +// .postleitzahl("1200") +// .street("Wallensteinstraße") +// .number("52") + .postleitzahl("1200") + .street("Wallensteinstraße") + .number("52") + .build(); + + final ZmrRegisterResult result = client.searchWithResidenceData( + null, "Ingun", "Walch", "1972-12-11", "IT", addressData); + + assertNotNull("ZMR response", result); + assertNotNull("ZMR processId", result.getProcessId()); + assertNotNull("ZMR personResult", result.getPersonResult()); + assertEquals("personResult size", 1, result.getPersonResult().size()); + + } + + @Test public void searchWithMdsOnly() throws EidasSAuthenticationException { @@ -78,6 +116,22 @@ public class ZmrClientProductionTest { } + //@Ignore + @Test + public void searchWithPersonalIdentifier() throws EidasSAuthenticationException { + + final ZmrRegisterResult result = client.searchWithPersonIdentifier( + null, "7cEYSvKZvon+V4CDVzNT4E7cjkU4Vq", "EE"); + + assertNotNull("ZMR response", result); + assertNotNull("ZMR processId", result.getProcessId()); + assertNotNull("ZMR personResult", result.getPersonResult()); + assertEquals("personResult size", 1, result.getPersonResult().size()); + + } + + + @Test public void searchWithMdsOnlyTestIdentity() throws EidasSAuthenticationException { diff --git a/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/clients/ZmrClientTest.java b/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/clients/ZmrClientTest.java index ef9cc9b7..1f0ddb02 100644 --- a/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/clients/ZmrClientTest.java +++ b/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/clients/ZmrClientTest.java @@ -235,6 +235,70 @@ public class ZmrClientTest { } + @Test + @SneakyThrows + public void searchWithMdsWithClosedEntity() { + String familyName = RandomStringUtils.randomAlphabetic(10); + String givenName = RandomStringUtils.randomAlphabetic(10); + String dateOfBirth = RandomStringUtils.randomAlphabetic(10); + final String cc = "EE"; + + BigInteger processId = new BigInteger(RandomStringUtils.randomNumeric(6)); + + final ArgumentCaptor zmrReq = ArgumentCaptor.forClass(RequestType.class); + + // inject response + when(zmrMock.service(zmrReq.capture(), any())).thenReturn( + loadResponseFromFile("/data/zmr/search_with_personalId_only_resp_moreThanOne_closed_entity.xml")); + + // execute operation + ZmrRegisterResult resp = client.searchWithMds(processId, + givenName, familyName, dateOfBirth, cc); + + // validate state + assertNotNull("no ZMR response", resp); + assertEquals("wrong processId", "367100000000080", resp.getProcessId().toString()); + assertEquals("wrong resp size", 2, resp.getPersonResult().size()); + + // check first person + RegisterResult persInfo = resp.getPersonResult().get(0); + assertEquals("bPK", "9/MtsPZgBHQMBpQOD6aOY2TUqcY=", persInfo.getBpk()); + assertEquals("dateOfBirth", "1983-06-04", persInfo.getDateOfBirth()); + assertEquals("familyName", "XXXTüzekçi", persInfo.getFamilyName()); + assertEquals("givenName", "XXXŐzgür", persInfo.getGivenName()); + assertNull("placeOfBirth", persInfo.getPlaceOfBirth()); + assertNull("birthName", persInfo.getBirthName()); + assertEquals("num. stored eIDAS identifiers", 1, persInfo.getPseudonym().size()); + assertEquals("stored eIDAS identifiers", + "aabbcc_should_not_be_included_for_DE", persInfo.getPseudonym().get(0)); + + // check second person + RegisterResult persInfo2 = resp.getPersonResult().get(1); + assertEquals("bPK", "UgeknNsc26lVuB7U/uYGVmWtnnA=", persInfo2.getBpk()); + assertEquals("dateOfBirth", "1983-06-04", persInfo2.getDateOfBirth()); + assertEquals("familyName", "XXXTüzekçi", persInfo2.getFamilyName()); + assertEquals("givenName", "XXXŐzgür", persInfo2.getGivenName()); + assertEquals("num. stored eIDAS identifiers", 1, persInfo2.getPseudonym().size()); + assertEquals("stored eIDAS identifiers", + "7cEYSvKZasdfsafsaf4CDVzNT4E7cjkU4Vq_first", persInfo2.getPseudonym().get(0)); + + // validate request + assertEquals("wrong number of req.", 1, zmrReq.getAllValues().size()); + assertNotNull("Personensuche req.", zmrReq.getValue().getPersonSuchenRequest()); + checkBasicRequestParameters(zmrReq.getValue(), PROCESS_TASK_SEARCH, processId, "jUnit123456"); + PersonSuchenRequest pSuche = zmrReq.getValue().getPersonSuchenRequest(); + checkSearchParameters(pSuche.getPersonensucheInfo()); + + assertEquals("eidas Docs. size", 0, pSuche.getEidasSuchdaten().size()); + assertNotNull("mds", pSuche.getNatuerlichePerson()); + + assertEquals("req. givenName", givenName, pSuche.getNatuerlichePerson().getPersonenName().getVorname()); + assertEquals("req. familyName", familyName, pSuche.getNatuerlichePerson().getPersonenName().getFamilienname()); + assertEquals("req. dateOfBirth", dateOfBirth, pSuche.getNatuerlichePerson().getGeburtsdatum()); + + } + + //TODO: test does not throw the valid exception to catch the error that we like to test. @Ignore @Test @@ -348,6 +412,58 @@ public class ZmrClientTest { } + @Test + @SneakyThrows + public void searchWithPersonalIdentifierClosedEntry() { + final String personalIdentifierFirst = "7cEYWithDEElementsasdfsafsaf4CDVzNT4E7cjkU4VqForjUnit"; + final String cc = "DE"; + + final ArgumentCaptor zmrReq = ArgumentCaptor.forClass(RequestType.class); + + // inject response + when(zmrMock.service(zmrReq.capture(), any())).thenReturn( + loadResponseFromFile("/data/zmr/search_with_personalId_only_resp_closed_entry.xml")); + + // execute operation + EidasSAuthenticationException error = assertThrows("wrong Exception", EidasSAuthenticationException.class, + () -> client.searchWithPersonIdentifier(null, personalIdentifierFirst, cc)); + + assertEquals("wrong errorCode", "module.eidasauth.matching.03", error.getErrorId()); + + } + + @Test + @SneakyThrows + public void searchWithPersonalIdentifierNotYetClosed() { + final String personalIdentifierFirst = "7cEYWithDEElementsasdfsafsaf4CDVzNT4E7cjkU4VqForjUnit"; + final String cc = "DE"; + final SimpleEidasData eidasDataFirst = SimpleEidasData.builder() + .citizenCountryCode(cc) + .familyName("XXXvon Brandenburg") + .givenName("XXXClaus - Maria") + .dateOfBirth("1994-12-31") + .personalIdentifier(cc + "/AT/" + personalIdentifierFirst) + .pseudonym(personalIdentifierFirst) + .build(); + + BigInteger processId = new BigInteger(RandomStringUtils.randomNumeric(6)); + + final ArgumentCaptor zmrReq = ArgumentCaptor.forClass(RequestType.class); + + // inject response + when(zmrMock.service(zmrReq.capture(), any())).thenReturn( + loadResponseFromFile("/data/zmr/search_with_personalId_only_resp_closed_entry_future.xml")); + + // execute operation + ZmrRegisterResult resp = client.searchWithPersonIdentifier(processId, + eidasDataFirst.getPseudonym(), eidasDataFirst.getCitizenCountryCode()); + + // validate state + assertNotNull("no ZMR response", resp); + assertEquals("wrong resp size", 1, resp.getPersonResult().size()); + + } + @Test @SneakyThrows public void searchWithPersonalIdentifierSuccess() { @@ -765,6 +881,48 @@ public class ZmrClientTest { } + @Test + @SneakyThrows + public void searchResidenceSuccessButClosedEntity() { + final String personalIdentifierFirst = "7cEYWithDEElementsasdfsafsaf4CDVzNT4E7cjkU4VqForjUnit"; + final String cc = "DE"; + final SimpleEidasData eidasDataFirst = SimpleEidasData.builder() + .citizenCountryCode(cc) + .familyName("XXXvon Brandenburg") + .givenName("XXXClaus - Maria") + .dateOfBirth("1994-12-31") + .personalIdentifier(cc + "/AT/" + personalIdentifierFirst) + .pseudonym(personalIdentifierFirst) + .build(); + + BigInteger processId = new BigInteger(RandomStringUtils.randomNumeric(6)); + + String familyName = RandomStringUtils.randomAlphabetic(10); + String givenName = RandomStringUtils.randomAlphabetic(10); + String dateOfBirth = RandomStringUtils.randomAlphabetic(10); + AdresssucheOutput addressInfo = AdresssucheOutput.builder() + .municipality(RandomStringUtils.randomAlphabetic(10)) + .postleitzahl(RandomStringUtils.randomAlphabetic(10)) + .build(); + + final ArgumentCaptor zmrReq = ArgumentCaptor.forClass(RequestType.class); + + // inject response + when(zmrMock.service(zmrReq.capture(), any())).thenReturn( + loadResponseFromFile("/data/zmr/search_with_personalId_only_resp_closed_entry.xml")); + + // execute operation + ZmrRegisterResult resp = client.searchWithResidenceData(processId, + givenName, familyName, dateOfBirth, cc, addressInfo); + + // validate state + assertNotNull("no ZMR response", resp); + assertEquals("wrong processId", "367100000000079", resp.getProcessId().toString()); + + // we get zero results because address is found but entity was closed + assertEquals("wrong resp size", 0, resp.getPersonResult().size()); + + } @Test @SneakyThrows diff --git a/modules/authmodule-eIDAS-v2/src/test/resources/data/ernp/1_search_with_personalId_closed_entry_resp.json b/modules/authmodule-eIDAS-v2/src/test/resources/data/ernp/1_search_with_personalId_closed_entry_resp.json new file mode 100644 index 00000000..c2f2d612 --- /dev/null +++ b/modules/authmodule-eIDAS-v2/src/test/resources/data/ernp/1_search_with_personalId_closed_entry_resp.json @@ -0,0 +1,44 @@ +{ + "person": [ + { + "type": "Person", + "eidas": [ + { + "ablaufDatum": "9999-12-31T00:00:00.000+01:00", + "art": "http://eidas.europa.eu/attributes/naturalperson/PersonIdentifier", + "ausstellDatum": "9999-12-31T00:00:00.000+01:00", + "entityId": "47769100000077607", + "gueltigAb": "2022-10-06T08:01:18.117+02:00", + "gueltigBis": "2022-10-06T08:01:18.117+02:00", + "staatscode2": "XZ", + "wert": "eidasmatcherclosed19740404_01" + } + ], + "entityId": "47769100000077596", + "gueltigAb": "2022-10-06T08:01:18.117+02:00", + "gueltigBis": "2022-10-06T08:01:18.117+02:00", + "letzteOperation": { + "begruendung": "EIDAS Integrationstest", + "grund": "Person amtlich beenden", + "vorgang": "PersonAmtlichBeenden", + "zeitpunkt": "2022-10-06T08:01:18.117+02:00" + }, + "personendaten": { + "basiszahl": "000862899079", + "bpkZp": "mhnWeYYC8KfRY/MaYKdUDkzwD2w=", + "entityId": "47769100000077596", + "familienname": "EidasMatcher", + "geburtsdatum": { + "jahr": 1974, + "monat": 4, + "tag": 4 + }, + "geprueft": false, + "gueltigAb": "2022-10-06T08:01:18.117+02:00", + "gueltigBis": "2022-10-06T08:01:18.117+02:00", + "vorname": "Closed" + }, + "version": "2022-10-06T08:01:18.117+02:00" + } + ] +} \ No newline at end of file diff --git a/modules/authmodule-eIDAS-v2/src/test/resources/data/ernp/1_search_with_personalId_not_yet_closed_entry_resp.json b/modules/authmodule-eIDAS-v2/src/test/resources/data/ernp/1_search_with_personalId_not_yet_closed_entry_resp.json new file mode 100644 index 00000000..fa58d048 --- /dev/null +++ b/modules/authmodule-eIDAS-v2/src/test/resources/data/ernp/1_search_with_personalId_not_yet_closed_entry_resp.json @@ -0,0 +1,44 @@ +{ + "person": [ + { + "type": "Person", + "eidas": [ + { + "ablaufDatum": "9999-12-31T00:00:00.000+01:00", + "art": "http://eidas.europa.eu/attributes/naturalperson/PersonIdentifier", + "ausstellDatum": "9999-12-31T00:00:00.000+01:00", + "entityId": "47769100000077607", + "gueltigAb": "2022-10-06T08:01:18.117+02:00", + "gueltigBis": "2022-10-06T08:01:18.117+02:00", + "staatscode2": "XZ", + "wert": "eidasmatcherclosed19740404_01" + } + ], + "entityId": "47769100000077596", + "gueltigAb": "2022-10-06T08:01:18.117+02:00", + "gueltigBis": "2045-10-06T08:01:18.117+02:00", + "letzteOperation": { + "begruendung": "EIDAS Integrationstest", + "grund": "Person amtlich beenden", + "vorgang": "PersonAmtlichBeenden", + "zeitpunkt": "2022-10-06T08:01:18.117+02:00" + }, + "personendaten": { + "basiszahl": "000862899079", + "bpkZp": "mhnWeYYC8KfRY/MaYKdUDkzwD2w=", + "entityId": "47769100000077596", + "familienname": "EidasMatcher", + "geburtsdatum": { + "jahr": 1974, + "monat": 4, + "tag": 4 + }, + "geprueft": false, + "gueltigAb": "2022-10-06T08:01:18.117+02:00", + "gueltigBis": "2022-10-06T08:01:18.117+02:00", + "vorname": "Closed" + }, + "version": "2022-10-06T08:01:18.117+02:00" + } + ] +} \ No newline at end of file diff --git a/modules/authmodule-eIDAS-v2/src/test/resources/data/ernp/5_search_with_mds_multi_with_closed_resp.json b/modules/authmodule-eIDAS-v2/src/test/resources/data/ernp/5_search_with_mds_multi_with_closed_resp.json new file mode 100644 index 00000000..7bf58798 --- /dev/null +++ b/modules/authmodule-eIDAS-v2/src/test/resources/data/ernp/5_search_with_mds_multi_with_closed_resp.json @@ -0,0 +1,124 @@ +{ + "person": [ + { + "type": "Person", + "eidas": [ + { + "ablaufDatum": "9999-12-31T00:00:00.000+01:00", + "art": "http://eidas.europa.eu/attributes/naturalperson/PersonIdentifier", + "ausstellDatum": "9999-12-31T00:00:00.000+01:00", + "entityId": "1933000000000653", + "gueltigAb": "2022-03-03T11:27:57.651+01:00", + "staatscode2": "XZ", + "wert": "ybgLmbYGxU" + } + ], + "entityId": "1933000000000642", + "gueltigAb": "2022-03-03T11:27:57.651+01:00", + "letzteOperation": { + "begruendung": "Add new person", + "durchgefuehrtVon": { + "behoerdenkennzeichen": "380630", + "benutzer": "eidtapp@bmi.gv.at" + }, + "vorgang": "PersonAnlegen", + "zeitpunkt": "2022-03-03T11:27:57.651+01:00" + }, + "personendaten": { + "basiszahl": "000693812023", + "bpkZp": "QJ/5YLEbOCfRhG5R0KKHNnmeMYo=", + "entityId": "1933000000000642", + "familienname": "HjecFKGu", + "geburtsdatum": { + "jahr": 1996, + "monat": 1, + "tag": 1 + }, + "geprueft": false, + "gueltigAb": "2022-03-03T11:27:57.651+01:00", + "vorname": "QwnAMXsJ" + }, + "version": "2022-03-03T11:27:57.651+01:00" + }, + { + "type": "Person", + "eidas": [ + { + "ablaufDatum": "9999-12-31T00:00:00.000+01:00", + "art": "http://eidas.europa.eu/attributes/naturalperson/PersonIdentifier", + "ausstellDatum": "9999-12-31T00:00:00.000+01:00", + "entityId": "47769100000077607", + "gueltigAb": "2022-10-06T08:01:18.117+02:00", + "gueltigBis": "2022-10-06T08:01:18.117+02:00", + "staatscode2": "XZ", + "wert": "eidasmatcherclosed19740404_01" + } + ], + "entityId": "47769100000077596", + "gueltigAb": "2022-10-06T08:01:18.117+02:00", + "gueltigBis": "2022-10-06T08:01:18.117+02:00", + "letzteOperation": { + "begruendung": "EIDAS Integrationstest", + "grund": "Person amtlich beenden", + "vorgang": "PersonAmtlichBeenden", + "zeitpunkt": "2022-10-06T08:01:18.117+02:00" + }, + "personendaten": { + "basiszahl": "000862899079", + "bpkZp": "mhnWeYYC8KfRY/MaYKdUDkzwD2w=", + "entityId": "47769100000077596", + "familienname": "EidasMatcher", + "geburtsdatum": { + "jahr": 1974, + "monat": 4, + "tag": 4 + }, + "geprueft": false, + "gueltigAb": "2022-10-06T08:01:18.117+02:00", + "gueltigBis": "2022-10-06T08:01:18.117+02:00", + "vorname": "Closed" + }, + "version": "2022-10-06T08:01:18.117+02:00" + }, + { + "type": "Person", + "eidas": [ + { + "ablaufDatum": "9999-12-31T00:00:00.000+01:00", + "art": "http://eidas.europa.eu/attributes/naturalperson/PersonIdentifier", + "ausstellDatum": "9999-12-31T00:00:00.000+01:00", + "entityId": "1933100000000762", + "gueltigAb": "2022-03-03T11:27:57.885+01:00", + "staatscode2": "XZ", + "wert": "rEhBYWgiSx" + } + ], + "entityId": "1933100000000751", + "gueltigAb": "2022-03-03T11:27:57.885+01:00", + "letzteOperation": { + "begruendung": "Add new person", + "durchgefuehrtVon": { + "behoerdenkennzeichen": "380630", + "benutzer": "eidtapp@bmi.gv.at" + }, + "vorgang": "PersonAnlegen", + "zeitpunkt": "2022-03-03T11:27:57.885+01:00" + }, + "personendaten": { + "basiszahl": "000803465934", + "bpkZp": "ZaJ2Yvx0u/z8VqNyCJ8zKT8XQa0=", + "entityId": "1933100000000751", + "familienname": "HjecFKGu", + "geburtsdatum": { + "jahr": 1996, + "monat": 1, + "tag": 1 + }, + "geprueft": false, + "gueltigAb": "2022-03-03T11:27:57.885+01:00", + "vorname": "QwnAMXsJ" + }, + "version": "2022-03-03T11:27:57.885+01:00" + } + ] +} diff --git a/modules/authmodule-eIDAS-v2/src/test/resources/data/zmr/search_with_personalId_only_resp_closed_entry.xml b/modules/authmodule-eIDAS-v2/src/test/resources/data/zmr/search_with_personalId_only_resp_closed_entry.xml new file mode 100644 index 00000000..0a9b9d32 --- /dev/null +++ b/modules/authmodule-eIDAS-v2/src/test/resources/data/zmr/search_with_personalId_only_resp_closed_entry.xml @@ -0,0 +1,291 @@ + + + + GP_EIDAS + 367100000000079 + 0 + + + ZMR-Server Version: 5.9.0.0-SNAPSHOT + 2021-11-12T08:24:40.985 + 1877300000000139 + + + + + Searching PersonIdentifier + + true + false + + + false + + 10 + + + + + 5020 + Person gefunden. + + + 1 + 0 + 0 + 1 + + + + + 2021-11-12T08:24:39.695 + + + + 44453600000000697 + 2020-02-05T13:07:06.311 + + 2020-02-05T13:07:06.311 + SONSTIGES + Sonstiges + Testerperson + 2020-02-05T13:07:06.311 + + + 109091 + + + + 000430320173 + + + UgeknNsc26lVuB7U/uYGVmWtnnA= + urn:publicid:gv.at:cdid+ZP + + + XXXClaus - Maria + XXXvon Brandenburg + + unbekannt + männlich + 1994-12-31 + Wien + Wien + Österreich + + AUT + Österreich + + + 44453600000000727 + 2020-02-05T13:07:06.311 + + 2020-02-05T13:07:06.311 + STAATSANGEH_ANLEGEN + Staatsangehörigkeit anlegen + Testerperson + + + 109091 + + + + + + + + + 1879000000000001 + 2021-11-12T08:24:39.695 + + 2021-11-12T08:24:39.695 + EIDAS_ANLEGEN + KITT for eIDAS Matching + + + 101179 + + eidtapp@bmi.gv.at + + + http://eidas.europa.eu/attributes/naturalperson/BirthName + DE + + XXXvon Heuburg + 9999-12-31 + 9999-12-31 + + + + + 1879000000000003 + 2021-11-12T08:24:39.695 + + 2021-11-12T08:24:39.695 + EIDAS_ANLEGEN + KITT for eIDAS Matching + + + 101179 + + eidtapp@bmi.gv.at + + + http://eidas.europa.eu/attributes/naturalperson/PlaceOfBirth + DE + + Hintergigritzpotschn + 9999-12-31 + 9999-12-31 + + + + + 1879000000000005 + 2021-11-12T08:24:39.695 + + 2021-11-12T08:24:39.695 + EIDAS_ANLEGEN + KITT for eIDAS Matching + + + 101179 + + eidtapp@bmi.gv.at + + + http://eidas.europa.eu/attributes/naturalperson/PersonIdentifier + DE + + 7cEYWithDEElementsasdfsafsaf4CDVzNT4E7cjkU4VqForjUnit + 9999-12-31 + 9999-12-31 + + + + + 1879000000000005 + 2021-11-12T08:24:39.695 + + 2021-11-12T08:24:39.695 + EIDAS_ANLEGEN + KITT for eIDAS Matching + + + 101179 + + eidtapp@bmi.gv.at + + + http://eidas.europa.eu/attributes/naturalperson/PersonIdentifier + EE + + aabbcc_should_not_be_included_for_DE + 9999-12-31 + 9999-12-31 + + + + + 1879000000000005 + 2021-11-12T08:24:39.695 + + 2021-11-12T08:24:39.695 + EIDAS_ANLEGEN + KITT for eIDAS Matching + + + 101179 + + eidtapp@bmi.gv.at + + + http://eidas.europa.eu/attributes/naturalperson/PersonIdentifier + DE + + 7cEYWithDEElementsasdfsafsaf4CDVzNT4E7cjkU4VqForjUnit_second_one + 9999-12-31 + 9999-12-31 + + + + + + + 2020-02-05T13:07:06.311 + + + + 44453500000005242 + 2020-02-05T13:07:06.311 + + 2020-02-05T13:07:06.311 + WSANM + Wohnsitz anmelden + + + 109091 + + + + + + 0088 + Testgemeinde + 09988 + Testort A + + Testgasse + 1a-2b + Stg. 3c-4d + 5 + H + false + 0001 + + T800001 + 001 + T800001 + + + + HST111WWW + + T8001 + T80001 + T80000000001 + T80000000002 + + H + Testpostort + + 2020-02-05T13:07:06.311 + WSANM + Wohnsitz anmelden + + + + 44453500000005262 + 2020-02-05T13:07:06.311 + + 2020-02-05T13:07:06.311 + AUSK_SPERRE_SETZ + Auskunftssperre setzen + + + 109091 + + + + 2020-02-05T13:07:06.311 + 9999-12-31T23:59:59.000 + ASMG + Auskunftssperre nach § 18 / 2ff MeldeG + automatische Auskunftssperre + + + + + + + diff --git a/modules/authmodule-eIDAS-v2/src/test/resources/data/zmr/search_with_personalId_only_resp_closed_entry_future.xml b/modules/authmodule-eIDAS-v2/src/test/resources/data/zmr/search_with_personalId_only_resp_closed_entry_future.xml new file mode 100644 index 00000000..b95b967e --- /dev/null +++ b/modules/authmodule-eIDAS-v2/src/test/resources/data/zmr/search_with_personalId_only_resp_closed_entry_future.xml @@ -0,0 +1,291 @@ + + + + GP_EIDAS + 367100000000079 + 0 + + + ZMR-Server Version: 5.9.0.0-SNAPSHOT + 2021-11-12T08:24:40.985 + 1877300000000139 + + + + + Searching PersonIdentifier + + true + false + + + false + + 10 + + + + + 5020 + Person gefunden. + + + 1 + 0 + 0 + 1 + + + + + 2021-11-12T08:24:39.695 + + + + 44453600000000697 + 2020-02-05T13:07:06.311 + + 2020-02-05T13:07:06.311 + SONSTIGES + Sonstiges + Testerperson + 2046-02-05T13:07:06.311 + + + 109091 + + + + 000430320173 + + + UgeknNsc26lVuB7U/uYGVmWtnnA= + urn:publicid:gv.at:cdid+ZP + + + XXXClaus - Maria + XXXvon Brandenburg + + unbekannt + männlich + 1994-12-31 + Wien + Wien + Österreich + + AUT + Österreich + + + 44453600000000727 + 2020-02-05T13:07:06.311 + + 2020-02-05T13:07:06.311 + STAATSANGEH_ANLEGEN + Staatsangehörigkeit anlegen + Testerperson + + + 109091 + + + + + + + + + 1879000000000001 + 2021-11-12T08:24:39.695 + + 2021-11-12T08:24:39.695 + EIDAS_ANLEGEN + KITT for eIDAS Matching + + + 101179 + + eidtapp@bmi.gv.at + + + http://eidas.europa.eu/attributes/naturalperson/BirthName + DE + + XXXvon Heuburg + 9999-12-31 + 9999-12-31 + + + + + 1879000000000003 + 2021-11-12T08:24:39.695 + + 2021-11-12T08:24:39.695 + EIDAS_ANLEGEN + KITT for eIDAS Matching + + + 101179 + + eidtapp@bmi.gv.at + + + http://eidas.europa.eu/attributes/naturalperson/PlaceOfBirth + DE + + Hintergigritzpotschn + 9999-12-31 + 9999-12-31 + + + + + 1879000000000005 + 2021-11-12T08:24:39.695 + + 2021-11-12T08:24:39.695 + EIDAS_ANLEGEN + KITT for eIDAS Matching + + + 101179 + + eidtapp@bmi.gv.at + + + http://eidas.europa.eu/attributes/naturalperson/PersonIdentifier + DE + + 7cEYWithDEElementsasdfsafsaf4CDVzNT4E7cjkU4VqForjUnit + 9999-12-31 + 9999-12-31 + + + + + 1879000000000005 + 2021-11-12T08:24:39.695 + + 2021-11-12T08:24:39.695 + EIDAS_ANLEGEN + KITT for eIDAS Matching + + + 101179 + + eidtapp@bmi.gv.at + + + http://eidas.europa.eu/attributes/naturalperson/PersonIdentifier + EE + + aabbcc_should_not_be_included_for_DE + 9999-12-31 + 9999-12-31 + + + + + 1879000000000005 + 2021-11-12T08:24:39.695 + + 2021-11-12T08:24:39.695 + EIDAS_ANLEGEN + KITT for eIDAS Matching + + + 101179 + + eidtapp@bmi.gv.at + + + http://eidas.europa.eu/attributes/naturalperson/PersonIdentifier + DE + + 7cEYWithDEElementsasdfsafsaf4CDVzNT4E7cjkU4VqForjUnit_second_one + 9999-12-31 + 9999-12-31 + + + + + + + 2020-02-05T13:07:06.311 + + + + 44453500000005242 + 2020-02-05T13:07:06.311 + + 2020-02-05T13:07:06.311 + WSANM + Wohnsitz anmelden + + + 109091 + + + + + + 0088 + Testgemeinde + 09988 + Testort A + + Testgasse + 1a-2b + Stg. 3c-4d + 5 + H + false + 0001 + + T800001 + 001 + T800001 + + + + HST111WWW + + T8001 + T80001 + T80000000001 + T80000000002 + + H + Testpostort + + 2020-02-05T13:07:06.311 + WSANM + Wohnsitz anmelden + + + + 44453500000005262 + 2020-02-05T13:07:06.311 + + 2020-02-05T13:07:06.311 + AUSK_SPERRE_SETZ + Auskunftssperre setzen + + + 109091 + + + + 2020-02-05T13:07:06.311 + 9999-12-31T23:59:59.000 + ASMG + Auskunftssperre nach § 18 / 2ff MeldeG + automatische Auskunftssperre + + + + + + + diff --git a/modules/authmodule-eIDAS-v2/src/test/resources/data/zmr/search_with_personalId_only_resp_moreThanOne_closed_entity.xml b/modules/authmodule-eIDAS-v2/src/test/resources/data/zmr/search_with_personalId_only_resp_moreThanOne_closed_entity.xml new file mode 100644 index 00000000..010fb5c1 --- /dev/null +++ b/modules/authmodule-eIDAS-v2/src/test/resources/data/zmr/search_with_personalId_only_resp_moreThanOne_closed_entity.xml @@ -0,0 +1,641 @@ + + + + GP_EIDAS + 367100000000080 + 0 + + + ZMR-Server Version: 5.9.0.0-SNAPSHOT + 2021-11-12T08:24:40.985 + 1877300000000139 + + + + + Searching PersonIdentifier + + true + false + + + false + + 10 + + + + + 5020 + Person gefunden. + + + 2 + 0 + 0 + 1 + + + + + 2021-11-12T08:24:39.695 + + + + 44453600000000697 + 2020-02-05T13:07:06.311 + + 2020-02-05T13:07:06.311 + SONSTIGES + Sonstiges + Testerperson + + + 109091 + + + + 000430320173 + + + 9/MtsPZgBHQMBpQOD6aOY2TUqcY= + urn:publicid:gv.at:cdid+ZP + + + XXXŐzgür + XXXTüzekçi + + unbekannt + männlich + 1983-06-04 + Wien + Wien + Österreich + + AUT + Österreich + + + 44453600000000727 + 2020-02-05T13:07:06.311 + + 2020-02-05T13:07:06.311 + STAATSANGEH_ANLEGEN + Staatsangehörigkeit anlegen + Testerperson + + + 109091 + + + + + + + + + 1879000000000001 + 2021-11-12T08:24:39.695 + + 2021-11-12T08:24:39.695 + EIDAS_ANLEGEN + KITT for eIDAS Matching + + + 101179 + + eidtapp@bmi.gv.at + + + http://eidas.europa.eu/attributes/naturalperson/BirthName + DE + + XXXvon Heuburg + 9999-12-31 + 9999-12-31 + + + + + 1879000000000003 + 2021-11-12T08:24:39.695 + + 2021-11-12T08:24:39.695 + EIDAS_ANLEGEN + KITT for eIDAS Matching + + + 101179 + + eidtapp@bmi.gv.at + + + http://eidas.europa.eu/attributes/naturalperson/PlaceOfBirth + DE + + Hintergigritzpotschn + 9999-12-31 + 9999-12-31 + + + + + 1879000000000005 + 2021-11-12T08:24:39.695 + + 2021-11-12T08:24:39.695 + EIDAS_ANLEGEN + KITT for eIDAS Matching + + + 101179 + + eidtapp@bmi.gv.at + + + http://eidas.europa.eu/attributes/naturalperson/PersonIdentifier + DE + + 7cEYWithDEElementsasdfsafsaf4CDVzNT4E7cjkU4VqForjUnit + 9999-12-31 + 9999-12-31 + + + + + 1879000000000005 + 2021-11-12T08:24:39.695 + + 2021-11-12T08:24:39.695 + EIDAS_ANLEGEN + KITT for eIDAS Matching + + + 101179 + + eidtapp@bmi.gv.at + + + http://eidas.europa.eu/attributes/naturalperson/PersonIdentifier + EE + + aabbcc_should_not_be_included_for_DE + 9999-12-31 + 9999-12-31 + + + + + 1879000000000005 + 2021-11-12T08:24:39.695 + + 2021-11-12T08:24:39.695 + EIDAS_ANLEGEN + KITT for eIDAS Matching + + + 101179 + + eidtapp@bmi.gv.at + + + http://eidas.europa.eu/attributes/naturalperson/PersonIdentifier + DE + + 7cEYWithDEElementsasdfsafsaf4CDVzNT4E7cjkU4VqForjUnit_second_one + 9999-12-31 + 9999-12-31 + + + + + + + 2020-02-05T13:07:06.311 + + + + 44453500000005242 + 2020-02-05T13:07:06.311 + + 2020-02-05T13:07:06.311 + WSANM + Wohnsitz anmelden + + + 109091 + + + + + + 0088 + Testgemeinde + 09988 + Testort A + + Testgasse + 1a-2b + Stg. 3c-4d + 5 + H + false + 0001 + + T800001 + 001 + T800001 + + + + HST111WWW + + T8001 + T80001 + T80000000001 + T80000000002 + + H + Testpostort + + 2020-02-05T13:07:06.311 + WSANM + Wohnsitz anmelden + + + + 44453500000005262 + 2020-02-05T13:07:06.311 + + 2020-02-05T13:07:06.311 + AUSK_SPERRE_SETZ + Auskunftssperre setzen + + + 109091 + + + + 2020-02-05T13:07:06.311 + 9999-12-31T23:59:59.000 + ASMG + Auskunftssperre nach § 18 / 2ff MeldeG + automatische Auskunftssperre + + + + + + + + + 2021-10-21T13:07:39.000 + + + + 44454000000000811 + 2020-02-05T13:45:52.563 + + 2020-02-05T13:45:52.563 + SONSTIGES + Sonstiges + Testperson + + + 109091 + + + + 000648035760 + + + UgeknNsc26lVuB7U/uYGVmWtnnA= + urn:publicid:gv.at:cdid+ZP + + + XXXŐzgür + XXXTüzekçi + + unbekannt + weiblich + 1983-06-04 + Wien + Wien + Österreich + + TUR + Türkei + + + 44454000000000841 + 2020-02-05T13:45:52.563 + + 2020-02-05T13:45:52.563 + STAATSANGEH_ANLEGEN + Staatsangehörigkeit anlegen + Testperson + + + 109091 + + + + + + + + + 44454000000000855 + 2020-02-05T13:45:52.563 + + 2020-02-05T13:45:52.563 + REISEDOK_ANLEGEN + Reisedokument anlegen + Testperson + + + 109091 + + + + FREMDEROA + + + + + 1867900000000716 + 2021-10-21T13:07:38.065 + + 2021-10-21T13:07:38.065 + EIDAS_ANLEGEN + KITT for eIDAS Matching + + + 101179 + + eidtapp@bmi.gv.at + + + http://eidas.europa.eu/attributes/naturalperson/PersonIdentifier + EE + + 7cEYSvKZasdfsafsaf4CDVzNT4E7cjkU4Vq_first + 9999-12-31 + 9999-12-31 + + + + + + + 2020-02-05T13:45:52.563 + + + + 44453900000006913 + 2020-02-05T13:45:52.563 + + 2020-02-05T13:45:52.563 + WSANM + Wohnsitz anmelden + + + 109091 + + + + + + 0088 + Testgemeinde + 09988 + Testort A + + Testgasse + 1a-2b + Stg. 3c-4d + H + false + + T800001 + 001 + T800001 + + + + HSX11XWWX + + T8001 + T80001 + T80000000001 + T80000000002 + + H + Testpostort + + 2020-02-05T13:45:52.563 + WSANM + Wohnsitz anmelden + + + + 44453900000006933 + 2020-02-05T13:45:52.563 + + 2020-02-05T13:45:52.563 + AUSK_SPERRE_SETZ + Auskunftssperre setzen + + + 109091 + + + + 2020-02-05T13:45:52.563 + 9999-12-31T23:59:59.000 + ASMG + Auskunftssperre nach § 18 / 2ff MeldeG + automatische Auskunftssperre + + + + + + + + + 2021-10-21T13:07:39.000 + + + + 44454000000000811 + 2020-02-05T13:45:52.563 + + 2020-02-05T13:45:52.563 + SONSTIGES + Sonstiges + Testperson + 2020-02-05T13:45:52.563 + + + 109091 + + + + 000648035760 + + + UgeknNsc26lVuB7U/uYGVmWtnnB= + urn:publicid:gv.at:cdid+ZP + + + XXXŐzgür + XXXTüzekçi + + unbekannt + weiblich + 1983-06-04 + Wien + Wien + Österreich + + TUR + Türkei + + + 44454000000000841 + 2020-02-05T13:45:52.563 + + 2020-02-05T13:45:52.563 + STAATSANGEH_ANLEGEN + Staatsangehörigkeit anlegen + Testperson + + + 109091 + + + + + + + + + 44454000000000855 + 2020-02-05T13:45:52.563 + + 2020-02-05T13:45:52.563 + REISEDOK_ANLEGEN + Reisedokument anlegen + Testperson + + + 109091 + + + + FREMDEROA + + + + + 1867900000000716 + 2021-10-21T13:07:38.065 + + 2021-10-21T13:07:38.065 + EIDAS_ANLEGEN + KITT for eIDAS Matching + + + 101179 + + eidtapp@bmi.gv.at + + + http://eidas.europa.eu/attributes/naturalperson/PersonIdentifier + EE + + 7cEYSvKZasdfsafsaf4CDasdfVzNT4E7cjkU4Vq_first + 9999-12-31 + 9999-12-31 + + + + + + + 2020-02-05T13:45:52.563 + + + + 44453900000006913 + 2020-02-05T13:45:52.563 + + 2020-02-05T13:45:52.563 + WSANM + Wohnsitz anmelden + + + 109091 + + + + + + 0088 + Testgemeinde + 09988 + Testort A + + Testgasse + 1a-2b + Stg. 3c-4d + H + false + + T800001 + 001 + T800001 + + + + HSX11XWWX + + T8001 + T80001 + T80000000001 + T80000000002 + + H + Testpostort + + 2020-02-05T13:45:52.563 + WSANM + Wohnsitz anmelden + + + + 44453900000006933 + 2020-02-05T13:45:52.563 + + 2020-02-05T13:45:52.563 + AUSK_SPERRE_SETZ + Auskunftssperre setzen + + + 109091 + + + + 2020-02-05T13:45:52.563 + 9999-12-31T23:59:59.000 + ASMG + Auskunftssperre nach § 18 / 2ff MeldeG + automatische Auskunftssperre + + + + + + + -- cgit v1.2.3