SEBSERV-112 fixes

This commit is contained in:
anhefti 2020-04-14 16:47:55 +02:00
parent 7c402c7a46
commit bdb8e673dd
7 changed files with 34 additions and 33 deletions

View file

@ -225,6 +225,8 @@ SEB Setting Differences
In the current version (1.0) of SEB Server, there are some differences to some SEB settings and also some SEB settings that are currently not
available on the SEB Server.
**SEB settings currently not supported by the SEB Server**
- Start URL: Since SEB Server has already been contacted by a SEB client when downloading the exam configuration this is not used by the exam configuration on SEB Server. But this can be used as fallback URL in the Client Configuration.
@ -235,11 +237,12 @@ available on the SEB Server.
- Browser Exam Key: There is currently no possibility to generate the Browser Exam Key on the SEB Server. But an already generated Browser Exam Key may be used within the SEB restriction feature on the exam configuration if this feature is supported by the LMS in use.
**SEB settings that has a slightly different form or handling in SEB Server comparing to the SEB configuration tool**
- Download Directory OSX: Since it is not possible within a web-service to choose a local directory on a remote device this is just a text input where one has to give the full-path to the directory on the client device in text form.
- Log Directory OSX, Log Directory Win: Since it is not possible within a web-service to choose a local directory on a remote device this is just a text input where one has to give the full-path to the directory on the client device in text form.
- Permitted Processes / Executable: This is also just a text input field where one can give the name of the process in text form.
**SEB settings from versions before 3.0 that are not supported anymore**
- Permitted Processes / Window Handling Process

View file

