-
Notifications
You must be signed in to change notification settings - Fork 648
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
Conversation
… issues due to invalid values
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may not be the right approach.
Let's assume I'm unintentionally providing content that is considered an invalid license, thinking it's right. How will I find out my license content differs from what I think it is?
I'd appreciate it if you could have a warning log.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ramonsmits in the issue referenced, it seems the user is explicitly calling the API, which in this case is throwing an exception.
If the user wants to handle a scenario where the license string may be empty or null, then they have to handle that themselves before calling the API.
In other words, I think the validation error is correct and should not be removed.
It feels like if you're specifically using |
The documentation states:
However, this API is an explicit call. It is expected that some data to process is present. |
ArgumentNullException.ThrowIfNull(config); | ||
ArgumentException.ThrowIfNullOrWhiteSpace(licenseFile); | ||
|
||
// Intentionally not doing validation as passed value could be dynamic and (temporarily) be invalid |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
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
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. |
Do not validate licenseFile and licenseText values to prevent startup issues due to invalid values
Resolves:
Source: https://docs.particular.net/nservicebus/licensing/#throughput-limitations