diff options
author | Thomas <> | 2022-10-07 17:13:27 +0200 |
---|---|---|
committer | Thomas <> | 2022-10-07 17:13:27 +0200 |
commit | 2491f68f97b8aa956a1f1e106fa2cf3540d8f86b (patch) | |
tree | c933bc073a11c43f39ef418b5e49e146c91c767f /modules/authmodule-eIDAS-v2/src/main | |
parent | 9da6640b1aa6ffd60866a6f34ea92f70ada1a3e6 (diff) | |
download | National_eIDAS_Gateway-2491f68f97b8aa956a1f1e106fa2cf3540d8f86b.tar.gz National_eIDAS_Gateway-2491f68f97b8aa956a1f1e106fa2cf3540d8f86b.tar.bz2 National_eIDAS_Gateway-2491f68f97b8aa956a1f1e106fa2cf3540d8f86b.zip |
fix(eIDAS-ERnP): eIDAS documents can by 'null' in ERnP response
Diffstat (limited to 'modules/authmodule-eIDAS-v2/src/main')
-rw-r--r-- | modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/clients/ernp/ErnpRestClient.java | 8 |
1 files changed, 6 insertions, 2 deletions
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 feb2853a..4212aae8 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 @@ -572,8 +572,12 @@ public class ErnpRestClient implements IErnpClient { } + // get all eIDAS documents from current ERnP entry or an empty list of no exists + List<Eidas> currentEidasDocs = ernpPersonToKitt.getEidas() != null + ? ernpPersonToKitt.getEidas() : Collections.emptyList(); + // check if eIDAS attribute is already includes an eIDAS-Document - boolean alreadyExist = ernpPersonToKitt.getEidas().stream() + boolean alreadyExist = currentEidasDocs.stream() .filter(el -> el.getWert().equals(attrValue) && el.getArt().equals(attrName) && el.getStaatscode2().equals(citizenCountryCode)) @@ -582,7 +586,7 @@ public class ErnpRestClient implements IErnpClient { if (!alreadyExist) { // check eIDAS documents already contains a document with this pair of country-code and attribute-name - Optional<Eidas> oneDocWithNameExists = ernpPersonToKitt.getEidas().stream() + Optional<Eidas> oneDocWithNameExists = currentEidasDocs.stream() .filter(el -> el.getStaatscode2().equals(citizenCountryCode) && el.getArt().equals(attrName)) .findAny(); |