// Copyright © WireMock.Net using System; using System.Collections.Concurrent; using WireMock.Handlers; using WireMock.Logging; using WireMock.Matchers; using WireMock.Owin.ActivityTracing; using WireMock.Types; using WireMock.Util; using System.Security.Cryptography.X509Certificates; #if !USE_ASPNETCORE using Owin; #else using IAppBuilder = Microsoft.AspNetCore.Builder.IApplicationBuilder; using Microsoft.Extensions.DependencyInjection; #endif namespace WireMock.Owin; internal class WireMockMiddlewareOptions : IWireMockMiddlewareOptions { public IWireMockLogger Logger { get; set; } public TimeSpan? RequestProcessingDelay { get; set; } public IStringMatcher? AuthenticationMatcher { get; set; } public bool? AllowPartialMapping { get; set; } public ConcurrentDictionary Mappings { get; } = new ConcurrentDictionary(); public ConcurrentDictionary Scenarios { get; } = new(StringComparer.OrdinalIgnoreCase); public ConcurrentObservableCollection LogEntries { get; } = new(); public int? RequestLogExpirationDuration { get; set; } public int? MaxRequestLogCount { get; set; } public Action? PreWireMockMiddlewareInit { get; set; } public Action? PostWireMockMiddlewareInit { get; set; } #if USE_ASPNETCORE public Action? AdditionalServiceRegistration { get; set; } public CorsPolicyOptions? CorsPolicyOptions { get; set; } public ClientCertificateMode ClientCertificateMode { get; set; } /// public bool AcceptAnyClientCertificate { get; set; } #endif /// public IFileSystemHandler? FileSystemHandler { get; set; } /// public bool? AllowBodyForAllHttpMethods { get; set; } /// public bool? AllowOnlyDefinedHttpStatusCodeInResponse { get; set; } /// public bool? DisableJsonBodyParsing { get; set; } /// public bool? DisableRequestBodyDecompressing { get; set; } /// public bool? HandleRequestsSynchronously { get; set; } /// public string? X509StoreName { get; set; } /// public string? X509StoreLocation { get; set; } /// public string? X509ThumbprintOrSubjectName { get; set; } /// public string? X509CertificateFilePath { get; set; } /// public X509Certificate2? X509Certificate { get; set; } /// public string? X509CertificatePassword { get; set; } /// public bool CustomCertificateDefined => !string.IsNullOrEmpty(X509StoreName) && !string.IsNullOrEmpty(X509StoreLocation) || !string.IsNullOrEmpty(X509CertificateFilePath) || X509Certificate != null; /// public bool? SaveUnmatchedRequests { get; set; } /// public bool? DoNotSaveDynamicResponseInLogEntry { get; set; } /// public QueryParameterMultipleValueSupport? QueryParameterMultipleValueSupport { get; set; } /// public bool ProxyAll { get; set; } #if ACTIVITY_TRACING_SUPPORTED /// public ActivityTracingOptions? ActivityTracingOptions { get; set; } #endif }