Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/KurrentDB.Core/ClusterVNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1063,7 +1063,8 @@ GossipAdvertiseInfo GetGossipAdvertiseInfo() {
new Dictionary<string, bool> {
["projections"] = options.Projection.RunProjections != ProjectionType.None || options.DevMode.Dev,
["userManagement"] = options.Auth.AuthenticationType == Opts.AuthenticationTypeDefault && !options.Application.Insecure,
["atomPub"] = options.Interface.EnableAtomPubOverHttp || options.DevMode.Dev
["atomPub"] = options.Interface.EnableAtomPubOverHttp || options.DevMode.Dev,
["connectors"] = options.IsPluginEnabled("Connectors")
},
_authenticationProvider
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// ReSharper disable CheckNamespace

using System;
using System.Linq;
using System.Net;
using System.Security.Cryptography.X509Certificates;
using EventStore.Plugins;
Expand All @@ -27,6 +28,12 @@ public static ClusterVNodeOptions WithPlugableComponents(this ClusterVNodeOption
public static ClusterVNodeOptions WithPlugableComponent(this ClusterVNodeOptions options, IPlugableComponent plugableComponent) =>
options with { PlugableComponents = [.. options.PlugableComponents, plugableComponent] };

/// <summary>
/// Returns whether a pluggable component with the given name is present and enabled.
/// </summary>
public static bool IsPluginEnabled(this ClusterVNodeOptions options, string name) =>
options.PlugableComponents.Any(x => string.Equals(x.Name, name, StringComparison.OrdinalIgnoreCase) && x.Enabled);

public static ClusterVNodeOptions InCluster(this ClusterVNodeOptions options, int clusterSize) => options with {
Cluster = options.Cluster with {
ClusterSize = clusterSize <= 1
Expand Down
2 changes: 1 addition & 1 deletion src/KurrentDB/Components/Plugins/PluginsService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ namespace KurrentDB.Components.Plugins;
public class PluginsService(ClusterVNodeOptions options) {
public readonly IReadOnlyList<IPlugableComponent> PluggableComponents = options.PlugableComponents.OrderBy(x => x.Name).ToList();

public bool IsPluginEnabled(string name) => PluggableComponents.Any(x => x.Name == name && x.Enabled);
public bool IsPluginEnabled(string name) => options.IsPluginEnabled(name);
}