pub struct LicenseGate { /* private fields */ }Expand description
The enterprise licensing gate.
In OSS builds (no ent feature) this is a zero-sized stub: every
method returns the OSS answer and no licensing-core types appear.
In ent builds it holds an optional verified license plus the grace
window and the current status.
Implementations§
Source§impl LicenseGate
impl LicenseGate
Sourcepub fn none() -> Self
pub fn none() -> Self
No license: OSS mode. All enterprise features are inert. This is the only constructor available in OSS builds.
Sourcepub fn grace_period_days(&self) -> u32
pub fn grace_period_days(&self) -> u32
The configured grace period (days).
Sourcepub fn status(&self) -> LicenseStatus
pub fn status(&self) -> LicenseStatus
The current license status (mirrors the dwara_license_status
metric).
Sourcepub fn is_enterprise(&self) -> bool
pub fn is_enterprise(&self) -> bool
True if a valid license is loaded AND enterprise features should be active. A license expired within the grace period still returns true; a license expired past grace (or no license at all) returns false.
Sourcepub fn has_feature(&self, feature: &str) -> bool
pub fn has_feature(&self, feature: &str) -> bool
True if the loaded license grants the named feature claim. Returns
false when there is no license, when the license has degraded past
grace, or when the feature is not in the license’s features
list.
Sourcepub fn is_expired(&self) -> bool
pub fn is_expired(&self) -> bool
True if the license has passed its expires_at timestamp (whether
or not it is still within the grace period). Returns false when
there is no license.
Sourcepub fn assert_fips_compliance(&self) -> Result<(), String>
pub fn assert_fips_compliance(&self) -> Result<(), String>
DW-111: FIPS mode license assertion. A license that carries the
fips feature claim (FEATURE_FIPS) REQUIRES the gateway to be
running in FIPS mode. When the license grants the claim but the
gateway is NOT in FIPS mode (the fips cargo feature is off), the
license is invalid for this deployment.
This is a config-time check: the caller (dwara-bin) runs it at
startup after the gate is built and before enterprise features
engage. Returns Ok(()) when the assertion passes (the license
does not require FIPS, or FIPS mode is active) and Err(message)
when the license requires FIPS but the gateway is not in FIPS mode.
Trait Implementations§
Source§impl Clone for LicenseGate
impl Clone for LicenseGate
Source§fn clone(&self) -> LicenseGate
fn clone(&self) -> LicenseGate
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LicenseGate
impl Debug for LicenseGate
Auto Trait Implementations§
impl Freeze for LicenseGate
impl RefUnwindSafe for LicenseGate
impl Send for LicenseGate
impl Sync for LicenseGate
impl Unpin for LicenseGate
impl UnwindSafe for LicenseGate
Blanket Implementations§
§impl<T> AnyExt for T
impl<T> AnyExt for T
§fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
T behind reference§fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
T behind mutable reference§fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
T behind Rc pointer§fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
T behind Arc pointer§fn downcast_box<T>(this: Box<Self>) -> Result<Box<T>, Box<Self>>where
T: Any,
fn downcast_box<T>(this: Box<Self>) -> Result<Box<T>, Box<Self>>where
T: Any,
T behind Box pointer§fn downcast_move<T>(this: Self) -> Option<T>
fn downcast_move<T>(this: Self) -> Option<T>
Self to T,
useful only in generic context as a workaround for specializationSource§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
impl<T, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
fn coerce_rc_to(self: Rc<X>) -> Rc<T>
fn coerce_box_to(self: Box<X>) -> Box<T>
fn coerce_ref_to(&self) -> &T
fn coerce_mut_to(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more