aboutsummaryrefslogtreecommitdiff
path: root/eidas_modules
diff options
context:
space:
mode:
authorAlexander Marsalek <amarsalek@iaik.tugraz.at>2020-12-17 14:58:11 +0100
committerThomas Lenz <thomas.lenz@egiz.gv.at>2021-01-15 14:19:29 +0100
commit14a14c71bc33cdbbcf0d4a65f9b6689091e7082c (patch)
tree104b0d0a93752956382c406a4f66920fa7dbcc62 /eidas_modules
parent21613f2d1af10639b65077c5600763e82b5eb63c (diff)
downloadNational_eIDAS_Gateway-14a14c71bc33cdbbcf0d4a65f9b6689091e7082c.tar.gz
National_eIDAS_Gateway-14a14c71bc33cdbbcf0d4a65f9b6689091e7082c.tar.bz2
National_eIDAS_Gateway-14a14c71bc33cdbbcf0d4a65f9b6689091e7082c.zip
added register update method
Diffstat (limited to 'eidas_modules')
-rw-r--r--eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/ernb/DummyErnbClient.java6
-rw-r--r--eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/ernb/IErnbClient.java2
-rw-r--r--eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/InitialSearchTask.java18
-rw-r--r--eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/zmr/DummyZmrClient.java6
-rw-r--r--eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/zmr/IZmrClient.java2
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 e722200c..3e38ca20 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
@@ -99,7 +99,7 @@ public class InitialSearchTask extends AbstractAuthServletTask {
ImmutableMap<AttributeDefinition<?>, ImmutableSet<? extends AttributeValue<?>>> aa =
eidasResponse.getAttributes().getAttributeMap();
-
+
final Map<String, Object> simpleAttrMap = convertEidasAttrToSimpleMap(
eidasResponse.getAttributes().getAttributeMap());
@@ -236,8 +236,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);
}