SEBSERV-270 fixed
This commit is contained in:
parent
1d6bd86b57
commit
ed28bb7c5d
3 changed files with 28 additions and 47 deletions
|
@ -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();
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue