// ReSharper restore FieldCanBeMadeReadOnly.Local

        private EmbeddedVNodeBuilder()
        {
            _chunkSize       = TFConsts.ChunkSize;
            _dbPath          = Path.Combine(Path.GetTempPath(), "EmbeddedEventStore", string.Format("{0:yyyy-MM-dd_HH.mm.ss.ffffff}-EmbeddedNode", DateTime.UtcNow));
            _chunksCacheSize = TFConsts.ChunksCacheSize;
            _inMemoryDb      = true;

            _externalTcp       = new IPEndPoint(Opts.ExternalIpDefault, Opts.ExternalHttpPortDefault);
            _externalSecureTcp = null;
            _externalTcp       = new IPEndPoint(Opts.ExternalIpDefault, Opts.ExternalHttpPortDefault);
            _externalSecureTcp = null;
            _externalHttp      = new IPEndPoint(Opts.ExternalIpDefault, Opts.ExternalHttpPortDefault);
            _externalHttp      = new IPEndPoint(Opts.ExternalIpDefault, Opts.ExternalHttpPortDefault);

            _intHttpPrefixes   = new List <string>();
            _extHttpPrefixes   = new List <string>();
            _enableTrustedAuth = Opts.EnableTrustedAuthDefault;
            _certificate       = null;
            _workerThreads     = Opts.WorkerThreadsDefault;

            _discoverViaDns = false;
            _clusterDns     = Opts.ClusterDnsDefault;
            _gossipSeeds    = new List <IPEndPoint>();

            _minFlushDelay = TimeSpan.FromMilliseconds(Opts.MinFlushDelayMsDefault);

            _clusterNodeCount = 1;
            _prepareAckCount  = 1;
            _commitAckCount   = 1;
            _prepareTimeout   = TimeSpan.FromMilliseconds(Opts.PrepareTimeoutMsDefault);
            _commitTimeout    = TimeSpan.FromMilliseconds(Opts.CommitTimeoutMsDefault);

            _nodePriority = Opts.NodePriorityDefault;

            _useSsl            = Opts.UseInternalSslDefault;
            _sslTargetHost     = Opts.SslTargetHostDefault;
            _sslValidateServer = Opts.SslValidateServerDefault;

            _statsPeriod  = TimeSpan.FromSeconds(Opts.StatsPeriodDefault);
            _statsStorage = StatsStorage.Stream;

            _authenticationProviderFactory = new InternalAuthenticationProviderFactory();
            _disableScavengeMerging        = Opts.DisableScavengeMergeDefault;
            _adminOnPublic  = Opts.AdminOnExtDefault;
            _statsOnPublic  = Opts.StatsOnExtDefault;
            _gossipOnPublic = Opts.GossipOnExtDefault;
            _gossipInterval = TimeSpan.FromMilliseconds(Opts.GossipIntervalMsDefault);
            _gossipAllowedTimeDifference = TimeSpan.FromMilliseconds(Opts.GossipAllowedDifferenceMsDefault);
            _gossipTimeout = TimeSpan.FromMilliseconds(Opts.GossipTimeoutMsDefault);

            _intTcpHeartbeatInterval = TimeSpan.FromMilliseconds(Opts.IntTcpHeartbeatInvervalDefault);
            _intTcpHeartbeatTimeout  = TimeSpan.FromMilliseconds(Opts.IntTcpHeartbeatTimeoutDefault);
            _extTcpHeartbeatInterval = TimeSpan.FromMilliseconds(Opts.ExtTcpHeartbeatIntervalDefault);
            _extTcpHeartbeatTimeout  = TimeSpan.FromMilliseconds(Opts.ExtTcpHeartbeatTimeoutDefault);

            _skipVerifyDbHashes = Opts.SkipDbVerifyDefault;
            _maxMemtableSize    = Opts.MaxMemtableSizeDefault;
            _subsystems         = new List <ISubsystem>();
            _clusterGossipPort  = Opts.ClusterGossipPortDefault;
        }
 public AuthenticationMiddleware(RequestDelegate next,
                                 IApplicationBuilder app,
                                 IClientRequestRepository clientRequestRepository,
                                 IAuthenticationProviderFactory authencationProviderFactory,
                                 ILoggerFactory loggerFactory) :
     base(next, app, clientRequestRepository, loggerFactory)
 {
     _authenication = authencationProviderFactory.CreateAuthencationProvider();
     _logger        = loggerFactory.CreateLogger <AuthenticationMiddleware>();
 }
Exemple #3
0
 public NetworkingModule(string ip, int port, IIdProvider <ulong> idProvider,
                         INetworkingEntityFactory entityFactory,
                         IIdProvider <string> tokenProvider, INetworkingClientFactory clientFactory,
                         IAuthenticationProviderFactory authenticationProviderFactory,
                         IStreamingHandlerFactory streamingHandlerFactory)
 {
     IdProvider    = idProvider;
     TokenProvider = tokenProvider;
     EntityPool    = new NetworkingEntityPool(idProvider, entityFactory);
     ClientPool    = new NetworkingClientPool(tokenProvider, clientFactory);
     Streamer      = new EntityStreamer();
     Server        = new Server(ip, port, ClientPool, authenticationProviderFactory, Streamer, streamingHandlerFactory);
 }
