From 3aa46b32410c1a16cf0d5ff8c6cce982cf5e4d7b Mon Sep 17 00:00:00 2001 From: anhefti Date: Thu, 4 Nov 2021 17:36:25 +0100 Subject: [PATCH] better logging for Zoom Proctoring --- .../lms/impl/mockup/MockupLmsAPITemplate.java | 4 ---- .../impl/proctoring/ZoomProctoringService.java | 12 ++++++++++++ src/main/resources/config/application-dev.properties | 3 ++- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/mockup/MockupLmsAPITemplate.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/mockup/MockupLmsAPITemplate.java index cad64113..35e67a9f 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/mockup/MockupLmsAPITemplate.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/mockup/MockupLmsAPITemplate.java @@ -236,10 +236,6 @@ public class MockupLmsAPITemplate implements LmsAPITemplate { this.webserviceInfo.getHttpScheme() + "://" + externalAddressAlias + "/api/"; - if (log.isTraceEnabled()) { - log.trace("Use external address for course access: {}", _externalStartURI); - } - return new QuizData( quizData.id, quizData.institutionId, quizData.lmsSetupId, quizData.lmsType, quizData.name, quizData.description, quizData.startTime, diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/proctoring/ZoomProctoringService.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/proctoring/ZoomProctoringService.java index 0118f4b9..9ec6cb89 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/proctoring/ZoomProctoringService.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/proctoring/ZoomProctoringService.java @@ -623,6 +623,10 @@ public class ZoomProctoringService implements ExamProctoringService { credentials.clientIdAsString(), expTime); + if (log.isTraceEnabled()) { + log.trace("Zoom API Token payload: {}", jwtPayload); + } + final String jwtPayloadPart = urlEncoder .encodeToString(jwtPayload.getBytes(StandardCharsets.UTF_8)); @@ -675,6 +679,10 @@ public class ZoomProctoringService implements ExamProctoringService { expTime, expTime); + if (log.isTraceEnabled()) { + log.trace("Zoom SDK Token payload: {}", jwtPayload); + } + final String jwtPayloadPart = urlEncoder .encodeToString(jwtPayload.getBytes(StandardCharsets.UTF_8)); @@ -724,6 +732,10 @@ public class ZoomProctoringService implements ExamProctoringService { final String tmpString = String.format("%s.%s.%s.%d.%s", apiKey, meetingId, ts, status, hashBase64Str); final String encodedString = Base64.getEncoder().encodeToString(tmpString.getBytes()); + if (log.isTraceEnabled()) { + log.trace("Zoom Meeting signature payload: {}", tmpString); + } + return encodedString.replaceAll("\\=+$", ""); } catch (final Exception e) { diff --git a/src/main/resources/config/application-dev.properties b/src/main/resources/config/application-dev.properties index b11db757..ae66eec3 100644 --- a/src/main/resources/config/application-dev.properties +++ b/src/main/resources/config/application-dev.properties @@ -10,8 +10,9 @@ server.tomcat.uri-encoding=UTF-8 logging.level.ch=INFO logging.level.ch.ethz.seb.sebserver.webservice.datalayer=INFO logging.level.org.springframework.cache=INFO -logging.level.ch.ethz.seb.sebserver.webservice.servicelayer.lms.impl=DEBUG +logging.level.ch.ethz.seb.sebserver.webservice.servicelayer.lms.impl=TRACE logging.level.ch.ethz.seb.sebserver.webservice.servicelayer.session=DEBUG +logging.level.ch.ethz.seb.sebserver.webservice.servicelayer.session.impl.proctoring=TRACE #logging.level.ch.ethz.seb.sebserver.webservice.weblayer.api.ExamAPI_V1_Controller=TRACE sebserver.http.client.connect-timeout=150000