using System; using System.Collections.Concurrent; using WireMock.Handlers; using WireMock.Logging; using WireMock.Matchers; using WireMock.Types; using WireMock.Util; #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 ConcurrentDictionary(); public ConcurrentObservableCollection LogEntries { get; } = new ConcurrentObservableCollection(); 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; } #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 string X509CertificatePassword { get; set; } /// public bool CustomCertificateDefined => !string.IsNullOrEmpty(X509StoreName) && !string.IsNullOrEmpty(X509StoreLocation) || !string.IsNullOrEmpty(X509CertificateFilePath); /// public bool? SaveUnmatchedRequests { get; set; } } }