Exemple #4
0
        public EdmxProcessor(
            IOptionsMonitor <EdmxProcessorOptions> options,
            IAuthenticationProviderFactory authenticationProviderFactory,
            ILogger <EdmxProcessor> logger,
            IServiceProvider serviceProvider,
            ICodeAnalyzer codeAnalyzer)
        {
            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }

            if (authenticationProviderFactory == null)
            {
                throw new ArgumentNullException(nameof(authenticationProviderFactory));
            }

            this.options             = options.CurrentValue;
            this.authProviderFactory = authenticationProviderFactory;
            this.log          = logger;
            this.codeAnalyzer = codeAnalyzer;
        }
 public AuthController(IAuthenticationProviderFactory <Account> authFactory, SessionService <Account> session)
 {
     _authFactory = authFactory;
     _session     = session;
 }
        public ClusterVNodeSettings(Guid instanceId, int debugIndex,
                                    IPEndPoint internalTcpEndPoint,
                                    IPEndPoint internalSecureTcpEndPoint,
                                    IPEndPoint externalTcpEndPoint,
                                    IPEndPoint externalSecureTcpEndPoint,
                                    IPEndPoint internalHttpEndPoint,
                                    IPEndPoint externalHttpEndPoint,
                                    string[] httpPrefixes,
                                    bool enableTrustedAuth,
                                    X509Certificate2 certificate,
                                    int workerThreads,
                                    bool discoverViaDns,
                                    string clusterDns,
                                    IPEndPoint[] gossipSeeds,
                                    TimeSpan minFlushDelay,
                                    int clusterNodeCount,
                                    int prepareAckCount,
                                    int commitAckCount,
                                    TimeSpan prepareTimeout,
                                    TimeSpan commitTimeout,
                                    bool useSsl,
                                    string sslTargetHost,
                                    bool sslValidateServer,
                                    TimeSpan statsPeriod,
                                    StatsStorage statsStorage,
                                    int nodePriority,
                                    IAuthenticationProviderFactory authenticationProviderFactory,
                                    bool disableScavengeMerging,
                                    bool adminOnPublic,
                                    bool statsOnPublic,
                                    bool gossipOnPublic,
                                    TimeSpan gossipInterval,
                                    TimeSpan gossipAllowedTimeDifference,
                                    TimeSpan gossipTimeout,
                                    TimeSpan tcpTimeout)
        {
            Ensure.NotEmptyGuid(instanceId, "instanceId");
            Ensure.NotNull(internalTcpEndPoint, "internalTcpEndPoint");
            Ensure.NotNull(externalTcpEndPoint, "externalTcpEndPoint");
            Ensure.NotNull(internalHttpEndPoint, "internalHttpEndPoint");
            Ensure.NotNull(externalHttpEndPoint, "externalHttpEndPoint");
            Ensure.NotNull(httpPrefixes, "httpPrefixes");
            if (internalSecureTcpEndPoint != null || externalSecureTcpEndPoint != null)
                Ensure.NotNull(certificate, "certificate");
            Ensure.Positive(workerThreads, "workerThreads");
            Ensure.NotNull(clusterDns, "clusterDns");
            Ensure.NotNull(gossipSeeds, "gossipSeeds");
            Ensure.Positive(clusterNodeCount, "clusterNodeCount");
            Ensure.Positive(prepareAckCount, "prepareAckCount");
            Ensure.Positive(commitAckCount, "commitAckCount");

            if (discoverViaDns && string.IsNullOrWhiteSpace(clusterDns))
                throw new ArgumentException("Either DNS Discovery must be disabled (and seeds specified), or a cluster DNS name must be provided.");

            if (useSsl)
                Ensure.NotNull(sslTargetHost, "sslTargetHost");

            NodeInfo = new VNodeInfo(instanceId, debugIndex,
                                     internalTcpEndPoint, internalSecureTcpEndPoint,
                                     externalTcpEndPoint, externalSecureTcpEndPoint,
                                     internalHttpEndPoint, externalHttpEndPoint);
            HttpPrefixes = httpPrefixes;
            EnableTrustedAuth = enableTrustedAuth;
            Certificate = certificate;
            WorkerThreads = workerThreads;

            DiscoverViaDns = discoverViaDns;
            ClusterDns = clusterDns;
            GossipSeeds = gossipSeeds;

            ClusterNodeCount = clusterNodeCount;
            MinFlushDelay = minFlushDelay;
            PrepareAckCount = prepareAckCount;
            CommitAckCount = commitAckCount;
            PrepareTimeout = prepareTimeout;
            CommitTimeout = commitTimeout;

            UseSsl = useSsl;
            SslTargetHost = sslTargetHost;
            SslValidateServer = sslValidateServer;

            StatsPeriod = statsPeriod;
            StatsStorage = statsStorage;

            AuthenticationProviderFactory = authenticationProviderFactory;

            NodePriority = nodePriority;
            DisableScavengeMerging = disableScavengeMerging;
            AdminOnPublic = adminOnPublic;
            StatsOnPublic = statsOnPublic;
            GossipOnPublic = gossipOnPublic;
            GossipInterval = gossipInterval;
            GossipAllowedTimeDifference = gossipAllowedTimeDifference;
            GossipTimeout = gossipTimeout;
            TcpTimeout = tcpTimeout;
        }
        public ClusterVNodeSettings(Guid instanceId, int debugIndex,
                                    IPEndPoint internalTcpEndPoint,
                                    IPEndPoint internalSecureTcpEndPoint,
                                    IPEndPoint externalTcpEndPoint,
                                    IPEndPoint externalSecureTcpEndPoint,
                                    IPEndPoint internalHttpEndPoint,
                                    IPEndPoint externalHttpEndPoint,
                                    GossipAdvertiseInfo gossipAdvertiseInfo,
                                    string[] intHttpPrefixes,
                                    string[] extHttpPrefixes,
                                    bool enableTrustedAuth,
                                    X509Certificate2 certificate,
                                    int workerThreads,
                                    bool discoverViaDns,
                                    string clusterDns,
                                    IPEndPoint[] gossipSeeds,
                                    TimeSpan minFlushDelay,
                                    int clusterNodeCount,
                                    int prepareAckCount,
                                    int commitAckCount,
                                    TimeSpan prepareTimeout,
                                    TimeSpan commitTimeout,
                                    bool useSsl,
                                    string sslTargetHost,
                                    bool sslValidateServer,
                                    TimeSpan statsPeriod,
                                    StatsStorage statsStorage,
                                    int nodePriority,
                                    IAuthenticationProviderFactory authenticationProviderFactory,
                                    bool disableScavengeMerging,
                                    bool adminOnPublic,
                                    bool statsOnPublic,
                                    bool gossipOnPublic,
                                    TimeSpan gossipInterval,
                                    TimeSpan gossipAllowedTimeDifference,
                                    TimeSpan gossipTimeout,
                                    TimeSpan intTcpHeartbeatTimeout,
                                    TimeSpan intTcpHeartbeatInterval,
                                    TimeSpan extTcpHeartbeatTimeout,
                                    TimeSpan extTcpHeartbeatInterval,
				                    bool verifyDbHash,
				                    int maxMemtableEntryCount,
                                    bool startStandardProjections,
                                    bool disableHTTPCaching, string index = null, bool enableHistograms = false,
                                    int indexCacheDepth = 16,
                                    IPersistentSubscriptionConsumerStrategyFactory[] additionalConsumerStrategies = null)
        {
            Ensure.NotEmptyGuid(instanceId, "instanceId");
            Ensure.NotNull(internalTcpEndPoint, "internalTcpEndPoint");
            Ensure.NotNull(externalTcpEndPoint, "externalTcpEndPoint");
            Ensure.NotNull(internalHttpEndPoint, "internalHttpEndPoint");
            Ensure.NotNull(externalHttpEndPoint, "externalHttpEndPoint");
            Ensure.NotNull(intHttpPrefixes, "intHttpPrefixes");
            Ensure.NotNull(extHttpPrefixes, "extHttpPrefixes");
            if (internalSecureTcpEndPoint != null || externalSecureTcpEndPoint != null)
                Ensure.NotNull(certificate, "certificate");
            Ensure.Positive(workerThreads, "workerThreads");
            Ensure.NotNull(clusterDns, "clusterDns");
            Ensure.NotNull(gossipSeeds, "gossipSeeds");
            Ensure.Positive(clusterNodeCount, "clusterNodeCount");
            Ensure.Positive(prepareAckCount, "prepareAckCount");
            Ensure.Positive(commitAckCount, "commitAckCount");
            Ensure.NotNull(gossipAdvertiseInfo, "gossipAdvertiseInfo");

            if (discoverViaDns && string.IsNullOrWhiteSpace(clusterDns))
                throw new ArgumentException("Either DNS Discovery must be disabled (and seeds specified), or a cluster DNS name must be provided.");

            if (useSsl)
                Ensure.NotNull(sslTargetHost, "sslTargetHost");

            NodeInfo = new VNodeInfo(instanceId, debugIndex,
                                     internalTcpEndPoint, internalSecureTcpEndPoint,
                                     externalTcpEndPoint, externalSecureTcpEndPoint,
                                     internalHttpEndPoint, externalHttpEndPoint);
            GossipAdvertiseInfo = gossipAdvertiseInfo;
            IntHttpPrefixes = intHttpPrefixes;
            ExtHttpPrefixes = extHttpPrefixes;
            EnableTrustedAuth = enableTrustedAuth;
            Certificate = certificate;
            WorkerThreads = workerThreads;
            StartStandardProjections = startStandardProjections;
            DisableHTTPCaching = disableHTTPCaching;
            AdditionalConsumerStrategies = additionalConsumerStrategies ?? new IPersistentSubscriptionConsumerStrategyFactory[0];

            DiscoverViaDns = discoverViaDns;
            ClusterDns = clusterDns;
            GossipSeeds = gossipSeeds;

            ClusterNodeCount = clusterNodeCount;
            MinFlushDelay = minFlushDelay;
            PrepareAckCount = prepareAckCount;
            CommitAckCount = commitAckCount;
            PrepareTimeout = prepareTimeout;
            CommitTimeout = commitTimeout;

            UseSsl = useSsl;
            SslTargetHost = sslTargetHost;
            SslValidateServer = sslValidateServer;

            StatsPeriod = statsPeriod;
            StatsStorage = statsStorage;

            AuthenticationProviderFactory = authenticationProviderFactory;

            NodePriority = nodePriority;
            DisableScavengeMerging = disableScavengeMerging;
            AdminOnPublic = adminOnPublic;
            StatsOnPublic = statsOnPublic;
            GossipOnPublic = gossipOnPublic;
            GossipInterval = gossipInterval;
            GossipAllowedTimeDifference = gossipAllowedTimeDifference;
            GossipTimeout = gossipTimeout;
            IntTcpHeartbeatTimeout = intTcpHeartbeatTimeout;
            IntTcpHeartbeatInterval = intTcpHeartbeatInterval;
            ExtTcpHeartbeatTimeout = extTcpHeartbeatTimeout;
            ExtTcpHeartbeatInterval = extTcpHeartbeatInterval;

            VerifyDbHash = verifyDbHash;
            MaxMemtableEntryCount = maxMemtableEntryCount;

            EnableHistograms = enableHistograms;
            IndexCacheDepth = indexCacheDepth;
            Index = index;
        }
