Certificate/wireless plugins; major refactoring
Migrate much of BI to Services. Added Wireless Profile Provider plugin feature. Added Certificate Authority Provider plugin feature. Modified Certificate Provider plugin feature. Database migration v17, for Device Profiles. Enrolment Client Updated to support CA Certificates, Wireless Profiles and Hardware Info. New Client Enrolment Protocol to support new features. Plugin Manifest Generator added to main solution. Improved AD search performance.
This commit is contained in:
+14
@@ -0,0 +1,14 @@
|
||||
using Disco.Data.Repository;
|
||||
using Disco.Models.ClientServices;
|
||||
using Disco.Models.Repository;
|
||||
|
||||
namespace Disco.Services.Plugins.Features.CertificateAuthorityProvider
|
||||
{
|
||||
[PluginFeatureCategory(DisplayName = "Certificate Authority Providers")]
|
||||
public abstract class CertificateAuthorityProviderFeature : PluginFeature
|
||||
{
|
||||
public abstract string CertificateProviderId { get; }
|
||||
|
||||
public abstract ProvisionAuthorityCertificatesResult ProvisionAuthorityCertificates(DiscoDataContext Database, Device Device, Enrol Enrolment);
|
||||
}
|
||||
}
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
using Disco.Models.ClientServices;
|
||||
using Disco.Models.Repository;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Disco.Services.Plugins.Features.CertificateAuthorityProvider
|
||||
{
|
||||
public class ProvisionAuthorityCertificatesResult
|
||||
{
|
||||
/// <summary>
|
||||
/// The <see cref="Device"/> associated with the provision result.
|
||||
/// </summary>
|
||||
public Device Device { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The <see cref="Enrol"/> associated with the provision result.
|
||||
/// </summary>
|
||||
public Enrol Enrolment { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// A list of certificate thumbprints to be removed from the Trusted Root Certification Authorities store
|
||||
/// Matching certificates will be removed unless they match the <see cref="TrustedRootCertificates"/>.
|
||||
/// </summary>
|
||||
public List<string> TrustedRootCertificateRemoveThumbprints { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// A list of certificates to be added to the Trusted Root Certification Authorities store on the client device.
|
||||
/// </summary>
|
||||
public List<byte[]> TrustedRootCertificates { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// A list of certificate thumbprints to be removed from the Intermedate Certificate Authorities store.
|
||||
/// Matching certificates will be removed unless they match the <see cref="IntermediateCertificates"/>.
|
||||
/// </summary>
|
||||
public List<string> IntermediateCertificateRemoveThumbprints { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// A list of certificates to be added to the Intermedate Certificate Authorities store on the client device.
|
||||
/// </summary>
|
||||
public List<byte[]> IntermediateCertificates { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Disco.Data.Repository;
|
||||
using Disco.Data.Repository;
|
||||
using Disco.Models.ClientServices;
|
||||
using Disco.Models.Repository;
|
||||
|
||||
namespace Disco.Services.Plugins.Features.CertificateProvider
|
||||
@@ -11,8 +7,8 @@ namespace Disco.Services.Plugins.Features.CertificateProvider
|
||||
[PluginFeatureCategory(DisplayName = "Certificate Providers")]
|
||||
public abstract class CertificateProviderFeature : PluginFeature
|
||||
{
|
||||
// Certificate Plugin Requirements
|
||||
public abstract string CertificateProviderId { get; }
|
||||
public abstract Tuple<DeviceCertificate, List<string>> AllocateCertificate(DiscoDataContext Database, Device Device);
|
||||
|
||||
public abstract ProvisionPersonalCertificateResult ProvisionPersonalCertificate(DiscoDataContext Database, Device Device, Enrol Enrolment);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,129 +1,127 @@
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Services.Logging;
|
||||
using Disco.Services.Logging.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace Disco.Services.Plugins.Features.CertificateProvider
|
||||
{
|
||||
public class CertificateProvidersLog : LogBase
|
||||
{
|
||||
public enum EventTypeIds
|
||||
{
|
||||
RetrievalStarting = 10,
|
||||
RetrievalProgress,
|
||||
RetrievalFinished,
|
||||
RetrievalWarning = 15,
|
||||
RetrievalError,
|
||||
RetrievalCertificateStarting = 20,
|
||||
RetrievalCertificateFinished = 22,
|
||||
RetrievalCertificateWarning = 25,
|
||||
RetrievalCertificateError,
|
||||
Allocated = 40,
|
||||
AllocationFailed = 50,
|
||||
public class CertificateProvidersLog : LogBase
|
||||
{
|
||||
public enum EventTypeIds
|
||||
{
|
||||
RetrievalStarting = 10,
|
||||
RetrievalProgress,
|
||||
RetrievalFinished,
|
||||
RetrievalWarning = 15,
|
||||
RetrievalError,
|
||||
RetrievalCertificateStarting = 20,
|
||||
RetrievalCertificateFinished = 22,
|
||||
RetrievalCertificateWarning = 25,
|
||||
RetrievalCertificateError,
|
||||
Allocated = 40,
|
||||
AllocationFailed = 50,
|
||||
DisabledCertificate = 100,
|
||||
EnabledCertificate = 110,
|
||||
DeletedCertificate = 120,
|
||||
UpdatedCertificate = 130
|
||||
}
|
||||
private const int _ModuleId = 60;
|
||||
private static bool _IsCertificateRetrievalProcessing;
|
||||
private static string _CertificateRetrievalStatus;
|
||||
private static int _CertificateRetrievalProgress;
|
||||
public static CertificateProvidersLog Current
|
||||
{
|
||||
get
|
||||
{
|
||||
return (CertificateProvidersLog)LogContext.LogModules[60];
|
||||
}
|
||||
}
|
||||
public static bool IsCertificateRetrievalProcessing
|
||||
{
|
||||
get
|
||||
{
|
||||
return CertificateProvidersLog._IsCertificateRetrievalProcessing;
|
||||
}
|
||||
}
|
||||
public override string ModuleDescription
|
||||
{
|
||||
get
|
||||
{
|
||||
return "Certificate Providers";
|
||||
}
|
||||
}
|
||||
public override int ModuleId
|
||||
{
|
||||
get
|
||||
{
|
||||
return 60;
|
||||
}
|
||||
}
|
||||
public override string ModuleName
|
||||
{
|
||||
get
|
||||
{
|
||||
return "CertificateProviders";
|
||||
}
|
||||
}
|
||||
[System.Diagnostics.DebuggerNonUserCode]
|
||||
public CertificateProvidersLog()
|
||||
{
|
||||
}
|
||||
private static void Log(CertificateProvidersLog.EventTypeIds EventTypeId, params object[] Args)
|
||||
{
|
||||
CertificateProvidersLog.Current.Log((int)EventTypeId, Args);
|
||||
}
|
||||
public static void LogRetrievalStarting(int CertificateCount, int CertificateIdFrom, int CertificateIdTo)
|
||||
{
|
||||
CertificateProvidersLog.Log(CertificateProvidersLog.EventTypeIds.RetrievalStarting, new object[]
|
||||
{
|
||||
CertificateCount,
|
||||
CertificateIdFrom,
|
||||
CertificateIdTo
|
||||
});
|
||||
}
|
||||
public static void LogRetrievalFinished()
|
||||
{
|
||||
CertificateProvidersLog.Log(CertificateProvidersLog.EventTypeIds.RetrievalFinished, new object[0]);
|
||||
}
|
||||
public static void LogRetrievalWarning(string Message)
|
||||
{
|
||||
CertificateProvidersLog.Log(CertificateProvidersLog.EventTypeIds.RetrievalWarning, new object[]
|
||||
{
|
||||
Message
|
||||
});
|
||||
}
|
||||
public static void LogRetrievalError(string Message)
|
||||
{
|
||||
CertificateProvidersLog.Log(CertificateProvidersLog.EventTypeIds.RetrievalError, new object[]
|
||||
{
|
||||
Message
|
||||
});
|
||||
}
|
||||
public static void LogRetrievalCertificateStarting(string CertificateId)
|
||||
{
|
||||
CertificateProvidersLog.Log(CertificateProvidersLog.EventTypeIds.RetrievalCertificateStarting, CertificateId);
|
||||
}
|
||||
public static void LogRetrievalCertificateFinished(string CertificateId)
|
||||
{
|
||||
CertificateProvidersLog.Log(CertificateProvidersLog.EventTypeIds.RetrievalCertificateFinished, CertificateId);
|
||||
}
|
||||
public static void LogRetrievalCertificateWarning(string CertificateId, string Message)
|
||||
{
|
||||
CertificateProvidersLog.Log(CertificateProvidersLog.EventTypeIds.RetrievalCertificateWarning, CertificateId, Message);
|
||||
}
|
||||
public static void LogRetrievalCertificateError(string CertificateId, string Message)
|
||||
{
|
||||
CertificateProvidersLog.Log(CertificateProvidersLog.EventTypeIds.RetrievalCertificateError, CertificateId, Message);
|
||||
}
|
||||
public static void LogAllocated(string CertificateId, string DeviceSerialNumber)
|
||||
{
|
||||
CertificateProvidersLog.Log(CertificateProvidersLog.EventTypeIds.Allocated, CertificateId, DeviceSerialNumber);
|
||||
}
|
||||
public static void LogAllocationFailed(string DeviceSerialNumber)
|
||||
{
|
||||
CertificateProvidersLog.Log(CertificateProvidersLog.EventTypeIds.AllocationFailed, DeviceSerialNumber);
|
||||
}
|
||||
}
|
||||
private const int _ModuleId = 60;
|
||||
private static bool _IsCertificateRetrievalProcessing;
|
||||
private static string _CertificateRetrievalStatus;
|
||||
private static int _CertificateRetrievalProgress;
|
||||
public static CertificateProvidersLog Current
|
||||
{
|
||||
get
|
||||
{
|
||||
return (CertificateProvidersLog)LogContext.LogModules[60];
|
||||
}
|
||||
}
|
||||
public static bool IsCertificateRetrievalProcessing
|
||||
{
|
||||
get
|
||||
{
|
||||
return CertificateProvidersLog._IsCertificateRetrievalProcessing;
|
||||
}
|
||||
}
|
||||
public override string ModuleDescription
|
||||
{
|
||||
get
|
||||
{
|
||||
return "Certificate Providers";
|
||||
}
|
||||
}
|
||||
public override int ModuleId
|
||||
{
|
||||
get
|
||||
{
|
||||
return 60;
|
||||
}
|
||||
}
|
||||
public override string ModuleName
|
||||
{
|
||||
get
|
||||
{
|
||||
return "CertificateProviders";
|
||||
}
|
||||
}
|
||||
[System.Diagnostics.DebuggerNonUserCode]
|
||||
public CertificateProvidersLog()
|
||||
{
|
||||
}
|
||||
private static void Log(CertificateProvidersLog.EventTypeIds EventTypeId, params object[] Args)
|
||||
{
|
||||
CertificateProvidersLog.Current.Log((int)EventTypeId, Args);
|
||||
}
|
||||
public static void LogRetrievalStarting(int CertificateCount, int CertificateIdFrom, int CertificateIdTo)
|
||||
{
|
||||
CertificateProvidersLog.Log(CertificateProvidersLog.EventTypeIds.RetrievalStarting, new object[]
|
||||
{
|
||||
CertificateCount,
|
||||
CertificateIdFrom,
|
||||
CertificateIdTo
|
||||
});
|
||||
}
|
||||
public static void LogRetrievalFinished()
|
||||
{
|
||||
CertificateProvidersLog.Log(CertificateProvidersLog.EventTypeIds.RetrievalFinished, new object[0]);
|
||||
}
|
||||
public static void LogRetrievalWarning(string Message)
|
||||
{
|
||||
CertificateProvidersLog.Log(CertificateProvidersLog.EventTypeIds.RetrievalWarning, new object[]
|
||||
{
|
||||
Message
|
||||
});
|
||||
}
|
||||
public static void LogRetrievalError(string Message)
|
||||
{
|
||||
CertificateProvidersLog.Log(CertificateProvidersLog.EventTypeIds.RetrievalError, new object[]
|
||||
{
|
||||
Message
|
||||
});
|
||||
}
|
||||
public static void LogRetrievalCertificateStarting(string CertificateId)
|
||||
{
|
||||
CertificateProvidersLog.Log(CertificateProvidersLog.EventTypeIds.RetrievalCertificateStarting, CertificateId);
|
||||
}
|
||||
public static void LogRetrievalCertificateFinished(string CertificateId)
|
||||
{
|
||||
CertificateProvidersLog.Log(CertificateProvidersLog.EventTypeIds.RetrievalCertificateFinished, CertificateId);
|
||||
}
|
||||
public static void LogRetrievalCertificateWarning(string CertificateId, string Message)
|
||||
{
|
||||
CertificateProvidersLog.Log(CertificateProvidersLog.EventTypeIds.RetrievalCertificateWarning, CertificateId, Message);
|
||||
}
|
||||
public static void LogRetrievalCertificateError(string CertificateId, string Message)
|
||||
{
|
||||
CertificateProvidersLog.Log(CertificateProvidersLog.EventTypeIds.RetrievalCertificateError, CertificateId, Message);
|
||||
}
|
||||
public static void LogAllocated(string CertificateId, string DeviceSerialNumber)
|
||||
{
|
||||
CertificateProvidersLog.Log(CertificateProvidersLog.EventTypeIds.Allocated, CertificateId, DeviceSerialNumber);
|
||||
}
|
||||
public static void LogAllocationFailed(string DeviceSerialNumber)
|
||||
{
|
||||
CertificateProvidersLog.Log(CertificateProvidersLog.EventTypeIds.AllocationFailed, DeviceSerialNumber);
|
||||
}
|
||||
public static void LogDisabledCertificate(DeviceCertificate Certificate, string Reason)
|
||||
{
|
||||
CertificateProvidersLog.Log(EventTypeIds.DisabledCertificate, Certificate.Name, Certificate.Id, Reason);
|
||||
@@ -140,210 +138,210 @@ namespace Disco.Services.Plugins.Features.CertificateProvider
|
||||
{
|
||||
CertificateProvidersLog.Log(EventTypeIds.UpdatedCertificate, Certificate.Name, Certificate.Id, Reason);
|
||||
}
|
||||
|
||||
public static void LogCertificateRetrievalProgress(bool? IsProcessing, int? Progress, string Status)
|
||||
{
|
||||
bool flag = IsProcessing.HasValue;
|
||||
if (flag)
|
||||
{
|
||||
CertificateProvidersLog._IsCertificateRetrievalProcessing = IsProcessing.Value;
|
||||
}
|
||||
flag = CertificateProvidersLog._IsCertificateRetrievalProcessing;
|
||||
if (flag)
|
||||
{
|
||||
bool flag2 = Status != null;
|
||||
if (flag2)
|
||||
{
|
||||
CertificateProvidersLog._CertificateRetrievalStatus = Status;
|
||||
}
|
||||
flag2 = Progress.HasValue;
|
||||
if (flag2)
|
||||
{
|
||||
CertificateProvidersLog._CertificateRetrievalProgress = Progress.Value;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
CertificateProvidersLog._CertificateRetrievalStatus = null;
|
||||
CertificateProvidersLog._CertificateRetrievalProgress = 0;
|
||||
}
|
||||
CertificateProvidersLog.Log(CertificateProvidersLog.EventTypeIds.RetrievalProgress, new object[]
|
||||
{
|
||||
CertificateProvidersLog._IsCertificateRetrievalProcessing,
|
||||
CertificateProvidersLog._CertificateRetrievalProgress,
|
||||
CertificateProvidersLog._CertificateRetrievalStatus
|
||||
});
|
||||
}
|
||||
protected override System.Collections.Generic.List<LogEventType> LoadEventTypes()
|
||||
{
|
||||
return new System.Collections.Generic.List<LogEventType>
|
||||
{
|
||||
new LogEventType
|
||||
{
|
||||
Id = (int)EventTypeIds.RetrievalStarting,
|
||||
ModuleId = 60,
|
||||
Name = "Retrieval Starting",
|
||||
Format = "Starting retrieval of {0} certificate/s ({1} to {2})",
|
||||
Severity = 0,
|
||||
UseLive = true,
|
||||
UsePersist = true,
|
||||
UseDisplay = true
|
||||
},
|
||||
new LogEventType
|
||||
{
|
||||
Id = (int)EventTypeIds.RetrievalProgress,
|
||||
ModuleId = 60,
|
||||
Name = "Retrieval Progress",
|
||||
Format = "Processing: {0}; {1}% Complete; Status: {2}",
|
||||
Severity = 0,
|
||||
UseLive = true,
|
||||
UsePersist = false,
|
||||
UseDisplay = false
|
||||
},
|
||||
new LogEventType
|
||||
{
|
||||
Id = (int)EventTypeIds.RetrievalFinished,
|
||||
ModuleId = 60,
|
||||
Name = "Retrieval Finished",
|
||||
Format = "Retrieval of Certificates Complete",
|
||||
Severity = 0,
|
||||
UseLive = true,
|
||||
UsePersist = true,
|
||||
UseDisplay = true
|
||||
},
|
||||
new LogEventType
|
||||
{
|
||||
Id = (int)EventTypeIds.RetrievalWarning,
|
||||
ModuleId = 60,
|
||||
Name = "Retrieval Warning",
|
||||
Format = "Retrieval Warning: {0}",
|
||||
Severity = 1,
|
||||
UseLive = true,
|
||||
UsePersist = true,
|
||||
UseDisplay = true
|
||||
},
|
||||
new LogEventType
|
||||
{
|
||||
Id = (int)EventTypeIds.RetrievalError,
|
||||
ModuleId = 60,
|
||||
Name = "Retrieval Error",
|
||||
Format = "Retrieval Error: {0}",
|
||||
Severity = 2,
|
||||
UseLive = true,
|
||||
UsePersist = true,
|
||||
UseDisplay = true
|
||||
},
|
||||
new LogEventType
|
||||
{
|
||||
Id = (int)EventTypeIds.RetrievalCertificateStarting,
|
||||
ModuleId = 60,
|
||||
Name = "Retrieval Certificate Starting",
|
||||
Format = "Retrieving Certificate: {0}",
|
||||
Severity = 0,
|
||||
UseLive = true,
|
||||
UsePersist = true,
|
||||
UseDisplay = true
|
||||
},
|
||||
new LogEventType
|
||||
{
|
||||
Id = (int)EventTypeIds.RetrievalCertificateFinished,
|
||||
ModuleId = 60,
|
||||
Name = "Retrieval Certificate Finished",
|
||||
Format = "Certificate Retrieved: {0}",
|
||||
Severity = 0,
|
||||
UseLive = true,
|
||||
UsePersist = true,
|
||||
UseDisplay = true
|
||||
},
|
||||
new LogEventType
|
||||
{
|
||||
Id = (int)EventTypeIds.RetrievalCertificateWarning,
|
||||
ModuleId = 60,
|
||||
Name = "Retrieval Certificate Warning",
|
||||
Format = "{0} Certificate Warning: {1}",
|
||||
Severity = 1,
|
||||
UseLive = true,
|
||||
UsePersist = true,
|
||||
UseDisplay = true
|
||||
},
|
||||
new LogEventType
|
||||
{
|
||||
Id = (int)EventTypeIds.RetrievalCertificateError,
|
||||
ModuleId = 60,
|
||||
Name = "Retrieval Certificate Error",
|
||||
Format = "{0} Certificate Error: {1}",
|
||||
Severity = 2,
|
||||
UseLive = true,
|
||||
UsePersist = true,
|
||||
UseDisplay = true
|
||||
},
|
||||
new LogEventType
|
||||
{
|
||||
Id = (int)EventTypeIds.Allocated,
|
||||
ModuleId = 60,
|
||||
Name = "Allocated",
|
||||
Format = "Certificate {0} allocated to {1}",
|
||||
Severity = 0,
|
||||
UseLive = true,
|
||||
UsePersist = true,
|
||||
UseDisplay = true
|
||||
},
|
||||
new LogEventType
|
||||
{
|
||||
Id = (int)EventTypeIds.AllocationFailed,
|
||||
ModuleId = 60,
|
||||
Name = "Allocation Failed",
|
||||
Format = "No certificates available for Device: {0}",
|
||||
Severity = 2,
|
||||
UseLive = true,
|
||||
UsePersist = true,
|
||||
UseDisplay = true
|
||||
},
|
||||
new LogEventType
|
||||
{
|
||||
Id = (int)EventTypeIds.DisabledCertificate,
|
||||
ModuleId = 60,
|
||||
Name = "Disabled Certificate",
|
||||
Format = "Certificate Disabled: {0} [{1}], Reason: {2}",
|
||||
Severity = 0,
|
||||
UseLive = true,
|
||||
UsePersist = true,
|
||||
UseDisplay = true
|
||||
},
|
||||
|
||||
public static void LogCertificateRetrievalProgress(bool? IsProcessing, int? Progress, string Status)
|
||||
{
|
||||
bool flag = IsProcessing.HasValue;
|
||||
if (flag)
|
||||
{
|
||||
CertificateProvidersLog._IsCertificateRetrievalProcessing = IsProcessing.Value;
|
||||
}
|
||||
flag = CertificateProvidersLog._IsCertificateRetrievalProcessing;
|
||||
if (flag)
|
||||
{
|
||||
bool flag2 = Status != null;
|
||||
if (flag2)
|
||||
{
|
||||
CertificateProvidersLog._CertificateRetrievalStatus = Status;
|
||||
}
|
||||
flag2 = Progress.HasValue;
|
||||
if (flag2)
|
||||
{
|
||||
CertificateProvidersLog._CertificateRetrievalProgress = Progress.Value;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
CertificateProvidersLog._CertificateRetrievalStatus = null;
|
||||
CertificateProvidersLog._CertificateRetrievalProgress = 0;
|
||||
}
|
||||
CertificateProvidersLog.Log(CertificateProvidersLog.EventTypeIds.RetrievalProgress, new object[]
|
||||
{
|
||||
CertificateProvidersLog._IsCertificateRetrievalProcessing,
|
||||
CertificateProvidersLog._CertificateRetrievalProgress,
|
||||
CertificateProvidersLog._CertificateRetrievalStatus
|
||||
});
|
||||
}
|
||||
protected override System.Collections.Generic.List<LogEventType> LoadEventTypes()
|
||||
{
|
||||
return new System.Collections.Generic.List<LogEventType>
|
||||
{
|
||||
new LogEventType
|
||||
{
|
||||
Id = (int)EventTypeIds.EnabledCertificate,
|
||||
ModuleId = 60,
|
||||
Name = "Enabled Certificate",
|
||||
Format = "Certificate Disabled: {0} [{1}], Reason: {2}",
|
||||
Severity = 0,
|
||||
UseLive = true,
|
||||
UsePersist = true,
|
||||
UseDisplay = true
|
||||
},
|
||||
new LogEventType
|
||||
{
|
||||
Id = (int)EventTypeIds.DeletedCertificate,
|
||||
ModuleId = 60,
|
||||
Name = "Deleted Certificate",
|
||||
Format = "Certificate Deleted: {0} [{1}], Reason: {2}",
|
||||
Severity = 0,
|
||||
UseLive = true,
|
||||
UsePersist = true,
|
||||
UseDisplay = true
|
||||
},
|
||||
new LogEventType
|
||||
{
|
||||
Id = (int)EventTypeIds.UpdatedCertificate,
|
||||
ModuleId = 60,
|
||||
Name = "Updated Certificate",
|
||||
Format = "Certificate Updated: {0} [{1}], Reason: {2}",
|
||||
Severity = 0,
|
||||
UseLive = true,
|
||||
UsePersist = true,
|
||||
UseDisplay = true
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
{
|
||||
Id = (int)EventTypeIds.RetrievalStarting,
|
||||
ModuleId = 60,
|
||||
Name = "Retrieval Starting",
|
||||
Format = "Starting retrieval of {0} certificate/s ({1} to {2})",
|
||||
Severity = 0,
|
||||
UseLive = true,
|
||||
UsePersist = true,
|
||||
UseDisplay = true
|
||||
},
|
||||
new LogEventType
|
||||
{
|
||||
Id = (int)EventTypeIds.RetrievalProgress,
|
||||
ModuleId = 60,
|
||||
Name = "Retrieval Progress",
|
||||
Format = "Processing: {0}; {1}% Complete; Status: {2}",
|
||||
Severity = 0,
|
||||
UseLive = true,
|
||||
UsePersist = false,
|
||||
UseDisplay = false
|
||||
},
|
||||
new LogEventType
|
||||
{
|
||||
Id = (int)EventTypeIds.RetrievalFinished,
|
||||
ModuleId = 60,
|
||||
Name = "Retrieval Finished",
|
||||
Format = "Retrieval of Certificates Complete",
|
||||
Severity = 0,
|
||||
UseLive = true,
|
||||
UsePersist = true,
|
||||
UseDisplay = true
|
||||
},
|
||||
new LogEventType
|
||||
{
|
||||
Id = (int)EventTypeIds.RetrievalWarning,
|
||||
ModuleId = 60,
|
||||
Name = "Retrieval Warning",
|
||||
Format = "Retrieval Warning: {0}",
|
||||
Severity = 1,
|
||||
UseLive = true,
|
||||
UsePersist = true,
|
||||
UseDisplay = true
|
||||
},
|
||||
new LogEventType
|
||||
{
|
||||
Id = (int)EventTypeIds.RetrievalError,
|
||||
ModuleId = 60,
|
||||
Name = "Retrieval Error",
|
||||
Format = "Retrieval Error: {0}",
|
||||
Severity = 2,
|
||||
UseLive = true,
|
||||
UsePersist = true,
|
||||
UseDisplay = true
|
||||
},
|
||||
new LogEventType
|
||||
{
|
||||
Id = (int)EventTypeIds.RetrievalCertificateStarting,
|
||||
ModuleId = 60,
|
||||
Name = "Retrieval Certificate Starting",
|
||||
Format = "Retrieving Certificate: {0}",
|
||||
Severity = 0,
|
||||
UseLive = true,
|
||||
UsePersist = true,
|
||||
UseDisplay = true
|
||||
},
|
||||
new LogEventType
|
||||
{
|
||||
Id = (int)EventTypeIds.RetrievalCertificateFinished,
|
||||
ModuleId = 60,
|
||||
Name = "Retrieval Certificate Finished",
|
||||
Format = "Certificate Retrieved: {0}",
|
||||
Severity = 0,
|
||||
UseLive = true,
|
||||
UsePersist = true,
|
||||
UseDisplay = true
|
||||
},
|
||||
new LogEventType
|
||||
{
|
||||
Id = (int)EventTypeIds.RetrievalCertificateWarning,
|
||||
ModuleId = 60,
|
||||
Name = "Retrieval Certificate Warning",
|
||||
Format = "{0} Certificate Warning: {1}",
|
||||
Severity = 1,
|
||||
UseLive = true,
|
||||
UsePersist = true,
|
||||
UseDisplay = true
|
||||
},
|
||||
new LogEventType
|
||||
{
|
||||
Id = (int)EventTypeIds.RetrievalCertificateError,
|
||||
ModuleId = 60,
|
||||
Name = "Retrieval Certificate Error",
|
||||
Format = "{0} Certificate Error: {1}",
|
||||
Severity = 2,
|
||||
UseLive = true,
|
||||
UsePersist = true,
|
||||
UseDisplay = true
|
||||
},
|
||||
new LogEventType
|
||||
{
|
||||
Id = (int)EventTypeIds.Allocated,
|
||||
ModuleId = 60,
|
||||
Name = "Allocated",
|
||||
Format = "Certificate {0} allocated to {1}",
|
||||
Severity = 0,
|
||||
UseLive = true,
|
||||
UsePersist = true,
|
||||
UseDisplay = true
|
||||
},
|
||||
new LogEventType
|
||||
{
|
||||
Id = (int)EventTypeIds.AllocationFailed,
|
||||
ModuleId = 60,
|
||||
Name = "Allocation Failed",
|
||||
Format = "No certificates available for Device: {0}",
|
||||
Severity = 2,
|
||||
UseLive = true,
|
||||
UsePersist = true,
|
||||
UseDisplay = true
|
||||
},
|
||||
new LogEventType
|
||||
{
|
||||
Id = (int)EventTypeIds.DisabledCertificate,
|
||||
ModuleId = 60,
|
||||
Name = "Disabled Certificate",
|
||||
Format = "Certificate Disabled: {0} [{1}], Reason: {2}",
|
||||
Severity = 0,
|
||||
UseLive = true,
|
||||
UsePersist = true,
|
||||
UseDisplay = true
|
||||
},
|
||||
new LogEventType
|
||||
{
|
||||
Id = (int)EventTypeIds.EnabledCertificate,
|
||||
ModuleId = 60,
|
||||
Name = "Enabled Certificate",
|
||||
Format = "Certificate Disabled: {0} [{1}], Reason: {2}",
|
||||
Severity = 0,
|
||||
UseLive = true,
|
||||
UsePersist = true,
|
||||
UseDisplay = true
|
||||
},
|
||||
new LogEventType
|
||||
{
|
||||
Id = (int)EventTypeIds.DeletedCertificate,
|
||||
ModuleId = 60,
|
||||
Name = "Deleted Certificate",
|
||||
Format = "Certificate Deleted: {0} [{1}], Reason: {2}",
|
||||
Severity = 0,
|
||||
UseLive = true,
|
||||
UsePersist = true,
|
||||
UseDisplay = true
|
||||
},
|
||||
new LogEventType
|
||||
{
|
||||
Id = (int)EventTypeIds.UpdatedCertificate,
|
||||
ModuleId = 60,
|
||||
Name = "Updated Certificate",
|
||||
Format = "Certificate Updated: {0} [{1}], Reason: {2}",
|
||||
Severity = 0,
|
||||
UseLive = true,
|
||||
UsePersist = true,
|
||||
UseDisplay = true
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
using Disco.Models.ClientServices;
|
||||
using Disco.Models.Repository;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Disco.Services.Plugins.Features.CertificateProvider
|
||||
{
|
||||
public class ProvisionPersonalCertificateResult
|
||||
{
|
||||
/// <summary>
|
||||
/// The <see cref="Device"/> associated with the provision result.
|
||||
/// </summary>
|
||||
public Device Device { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The <see cref="Enrol"/> associated with the provision result.
|
||||
/// </summary>
|
||||
public Enrol Enrolment { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// A list of <see cref="DeviceCertificate"/> assigned to the device.
|
||||
/// </summary>
|
||||
public List<DeviceCertificate> AllocatedCertificates { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// A list of certificate thumbprints to be removed from the Personal Certificate store.
|
||||
/// Matching certificates will be removed unless they match the <see cref="AllocatedCertificate"/>.
|
||||
/// </summary>
|
||||
public List<string> RemoveCertificateThumbprints { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
using Disco.Models.ClientServices;
|
||||
using Disco.Models.Repository;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Disco.Services.Plugins.Features.WirelessProfileProvider
|
||||
{
|
||||
public class ProvisionWirelessProfilesResult
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// The <see cref="Device"/> associated with the provision result.
|
||||
/// </summary>
|
||||
public Device Device { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The <see cref="Enrol"/> associated with the provision result.
|
||||
/// </summary>
|
||||
public Enrol Enrolment { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// A list of wireless profiles to add to the client device.
|
||||
/// If the wireless profile already exists it will be ignored.
|
||||
/// </summary>
|
||||
public List<WirelessProfile> Profiles { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// A list of transformations to be applied to existing XML wireless profiles found on the client device.
|
||||
/// </summary>
|
||||
public List<WirelessProfileTransformation> Transformations { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// A list of wireless profile names to be removed from the client device.
|
||||
/// </summary>
|
||||
public List<string> RemoveNames { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
|
||||
namespace Disco.Services.Plugins.Features.WirelessProfileProvider
|
||||
{
|
||||
public class WirelessProfile
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// The name of the wireless profile, typically the SSID
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The guid of the associated interface. Null to deploy to all supported interfaces.
|
||||
/// </summary>
|
||||
public Guid? InterfaceGuid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates the profile should be overwritten even if it already exists
|
||||
/// </summary>
|
||||
public bool ForceDeployment { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The wireless profile XML definition
|
||||
/// </summary>
|
||||
public string ProfileXml { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
using Disco.Data.Repository;
|
||||
using Disco.Models.ClientServices;
|
||||
using Disco.Models.Repository;
|
||||
|
||||
namespace Disco.Services.Plugins.Features.WirelessProfileProvider
|
||||
{
|
||||
[PluginFeatureCategory(DisplayName = "Wireless Profile Providers")]
|
||||
public abstract class WirelessProfileProviderFeature : PluginFeature
|
||||
{
|
||||
|
||||
public abstract string WirelessProfileProviderId { get; }
|
||||
|
||||
public abstract ProvisionWirelessProfilesResult ProvisionWirelessProfiles(DiscoDataContext Database, Device Device, Enrol Enrolment);
|
||||
|
||||
}
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
namespace Disco.Services.Plugins.Features.WirelessProfileProvider
|
||||
{
|
||||
/// <summary>
|
||||
/// A transform to be applied to the matching <see cref="Name"/>.
|
||||
/// </summary>
|
||||
public class WirelessProfileTransformation
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// The name of the wireless profile related to this transformation, typically the SSID
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The regular expression to evaluate against the wireless profile XML
|
||||
/// </summary>
|
||||
public string RegularExpression { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The replacement string used when evaluating the regular expression
|
||||
/// </summary>
|
||||
public string RegularExpressionReplacement { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -134,10 +134,8 @@ namespace Disco.Services.Plugins
|
||||
{
|
||||
return new List<string>()
|
||||
{
|
||||
"BitMiracle.LibTiff.NET",
|
||||
"C5",
|
||||
"Common.Logging",
|
||||
"DiffieHellman",
|
||||
"Disco.BI",
|
||||
"Disco.Data",
|
||||
"Disco.Models",
|
||||
@@ -154,14 +152,17 @@ namespace Disco.Services.Plugins
|
||||
"Microsoft.AspNet.SignalR.Core",
|
||||
"Microsoft.AspNet.SignalR.SystemWeb",
|
||||
"Microsoft.Owin",
|
||||
"Microsoft.Owin.Security",
|
||||
"Microsoft.Owin.Host.SystemWeb",
|
||||
"Microsoft.Owin.Security",
|
||||
"Microsoft.Web.Infrastructure",
|
||||
"Newtonsoft.Json",
|
||||
"Org.Mentalis.Security",
|
||||
"Owin",
|
||||
"PdfiumViewer",
|
||||
"PdfSharp",
|
||||
"PList",
|
||||
"Quartz",
|
||||
"RazorGenerator.Mvc",
|
||||
"Renci.SshNet",
|
||||
"Spring.Core",
|
||||
"System.Data.SqlServerCe",
|
||||
"System.Data.SqlServerCe.Entity",
|
||||
@@ -181,7 +182,6 @@ namespace Disco.Services.Plugins
|
||||
"System.Web.WebPages",
|
||||
"System.Web.WebPages.Razor",
|
||||
"T4MVCExtensions",
|
||||
"Tamir.SharpSSH",
|
||||
"WebActivatorEx",
|
||||
"zxing"
|
||||
};
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using Disco.Data.Repository;
|
||||
using Disco.Models.Services.Interop.DiscoServices;
|
||||
using Disco.Services.Interop.DiscoServices;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
@@ -187,15 +186,22 @@ namespace Disco.Services.Plugins
|
||||
}
|
||||
public static bool TryGetPluginFeature(string PluginFeatureId, Type CategoryType, out PluginFeatureManifest PluginFeatureManifest)
|
||||
{
|
||||
PluginFeatureManifest = null;
|
||||
|
||||
if (_PluginManifests == null)
|
||||
{
|
||||
PluginFeatureManifest = null;
|
||||
return false;
|
||||
}
|
||||
|
||||
var featureManifest = _PluginManifests.Values.SelectMany(pm => pm.Features).Where(fm => fm.Id == PluginFeatureId).FirstOrDefault();
|
||||
var featureManifest = _PluginManifests.Values
|
||||
.SelectMany(pm => pm.Features)
|
||||
.Where(fm => fm.Id == PluginFeatureId)
|
||||
.FirstOrDefault();
|
||||
|
||||
if (featureManifest == null)
|
||||
{
|
||||
PluginFeatureManifest = null;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (CategoryType == null)
|
||||
{
|
||||
@@ -210,7 +216,10 @@ namespace Disco.Services.Plugins
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
PluginFeatureManifest = null;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
public static PluginFeatureManifest GetPluginFeature(string PluginFeatureId)
|
||||
|
||||
Reference in New Issue
Block a user