Skip to content

Commit

Permalink
Merge branch 'dev-2.0' of github.com:SafeExamBrowser/seb-server into …
Browse files Browse the repository at this point in the history
…docu
  • Loading branch information
Nadim Ritter committed Aug 16, 2024
2 parents ccae9fa + f632cc9 commit 54ec29d
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 5 deletions.
14 changes: 12 additions & 2 deletions src/main/java/ch/ethz/seb/sebserver/webservice/WebserviceInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public class WebserviceInfo {
private static final String WEB_SERVICE_EXTERNAL_ADDRESS_ALIAS = "sebserver.webservice.lms.address.alias";
private static final String WEB_SERVICE_CONTEXT_PATH = "server.servlet.context-path";
public static final String SEBSERVER_WEBSERVICE_AUTOLOGIN_ENDPOINT = "sebserver.webservice.autologin.endpoint";
public static final String WEB_SERVICE_GUI_AUTOLOGIN_URL_KEY = "sebserver.webservice.autologin.url";

private final String sebServerVersion;
private final String testProperty;
Expand All @@ -69,6 +70,8 @@ public class WebserviceInfo {
private final boolean isDistributed;
private final String webserviceUUID;

private final String guiAutologinURL;

private final long distributedUpdateInterval;

private Map<String, String> lmsExternalAddressAlias;
Expand Down Expand Up @@ -135,6 +138,11 @@ public WebserviceInfo(
builder.path(this.contextPath);
}
this.serverURLPrefix = builder.toUriString();
String guiAutologinURL = environment.getProperty(WEB_SERVICE_GUI_AUTOLOGIN_URL_KEY, builder.toUriString());
if (StringUtils.isBlank(guiAutologinURL)) {
guiAutologinURL = builder.toUriString();
}
this.guiAutologinURL = guiAutologinURL;

this.isLightSetup = BooleanUtils.toBoolean(environment.getProperty(
"sebserver.webservice.light.setup",
Expand Down Expand Up @@ -295,6 +303,10 @@ public String getExternalServerURL() {
return this.serverURLPrefix;
}

public String getGUIAutologinURL() {
return this.guiAutologinURL;
}

public String getOAuthTokenURI() {
return getExternalServerURL() + API.OAUTH_TOKEN_ENDPOINT;
}
Expand Down Expand Up @@ -359,8 +371,6 @@ public String toString() {
return builder.toString();
}



public static final class ScreenProctoringServiceBundle implements SPSAPIAccessData {

public final boolean bundled;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ public void onApplicationEvent(final ApplicationReadyEvent event) {
SEBServerInit.INIT_LOGGER.info("---->");
SEBServerInit.INIT_LOGGER.info("----> Context Path: {}", this.webserviceInfo.getContextPath());
SEBServerInit.INIT_LOGGER.info("----> External-Host URL: {}", this.webserviceInfo.getExternalServerURL());
SEBServerInit.INIT_LOGGER.info("----> Autologin URL: {}", this.webserviceInfo.getGUIAutologinURL());
SEBServerInit.INIT_LOGGER.info("----> LMS-External-Address-Alias: {}",
this.webserviceInfo.getLmsExternalAddressAlias());
SEBServerInit.INIT_LOGGER.info("---->");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,17 @@ public LmsSetupTestResult testAdHoc(final LmsSetup lmsSetup) {
}

final LmsSetupTestResult lmsSetupTestResult = fullIntegrationTest(lmsSetupTemplate);
if (lmsSetupTestResult != null) return lmsSetupTestResult;
if (lmsSetupTestResult != null) {
return lmsSetupTestResult;
}

return LmsSetupTestResult.ofOkay(lmsSetupTemplate.lmsSetup().getLmsType());
}

private LmsSetupTestResult fullIntegrationTest(final LmsAPITemplate template) {
if (!template.fullIntegrationActive()) {
return null;
}
if (template.lmsSetup().getLmsType().features.contains(LmsSetup.Features.LMS_FULL_INTEGRATION)) {
final Long lmsSetupId = template.lmsSetup().id;
final LmsSetupTestResult lmsSetupTestResult = template.testFullIntegrationAPI();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,6 @@ public FullLmsIntegrationService.TokenLoginResponse getOneTimeLoginToken(

return new FullLmsIntegrationService.TokenLoginResponse(
lmsUUId,
webserviceInfo.getExternalServerURL() + API.LMS_FULL_INTEGRATION_LOGIN_TOKEN_ENDPOINT + "?jwt=" + token);
webserviceInfo.getGUIAutologinURL() + API.LMS_FULL_INTEGRATION_LOGIN_TOKEN_ENDPOINT + "?jwt=" + token);
}
}
3 changes: 2 additions & 1 deletion src/main/resources/config/application-ws.properties
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ sebserver.webservice.http.external.port=
sebserver.webservice.http.redirect.gui=/gui
sebserver.webservice.ping.service.strategy=BLOCKING
sebserver.webservice.autologin.endpoint=/auto_login
sebserver.webservice.autologin.url=


### webservice API
Expand Down Expand Up @@ -116,7 +117,7 @@ sebserver.feature.exam.noLMS.enabled=true
sebserver.feature.exam.seb.liveProctoring.enabled=false
sebserver.feature.exam.seb.screenProctoring.enabled=true
sebserver.feature.exam.seb.screenProctoring.bundled=true
sebserver.feature.exam.seb.screenProctoring.bundled.url=sps-service:8090
sebserver.feature.exam.seb.screenProctoring.bundled.url=http://sps-webservice:8090
sebserver.feature.exam.seb.screenProctoring.bundled.clientId=sebserverClient
sebserver.feature.exam.seb.screenProctoring.bundled.clientPassword=${sps.sebserver.client.secret}
sebserver.feature.exam.seb.screenProctoring.bundled.sebserveraccount.username=SEBServerAPIAccount
Expand Down

0 comments on commit 54ec29d

Please sign in to comment.