Exemple #8
0
        public ClusterVNodeSettings(Guid instanceId, int debugIndex,
                                    IPEndPoint internalTcpEndPoint,
                                    IPEndPoint internalSecureTcpEndPoint,
                                    IPEndPoint externalTcpEndPoint,
                                    IPEndPoint externalSecureTcpEndPoint,
                                    IPEndPoint internalHttpEndPoint,
                                    IPEndPoint externalHttpEndPoint,
                                    string[] httpPrefixes,
                                    bool enableTrustedAuth,
                                    X509Certificate2 certificate,
                                    int workerThreads,
                                    bool discoverViaDns,
                                    string clusterDns,
                                    IPEndPoint[] gossipSeeds,
                                    TimeSpan minFlushDelay,
                                    int clusterNodeCount,
                                    int prepareAckCount,
                                    int commitAckCount,
                                    TimeSpan prepareTimeout,
                                    TimeSpan commitTimeout,
                                    bool useSsl,
                                    string sslTargetHost,
                                    bool sslValidateServer,
                                    TimeSpan statsPeriod,
                                    StatsStorage statsStorage,
                                    int nodePriority,
                                    IAuthenticationProviderFactory authenticationProviderFactory,
                                    bool disableScavengeMerging,
                                    bool adminOnPublic,
                                    bool statsOnPublic,
                                    bool gossipOnPublic,
                                    TimeSpan gossipInterval,
                                    TimeSpan gossipAllowedTimeDifference,
                                    TimeSpan gossipTimeout,
                                    TimeSpan intTcpHeartbeatTimeout,
                                    TimeSpan intTcpHeartbeatInterval,
                                    TimeSpan extTcpHeartbeatTimeout,
                                    TimeSpan extTcpHeartbeatInterval,
                                    bool verifyDbHash,
                                    int maxMemtableEntryCount)
        {
            Ensure.NotEmptyGuid(instanceId, "instanceId");
            Ensure.NotNull(internalTcpEndPoint, "internalTcpEndPoint");
            Ensure.NotNull(externalTcpEndPoint, "externalTcpEndPoint");
            Ensure.NotNull(internalHttpEndPoint, "internalHttpEndPoint");
            Ensure.NotNull(externalHttpEndPoint, "externalHttpEndPoint");
            Ensure.NotNull(httpPrefixes, "httpPrefixes");
            if (internalSecureTcpEndPoint != null || externalSecureTcpEndPoint != null)
            {
                Ensure.NotNull(certificate, "certificate");
            }
            Ensure.Positive(workerThreads, "workerThreads");
            Ensure.NotNull(clusterDns, "clusterDns");
            Ensure.NotNull(gossipSeeds, "gossipSeeds");
            Ensure.Positive(clusterNodeCount, "clusterNodeCount");
            Ensure.Positive(prepareAckCount, "prepareAckCount");
            Ensure.Positive(commitAckCount, "commitAckCount");

            if (discoverViaDns && string.IsNullOrWhiteSpace(clusterDns))
            {
                throw new ArgumentException("Either DNS Discovery must be disabled (and seeds specified), or a cluster DNS name must be provided.");
            }

            if (useSsl)
            {
                Ensure.NotNull(sslTargetHost, "sslTargetHost");
            }

            NodeInfo = new VNodeInfo(instanceId, debugIndex,
                                     internalTcpEndPoint, internalSecureTcpEndPoint,
                                     externalTcpEndPoint, externalSecureTcpEndPoint,
                                     internalHttpEndPoint, externalHttpEndPoint);
            HttpPrefixes      = httpPrefixes;
            EnableTrustedAuth = enableTrustedAuth;
            Certificate       = certificate;
            WorkerThreads     = workerThreads;

            DiscoverViaDns = discoverViaDns;
            ClusterDns     = clusterDns;
            GossipSeeds    = gossipSeeds;

            ClusterNodeCount = clusterNodeCount;
            MinFlushDelay    = minFlushDelay;
            PrepareAckCount  = prepareAckCount;
            CommitAckCount   = commitAckCount;
            PrepareTimeout   = prepareTimeout;
            CommitTimeout    = commitTimeout;

            UseSsl            = useSsl;
            SslTargetHost     = sslTargetHost;
            SslValidateServer = sslValidateServer;

            StatsPeriod  = statsPeriod;
            StatsStorage = statsStorage;

            AuthenticationProviderFactory = authenticationProviderFactory;

            NodePriority                = nodePriority;
            DisableScavengeMerging      = disableScavengeMerging;
            AdminOnPublic               = adminOnPublic;
            StatsOnPublic               = statsOnPublic;
            GossipOnPublic              = gossipOnPublic;
            GossipInterval              = gossipInterval;
            GossipAllowedTimeDifference = gossipAllowedTimeDifference;
            GossipTimeout               = gossipTimeout;
            IntTcpHeartbeatTimeout      = intTcpHeartbeatTimeout;
            IntTcpHeartbeatInterval     = intTcpHeartbeatInterval;
            ExtTcpHeartbeatTimeout      = extTcpHeartbeatTimeout;
            ExtTcpHeartbeatInterval     = extTcpHeartbeatInterval;

            VerifyDbHash          = verifyDbHash;
            MaxMemtableEntryCount = maxMemtableEntryCount;
        }
