aboutsummaryrefslogtreecommitdiff
path: root/eidas_modules/authmodule-eIDAS-v2/src/main
diff options
context:
space:
mode:
authorThomas <>2022-02-07 11:17:42 +0100
committerThomas <>2022-02-08 09:37:25 +0100
commit1a442f77692a0438cc9d43be563b0ca965ff6c2b (patch)
tree805c291d420d1d7418a9144230f584521640ccb3 /eidas_modules/authmodule-eIDAS-v2/src/main
parent8c08120d543f4eba2b1d1480d6649f13c46e9ef0 (diff)
downloadNational_eIDAS_Gateway-1a442f77692a0438cc9d43be563b0ca965ff6c2b.tar.gz
National_eIDAS_Gateway-1a442f77692a0438cc9d43be563b0ca965ff6c2b.tar.bz2
National_eIDAS_Gateway-1a442f77692a0438cc9d43be563b0ca965ff6c2b.zip
refactor(szr): remove 'insertErnp' functionality from SZR client.
After this, the person is directly added into ERnP by using ErnpRestClient
Diffstat (limited to 'eidas_modules/authmodule-eIDAS-v2/src/main')
-rw-r--r--eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/clients/szr/SzrClient.java49
-rw-r--r--eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/CreateIdentityLinkTask.java29
2 files changed, 4 insertions, 74 deletions
diff --git a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/clients/szr/SzrClient.java b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/clients/szr/SzrClient.java
index 397cbe46..bd1eb13e 100644
--- a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/clients/szr/SzrClient.java
+++ b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/clients/szr/SzrClient.java
@@ -111,28 +111,6 @@ public class SzrClient extends AbstractSoapClient {
final ObjectMapper mapper = new ObjectMapper();
- /**
- * Get IdentityLink of a person.
- *
- *
- * @param eidData minimum dataset of person
- * @return IdentityLink
- * @throws SzrCommunicationException In case of a SZR error
- */
- public IdentityLinkType getIdentityLinkInRawMode(SimpleEidasData eidData)
- throws SzrCommunicationException {
- try {
- final GetIdentityLinkEidas getIdl = new GetIdentityLinkEidas();
- getIdl.setPersonInfo(generateSzrRequest(eidData));
-
- return getIdentityLinkGeneric(getIdl);
-
- } catch (final Exception e) {
- log.warn("SZR communication FAILED. Reason: " + e.getMessage(), e);
- throw new SzrCommunicationException("ernb.02", new Object[]{e.getMessage()}, e);
-
- }
- }
/**
* Get IdentityLink of a person.
@@ -206,33 +184,6 @@ public class SzrClient extends AbstractSoapClient {
}
return resp;
}
-
- /**
- * Request a encrypted baseId from SZR.
- *
- * <b>Note</b>: Previously, this method did create a new ERnP entry, if it did not exist. This is
- * <b>not</b> the case any more. See {@link #createNewErnpEntry(SimpleEidasData)} for that functionality.
- *
- * @param eidData Minimum dataset of person
- * @return encrypted baseId
- * @throws SzrCommunicationException In case of a SZR error
- */
- public String getEncryptedStammzahl(final SimpleEidasData eidData)
- throws SzrCommunicationException {
- final String resp;
- try {
- resp = this.szr.getStammzahlEncrypted(generateSzrRequest(eidData), false);
- } catch (SZRException_Exception e) {
- throw new SzrCommunicationException("ernb.02", new Object[]{e.getMessage()}, e);
- }
-
- if (StringUtils.isEmpty(resp)) {
- throw new SzrCommunicationException("ernb.01", new Object[]{"Stammzahl response empty"}); // TODO error handling
- }
-
- return resp;
-
- }
/**
* Request a encrypted baseId from SZR.
diff --git a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/CreateIdentityLinkTask.java b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/CreateIdentityLinkTask.java
index c95c275e..740e5292 100644
--- a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/CreateIdentityLinkTask.java
+++ b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/CreateIdentityLinkTask.java
@@ -86,9 +86,6 @@ import szrservices.IdentityLinkType;
* <ul>
* <li>{@link at.gv.egiz.eaaf.core.impl.idp.controller.tasks.FinalizeAuthenticationTask}</li>
* </ul>
- * TODO Take Constants#DATA_SIMPLE_EIDAS and Constants#DATA_RESULT_MATCHING_BPK
- * TODO Only do VSZ Erstellung and eidasBind -- this is always the end of the whole process
- * TODO Move Eintragung to separate Task, as it does not happen every time
* @author tlenz
*/
@Slf4j
@@ -192,16 +189,8 @@ public class CreateIdentityLinkTask extends AbstractAuthServletTask {
private void executeEidMode(SimpleEidasData eidData, MatchedPersonResult matchedPersonData)
throws JsonProcessingException, EaafException, JoseException {
// get encrypted baseId
- String vsz;
- if (matchedPersonData != null) {
- log.debug("Requesting encrypted baseId by already matched person information ... ");
- vsz = szrClient.getEncryptedStammzahl(matchedPersonData);
-
- } else {
- log.debug("Requesting encrypted baseId by using eIDAS information directly ... ");
- vsz = szrClient.createNewErnpEntry(eidData);
-
- }
+ log.debug("Requesting encrypted baseId by already matched person information ... ");
+ String vsz = szrClient.getEncryptedStammzahl(matchedPersonData);
//write revision-Log entry and extended infos personal-identifier mapping
revisionsLogger.logEvent(pendingReq, MsConnectorEventCodes.SZR_VSZ_RECEIVED);
@@ -252,18 +241,8 @@ public class CreateIdentityLinkTask extends AbstractAuthServletTask {
private SzrResultHolder requestSzrForIdentityLink(SimpleEidasData eidData,
MatchedPersonResult matchedPersonData) throws EaafException {
//request IdentityLink from SZR
- IdentityLinkType result;
-
- if (matchedPersonData != null) {
- log.debug("Requesting encrypted baseId by already matched person information ... ");
- result = szrClient.getIdentityLinkInRawMode(matchedPersonData);
-
- } else {
- log.debug("Requesting encrypted baseId by using eIDAS information directly ... ");
- result = szrClient.getIdentityLinkInRawMode(eidData);
-
- }
-
+ log.debug("Requesting encrypted baseId by already matched person information ... ");
+ IdentityLinkType result = szrClient.getIdentityLinkInRawMode(matchedPersonData);
final Element idlFromSzr = (Element) result.getAssertion();
final IIdentityLink identityLink = new SimpleIdentityLinkAssertionParser(idlFromSzr).parseIdentityLink();