-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #48 from EventStore/timothycoleman/check-entitlements
[ESDB-159-3] Add support for checking Entitlements
- Loading branch information
Showing
8 changed files
with
177 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
namespace EventStore.Plugins.Licensing; | ||
|
||
// Allows plugins to access the current license, get updates to it, and reject a license | ||
// if it is missing entitlements | ||
public interface ILicenseService { | ||
// For checking that the license service itself is authentic | ||
License SelfLicense { get; } | ||
|
||
License? CurrentLicense { get; } | ||
|
||
// The current license and updates to it | ||
IObservable<License> Licenses { get; } | ||
|
||
void RejectLicense(Exception ex); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,14 @@ | ||
namespace EventStore.Plugins; | ||
|
||
public class PluginLicenseException(string pluginName) : Exception( | ||
public class PluginLicenseException(string pluginName, Exception? inner = null) : Exception( | ||
$"A license is required to use the {pluginName} plugin, but was not found. " + | ||
"Please obtain a license or disable the plugin." | ||
"Please obtain a license or disable the plugin.", | ||
inner | ||
) { | ||
public string PluginName { get; } = pluginName; | ||
} | ||
} | ||
|
||
public class PluginLicenseEntitlementException(string pluginName, string entitlement) : Exception( | ||
$"{pluginName} plugin requires the {entitlement} entitlement. Please contact EventStore support.") { | ||
public string PluginName { get; } = pluginName; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.