pub struct Builder { /* private fields */ }Expand description
Configures and builds the plugin.
Implementations§
Source§impl Builder
impl Builder
Sourcepub fn new(
endpoint: impl Into<String>,
product_id: impl Into<String>,
public_key: impl Into<String>,
) -> Self
pub fn new( endpoint: impl Into<String>, product_id: impl Into<String>, public_key: impl Into<String>, ) -> Self
Your store (https://<tenant>.moonbase.sh), the product id, and the
product’s public key (PEM or base64 DER), all from the Moonbase dashboard.
Sourcepub fn account_id(self, account_id: impl Into<String>) -> Self
pub fn account_id(self, account_id: impl Into<String>) -> Self
Pin the token issuer to your Moonbase account id.
Sourcepub fn application_version(self, version: impl Into<String>) -> Self
pub fn application_version(self, version: impl Into<String>) -> Self
The version reported to Moonbase and compared with the latest release, and
the version a license that covers only some versions has to cover.
Defaults to the app’s own version from tauri.conf.json.
Sourcepub fn enforce_release_access(self, enforce: bool) -> Self
pub fn enforce_release_access(self, enforce: bool) -> Self
Whether a license that doesn’t cover the app’s version is refused on this device too, when Moonbase isn’t asked (an offline license, or within the check interval). Moonbase refuses one when validating online either way. On by default.
Sourcepub fn auto_activate_sub_products(self, auto_activate: bool) -> Self
pub fn auto_activate_sub_products(self, auto_activate: bool) -> Self
Whether activating and validating also takes a seat of each add-on (a
sub-product the merchant includes in this product’s license) that the
customer owns, so the license reports it. On by default. Turn it off to take
seats yourself with Moonbase::activate_sub_product; the add-ons screen
then offers “Activate” for each one owned.
Sourcepub fn license_file(self, path: impl Into<PathBuf>) -> Self
pub fn license_file(self, path: impl Into<PathBuf>) -> Self
Where the license is kept. Defaults to license.mb in the app’s data
directory.
Sourcepub fn grace_period(self, grace: Duration) -> Self
pub fn grace_period(self, grace: Duration) -> Self
How long an online-activated license keeps working without a successful online check. Default 7 days.
Sourcepub fn check_interval(self, interval: Duration) -> Self
pub fn check_interval(self, interval: Duration) -> Self
The least time between online checks of the license. Default 5 minutes.
pub fn http_timeouts(self, connect: Duration, request: Duration) -> Self
Sourcepub fn client_info(self, client_info: impl Into<String>) -> Self
pub fn client_info(self, client_info: impl Into<String>) -> Self
An extra User-Agent segment for a layer built on top of this plugin, such
as "MyFramework/2.0". Appended after the plugin’s own.
Sourcepub fn metadata(self, key: impl Into<String>, value: impl Into<String>) -> Self
pub fn metadata(self, key: impl Into<String>, value: impl Into<String>) -> Self
Sent as meta[<key>] with license requests.
Sourcepub fn device_id_resolver(
self,
resolver: impl DeviceIdResolver + 'static,
) -> Self
pub fn device_id_resolver( self, resolver: impl DeviceIdResolver + 'static, ) -> Self
Override how this machine is identified. Defaults to the cross-SDK
MoonbaseDeviceIdResolver, so a license activated through any Moonbase
SDK on this machine validates here too. Pass the resolver itself, or an
Arc of one.
Sourcepub fn transport(self, transport: impl HttpTransport + 'static) -> Self
pub fn transport(self, transport: impl HttpTransport + 'static) -> Self
Send requests through your own HttpTransport, e.g. one that shares the
app’s proxy settings. Defaults to the SDK’s bundled transport. Pass the
transport itself, or an Arc of one.
Sourcepub fn allow_device_name_fallback(self, allow: bool) -> Self
pub fn allow_device_name_fallback(self, allow: bool) -> Self
Accept a deliberately weaker device id (a hash of the host name, stamped
mbd2n_) on machines with no readable hardware identity, instead of
refusing to activate. Ignored with a custom resolver.
Sourcepub fn open_browser(self, open: bool) -> Self
pub fn open_browser(self, open: bool) -> Self
Whether activate opens the browser itself. On by default; turn it off to
open PendingActivation::browser_url yourself.
Sourcepub fn ui(self, ui: UiConfig) -> Self
pub fn ui(self, ui: UiConfig) -> Self
Brand and tune the built-in activation window, or turn it off with
UiConfig::disabled to drive your own UI from the state event.