Exemple #9
0
        public ClusterVNodeSettings(Guid instanceId, int debugIndex,
                                    IPEndPoint internalTcpEndPoint,
                                    IPEndPoint internalSecureTcpEndPoint,
                                    IPEndPoint externalTcpEndPoint,
                                    IPEndPoint externalSecureTcpEndPoint,
                                    IPEndPoint internalHttpEndPoint,
                                    IPEndPoint externalHttpEndPoint,
                                    GossipAdvertiseInfo gossipAdvertiseInfo,
                                    bool enableTrustedAuth,
                                    X509Certificate2 certificate,
                                    int workerThreads,
                                    bool discoverViaDns,
                                    string clusterDns,
                                    IPEndPoint[] gossipSeeds,
                                    TimeSpan minFlushDelay,
                                    int clusterNodeCount,
                                    int prepareAckCount,
                                    int commitAckCount,
                                    TimeSpan prepareTimeout,
                                    TimeSpan commitTimeout,
                                    bool disableInternalTls,
                                    bool disableExternalTls,
                                    TimeSpan statsPeriod,
                                    StatsStorage statsStorage,
                                    int nodePriority,
                                    IAuthenticationProviderFactory authenticationProviderFactory,
                                    IAuthorizationProviderFactory authorizationProviderFactory,
                                    bool disableScavengeMerging,
                                    int scavengeHistoryMaxAge,
                                    bool adminOnPublic,
                                    bool statsOnPublic,
                                    bool gossipOnPublic,
                                    TimeSpan gossipInterval,
                                    TimeSpan gossipAllowedTimeDifference,
                                    TimeSpan gossipTimeout,
                                    TimeSpan intTcpHeartbeatTimeout,
                                    TimeSpan intTcpHeartbeatInterval,
                                    TimeSpan extTcpHeartbeatTimeout,
                                    TimeSpan extTcpHeartbeatInterval,
                                    TimeSpan deadMemberRemovalPeriod,
                                    bool verifyDbHash,
                                    int maxMemtableEntryCount,
                                    int hashCollisionReadLimit,
                                    bool startStandardProjections,
                                    bool disableHTTPCaching,
                                    bool logHttpRequests,
                                    int connectionPendingSendBytesThreshold,
                                    int connectionQueueSizeThreshold,
                                    int ptableMaxReaderCount,
                                    string index             = null, bool enableHistograms = false,
                                    bool skipIndexVerify     = false,
                                    int indexCacheDepth      = 16,
                                    byte indexBitnessVersion = 4,
                                    bool optimizeIndexMerge  = false,
                                    IPersistentSubscriptionConsumerStrategyFactory[] additionalConsumerStrategies = null,
                                    bool unsafeIgnoreHardDeletes            = false,
                                    int readerThreadsCount                  = 4,
                                    bool alwaysKeepScavenged                = false,
                                    bool gossipOnSingleNode                 = false,
                                    bool skipIndexScanOnReads               = false,
                                    bool reduceFileCachePressure            = false,
                                    int initializationThreads               = 1,
                                    bool faultOutOfOrderProjections         = false,
                                    int maxAutoMergeIndexLevel              = 1000,
                                    bool disableFirstLevelHttpAuthorization = false,
                                    bool logFailedAuthenticationAttempts    = false,
                                    bool readOnlyReplica = false,
                                    int maxAppendSize    = 1024 * 1024,
                                    Func <HttpMessageHandler> createHttpMessageHandler = null,
                                    bool unsafeAllowSurplusNodes = false,
                                    bool enableExternalTCP       = false,
                                    bool enableAtomPubOverHTTP   = true,
                                    bool gossipOverHttps         = true)
        {
            Ensure.NotEmptyGuid(instanceId, "instanceId");
            Ensure.Equal(false, internalTcpEndPoint == null && internalSecureTcpEndPoint == null, "Both internal TCP endpoints are null");

            Ensure.NotNull(internalHttpEndPoint, "internalHttpEndPoint");
            Ensure.NotNull(externalHttpEndPoint, "externalHttpEndPoint");
            if (internalSecureTcpEndPoint != null || externalSecureTcpEndPoint != null)
            {
                Ensure.NotNull(certificate, "certificate");
            }
            Ensure.Positive(workerThreads, "workerThreads");
            Ensure.NotNull(clusterDns, "clusterDns");
            Ensure.NotNull(gossipSeeds, "gossipSeeds");
            Ensure.Positive(clusterNodeCount, "clusterNodeCount");
            Ensure.Positive(prepareAckCount, "prepareAckCount");
            Ensure.Positive(commitAckCount, "commitAckCount");
            Ensure.Positive(initializationThreads, "initializationThreads");
            Ensure.NotNull(gossipAdvertiseInfo, "gossipAdvertiseInfo");
            if (maxAppendSize > 1024 * 1024 * 16)
            {
                throw new ArgumentOutOfRangeException(nameof(maxAppendSize), $"{nameof(maxAppendSize)} exceeded 16MB.");
            }

            if (discoverViaDns && string.IsNullOrWhiteSpace(clusterDns))
            {
                throw new ArgumentException(
                          "Either DNS Discovery must be disabled (and seeds specified), or a cluster DNS name must be provided.");
            }

            NodeInfo = new VNodeInfo(instanceId, debugIndex,
                                     internalTcpEndPoint, internalSecureTcpEndPoint,
                                     externalTcpEndPoint, externalSecureTcpEndPoint,
                                     internalHttpEndPoint, externalHttpEndPoint,
                                     readOnlyReplica);
            GossipAdvertiseInfo = gossipAdvertiseInfo;
            EnableTrustedAuth   = enableTrustedAuth;
            Certificate         = certificate;

            WorkerThreads                   = workerThreads;
            StartStandardProjections        = startStandardProjections;
            EnableAtomPubOverHTTP           = enableAtomPubOverHTTP;
            DisableHTTPCaching              = disableHTTPCaching;
            LogHttpRequests                 = logHttpRequests;
            LogFailedAuthenticationAttempts = logFailedAuthenticationAttempts;
            AdditionalConsumerStrategies    =
                additionalConsumerStrategies ?? new IPersistentSubscriptionConsumerStrategyFactory[0];

            DiscoverViaDns     = discoverViaDns;
            ClusterDns         = clusterDns;
            GossipSeeds        = gossipSeeds;
            GossipOnSingleNode = gossipOnSingleNode;

            ClusterNodeCount = clusterNodeCount;
            MinFlushDelay    = minFlushDelay;
            PrepareAckCount  = prepareAckCount;
            CommitAckCount   = commitAckCount;
            PrepareTimeout   = prepareTimeout;
            CommitTimeout    = commitTimeout;

            DisableInternalTls = disableInternalTls;
            DisableExternalTls = disableExternalTls;
            EnableExternalTCP  = enableExternalTCP;

            StatsPeriod  = statsPeriod;
            StatsStorage = statsStorage;

            AuthenticationProviderFactory      = authenticationProviderFactory;
            AuthorizationProviderFactory       = authorizationProviderFactory;
            DisableFirstLevelHttpAuthorization = disableFirstLevelHttpAuthorization;

            NodePriority                        = nodePriority;
            DisableScavengeMerging              = disableScavengeMerging;
            ScavengeHistoryMaxAge               = scavengeHistoryMaxAge;
            AdminOnPublic                       = adminOnPublic;
            StatsOnPublic                       = statsOnPublic;
            GossipOnPublic                      = gossipOnPublic;
            GossipInterval                      = gossipInterval;
            GossipAllowedTimeDifference         = gossipAllowedTimeDifference;
            GossipTimeout                       = gossipTimeout;
            GossipOverHttps                     = gossipOverHttps;
            IntTcpHeartbeatTimeout              = intTcpHeartbeatTimeout;
            IntTcpHeartbeatInterval             = intTcpHeartbeatInterval;
            ExtTcpHeartbeatTimeout              = extTcpHeartbeatTimeout;
            ExtTcpHeartbeatInterval             = extTcpHeartbeatInterval;
            ConnectionPendingSendBytesThreshold = connectionPendingSendBytesThreshold;
            ConnectionQueueSizeThreshold        = connectionQueueSizeThreshold;
            DeadMemberRemovalPeriod             = deadMemberRemovalPeriod;

            VerifyDbHash           = verifyDbHash;
            MaxMemtableEntryCount  = maxMemtableEntryCount;
            HashCollisionReadLimit = hashCollisionReadLimit;

            EnableHistograms    = enableHistograms;
            SkipIndexVerify     = skipIndexVerify;
            IndexCacheDepth     = indexCacheDepth;
            IndexBitnessVersion = indexBitnessVersion;
            OptimizeIndexMerge  = optimizeIndexMerge;
            Index = index;
            UnsafeIgnoreHardDeletes    = unsafeIgnoreHardDeletes;
            ReaderThreadsCount         = readerThreadsCount;
            AlwaysKeepScavenged        = alwaysKeepScavenged;
            SkipIndexScanOnReads       = skipIndexScanOnReads;
            ReduceFileCachePressure    = reduceFileCachePressure;
            InitializationThreads      = initializationThreads;
            MaxAutoMergeIndexLevel     = maxAutoMergeIndexLevel;
            FaultOutOfOrderProjections = faultOutOfOrderProjections;
            ReadOnlyReplica            = readOnlyReplica;
            MaxAppendSize            = maxAppendSize;
            CreateHttpMessageHandler = createHttpMessageHandler;
            PTableMaxReaderCount     = ptableMaxReaderCount;
            UnsafeAllowSurplusNodes  = unsafeAllowSurplusNodes;
        }
 public CodeValidator(ISender mediator, IAuthenticationProviderFactory providerFactory)
 {
     _mediator        = mediator;
     _providerFactory = providerFactory;
 }
