diff options
author | Wouter Tinus <wouter.tinus@gmail.com> | 2020-06-14 19:50:41 +0200 |
---|---|---|
committer | Wouter Tinus <wouter.tinus@gmail.com> | 2020-06-14 19:50:41 +0200 |
commit | e49b52549f6f573d708a882ee70eaebbc0bd9dd5 (patch) | |
tree | 042606e067d7bdb37bce7e370d54865ef74d8f17 /src/main.lib/Plugins/Interfaces/IValidationPlugin.cs | |
parent | 0c1e53dca87941a6ca20e72772ef36c094e3abff (diff) | |
download | letsencrypt-win-simple-e49b52549f6f573d708a882ee70eaebbc0bd9dd5.zip letsencrypt-win-simple-e49b52549f6f573d708a882ee70eaebbc0bd9dd5.tar.gz letsencrypt-win-simple-e49b52549f6f573d708a882ee70eaebbc0bd9dd5.tar.bz2 |
enable parallel validation for http-01 selfhosting
Diffstat (limited to 'src/main.lib/Plugins/Interfaces/IValidationPlugin.cs')
-rw-r--r-- | src/main.lib/Plugins/Interfaces/IValidationPlugin.cs | 61 |
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 } - } |