Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spike: Do not validate licenseFile and licenseText values to prevent startup issues #7061

Closed
wants to merge 5 commits into from
Closed
Changes from 2 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
9 changes: 2 additions & 7 deletions src/NServiceBus.Core/Licensing/ConfigureLicenseExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
namespace NServiceBus;

using System;
using Features;

/// <summary>
Expand All @@ -16,9 +15,7 @@ public static class ConfigureLicenseExtensions
/// <remarks>The license provided via code-first API takes precedence over other license sources.</remarks>
public static void License(this EndpointConfiguration config, string licenseText)
{
ArgumentException.ThrowIfNullOrWhiteSpace(licenseText);
ArgumentNullException.ThrowIfNull(config);

// Intentionally not doing validation as passed value could be dynamic and (temporarily) be invalid
config.Settings.Set(LicenseReminder.LicenseTextSettingsKey, licenseText);
}

Expand All @@ -30,9 +27,7 @@ public static void License(this EndpointConfiguration config, string licenseText
/// <remarks>The license provided via code-first API takes precedence over other license sources.</remarks>
public static void LicensePath(this EndpointConfiguration config, string licenseFile)
{
ArgumentNullException.ThrowIfNull(config);
ArgumentException.ThrowIfNullOrWhiteSpace(licenseFile);

// Intentionally not doing validation as passed value could be dynamic and (temporarily) be invalid
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is strange here is that currently we do not do a File.Exist. If we defer that we could also defer ANY validation. However, now including a File.Exist is a breaking change.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a tricky situation, it may be nice to involve others to see their thoughts

config.Settings.Set(LicenseReminder.LicenseFilePathSettingsKey, licenseFile);
}
}