summaryrefslogtreecommitdiff
path: root/eaaf_modules/eaaf_module_auth_sl20/src/main
diff options
context:
space:
mode:
authorThomas <>2021-03-25 13:15:01 +0100
committerThomas <>2021-03-25 13:15:01 +0100
commite62a856f255163ecc145c16130d15147152bc0fd (patch)
tree14adaa3c128b4ba61356a4656ed6e11f5d248b80 /eaaf_modules/eaaf_module_auth_sl20/src/main
parentc3856db7ba2586edc4cb52bda18c38d8d05ae748 (diff)
downloadEAAF-Components-e62a856f255163ecc145c16130d15147152bc0fd.tar.gz
EAAF-Components-e62a856f255163ecc145c16130d15147152bc0fd.tar.bz2
EAAF-Components-e62a856f255163ecc145c16130d15147152bc0fd.zip
add additional logging into SL2.0 tasks
Diffstat (limited to 'eaaf_modules/eaaf_module_auth_sl20/src/main')
-rw-r--r--eaaf_modules/eaaf_module_auth_sl20/src/main/java/at/gv/egiz/eaaf/modules/auth/sl20/tasks/AbstractCreateQualEidRequestTask.java11
-rw-r--r--eaaf_modules/eaaf_module_auth_sl20/src/main/java/at/gv/egiz/eaaf/modules/auth/sl20/tasks/AbstractReceiveQualEidTask.java7
2 files changed, 15 insertions, 3 deletions
diff --git a/eaaf_modules/eaaf_module_auth_sl20/src/main/java/at/gv/egiz/eaaf/modules/auth/sl20/tasks/AbstractCreateQualEidRequestTask.java b/eaaf_modules/eaaf_module_auth_sl20/src/main/java/at/gv/egiz/eaaf/modules/auth/sl20/tasks/AbstractCreateQualEidRequestTask.java
index a1d5591a..1c1a8f78 100644
--- a/eaaf_modules/eaaf_module_auth_sl20/src/main/java/at/gv/egiz/eaaf/modules/auth/sl20/tasks/AbstractCreateQualEidRequestTask.java
+++ b/eaaf_modules/eaaf_module_auth_sl20/src/main/java/at/gv/egiz/eaaf/modules/auth/sl20/tasks/AbstractCreateQualEidRequestTask.java
@@ -9,11 +9,13 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
+import java.util.concurrent.TimeUnit;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.time.StopWatch;
import org.apache.http.NameValuePair;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpPost;
@@ -52,6 +54,8 @@ import lombok.extern.slf4j.Slf4j;
@Slf4j
public abstract class AbstractCreateQualEidRequestTask extends AbstractAuthServletTask {
+ private static final String FRIENDLYNAME_HTTP_CLIENT = "A-Trust Client";
+
@Autowired(required = true)
private IHttpClientFactory httpClientFactory;
@Autowired(required = true)
@@ -115,9 +119,16 @@ public abstract class AbstractCreateQualEidRequestTask extends AbstractAuthServl
Base64Url.encode(sl20Req.toString().getBytes(StandardCharsets.UTF_8)));
// request VDA
+
+ final StopWatch watch = StopWatch.createStarted();
+ log.info("Requesting {} for authentication ... ", FRIENDLYNAME_HTTP_CLIENT);
final Sl20ResponseHolder httpResp = httpClientFactory.getHttpClient(false).execute(
httpReq, SL20HttpBindingUtils.sl20ResponseHandler());
+ watch.stop();
+ log.info("Respone from {} received after: {}[ms] with statusCode: {}", FRIENDLYNAME_HTTP_CLIENT,
+ watch.getTime(TimeUnit.MILLISECONDS), httpResp.getResponseStatus().getStatusCode());
+
//check on error on http channel
if (httpResp.getError() != null) {
log.info("Basic SL2.0 response processing has an error. HTTP-StatusCode: {} ErrorMsg: {}",
diff --git a/eaaf_modules/eaaf_module_auth_sl20/src/main/java/at/gv/egiz/eaaf/modules/auth/sl20/tasks/AbstractReceiveQualEidTask.java b/eaaf_modules/eaaf_module_auth_sl20/src/main/java/at/gv/egiz/eaaf/modules/auth/sl20/tasks/AbstractReceiveQualEidTask.java
index 0ca6a491..0d0f990a 100644
--- a/eaaf_modules/eaaf_module_auth_sl20/src/main/java/at/gv/egiz/eaaf/modules/auth/sl20/tasks/AbstractReceiveQualEidTask.java
+++ b/eaaf_modules/eaaf_module_auth_sl20/src/main/java/at/gv/egiz/eaaf/modules/auth/sl20/tasks/AbstractReceiveQualEidTask.java
@@ -8,8 +8,6 @@ import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang3.StringUtils;
import org.jose4j.base64url.Base64Url;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import com.fasterxml.jackson.core.JsonParseException;
@@ -35,9 +33,10 @@ import at.gv.egiz.eaaf.modules.auth.sl20.utils.JsonMapper;
import at.gv.egiz.eaaf.modules.auth.sl20.utils.SL20Constants;
import at.gv.egiz.eaaf.modules.auth.sl20.utils.SL20JsonExtractorUtils;
import at.gv.egiz.eaaf.modules.auth.sl20.utils.SL20ResponseUtils;
+import lombok.extern.slf4j.Slf4j;
+@Slf4j
public abstract class AbstractReceiveQualEidTask extends AbstractAuthServletTask {
- private static final Logger log = LoggerFactory.getLogger(AbstractReceiveQualEidTask.class);
@Autowired(required = true)
private IJoseTools joseTools;
@@ -89,6 +88,8 @@ public abstract class AbstractReceiveQualEidTask extends AbstractAuthServletTask
}
+ log.info("Receive response from A-Trust. Starting response-message validation ... ");
+
// check on errorMessage
final VerificationResult payLoadContainerErrorCheck = SL20JsonExtractorUtils.extractSL20PayLoad(
sl20ReqObj,