Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@ public abstract class AuthenticationProviderBase(PluginOptions options) : Plugin
protected AuthenticationProviderBase(
string? name = null,
string? version = null,
string? licensePublicKey = null,
string? diagnosticsName = null,
params KeyValuePair<string, object?>[] diagnosticsTags
) : this(new() {
Name = name,
Version = version,
LicensePublicKey = licensePublicKey,
DiagnosticsName = diagnosticsName,
DiagnosticsTags = diagnosticsTags
}) { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@ public abstract class AuthorizationProviderBase(PluginOptions options) : Plugin(
protected AuthorizationProviderBase(
string? name = null,
string? version = null,
string? licensePublicKey = null,
string? diagnosticsName = null,
params KeyValuePair<string, object?>[] diagnosticsTags
) : this(new() {
Name = name,
Version = version,
LicensePublicKey = licensePublicKey,
DiagnosticsName = diagnosticsName,
DiagnosticsTags = diagnosticsTags
}) { }
Expand Down
2 changes: 0 additions & 2 deletions src/EventStore.Plugins/EventStore.Plugins.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.IdentityModel.JsonWebTokens" Version="7.6.0" />
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="8.0.1" />
<PackageReference Include="YamlDotNet" Version="15.1.4" />
<PackageReference Include="JetBrains.Annotations" Version="2023.3.0" />
<PackageReference Include="System.Reactive" Version="6.0.1" />
</ItemGroup>

<ItemGroup>
Expand Down
5 changes: 0 additions & 5 deletions src/EventStore.Plugins/IPlugableComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@ public interface IPlugableComponent {
/// </summary>
bool Enabled { get; }

/// <summary>
/// The public key used for licensing.
/// </summary>
string? LicensePublicKey { get; }

/// <summary>
/// Configures the services using the provided IServiceCollection and IConfiguration.
/// </summary>
Expand Down
15 changes: 0 additions & 15 deletions src/EventStore.Plugins/LicenseException.cs

This file was deleted.

15 changes: 0 additions & 15 deletions src/EventStore.Plugins/Licensing/ILicenseService.cs

This file was deleted.

98 changes: 0 additions & 98 deletions src/EventStore.Plugins/Licensing/License.cs

This file was deleted.

5 changes: 0 additions & 5 deletions src/EventStore.Plugins/Licensing/LicenseConstants.cs

This file was deleted.

50 changes: 0 additions & 50 deletions src/EventStore.Plugins/Licensing/LicenseMonitor.cs

This file was deleted.

26 changes: 0 additions & 26 deletions src/EventStore.Plugins/Plugin.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System.Diagnostics;
using EventStore.Plugins.Diagnostics;
using EventStore.Plugins.Licensing;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
Expand All @@ -13,8 +12,6 @@ namespace EventStore.Plugins;
public record PluginOptions {
public string? Name { get; init; }
public string? Version { get; init; }
public string? LicensePublicKey { get; init; }
public string[]? RequiredEntitlements { get; init; }
public string? DiagnosticsName { get; init; }
public KeyValuePair<string, object?>[] DiagnosticsTags { get; init; } = [];
}
Expand All @@ -24,8 +21,6 @@ public abstract class Plugin : IPlugableComponent, IDisposable {
protected Plugin(
string? name = null,
string? version = null,
string? licensePublicKey = null,
string[]? requiredEntitlements = null,
string? diagnosticsName = null,
params KeyValuePair<string, object?>[] diagnosticsTags) {

Expand All @@ -40,9 +35,6 @@ protected Plugin(

Version = GetPluginVersion(version, pluginType);

LicensePublicKey = licensePublicKey;
RequiredEntitlements = requiredEntitlements;

DiagnosticsName = diagnosticsName ?? Name;
DiagnosticsTags = diagnosticsTags;

Expand All @@ -68,15 +60,9 @@ static string GetPluginVersion(string? pluginVersion, Type pluginType) {
protected Plugin(PluginOptions options) : this(
options.Name,
options.Version,
options.LicensePublicKey,
options.RequiredEntitlements,
options.DiagnosticsName,
options.DiagnosticsTags) { }

public string? LicensePublicKey { get; }

public string[]? RequiredEntitlements { get; }

DiagnosticListener DiagnosticListener { get; }

(bool Enabled, string EnableInstructions) IsEnabledResult { get; set; }
Expand Down Expand Up @@ -134,18 +120,6 @@ void IPlugableComponent.ConfigureApplication(IApplicationBuilder app, IConfigura
return;
}

if (Enabled && LicensePublicKey is not null) {
// the plugin is enabled and requires a license
var licenseService = app.ApplicationServices.GetRequiredService<ILicenseService>();

_ = LicenseMonitor.MonitorAsync(
Name,
RequiredEntitlements ?? [],
licenseService,
logger,
LicensePublicKey);
}

// there is still a chance to disable the plugin when configuring the application
// this is useful when the plugin is enabled, but some conditions that can only be checked here are not met
ConfigureApplication(app, Configuration);
Expand Down
4 changes: 0 additions & 4 deletions src/EventStore.Plugins/SubsystemsPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,12 @@ protected SubsystemsPlugin(SubsystemsPluginOptions options) : base(options) {

protected SubsystemsPlugin(
string? name = null, string? version = null,
string? licensePublicKey = null,
string[]? requiredEntitlements = null,
string? commandLineName = null,
string? diagnosticsName = null,
params KeyValuePair<string, object?>[] diagnosticsTags
) : this(new() {
Name = name,
Version = version,
LicensePublicKey = licensePublicKey,
RequiredEntitlements = requiredEntitlements,
DiagnosticsName = diagnosticsName,
DiagnosticsTags = diagnosticsTags,
CommandLineName = commandLineName
Expand Down
Loading
Loading