aboutsummaryrefslogtreecommitdiff
path: root/eidas_modules/authmodule-eIDAS-v2/src
diff options
context:
space:
mode:
authorThomas <>2022-02-07 18:22:27 +0100
committerThomas <>2022-02-08 09:37:25 +0100
commitcc54421d99604cd2f2b01846f94bb11fb192028d (patch)
tree87fd9d6c441094771fe15979e4ac3dcec914e322 /eidas_modules/authmodule-eIDAS-v2/src
parent6f8bfc98e85e6c6ed819f39e878a44310674e178 (diff)
downloadNational_eIDAS_Gateway-cc54421d99604cd2f2b01846f94bb11fb192028d.tar.gz
National_eIDAS_Gateway-cc54421d99604cd2f2b01846f94bb11fb192028d.tar.bz2
National_eIDAS_Gateway-cc54421d99604cd2f2b01846f94bb11fb192028d.zip
chore(matching): fix some code-style and code-quality issues
Diffstat (limited to 'eidas_modules/authmodule-eIDAS-v2/src')
-rw-r--r--eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/clients/ernp/ErnpRestClient.java20
-rw-r--r--eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/exception/ErnpRestCommunicationException.java5
-rw-r--r--eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/CreateNewErnpEntryTask.java2
-rw-r--r--eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/CreateIdentityLinkTaskEidNewTest.java4
4 files changed, 18 insertions, 13 deletions
diff --git a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/clients/ernp/ErnpRestClient.java b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/clients/ernp/ErnpRestClient.java
index 15b7573c..3c19e9c1 100644
--- a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/clients/ernp/ErnpRestClient.java
+++ b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/clients/ernp/ErnpRestClient.java
@@ -86,7 +86,7 @@ import lombok.extern.slf4j.Slf4j;
public class ErnpRestClient implements IErnpClient {
private static final String ERROR_MATCHING_11 = "module.eidasauth.matching.11";
- private static final String ERROR_MATCHING_12 = "module.eidasauth.matching.12";
+ //private static final String ERROR_MATCHING_12 = "module.eidasauth.matching.12";
private static final String ERROR_MATCHING_99 = "module.eidasauth.matching.99";
private static final String LOGMSG_MISSING_CONFIG = "Missing configuration with key: {0}";
@@ -95,8 +95,8 @@ public class ErnpRestClient implements IErnpClient {
private static final String LOGMSG_ERNP_RESP_PROCESS =
"Proces ERnP response during '{}' operation failes with msg: {}";
- private static final String LOGMSG_ERNP_REST_ERROR =
- "ERnP anwser for transaction: {0} with code: {1} and message: {2}";
+ //private static final String LOGMSG_ERNP_REST_ERROR =
+ // "ERnP anwser for transaction: {0} with code: {1} and message: {2}";
private static final String PROCESS_SEARCH_PERSONAL_IDENTIFIER =
"Searching " + Constants.eIDAS_ATTR_PERSONALIDENTIFIER;
@@ -429,7 +429,7 @@ public class ErnpRestClient implements IErnpClient {
//TODO: search eIDAS has to be a LIST!!!!!!
SuchEidas eidasInfos = new SuchEidas();
- searchInfos.setEidas(eidasInfos );
+ searchInfos.setEidas(eidasInfos);
return searchInfos;
}
@@ -542,7 +542,7 @@ public class ErnpRestClient implements IErnpClient {
final Suchdaten searchInfos = new Suchdaten();
searchInfos.setFamilienname(registerResult.getFamilyName());
searchInfos.setVorname(registerResult.getGivenName());
- searchInfos.setGeburtsdatum(buildErnpBirthday(registerResult.getDateOfBirth()));
+ searchInfos.setGeburtsdatum(buildErnpBirthday(registerResult.getDateOfBirth()));
final PersonSuchen personSuchen = new PersonSuchen();
personSuchen.setSuchoptionen(generateSearchParameters());
@@ -572,8 +572,8 @@ public class ErnpRestClient implements IErnpClient {
Constants.eIDAS_ATTRURN_PERSONALIDENTIFIER, eidData.getPseudonym()));
if (StringUtils.isNotEmpty(eidData.getPlaceOfBirth())) {
- ernpReq.addEidasItem(buildNewEidasDocument(eidData.getCitizenCountryCode(),
- Constants.eIDAS_ATTRURN_PLACEOFBIRTH, eidData.getPlaceOfBirth()));
+ ernpReq.addEidasItem(buildNewEidasDocument(eidData.getCitizenCountryCode(),
+ Constants.eIDAS_ATTRURN_PLACEOFBIRTH, eidData.getPlaceOfBirth()));
}
@@ -773,9 +773,9 @@ public class ErnpRestClient implements IErnpClient {
public void handleError(ClientHttpResponse response) throws IOException {
// TODO: opimize errorHandling based on response info's from real ERnP
- List<String> serverId = response.getHeaders().getOrEmpty(ERNP_RESPONSE_HEADER_SERVER_ID);
- log.warn("Receive http-error: {} from ERnP with serverTransactionId",
- response.getRawStatusCode(), serverId.isEmpty() ? "'not set'" : serverId.get(0));
+ List<String> serverId = response.getHeaders().getOrEmpty(ERNP_RESPONSE_HEADER_SERVER_ID);
+ log.warn("Receive http-error: {} from ERnP with serverTransactionId",
+ response.getRawStatusCode(), serverId.isEmpty() ? "'not set'" : serverId.get(0));
throw new ErnpRestCommunicationException(response.getRawStatusCode());
diff --git a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/exception/ErnpRestCommunicationException.java b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/exception/ErnpRestCommunicationException.java
index e3224c93..566a8fa4 100644
--- a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/exception/ErnpRestCommunicationException.java
+++ b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/exception/ErnpRestCommunicationException.java
@@ -16,6 +16,11 @@ public class ErnpRestCommunicationException extends IOException {
@Getter
int httpStatusCode;
+ /**
+ * ERnP communication error on HTTP REST level.
+ *
+ * @param rawStatusCode HTTP statuscode
+ */
public ErnpRestCommunicationException(int rawStatusCode) {
super("ERnP service answers with an error and HTTP status-code: " + rawStatusCode);
this.httpStatusCode = rawStatusCode;
diff --git a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/CreateNewErnpEntryTask.java b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/CreateNewErnpEntryTask.java
index b63b0ca0..c7843be5 100644
--- a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/CreateNewErnpEntryTask.java
+++ b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/CreateNewErnpEntryTask.java
@@ -65,7 +65,7 @@ public class CreateNewErnpEntryTask extends AbstractAuthServletTask {
/**
* Constructor.
- * @param szrClient SZR client for creating a new ERnP entry
+ * @param client SZR client for creating a new ERnP entry
*/
public CreateNewErnpEntryTask(@Autowired ErnpRestClient client) {
this.ernpClient = client;
diff --git a/eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/CreateIdentityLinkTaskEidNewTest.java b/eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/CreateIdentityLinkTaskEidNewTest.java
index 14ace0b8..dbcc62dc 100644
--- a/eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/CreateIdentityLinkTaskEidNewTest.java
+++ b/eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/CreateIdentityLinkTaskEidNewTest.java
@@ -211,7 +211,7 @@ public class CreateIdentityLinkTaskEidNewTest {
String vsz = RandomStringUtils.randomNumeric(10);
when(szrMock.getStammzahlEncrypted(any(), any())).thenReturn(vsz);
- val signContentResp = new SignContentResponseType();
+ SignContentResponseType signContentResp = new SignContentResponseType();
final SignContentEntry signContentEntry = new SignContentEntry();
signContentEntry.setValue(RandomStringUtils.randomAlphanumeric(10));
signContentResp.getOut().add(signContentEntry);
@@ -333,7 +333,7 @@ public class CreateIdentityLinkTaskEidNewTest {
//initialize test
String vsz = RandomStringUtils.randomNumeric(10);
when(szrMock.getStammzahlEncrypted(any(), any())).thenReturn(vsz);
- val signContentResp = new SignContentResponseType();
+ SignContentResponseType signContentResp = new SignContentResponseType();
final SignContentEntry signContentEntry = new SignContentEntry();
signContentEntry.setValue(RandomStringUtils.randomAlphanumeric(10));
signContentResp.getOut().add(signContentEntry);