Giter Club home page Giter Club logo

Comments (3)

ramonsmits avatar ramonsmits commented on June 30, 2024

The call to License and LicensePath are explicit configuration call. It is expected that data is present. If a license is corrupt or expired we still start but without data we consider this a configuration error.

Since the longstanding principle of NSB has been to not prevent running of an endpoint if a license is not provided,

If no (valid) license is found by our license scanning heuristics or the passed license is invalid we still start. The difference is in the word "provided" vs "present". Invoking License and LicensePath is explicitly selecting that license data to use.

You're asking that if there is no data we should ignore those calls.

If there is not data the user should not invoke those methods:

if (!string.IsNullOrEmpty(licenseText))
{
	endpointConfiguration.License(licenseText);
}

or

if (!File.Exist(licensePath))
{
	endpointConfiguration.LicensePath(licensePath);
}

or

if (!File.Exist(licensePath))
{
	var licenseText = File.ReadAllText(licensePath);
	if (!string.IsNullOrEmpty(licenseText))
	{
		endpointConfiguration.LicensePath(licensePath);
	}
}

The difference is more in an explicit configuration using License and LicensePath versus implicit license loading.

@dbelcham Do you have more information as currently it seems that just ignoring an explicit decision by the user if not the right approach.

from nservicebus.

dbelcham avatar dbelcham commented on June 30, 2024

We use the call to License(string) because we are pulling the license value from a centralized configuration system (Azure App Config and Key Vault in our case). We have many different environments in our development work (DEV/UAT/PROD/etc) and each of those environments has it's own centralized configuration stores. As we progress through our environments towards production, the restrictions around who has access to the configuration stores becomes more and more restricted. Because the lower environments are widely accessible we do not want to put our production license into them where it can be taken/leaked much more easily due to the less restricted nature of that environment.

As such, we rely on NSB's licensing which allows us to run in any non-production environment without a full license. Our expectation is that we can have the exact same code in each of our environments (i.e. no conditional saying "use License(string) only if this is production") and that the endpoints should successfully start in any of those environments, whether the license is in the configuration store or not. Our expectation is that when an empty or null license is pulled from the configuration store the endpoint will behave as if it has not been provided a license.

It seems like a very leaky abstraction that we need to add a conditional check for what our license value is when we retrieve it and then we have to decide how NSB should behave when the license is not available. This isn't our application's concern. This is an NSB concern that should be fully encapsulated with in the apis that NSB provides.

from nservicebus.

johnsimons avatar johnsimons commented on June 30, 2024

We triaged this issue and concluded that this is not a bug.
We classify this as a small improvement and it will be considered in a future maintenance release.

from nservicebus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.