Exemple #11
0
        public Server(string ip, int port, INetworkingClientPool networkingClientPool, IAuthenticationProviderFactory authenticationProviderFactory, IEntityStreamer streamer,
                      IStreamingHandlerFactory factory)
        {
            var webSocket = new WebSocket();
            var authenticationProvider = authenticationProviderFactory.Create(ip, port, webSocket);
            var streamingHandler       = factory.Create(networkingClientPool, authenticationProvider);

            StreamingHandler                  = streamingHandler;
            webSocket.OnMessageReceived       = streamingHandler.OnMessage;
            webSocket.OnError                 = authenticationProvider.OnError;
            webSocket.OnConnectionEstablished = authenticationProvider.OnConnectionEstablished;
            webSocket.OnConnectionBroken      = authenticationProvider.OnConnectionBroken;
            webSocket.StartListen(port);
        }
Exemple #12
0
 /// <summary>
 /// Sets the authentication provider factory to use
 /// </summary>
 /// <param name="authenticationProviderFactory">The authentication provider factory to use </param>
 /// <returns>A <see cref="VNodeBuilder"/> with the options set</returns>
 public VNodeBuilder WithAuthenticationProvider(IAuthenticationProviderFactory authenticationProviderFactory)
 {
     _authenticationProviderFactory = authenticationProviderFactory;
     return this;
 }
