Particular / NServiceBus

Build, version, and monitor better microservices with the most powerful service platform for .NET
https://particular.net/nservicebus/
Other
2.07k stars 650 forks source link

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

Closed ramonsmits closed 1 month ago

ramonsmits commented 1 month ago

Do not validate licenseFile and licenseText values to prevent startup issues due to invalid values

Resolves:

No technical limitations are enforced at runtime when either no license is found or a license has expired.

Source: https://docs.particular.net/nservicebus/licensing/#throughput-limitations

jpalac commented 1 month ago

It feels like if you're specifically using endpointConfiguration.LicensePath("PathToLicense") then you intend to provide a path to a license file. If you do not have a path, then do not make the API call. If a path is provided but it is invalid (doesn't exist) or the license found at the path is invalid or expired, then the code works as expected.

ramonsmits commented 1 month ago

The documentation states:

No technical limitations are enforced at runtime when either no license is found or a license has expired.

However, this API is an explicit call. It is expected that some data to process is present.

ramonsmits commented 1 month ago

I'm not satisfied with these changes. Too big diff for what we want.

Alternative is to just add validation in the extension methods and use

LogManager.GetLogger<LicenseManager>().Error("LicensePath argument is invalid and will be ignored")

Problem with that is that although no ArgumentException is raised the behavior will be different as now we will scan a bunch of default locations for the presence of a license file.