SEBSERV-270 fixed

This commit is contained in:
anhefti 2022-02-28 14:30:20 +01:00
parent 1d6bd86b57
commit ed28bb7c5d
3 changed files with 28 additions and 47 deletions

View file

@ -141,20 +141,6 @@ public class JitsiProctoringService implements ExamProctoringService {
"proctoringSettings:serverURL:invalidURL");
}
if (StringUtils.isBlank(proctoringSettings.appKey)) {
throw new APIMessageException(Arrays.asList(
APIMessage.fieldValidationError(ProctoringServiceSettings.ATTR_APP_KEY,
"proctoringSettings:appKey:notNull"),
APIMessage.ErrorMessage.EXTERNAL_SERVICE_BINDING_ERROR.of()));
}
if (StringUtils.isBlank(proctoringSettings.appSecret)) {
throw new APIMessageException(Arrays.asList(
APIMessage.fieldValidationError(ProctoringServiceSettings.ATTR_APP_SECRET,
"proctoringSettings:appSecret:notNull"),
APIMessage.ErrorMessage.EXTERNAL_SERVICE_BINDING_ERROR.of()));
}
final ClientHttpRequestFactory clientHttpRequestFactory = this.clientHttpRequestFactoryService
.getClientHttpRequestFactory()
.getOrThrow();

View file

@ -172,20 +172,6 @@ public class ZoomProctoringService implements ExamProctoringService {
"proctoringSettings:serverURL:invalidURL");
}
if (StringUtils.isBlank(proctoringSettings.appKey)) {
throw new APIMessageException(Arrays.asList(
APIMessage.fieldValidationError(ProctoringServiceSettings.ATTR_APP_KEY,
"proctoringSettings:appKey:notNull"),
APIMessage.ErrorMessage.EXTERNAL_SERVICE_BINDING_ERROR.of()));
}
if (StringUtils.isBlank(proctoringSettings.appSecret)) {
throw new APIMessageException(Arrays.asList(
APIMessage.fieldValidationError(ProctoringServiceSettings.ATTR_APP_SECRET,
"proctoringSettings:appSecret:notNull"),
APIMessage.ErrorMessage.EXTERNAL_SERVICE_BINDING_ERROR.of()));
}
try {
final ClientCredentials credentials = new ClientCredentials(

View file

@ -25,28 +25,37 @@ public class ProctoringSettingsValidator
return false;
}
if (value.enableProctoring) {
if (value.serverType == ProctoringServerType.JITSI_MEET || value.serverType == ProctoringServerType.ZOOM) {
boolean passed = true;
if (StringUtils.isBlank(value.appKey)) {
context.disableDefaultConstraintViolation();
context
.buildConstraintViolationWithTemplate("proctoringSettings:appKey:notNull")
.addPropertyNode("appKey").addConstraintViolation();
passed = false;
}
//if (value.enableProctoring) {
if (value.serverType == ProctoringServerType.JITSI_MEET || value.serverType == ProctoringServerType.ZOOM) {
boolean passed = true;
if (StringUtils.isBlank(value.appSecret)) {
context.disableDefaultConstraintViolation();
context
.buildConstraintViolationWithTemplate("proctoringSettings:appSecret:notNull")
.addPropertyNode("appSecret").addConstraintViolation();
passed = false;
}
return passed;
if (StringUtils.isBlank(value.serverURL)) {
context.disableDefaultConstraintViolation();
context
.buildConstraintViolationWithTemplate("proctoringSettings:serverURL:notNull")
.addPropertyNode("serverURL").addConstraintViolation();
passed = false;
}
if (StringUtils.isBlank(value.appKey)) {
context.disableDefaultConstraintViolation();
context
.buildConstraintViolationWithTemplate("proctoringSettings:appKey:notNull")
.addPropertyNode("appKey").addConstraintViolation();
passed = false;
}
if (StringUtils.isBlank(value.appSecret)) {
context.disableDefaultConstraintViolation();
context
.buildConstraintViolationWithTemplate("proctoringSettings:appSecret:notNull")
.addPropertyNode("appSecret").addConstraintViolation();
passed = false;
}
return passed;
}
//}
return true;
}