Exemple #13
0
        // ReSharper restore FieldCanBeMadeReadOnly.Local

        protected VNodeBuilder()
        {
            _log = LogManager.GetLoggerFor<VNodeBuilder>();
            _statsStorage = StatsStorage.Stream;

            _chunkSize = TFConsts.ChunkSize;
            _dbPath = Path.Combine(Path.GetTempPath(), "EmbeddedEventStore", string.Format("{0:yyyy-MM-dd_HH.mm.ss.ffffff}-EmbeddedNode", DateTime.UtcNow));
            _chunksCacheSize = TFConsts.ChunksCacheSize;
            _cachedChunks = Opts.CachedChunksDefault;
            _inMemoryDb = true;
            _projectionType = ProjectionType.None;

            _externalTcp = new IPEndPoint(Opts.ExternalIpDefault, Opts.ExternalTcpPortDefault);
            _externalSecureTcp = null;
            _internalTcp = new IPEndPoint(Opts.InternalIpDefault, Opts.InternalTcpPortDefault);
            _internalSecureTcp = null;
            _externalHttp = new IPEndPoint(Opts.ExternalIpDefault, Opts.ExternalHttpPortDefault);
            _internalHttp = new IPEndPoint(Opts.InternalIpDefault, Opts.InternalHttpPortDefault);

            _intHttpPrefixes = new List<string>();
            _extHttpPrefixes = new List<string>();
            _addInterfacePrefixes = true;
            _enableTrustedAuth = Opts.EnableTrustedAuthDefault;
            _readerThreadsCount = Opts.ReaderThreadsCountDefault;
            _certificate = null;
            _workerThreads = Opts.WorkerThreadsDefault;

            _discoverViaDns = Opts.DiscoverViaDnsDefault;
            _clusterDns = Opts.ClusterDnsDefault;
            _gossipSeeds = new List<IPEndPoint>();

            _minFlushDelay = TimeSpan.FromMilliseconds(Opts.MinFlushDelayMsDefault);

            _clusterNodeCount = 1;
            _prepareAckCount = 1;
            _commitAckCount = 1;
            _prepareTimeout = TimeSpan.FromMilliseconds(Opts.PrepareTimeoutMsDefault);
            _commitTimeout = TimeSpan.FromMilliseconds(Opts.CommitTimeoutMsDefault);

            _nodePriority = Opts.NodePriorityDefault;

            _useSsl = Opts.UseInternalSslDefault;
            _sslTargetHost = Opts.SslTargetHostDefault;
            _sslValidateServer = Opts.SslValidateServerDefault;

            _statsPeriod = TimeSpan.FromSeconds(Opts.StatsPeriodDefault);

            _authenticationProviderFactory = new InternalAuthenticationProviderFactory();
            _disableScavengeMerging = Opts.DisableScavengeMergeDefault;
            _scavengeHistoryMaxAge = Opts.ScavengeHistoryMaxAgeDefault;
            _adminOnPublic = Opts.AdminOnExtDefault;
            _statsOnPublic = Opts.StatsOnExtDefault;
            _gossipOnPublic = Opts.GossipOnExtDefault;
            _gossipInterval = TimeSpan.FromMilliseconds(Opts.GossipIntervalMsDefault);
            _gossipAllowedTimeDifference = TimeSpan.FromMilliseconds(Opts.GossipAllowedDifferenceMsDefault);
            _gossipTimeout = TimeSpan.FromMilliseconds(Opts.GossipTimeoutMsDefault);

            _intTcpHeartbeatInterval = TimeSpan.FromMilliseconds(Opts.IntTcpHeartbeatIntervalDefault);
            _intTcpHeartbeatTimeout = TimeSpan.FromMilliseconds(Opts.IntTcpHeartbeatTimeoutDefault);
            _extTcpHeartbeatInterval = TimeSpan.FromMilliseconds(Opts.ExtTcpHeartbeatIntervalDefault);
            _extTcpHeartbeatTimeout = TimeSpan.FromMilliseconds(Opts.ExtTcpHeartbeatTimeoutDefault);

            _skipVerifyDbHashes = Opts.SkipDbVerifyDefault;
            _maxMemtableSize = Opts.MaxMemtableSizeDefault;
            _subsystems = new List<ISubsystem>();
            _clusterGossipPort = Opts.ClusterGossipPortDefault;

            _startStandardProjections = Opts.StartStandardProjectionsDefault;
            _disableHTTPCaching = Opts.DisableHttpCachingDefault;
            _logHttpRequests = Opts.LogHttpRequestsDefault;
            _enableHistograms = Opts.LogHttpRequestsDefault;
            _index = null;
            _indexCacheDepth = Opts.IndexCacheDepthDefault;
            _indexBitnessVersion = Opts.IndexBitnessVersionDefault;
            _unsafeIgnoreHardDelete = Opts.UnsafeIgnoreHardDeleteDefault;
            _betterOrdering = Opts.BetterOrderingDefault;
            _unsafeDisableFlushToDisk = Opts.UnsafeDisableFlushToDiskDefault;
            _alwaysKeepScavenged = Opts.AlwaysKeepScavengedDefault;
        }
        public ClusterVNodeSettings(Guid instanceId,
                                    IPEndPoint internalTcpEndPoint,
                                    IPEndPoint internalSecureTcpEndPoint,
                                    IPEndPoint externalTcpEndPoint,
                                    IPEndPoint externalSecureTcpEndPoint,
                                    IPEndPoint internalHttpEndPoint,
                                    IPEndPoint externalHttpEndPoint,
                                    string[] httpPrefixes,
                                    bool enableTrustedAuth,
                                    X509Certificate2 certificate,
                                    int workerThreads,
                                    bool discoverViaDns,
                                    string clusterDns,
                                    IPEndPoint[] gossipSeeds,
                                    TimeSpan minFlushDelay,
                                    int clusterNodeCount,
                                    int prepareAckCount,
                                    int commitAckCount,
                                    TimeSpan prepareTimeout,
                                    TimeSpan commitTimeout,
                                    bool useSsl,
                                    string sslTargetHost,
                                    bool sslValidateServer,
                                    TimeSpan statsPeriod,
                                    StatsStorage statsStorage,
                                    int nodePriority,
                                    IAuthenticationProviderFactory authenticationProviderFactory)
        {
            Ensure.NotEmptyGuid(instanceId, "instanceId");
            Ensure.NotNull(internalTcpEndPoint, "internalTcpEndPoint");
            Ensure.NotNull(externalTcpEndPoint, "externalTcpEndPoint");
            Ensure.NotNull(internalHttpEndPoint, "internalHttpEndPoint");
            Ensure.NotNull(externalHttpEndPoint, "externalHttpEndPoint");
            Ensure.NotNull(httpPrefixes, "httpPrefixes");
            if (internalSecureTcpEndPoint != null || externalSecureTcpEndPoint != null)
            {
                Ensure.NotNull(certificate, "certificate");
            }
            Ensure.Positive(workerThreads, "workerThreads");
            Ensure.NotNull(clusterDns, "clusterDns");
            Ensure.NotNull(gossipSeeds, "gossipSeeds");
            Ensure.Positive(clusterNodeCount, "clusterNodeCount");
            Ensure.Positive(prepareAckCount, "prepareAckCount");
            Ensure.Positive(commitAckCount, "commitAckCount");

            if (discoverViaDns && string.IsNullOrWhiteSpace(clusterDns))
            {
                throw new ArgumentException("Either DNS Discovery must be disabled (and seeds specified), or a cluster DNS name must be provided.");
            }

            if (useSsl)
            {
                Ensure.NotNull(sslTargetHost, "sslTargetHost");
            }

            NodeInfo = new VNodeInfo(instanceId,
                                     internalTcpEndPoint, internalSecureTcpEndPoint,
                                     externalTcpEndPoint, externalSecureTcpEndPoint,
                                     internalHttpEndPoint, externalHttpEndPoint);
            HttpPrefixes      = httpPrefixes;
            EnableTrustedAuth = enableTrustedAuth;
            Certificate       = certificate;
            WorkerThreads     = workerThreads;

            DiscoverViaDns = discoverViaDns;
            ClusterDns     = clusterDns;
            GossipSeeds    = gossipSeeds;

            ClusterNodeCount = clusterNodeCount;
            MinFlushDelay    = minFlushDelay;
            PrepareAckCount  = prepareAckCount;
            CommitAckCount   = commitAckCount;
            PrepareTimeout   = prepareTimeout;
            CommitTimeout    = commitTimeout;

            UseSsl            = useSsl;
            SslTargetHost     = sslTargetHost;
            SslValidateServer = sslValidateServer;

            StatsPeriod  = statsPeriod;
            StatsStorage = statsStorage;

            AuthenticationProviderFactory = authenticationProviderFactory;

            NodePriority = nodePriority;
        }
        public ClusterVNodeSettings(Guid instanceId, int debugIndex,
                                    IPEndPoint internalTcpEndPoint,
                                    IPEndPoint internalSecureTcpEndPoint,
                                    IPEndPoint externalTcpEndPoint,
                                    IPEndPoint externalSecureTcpEndPoint,
                                    IPEndPoint internalHttpEndPoint,
                                    IPEndPoint externalHttpEndPoint,
                                    GossipAdvertiseInfo gossipAdvertiseInfo,
                                    string[] intHttpPrefixes,
                                    string[] extHttpPrefixes,
                                    bool enableTrustedAuth,
                                    X509Certificate2 certificate,
                                    int workerThreads,
                                    bool discoverViaDns,
                                    string clusterDns,
                                    IPEndPoint[] gossipSeeds,
                                    TimeSpan minFlushDelay,
                                    int clusterNodeCount,
                                    int prepareAckCount,
                                    int commitAckCount,
                                    TimeSpan prepareTimeout,
                                    TimeSpan commitTimeout,
                                    bool useSsl,
                                    bool disableInsecureTCP,
                                    string sslTargetHost,
                                    bool sslValidateServer,
                                    TimeSpan statsPeriod,
                                    StatsStorage statsStorage,
                                    int nodePriority,
                                    IAuthenticationProviderFactory authenticationProviderFactory,
                                    bool disableScavengeMerging,
                                    int scavengeHistoryMaxAge,
                                    bool adminOnPublic,
                                    bool statsOnPublic,
                                    bool gossipOnPublic,
                                    TimeSpan gossipInterval,
                                    TimeSpan gossipAllowedTimeDifference,
                                    TimeSpan gossipTimeout,
                                    TimeSpan intTcpHeartbeatTimeout,
                                    TimeSpan intTcpHeartbeatInterval,
                                    TimeSpan extTcpHeartbeatTimeout,
                                    TimeSpan extTcpHeartbeatInterval,
                                    bool verifyDbHash,
                                    int maxMemtableEntryCount,
                                    int hashCollisionReadLimit,
                                    bool startStandardProjections,
                                    bool disableHTTPCaching,
                                    bool logHttpRequests,
                                    int connectionPendingSendBytesThreshold,
                                    int chunkInitialReaderCount,
                                    string index             = null, bool enableHistograms = false,
                                    bool skipIndexVerify     = false,
                                    int indexCacheDepth      = 16,
                                    byte indexBitnessVersion = 4,
                                    bool optimizeIndexMerge  = false,
                                    IPersistentSubscriptionConsumerStrategyFactory[] additionalConsumerStrategies = null,
                                    bool unsafeIgnoreHardDeletes = false,
                                    bool betterOrdering          = false,
                                    int readerThreadsCount       = 4,
                                    bool alwaysKeepScavenged     = false,
                                    bool gossipOnSingleNode      = false,
                                    bool skipIndexScanOnReads    = false,
                                    bool reduceFileCachePressure = false,
                                    int initializationThreads    = 1)
        {
            Ensure.NotEmptyGuid(instanceId, "instanceId");
            Ensure.NotNull(internalTcpEndPoint, "internalTcpEndPoint");
            Ensure.NotNull(externalTcpEndPoint, "externalTcpEndPoint");
            Ensure.NotNull(internalHttpEndPoint, "internalHttpEndPoint");
            Ensure.NotNull(externalHttpEndPoint, "externalHttpEndPoint");
            Ensure.NotNull(intHttpPrefixes, "intHttpPrefixes");
            Ensure.NotNull(extHttpPrefixes, "extHttpPrefixes");
            if (internalSecureTcpEndPoint != null || externalSecureTcpEndPoint != null)
            {
                Ensure.NotNull(certificate, "certificate");
            }
            Ensure.Positive(workerThreads, "workerThreads");
            Ensure.NotNull(clusterDns, "clusterDns");
            Ensure.NotNull(gossipSeeds, "gossipSeeds");
            Ensure.Positive(clusterNodeCount, "clusterNodeCount");
            Ensure.Positive(prepareAckCount, "prepareAckCount");
            Ensure.Positive(commitAckCount, "commitAckCount");
            Ensure.Positive(initializationThreads, "initializationThreads");
            Ensure.NotNull(gossipAdvertiseInfo, "gossipAdvertiseInfo");

            if (discoverViaDns && string.IsNullOrWhiteSpace(clusterDns))
            {
                throw new ArgumentException("Either DNS Discovery must be disabled (and seeds specified), or a cluster DNS name must be provided.");
            }

            if (useSsl)
            {
                Ensure.NotNull(sslTargetHost, "sslTargetHost");
            }

            NodeInfo = new VNodeInfo(instanceId, debugIndex,
                                     internalTcpEndPoint, internalSecureTcpEndPoint,
                                     externalTcpEndPoint, externalSecureTcpEndPoint,
                                     internalHttpEndPoint, externalHttpEndPoint);
            GossipAdvertiseInfo          = gossipAdvertiseInfo;
            IntHttpPrefixes              = intHttpPrefixes;
            ExtHttpPrefixes              = extHttpPrefixes;
            EnableTrustedAuth            = enableTrustedAuth;
            Certificate                  = certificate;
            WorkerThreads                = workerThreads;
            StartStandardProjections     = startStandardProjections;
            DisableHTTPCaching           = disableHTTPCaching;
            LogHttpRequests              = logHttpRequests;
            AdditionalConsumerStrategies = additionalConsumerStrategies ?? new IPersistentSubscriptionConsumerStrategyFactory[0];

            DiscoverViaDns     = discoverViaDns;
            ClusterDns         = clusterDns;
            GossipSeeds        = gossipSeeds;
            GossipOnSingleNode = gossipOnSingleNode;

            ClusterNodeCount = clusterNodeCount;
            MinFlushDelay    = minFlushDelay;
            PrepareAckCount  = prepareAckCount;
            CommitAckCount   = commitAckCount;
            PrepareTimeout   = prepareTimeout;
            CommitTimeout    = commitTimeout;

            UseSsl             = useSsl;
            DisableInsecureTCP = disableInsecureTCP;
            SslTargetHost      = sslTargetHost;
            SslValidateServer  = sslValidateServer;

            StatsPeriod  = statsPeriod;
            StatsStorage = statsStorage;

            AuthenticationProviderFactory = authenticationProviderFactory;

            NodePriority                        = nodePriority;
            DisableScavengeMerging              = disableScavengeMerging;
            ScavengeHistoryMaxAge               = scavengeHistoryMaxAge;
            AdminOnPublic                       = adminOnPublic;
            StatsOnPublic                       = statsOnPublic;
            GossipOnPublic                      = gossipOnPublic;
            GossipInterval                      = gossipInterval;
            GossipAllowedTimeDifference         = gossipAllowedTimeDifference;
            GossipTimeout                       = gossipTimeout;
            IntTcpHeartbeatTimeout              = intTcpHeartbeatTimeout;
            IntTcpHeartbeatInterval             = intTcpHeartbeatInterval;
            ExtTcpHeartbeatTimeout              = extTcpHeartbeatTimeout;
            ExtTcpHeartbeatInterval             = extTcpHeartbeatInterval;
            ConnectionPendingSendBytesThreshold = connectionPendingSendBytesThreshold;
            ChunkInitialReaderCount             = chunkInitialReaderCount;

            VerifyDbHash           = verifyDbHash;
            MaxMemtableEntryCount  = maxMemtableEntryCount;
            HashCollisionReadLimit = hashCollisionReadLimit;

            EnableHistograms    = enableHistograms;
            SkipIndexVerify     = skipIndexVerify;
            IndexCacheDepth     = indexCacheDepth;
            IndexBitnessVersion = indexBitnessVersion;
            OptimizeIndexMerge  = optimizeIndexMerge;
            Index = index;
            UnsafeIgnoreHardDeletes = unsafeIgnoreHardDeletes;
            BetterOrdering          = betterOrdering;
            ReaderThreadsCount      = readerThreadsCount;
            AlwaysKeepScavenged     = alwaysKeepScavenged;
            SkipIndexScanOnReads    = skipIndexScanOnReads;
            ReduceFileCachePressure = reduceFileCachePressure;
            InitializationThreads   = initializationThreads;
        }
        // ReSharper restore FieldCanBeMadeReadOnly.Local

        private EmbeddedVNodeBuilder()
        {
            _chunkSize = TFConsts.ChunkSize;
            _dbPath = Path.Combine(Path.GetTempPath(), "EmbeddedEventStore", string.Format("{0:yyyy-MM-dd_HH.mm.ss.ffffff}-EmbeddedNode", DateTime.UtcNow));
            _chunksCacheSize = TFConsts.ChunksCacheSize;
            _inMemoryDb = true;

            _externalTcp = new IPEndPoint(Opts.ExternalIpDefault, Opts.ExternalHttpPortDefault);
            _externalSecureTcp = null;
            _externalTcp = new IPEndPoint(Opts.ExternalIpDefault, Opts.ExternalHttpPortDefault);
            _externalSecureTcp = null;
            _externalHttp = new IPEndPoint(Opts.ExternalIpDefault, Opts.ExternalHttpPortDefault);
            _externalHttp = new IPEndPoint(Opts.ExternalIpDefault, Opts.ExternalHttpPortDefault);

            _httpPrefixes = new List<string>();
            _enableTrustedAuth = Opts.EnableTrustedAuthDefault;
            _certificate = null;
            _workerThreads = Opts.WorkerThreadsDefault;

            _discoverViaDns = false;
            _clusterDns = Opts.ClusterDnsDefault;
            _gossipSeeds = new List<IPEndPoint>();

            _minFlushDelay = TimeSpan.FromMilliseconds(Opts.MinFlushDelayMsDefault);

            _clusterNodeCount = 1;
            _prepareAckCount = 1;
            _commitAckCount = 1;
            _prepareTimeout = TimeSpan.FromMilliseconds(Opts.PrepareTimeoutMsDefault);
            _commitTimeout = TimeSpan.FromMilliseconds(Opts.CommitTimeoutMsDefault);

            _nodePriority = Opts.NodePriorityDefault;

            _useSsl = Opts.UseInternalSslDefault;
            _sslTargetHost = Opts.SslTargetHostDefault;
            _sslValidateServer = Opts.SslValidateServerDefault;

            _statsPeriod = TimeSpan.FromSeconds(Opts.StatsPeriodDefault);
            _statsStorage = StatsStorage.Stream;

            _authenticationProviderFactory = new InternalAuthenticationProviderFactory();
            _disableScavengeMerging = Opts.DisableScavengeMergeDefault;
            _adminOnPublic = Opts.AdminOnExtDefault;
            _statsOnPublic = Opts.StatsOnExtDefault;
            _gossipOnPublic = Opts.GossipOnExtDefault;
            _gossipInterval = TimeSpan.FromMilliseconds(Opts.GossipIntervalMsDefault);
            _gossipAllowedTimeDifference = TimeSpan.FromMilliseconds(Opts.GossipAllowedDifferenceMsDefault);
            _gossipTimeout = TimeSpan.FromMilliseconds(Opts.GossipTimeoutMsDefault);

            _intTcpHeartbeatInterval = TimeSpan.FromMilliseconds(Opts.IntTcpHeartbeatInvervalDefault);
            _intTcpHeartbeatTimeout = TimeSpan.FromMilliseconds(Opts.IntTcpHeartbeatTimeoutDefault);
            _extTcpHeartbeatInterval = TimeSpan.FromMilliseconds(Opts.ExtTcpHeartbeatIntervalDefault);
            _extTcpHeartbeatTimeout = TimeSpan.FromMilliseconds(Opts.ExtTcpHeartbeatTimeoutDefault);

            _skipVerifyDbHashes = Opts.SkipDbVerifyDefault;
            _maxMemtableSize = Opts.MaxMemtableSizeDefault;
            _subsystems = new List<ISubsystem>();
            _clusterGossipPort = Opts.ClusterGossipPortDefault;
        }
 /// <summary>
 /// Default constructor
 /// </summary>
 /// <param name="authenticationOptions"><see cref="PnPCoreAuthenticationOptions"/> authentication options</param>
 /// <param name="authenticationProviderFactory">Authentication factory</param>
 public AuthenticationProvidersOptionsConfigurator(IOptions <PnPCoreAuthenticationOptions> authenticationOptions,
                                                   IAuthenticationProviderFactory authenticationProviderFactory)
 {
     this.authenticationOptions         = authenticationOptions?.Value;
     this.authenticationProviderFactory = authenticationProviderFactory;
 }