pub struct ReferenceMonitor { /* private fields */ }Expand description
The reference monitor a Translator mediates every
dispatched op through once installed. Bundles the three injection points so
enforcement is all-or-nothing: there is no translator state in which the
token gate runs but the label resolver is absent, or vice versa.
Constructed by the application (hyprstream crate) at activation time from
its concrete token verifier, genesis/manifest label resolver, and AVC/PDP
adapter. The application installs it at every production 9P constructor;
monitor-less translators remain available for tests and embeddings.
Implementations§
Source§impl ReferenceMonitor
impl ReferenceMonitor
Sourcepub fn new(
authenticator: Arc<dyn AttachAuthenticator>,
labels: Arc<dyn ObjectLabelResolver + Send + Sync>,
decider: Arc<dyn AccessDecider>,
) -> Self
pub fn new( authenticator: Arc<dyn AttachAuthenticator>, labels: Arc<dyn ObjectLabelResolver + Send + Sync>, decider: Arc<dyn AccessDecider>, ) -> Self
Assemble the monitor from its three mandatory seams. There is no
permissive or partial construction: each argument is required, and the
crate’s fail-closed defaults (AnonymousAuthenticator,
DenyUnlabeledResolver, DenyAllDecider) are the explicit choices
for a seam the application does not supply.
Sourcepub async fn authenticate(
&self,
uname: &str,
aname: &str,
) -> Result<VerifiedAttach, MountError>
pub async fn authenticate( &self, uname: &str, aname: &str, ) -> Result<VerifiedAttach, MountError>
Verify the Tattach credential exactly once for this connection.
Complete mediation for one op on path under session, in the
mandatory order: trusted label resolution → token gate → independent
IFC dominance → local policy monitor. Every step fails closed: an
unresolvable label, missing/expired/insufficient token, non-dominating
subject, or decider denial all return false.
Auto Trait Implementations§
impl Freeze for ReferenceMonitor
impl !RefUnwindSafe for ReferenceMonitor
impl Send for ReferenceMonitor
impl Sync for ReferenceMonitor
impl Unpin for ReferenceMonitor
impl UnsafeUnpin for ReferenceMonitor
impl !UnwindSafe for ReferenceMonitor
Blanket Implementations§
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
§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