diff options
author | Alexander Marsalek <amarsalek@iaik.tugraz.at> | 2020-12-17 14:58:11 +0100 |
---|---|---|
committer | Alexander Marsalek <amarsalek@iaik.tugraz.at> | 2021-01-04 14:16:35 +0100 |
commit | 0ed301fe3628f5d646f1fc44e5717ed0e42d90fe (patch) | |
tree | 7e3ff789923e0f6ec5e29dc6ff8bbb96320f67c5 /eidas_modules/authmodule-eIDAS-v2 | |
parent | a1cffbe51cccef6b0cd7e238c384ac7f51ecb27f (diff) | |
download | National_eIDAS_Gateway-0ed301fe3628f5d646f1fc44e5717ed0e42d90fe.tar.gz National_eIDAS_Gateway-0ed301fe3628f5d646f1fc44e5717ed0e42d90fe.tar.bz2 National_eIDAS_Gateway-0ed301fe3628f5d646f1fc44e5717ed0e42d90fe.zip |
added register update method
Diffstat (limited to 'eidas_modules/authmodule-eIDAS-v2')
5 files changed, 32 insertions, 2 deletions
diff --git a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/ernb/DummyErnbClient.java b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/ernb/DummyErnbClient.java index 7e926c8e..0c8a2f59 100644 --- a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/ernb/DummyErnbClient.java +++ b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/ernb/DummyErnbClient.java @@ -1,6 +1,7 @@ package at.asitplus.eidas.specific.modules.auth.eidas.v2.ernb; import at.asitplus.eidas.specific.modules.auth.eidas.v2.dao.RegisterResult; +import at.asitplus.eidas.specific.modules.auth.eidas.v2.dao.SimpleEidasData; import org.springframework.stereotype.Service; import java.util.ArrayList; @@ -37,6 +38,11 @@ public class DummyErnbClient implements IErnbClient { return resultEmpty();//TODO } + @Override + public void update(RegisterResult registerResult, SimpleEidasData eidData) { + //TODO + } + private ArrayList<RegisterResult> resultEmpty() { return new ArrayList<RegisterResult>();//Nobody found } diff --git a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/ernb/IErnbClient.java b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/ernb/IErnbClient.java index f8a41cfe..cda4c426 100644 --- a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/ernb/IErnbClient.java +++ b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/ernb/IErnbClient.java @@ -1,6 +1,7 @@ package at.asitplus.eidas.specific.modules.auth.eidas.v2.ernb; import at.asitplus.eidas.specific.modules.auth.eidas.v2.dao.RegisterResult; +import at.asitplus.eidas.specific.modules.auth.eidas.v2.dao.SimpleEidasData; import java.util.ArrayList; @@ -15,4 +16,5 @@ public interface IErnbClient { ArrayList<RegisterResult> searchItSpecific(String txNumber); + void update(RegisterResult registerResult, SimpleEidasData eidData); } 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 2ae278dc..5b168c3b 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 @@ -95,7 +95,7 @@ public class InitialSearchTask extends AbstractAuthServletTask { ImmutableMap<AttributeDefinition<?>, ImmutableSet<? extends AttributeValue<?>>> aa = eidasResponse.getAttributes().getAttributeMap(); - + final Map<String, Object> simpleAttrMap = convertEidasAttrToSimpleMap( eidasResponse.getAttributes().getAttributeMap()); @@ -232,8 +232,22 @@ public class InitialSearchTask extends AbstractAuthServletTask { SimpleEidasData eidData) throws TaskExecutionException { //TODO automerge log.debug("Automerge " + initialSearchResult + " with " + eidData + " " + countrySpecificDetailSearchResult); - //TODO try { + if (initialSearchResult.getResultCount() != 0) { + throw new WorkflowException("initialSearchResult.getResultCount() != 0"); + } + if (countrySpecificDetailSearchResult.getResultCount() != 1) { + throw new WorkflowException("countrySpecificDetailSearchResult.getResultCount() != 1"); + } + if (countrySpecificDetailSearchResult.getResultsZmr().size() == 1) { + //update ZMR + zmrClient.update(countrySpecificDetailSearchResult.getResultsZmr().get(0), eidData); + } + if (countrySpecificDetailSearchResult.getResultsErnb().size() == 1) { + //update ErnB + ernbClient.update(countrySpecificDetailSearchResult.getResultsErnb().get(0), eidData); + } + String bpK = countrySpecificDetailSearchResult.getBpk(); return bpK; } catch (WorkflowException e) { diff --git a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/zmr/DummyZmrClient.java b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/zmr/DummyZmrClient.java index 343651f7..0f3436d8 100644 --- a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/zmr/DummyZmrClient.java +++ b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/zmr/DummyZmrClient.java @@ -1,6 +1,7 @@ package at.asitplus.eidas.specific.modules.auth.eidas.v2.zmr; import at.asitplus.eidas.specific.modules.auth.eidas.v2.dao.RegisterResult; +import at.asitplus.eidas.specific.modules.auth.eidas.v2.dao.SimpleEidasData; import org.springframework.stereotype.Service; import java.util.ArrayList; @@ -37,6 +38,11 @@ public class DummyZmrClient implements IZmrClient { return resultEmpty();//TODO } + @Override + public void update(RegisterResult registerResult, SimpleEidasData eidData) { + //TODO + } + private ArrayList<RegisterResult> resultEmpty() { return new ArrayList<RegisterResult>();//Nobody found } diff --git a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/zmr/IZmrClient.java b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/zmr/IZmrClient.java index 018122ea..4af7bfe9 100644 --- a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/zmr/IZmrClient.java +++ b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/zmr/IZmrClient.java @@ -1,6 +1,7 @@ package at.asitplus.eidas.specific.modules.auth.eidas.v2.zmr; import at.asitplus.eidas.specific.modules.auth.eidas.v2.dao.RegisterResult; +import at.asitplus.eidas.specific.modules.auth.eidas.v2.dao.SimpleEidasData; import java.util.ArrayList; @@ -15,4 +16,5 @@ public interface IZmrClient { ArrayList<RegisterResult> searchItSpecific(String txNumber); + void update(RegisterResult registerResult, SimpleEidasData eidData); } |