Service Cut-Off licensing approach

I’m wanting to implement a licensing model that will shutoff services if they are not licensed. We are planning to release a code each 3 months, licensing for 6 months ahead.

Is there a centralized location in the servicestack service model where I can wire in this mechanism ? I had considered the authorization code as that is centralized but open to suggestions.

Typically you’d do license verification once on Startup, I.e. throw an Exception if invalid.

If you wanted to do the license verification per request you could do it in a PreRequestFilter.

The trouble with doing it on startup is that it would require a restart of the services should the license code be changed. I was thinking to have a static class that loads once per day from DB.

I will investigate the PreRequestFilter option, thanks.

The PreRequestFilters basically allow you to run custom logic on every ServiceStack request, note: if performance is important I’d also maintain a static counter and only perform the license check every ~1000 requests.

Nice idea, yes looks ideal thanks.