Restore SEBPatch

This commit is contained in:
2025-06-01 11:44:20 +02:00
commit 8c656e3137
1297 changed files with 142172 additions and 0 deletions

View File

@@ -0,0 +1,69 @@
/*
* Copyright (c) 2024 ETH Zürich, IT Services
*
* 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;
using SafeExamBrowser.Communication.Contracts.Events;
namespace SafeExamBrowser.Communication.Contracts.Hosts
{
/// <summary>
/// Defines the functionality of the communication host for the client application component.
/// </summary>
public interface IClientHost : ICommunicationHost
{
/// <summary>
/// The token used for initial authentication with the runtime.
/// </summary>
Guid AuthenticationToken { set; }
/// <summary>
/// Indicates whether the runtime has established a connection to this host.
/// </summary>
bool IsConnected { get; }
/// <summary>
/// Event fired when the runtime requests a server exam selection from the user.
/// </summary>
event CommunicationEventHandler<ExamSelectionRequestEventArgs> ExamSelectionRequested;
/// <summary>
/// Event fired when the runtime requests a message box input from the user.
/// </summary>
event CommunicationEventHandler<MessageBoxRequestEventArgs> MessageBoxRequested;
/// <summary>
/// Event fired when the runtime requests a password input from the user.
/// </summary>
event CommunicationEventHandler<PasswordRequestEventArgs> PasswordRequested;
/// <summary>
/// Event fired when the runtime aborted a reconfiguration.
/// </summary>
event CommunicationEventHandler ReconfigurationAborted;
/// <summary>
/// Event fired when the runtime denied a reconfiguration request.
/// </summary>
event CommunicationEventHandler<ReconfigurationEventArgs> ReconfigurationDenied;
/// <summary>
/// Event fired when the runtime disconnected from the client.
/// </summary>
event CommunicationEventHandler RuntimeDisconnected;
/// <summary>
/// Event fired when the runtime requests a server failure action selection from the user.
/// </summary>
event CommunicationEventHandler<ServerFailureActionRequestEventArgs> ServerFailureActionRequested;
/// <summary>
/// Event fired when the runtime commands the client to shutdown.
/// </summary>
event CommunicationEventHandler Shutdown;
}
}

View File

@@ -0,0 +1,19 @@
/*
* Copyright (c) 2024 ETH Zürich, IT Services
*
* 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.ServiceModel;
namespace SafeExamBrowser.Communication.Contracts.Hosts
{
/// <summary>
/// The host object to be used in communication hosts.
/// </summary>
public interface IHostObject : ICommunicationObject
{
}
}

View File

@@ -0,0 +1,21 @@
/*
* Copyright (c) 2024 ETH Zürich, IT Services
*
* 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/.
*/
namespace SafeExamBrowser.Communication.Contracts.Hosts
{
/// <summary>
/// A factory to create host objects for communication hosts.
/// </summary>
public interface IHostObjectFactory
{
/// <summary>
/// Utilizes the given communication object to create a host object (see <see cref="IHostObject"/>) for the specified endpoint address.
/// </summary>
IHostObject CreateObject(string address, ICommunication communicationObject);
}
}

View File

@@ -0,0 +1,74 @@
/*
* Copyright (c) 2024 ETH Zürich, IT Services
*
* 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;
using SafeExamBrowser.Communication.Contracts.Events;
namespace SafeExamBrowser.Communication.Contracts.Hosts
{
/// <summary>
/// Defines the functionality of the communication host for the runtime application component.
/// </summary>
public interface IRuntimeHost : ICommunicationHost
{
/// <summary>
/// Determines whether another application component may establish a connection with the host.
/// </summary>
bool AllowConnection { get; set; }
/// <summary>
/// The token used for initial authentication.
/// </summary>
Guid? AuthenticationToken { set; }
/// <summary>
/// Event fired when the client disconnected from the runtime.
/// </summary>
event CommunicationEventHandler ClientDisconnected;
/// <summary>
/// Event fired when the client has signaled that it is ready to operate.
/// </summary>
event CommunicationEventHandler ClientReady;
/// <summary>
/// Event fired when the client requested its configuration data.
/// </summary>
event CommunicationEventHandler<ClientConfigurationEventArgs> ClientConfigurationNeeded;
/// <summary>
/// Event fired when the client submitted a server exam selection made by the user.
/// </summary>
event CommunicationEventHandler<ExamSelectionReplyEventArgs> ExamSelectionReceived;
/// <summary>
/// Event fired when the client submitted a message box result chosen by the user.
/// </summary>
event CommunicationEventHandler<MessageBoxReplyEventArgs> MessageBoxReplyReceived;
/// <summary>
/// Event fired when the client submitted a password entered by the user.
/// </summary>
event CommunicationEventHandler<PasswordReplyEventArgs> PasswordReceived;
/// <summary>
/// Event fired when the client requested a reconfiguration of the application.
/// </summary>
event CommunicationEventHandler<ReconfigurationEventArgs> ReconfigurationRequested;
/// <summary>
/// Event fired when the client submitted a server failure action chosen by the user.
/// </summary>
event CommunicationEventHandler<ServerFailureActionReplyEventArgs> ServerFailureActionReceived;
/// <summary>
/// Event fired when the client requests to shut down the application.
/// </summary>
event CommunicationEventHandler ShutdownRequested;
}
}

View File

@@ -0,0 +1,33 @@
/*
* Copyright (c) 2024 ETH Zürich, IT Services
*
* 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 SafeExamBrowser.Communication.Contracts.Events;
namespace SafeExamBrowser.Communication.Contracts.Hosts
{
/// <summary>
/// Defines the functionality of the communication host for the service application component.
/// </summary>
public interface IServiceHost : ICommunicationHost
{
/// <summary>
/// Event fired when the runtime requested to start a new session.
/// </summary>
event CommunicationEventHandler<SessionStartEventArgs> SessionStartRequested;
/// <summary>
/// Event fired when the runtime requested to stop a running session.
/// </summary>
event CommunicationEventHandler<SessionStopEventArgs> SessionStopRequested;
/// <summary>
/// Event fired when the runtime requested to update the system configuration.
/// </summary>
event CommunicationEventHandler SystemConfigurationUpdateRequested;
}
}