summaryrefslogtreecommitdiffstats
path: root/src/main.lib/Plugins/Interfaces/IValidationPlugin.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.lib/Plugins/Interfaces/IValidationPlugin.cs')
-rw-r--r--src/main.lib/Plugins/Interfaces/IValidationPlugin.cs61
1 files changed, 14 insertions, 47 deletions
diff --git a/src/main.lib/Plugins/Interfaces/IValidationPlugin.cs b/src/main.lib/Plugins/Interfaces/IValidationPlugin.cs
index 8b6820d..fb3a8e9 100644
--- a/src/main.lib/Plugins/Interfaces/IValidationPlugin.cs
+++ b/src/main.lib/Plugins/Interfaces/IValidationPlugin.cs
@@ -1,8 +1,5 @@
-using ACMESharp.Authorizations;
-using ACMESharp.Protocol.Resources;
-using Autofac;
-using PKISharp.WACS.DomainObjects;
-using System.Collections.Generic;
+using PKISharp.WACS.Context;
+using System;
using System.Threading.Tasks;
namespace PKISharp.WACS.Plugins.Interfaces
@@ -24,50 +21,20 @@ namespace PKISharp.WACS.Plugins.Interfaces
/// <summary>
/// Clean up after validation attempt
/// </summary>
- Task CleanUp(ValidationContext context);
+ Task CleanUp(ValidationContext context);
+
+ /// <summary>
+ /// Indicate level of supported parallelism
+ /// </summary>
+ ParallelOperations Parallelism { get; }
}
- public class ValidationContext
+ [Flags]
+ public enum ParallelOperations
{
- public ValidationContext(
- ILifetimeScope scope,
- Authorization authorization,
- TargetPart targetPart,
- string challengeType,
- string pluginName)
- {
- Identifier = authorization.Identifier.Value;
- TargetPart = targetPart;
- Authorization = authorization;
- Scope = scope;
- ChallengeType = challengeType;
- PluginName = pluginName;
- }
- public ILifetimeScope Scope { get; }
- public string Identifier { get; }
- public string ChallengeType { get; }
- public string PluginName { get; }
- public TargetPart TargetPart { get; }
- public Authorization Authorization { get; }
- public Challenge? Challenge { get; set; }
- public IChallengeValidationDetails? ChallengeDetails { get; set; }
- public IValidationPlugin? ValidationPlugin { get; set; }
- public bool? Success { get; set; }
- public List<string> ErrorMessages { get; } = new List<string>();
- public void AddErrorMessage(string? value, bool fatal = true)
- {
- if (value != null)
- {
- if (!ErrorMessages.Contains(value))
- {
- ErrorMessages.Add(value);
- }
- }
- if (fatal)
- {
- Success = false;
- }
- }
+ None = 0,
+ Prepare = 1,
+ Answer = 2,
+ Clean = 4
}
-
}