2018-01-17 08:26:44 +01:00
|
|
|
|
/*
|
2020-01-06 15:24:46 +01:00
|
|
|
|
* Copyright (c) 2020 ETH Zürich, Educational Development and Technology (LET)
|
2018-01-17 08:26:44 +01:00
|
|
|
|
*
|
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
using System;
|
|
|
|
|
|
2019-08-30 09:55:26 +02:00
|
|
|
|
namespace SafeExamBrowser.Configuration.Contracts
|
2018-01-17 08:26:44 +01:00
|
|
|
|
{
|
2018-03-06 11:38:12 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Defines the fundamental, global configuration information for all application components.
|
|
|
|
|
/// </summary>
|
2018-02-15 15:42:54 +01:00
|
|
|
|
[Serializable]
|
2018-06-29 09:50:20 +02:00
|
|
|
|
public class AppConfig
|
2018-01-17 08:26:44 +01:00
|
|
|
|
{
|
2019-06-26 10:13:11 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// The name of the backup data file used by the service component.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public const string BACKUP_FILE_NAME = "Backup.bin";
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The base address for all communication hosts of the application.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public const string BASE_ADDRESS = "net.pipe://localhost/safeexambrowser";
|
|
|
|
|
|
2019-07-19 10:56:32 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// The name of the synchronization primitive for the client component.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public const string CLIENT_MUTEX_NAME = "safe_exam_browser_client_mutex";
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The name of the synchronization primitive for the runtime component.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public const string RUNTIME_MUTEX_NAME = "safe_exam_browser_runtime_mutex";
|
|
|
|
|
|
2019-06-26 10:13:11 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// The communication address of the service component.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public const string SERVICE_ADDRESS = BASE_ADDRESS + "/service";
|
|
|
|
|
|
2019-07-19 10:56:32 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// The name of the synchronization primitive for the service component.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public const string SERVICE_MUTEX_NAME = "safe_exam_browser_reset_mutex";
|
|
|
|
|
|
2018-01-17 14:08:39 +01:00
|
|
|
|
/// <summary>
|
2019-06-06 15:44:03 +02:00
|
|
|
|
/// The file path of the local client configuration for the active user.
|
2018-01-17 14:08:39 +01:00
|
|
|
|
/// </summary>
|
2019-06-06 15:44:03 +02:00
|
|
|
|
public string AppDataFilePath { get; set; }
|
2018-01-17 14:08:39 +01:00
|
|
|
|
|
2018-01-17 08:26:44 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// The point in time when the application was started.
|
|
|
|
|
/// </summary>
|
2018-02-15 15:42:54 +01:00
|
|
|
|
public DateTime ApplicationStartTime { get; set; }
|
2018-01-17 08:26:44 +01:00
|
|
|
|
|
2018-01-17 14:08:39 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// The path where the browser cache is to be stored.
|
|
|
|
|
/// </summary>
|
2018-02-15 15:42:54 +01:00
|
|
|
|
public string BrowserCachePath { get; set; }
|
2018-01-17 14:08:39 +01:00
|
|
|
|
|
2018-01-17 08:26:44 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// The file path under which the log of the browser component is to be stored.
|
|
|
|
|
/// </summary>
|
2019-06-06 15:44:03 +02:00
|
|
|
|
public string BrowserLogFilePath { get; set; }
|
2018-01-17 08:26:44 +01:00
|
|
|
|
|
2018-02-06 15:12:11 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// The communication address of the client component.
|
|
|
|
|
/// </summary>
|
2018-02-15 15:42:54 +01:00
|
|
|
|
public string ClientAddress { get; set; }
|
2018-02-06 15:12:11 +01:00
|
|
|
|
|
2018-02-14 15:26:05 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// The executable path of the client compontent.
|
|
|
|
|
/// </summary>
|
2018-02-15 15:42:54 +01:00
|
|
|
|
public string ClientExecutablePath { get; set; }
|
2018-02-14 15:26:05 +01:00
|
|
|
|
|
2018-02-06 15:12:11 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// The unique identifier for the currently running client instance.
|
|
|
|
|
/// </summary>
|
2018-02-15 15:42:54 +01:00
|
|
|
|
public Guid ClientId { get; set; }
|
2018-02-06 15:12:11 +01:00
|
|
|
|
|
2018-01-17 08:26:44 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// The file path under which the log of the client component is to be stored.
|
|
|
|
|
/// </summary>
|
2019-06-06 15:44:03 +02:00
|
|
|
|
public string ClientLogFilePath { get; set; }
|
2018-01-17 08:26:44 +01:00
|
|
|
|
|
2020-02-10 12:19:25 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// The hash value of the certificate used to sign the application binaries, or <c>null</c> if the binaries are unsigned.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public string CodeSignatureHash { get; set; }
|
|
|
|
|
|
2018-06-21 07:56:25 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// The file extension of configuration files for the application (including the period).
|
|
|
|
|
/// </summary>
|
|
|
|
|
public string ConfigurationFileExtension { get; set; }
|
|
|
|
|
|
2020-02-06 11:10:22 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// The MIME type of configuration files for the application.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public string ConfigurationFileMimeType { get; set; }
|
|
|
|
|
|
2018-01-17 14:08:39 +01:00
|
|
|
|
/// <summary>
|
2019-08-13 10:02:05 +02:00
|
|
|
|
/// The build version of the application.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public string ProgramBuildVersion { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The copyright information for the application.
|
2018-01-17 14:08:39 +01:00
|
|
|
|
/// </summary>
|
2018-02-15 15:42:54 +01:00
|
|
|
|
public string ProgramCopyright { get; set; }
|
2018-01-17 14:08:39 +01:00
|
|
|
|
|
2018-01-18 15:14:05 +01:00
|
|
|
|
/// <summary>
|
2019-06-06 15:44:03 +02:00
|
|
|
|
/// The file path of the local client configuration for all users.
|
2018-01-18 15:14:05 +01:00
|
|
|
|
/// </summary>
|
2019-06-06 15:44:03 +02:00
|
|
|
|
public string ProgramDataFilePath { get; set; }
|
2018-01-18 15:14:05 +01:00
|
|
|
|
|
2018-01-17 14:08:39 +01:00
|
|
|
|
/// <summary>
|
2019-08-13 10:02:05 +02:00
|
|
|
|
/// The program title of the application.
|
2018-01-17 14:08:39 +01:00
|
|
|
|
/// </summary>
|
2018-02-15 15:42:54 +01:00
|
|
|
|
public string ProgramTitle { get; set; }
|
2018-01-17 14:08:39 +01:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
2019-08-13 10:02:05 +02:00
|
|
|
|
/// The informational version of the application.
|
2018-01-17 14:08:39 +01:00
|
|
|
|
/// </summary>
|
2019-08-13 10:02:05 +02:00
|
|
|
|
public string ProgramInformationalVersion { get; set; }
|
2018-01-17 14:08:39 +01:00
|
|
|
|
|
2018-02-06 15:12:11 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// The communication address of the runtime component.
|
|
|
|
|
/// </summary>
|
2018-02-15 15:42:54 +01:00
|
|
|
|
public string RuntimeAddress { get; set; }
|
2018-02-06 15:12:11 +01:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The unique identifier for the currently running runtime instance.
|
|
|
|
|
/// </summary>
|
2018-02-15 15:42:54 +01:00
|
|
|
|
public Guid RuntimeId { get; set; }
|
2018-02-06 15:12:11 +01:00
|
|
|
|
|
2018-01-17 08:26:44 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// The file path under which the log of the runtime component is to be stored.
|
|
|
|
|
/// </summary>
|
2019-06-06 15:44:03 +02:00
|
|
|
|
public string RuntimeLogFilePath { get; set; }
|
2018-02-06 15:12:11 +01:00
|
|
|
|
|
2018-08-14 09:06:35 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// The URI scheme for SEB resources.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public string SebUriScheme { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The URI scheme for secure SEB resources.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public string SebUriSchemeSecure { get; set; }
|
|
|
|
|
|
2020-07-28 19:56:25 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// The server API as JSON string.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public string ServerApi { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The connection token for a server.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public string ServerConnectionToken { get; set; }
|
|
|
|
|
|
2020-07-29 23:39:05 +02:00
|
|
|
|
/// <summary>
|
2020-12-02 17:43:02 +01:00
|
|
|
|
/// Determines whether the server connectivity should automatically be started in case of a reconfiguration.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public bool ServerConnectivityAutoStart { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2020-07-29 23:39:05 +02:00
|
|
|
|
/// The identifier of the selected server exam.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public string ServerExamId { get; set; }
|
|
|
|
|
|
2020-07-28 19:56:25 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// The OAuth2 token for a server.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public string ServerOauth2Token { get; set; }
|
|
|
|
|
|
2018-02-06 15:12:11 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// The communication address of the service component.
|
|
|
|
|
/// </summary>
|
2018-02-15 15:42:54 +01:00
|
|
|
|
public string ServiceAddress { get; set; }
|
2018-11-08 09:39:52 +01:00
|
|
|
|
|
2019-06-18 10:18:56 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// The name of the global inter-process synchronization event hosted by the service.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public string ServiceEventName { get; set; }
|
|
|
|
|
|
2019-06-18 15:51:35 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// The file path under which the log for the current session of the service component is to be stored.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public string ServiceLogFilePath { get; set; }
|
|
|
|
|
|
2020-01-29 10:07:28 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// The directory to be used for temporary application data.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public string TemporaryDirectory { get; set; }
|
|
|
|
|
|
2018-11-08 09:39:52 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Creates a shallow clone.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public AppConfig Clone()
|
|
|
|
|
{
|
|
|
|
|
return MemberwiseClone() as AppConfig;
|
|
|
|
|
}
|
2018-01-17 08:26:44 +01:00
|
|
|
|
}
|
|
|
|
|
}
|