pub struct ExtensionTrustTracker { /* private fields */ }Expand description
Mutable trust lifecycle tracker for a single extension.
This struct manages the trust state machine and produces audit events for every transition.
Implementations§
Source§impl ExtensionTrustTracker
impl ExtensionTrustTracker
Sourcepub fn new(extension_id: &str, initial_state: ExtensionTrustState) -> Self
pub fn new(extension_id: &str, initial_state: ExtensionTrustState) -> Self
Create a new tracker with the given initial state.
Sourcepub fn from_risk_report(report: &InstallTimeRiskReport) -> Self
pub fn from_risk_report(report: &InstallTimeRiskReport) -> Self
Create a tracker with initial state derived from an install-time risk report.
Sourcepub const fn state(&self) -> ExtensionTrustState
pub const fn state(&self) -> ExtensionTrustState
Current trust state.
Sourcepub fn extension_id(&self) -> &str
pub fn extension_id(&self) -> &str
Extension identifier.
Sourcepub fn history(&self) -> &[TrustTransitionEvent]
pub fn history(&self) -> &[TrustTransitionEvent]
Full transition history.
Sourcepub fn promote(
&mut self,
reason: &str,
operator_ack: bool,
risk_score: Option<u8>,
recommendation: Option<InstallRecommendation>,
) -> Result<&TrustTransitionEvent, TrustTransitionError>
pub fn promote( &mut self, reason: &str, operator_ack: bool, risk_score: Option<u8>, recommendation: Option<InstallRecommendation>, ) -> Result<&TrustTransitionEvent, TrustTransitionError>
Attempt to promote the extension to the next trust level.
Promotions must follow the strict path:
Quarantined → Restricted → Trusted.
Skipping levels (e.g., Quarantined → Trusted) is not allowed.
§Errors
Returns TrustTransitionError if:
operator_ackis false (promotions require explicit acknowledgment)- The extension is already
Trusted - The risk score exceeds the threshold for the target state
Sourcepub fn demote(
&mut self,
reason: &str,
) -> Result<&TrustTransitionEvent, TrustTransitionError>
pub fn demote( &mut self, reason: &str, ) -> Result<&TrustTransitionEvent, TrustTransitionError>
Demote the extension back to quarantine.
Demotions are always allowed and do not require operator acknowledgment. They are immediate and unconditional.
§Errors
Returns TrustTransitionError::InvalidTransition if the extension is
already quarantined.
Trait Implementations§
Source§impl Clone for ExtensionTrustTracker
impl Clone for ExtensionTrustTracker
Source§fn clone(&self) -> ExtensionTrustTracker
fn clone(&self) -> ExtensionTrustTracker
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for ExtensionTrustTracker
impl RefUnwindSafe for ExtensionTrustTracker
impl Send for ExtensionTrustTracker
impl Sync for ExtensionTrustTracker
impl Unpin for ExtensionTrustTracker
impl UnsafeUnpin for ExtensionTrustTracker
impl UnwindSafe for ExtensionTrustTracker
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§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,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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