@ -8,6 +8,21 @@
package ch.ethz.seb.sebserver.webservice.servicelayer.sebconfig.impl;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
import java.util.Stack;
import java.util.function.Consumer;
import java.util.function.Function;
import org.apache.commons.lang3.BooleanUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.text.StringEscapeUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.xml.sax.Attributes;
import org.xml.sax.helpers.DefaultHandler;
import ch.ethz.seb.sebserver.gbl.Constants;
import ch.ethz.seb.sebserver.gbl.model.sebconfig.AttributeType;
import ch.ethz.seb.sebserver.gbl.model.sebconfig.ConfigurationAttribute;
@ -15,19 +30,6 @@ import ch.ethz.seb.sebserver.gbl.model.sebconfig.ConfigurationValue;
import ch.ethz.seb.sebserver.gbl.util.Cryptor;
import ch.ethz.seb.sebserver.webservice.servicelayer.sebconfig.impl.ExamConfigXMLParser.PListNode.Type;
import ch.ethz.seb.sebserver.webservice.servicelayer.sebconfig.impl.converter.KioskModeConverter;
import org.apache.commons.lang3.BooleanUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.xml.sax.Attributes;
import org.xml.sax.helpers.DefaultHandler;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
import java.util.Stack;
import java.util.function.Consumer;
import java.util.function.Function;
public class ExamConfigXMLParser extends DefaultHandler {
@ -86,8 +88,7 @@ public class ExamConfigXMLParser extends DefaultHandler {
public static final Set<String> PASSWORD_ATTRIBUTES = new HashSet<>(Arrays.asList(
"hashedQuitPassword",
"hashedAdminPassword"
));
"hashedAdminPassword"));
private final Cryptor cryptor;
private final Consumer<ConfigurationValue> valueConsumer;
@ -330,7 +331,8 @@ public class ExamConfigXMLParser extends DefaultHandler {
// check if we have a simple values array
if (attribute != null && (attribute.type == AttributeType.MULTI_CHECKBOX_SELECTION
|| attribute.type == AttributeType.MULTI_SELECTION)) {
|| attribute.type == AttributeType.MULTI_SELECTION
|| attribute.type == AttributeType.TEXT_AREA)) {
saveValue(attrName, attribute, top.listIndex, (top.value == null) ? "" : top.value);
}
@ -389,7 +391,11 @@ public class ExamConfigXMLParser extends DefaultHandler {
final String value = String.valueOf(valueChar);
final PListNode top = this.stack.peek();
if (top.type == Type.VALUE_STRING) {
top.value = value;
if (top.value == null) {
top.value = StringEscapeUtils.unescapeXml(value);
} else {
top.value += StringEscapeUtils.unescapeXml(value);
}
} else if (top.type == Type.VALUE_INTEGER) {
top.value = value;
} else if (top.type == Type.KEY) {
@ -450,7 +456,7 @@ public class ExamConfigXMLParser extends DefaultHandler {
attribute.id,
listIndex,
StringUtils.isNotBlank(value)
? cryptor.encrypt(value + Constants.IMPORTED_PASSWORD_MARKER).toString()
? this.cryptor.encrypt(value + Constants.IMPORTED_PASSWORD_MARKER).toString()
: value);
}

View file

@ -9,8 +9,6 @@
<true />
<key>allowUserToChooseApp</key>
<false />
<key>allowedExecutables</key>
<string />
<key>arguments</key>
<array></array>
<key>autostart</key>
@ -33,8 +31,6 @@
<true />
<key>title</key>
<string>SEB</string>
<key>windowHandlingProcess</key>
<string />
<key>originalName</key>
<string>firefox.exe</string>
</dict>

View file

@ -98,7 +98,6 @@ INSERT INTO configuration_attribute VALUES
(77, 'permittedProcesses.description', 'TEXT_FIELD', 73, null, null, null, ''),
(78, 'permittedProcesses.executable', 'TEXT_FIELD', 73, null, null, null, ''),
(79, 'permittedProcesses.originalName', 'TEXT_FIELD', 73, null, null, null, ''),
(80, 'permittedProcesses.allowedExecutables', 'TEXT_FIELD', 73, null, null, null, ''),
(81, 'permittedProcesses.path', 'TEXT_FIELD', 73, null, null, null, ''),
(82, 'permittedProcesses.arguments', 'INLINE_TABLE', 73, '1:active:CHECKBOX|4:argument:TEXT_FIELD', null, null, null),
(85, 'permittedProcesses.identifier', 'TEXT_FIELD', 73, null, null, null, ''),
@ -364,7 +363,6 @@ INSERT INTO orientation VALUES
(77, 77, 0, 6, null, 0, 3, 1, 1, 'LEFT'),
(78, 78, 0, 6, null, 3, 4, 4, 1, 'LEFT'),
(79, 79, 0, 6, null, 0, 5, 1, 1, 'LEFT'),
(80, 80, 0, 6, null, 0, 6, 1, 1, 'LEFT'),
(81, 81, 0, 6, null, 0, 7, 1, 1, 'LEFT'),
(82, 82, 0, 6, null, 0, 8, 1, 3, 'LEFT'),

View file

@ -892,7 +892,7 @@ sebserver.examconfig.props.label.browserUserAgentWinDesktopMode.1=Custom
sebserver.examconfig.props.label.browserUserAgentWinDesktopMode.1.tooltip=Zoom only text on web pages using Ctrl-Mousewheel (Win)
sebserver.examconfig.props.label.browserUserAgentWinDesktopModeCustom.tooltip=Custom desktop user agent string<br/>(SEB appends its version number automatically)
sebserver.examconfig.props.group.userAgentTouch=User agent for touch/table mode
sebserver.examconfig.props.group.userAgentTouch=User agent for touch/tablet mode
sebserver.examconfig.props.label.browserUserAgentWinTouchMode.0=Touch default
sebserver.examconfig.props.label.browserUserAgentWinTouchMode.1=iPad
sebserver.examconfig.props.label.browserUserAgentWinTouchMode.2=Custom
@ -953,7 +953,7 @@ sebserver.examconfig.props.label.permittedProcesses.active=Active
sebserver.examconfig.props.label.permittedProcesses.active.tooltip=This permitted process item is active.
sebserver.examconfig.props.label.permittedProcesses.os=OS
sebserver.examconfig.props.label.permittedProcesses.os.tooltip=Indicates on which operating system the permitted process runs.
sebserver.examconfig.props.label.permittedProcesses.os.0=OS X
sebserver.examconfig.props.label.permittedProcesses.os.0=macOS
sebserver.examconfig.props.label.permittedProcesses.os.1=Win
sebserver.examconfig.props.label.permittedProcesses.title=Title
sebserver.examconfig.props.label.permittedProcesses.title.tooltip=Application title which is displayed in the application chooser.<br/> Background processes don't have a title, because they can't be selected by users.
@ -988,7 +988,7 @@ sebserver.examconfig.props.label.prohibitedProcesses=Prohibited Processes
sebserver.examconfig.props.label.prohibitedProcesses.active=Active
sebserver.examconfig.props.label.prohibitedProcesses.active.tooltip=Indicates if this prohibited process item is active.
sebserver.examconfig.props.label.prohibitedProcesses.os=OS
sebserver.examconfig.props.label.prohibitedProcesses.os.0=OS X
sebserver.examconfig.props.label.prohibitedProcesses.os.0=macOS
sebserver.examconfig.props.label.prohibitedProcesses.os.1=Win
sebserver.examconfig.props.label.prohibitedProcesses.description=Description
sebserver.examconfig.props.label.prohibitedProcesses.description.tooltip=Optional, to explain what kind of process this is,<br/> because this might not be obvious only from the executable's name.

View file

@ -1052,7 +1052,7 @@ public class UseCasesIntegrationTest extends GuiIntegrationTest {
assertNotNull(attributes);
assertFalse(attributes.hasError());
final AttributeMapping attributeMapping = attributes.get();
assertEquals(195, attributeMapping.attributeIdMapping.size());
assertEquals(194, attributeMapping.attributeIdMapping.size());
assertEquals(
"[active, audio, backToStart, browserSecurity, browserViewMode, exitSequence, functionKeys, kioskMode, logging, "
+ "macSettings, newBrowserWindow, newwinsize, proxies, quitLink, registry, servicePolicy, sessionHandling, "
@ -1716,7 +1716,7 @@ public class UseCasesIntegrationTest extends GuiIntegrationTest {
.getOrThrow();
assertNotNull(templateTrientations);
assertFalse(templateTrientations.isEmpty());
assertEquals(195, templateTrientations.size());
assertEquals(194, templateTrientations.size());
// get template attributes page
final Page<TemplateAttribute> templateAttributes = restService

View file

@ -121,7 +121,6 @@ INSERT IGNORE INTO configuration_attribute VALUES
(77, 'permittedProcesses.description', 'TEXT_FIELD', 73, null, null, null, ''),
(78, 'permittedProcesses.executable', 'TEXT_FIELD', 73, null, null, null, ''),
(79, 'permittedProcesses.originalName', 'TEXT_FIELD', 73, null, null, null, ''),
(80, 'permittedProcesses.allowedExecutables', 'TEXT_FIELD', 73, null, null, null, ''),
(81, 'permittedProcesses.path', 'TEXT_FIELD', 73, null, null, null, ''),
(82, 'permittedProcesses.arguments', 'INLINE_TABLE', 73, '1:active:CHECKBOX|4:argument:TEXT_FIELD', null, null, null),
(85, 'permittedProcesses.identifier', 'TEXT_FIELD', 73, null, null, null, ''),
@ -387,7 +386,6 @@ INSERT IGNORE INTO orientation VALUES
(77, 77, 0, 6, null, 0, 3, 1, 1, 'LEFT'),
(78, 78, 0, 6, null, 3, 4, 4, 1, 'LEFT'),
(79, 79, 0, 6, null, 0, 5, 1, 1, 'LEFT'),
(80, 80, 0, 6, null, 0, 6, 1, 1, 'LEFT'),
(81, 81, 0, 6, null, 0, 7, 1, 1, 'LEFT'),
(82, 82, 0, 6, null, 0, 8, 1, 3, 'LEFT'),