pub struct BindLabelMap { /* private fields */ }Expand description
The set of synthetic-mount bind-time labels keyed by mount prefix.
This is the carrier-(c) companion to super::genesis::GenesisMap (carrier
(a) static nodes): where genesis labels the generated /srv/{name} surface
from schema annotations, this labels the synthetic mounts a subject composes
into its own namespace, from the binder’s floor × the mount’s declared label.
Both carriers feed the same super::manifest::ObjectLabelResolver at
enforcement time; this type is the pure-data source for the bind-time half.
Implementations§
Source§impl BindLabelMap
impl BindLabelMap
Sourcepub fn bind(
&mut self,
prefix: &str,
binder_floor: SecurityLabel,
declared: SecurityLabel,
) -> BindLabel
pub fn bind( &mut self, prefix: &str, binder_floor: SecurityLabel, declared: SecurityLabel, ) -> BindLabel
Bind binder_floor × declared at prefix, storing the effective
bind_time_label and returning the stored label by value.
Both labels are mandatory (SecurityLabel, not Option): there is no
label-less bind — a synthetic mount must carry a label, and this is the
only way to add one. The effective label is the restrict-only join, so it
is always ⊒ binder_floor and ⊒ declared.
Sourcepub fn label_for(&self, prefix: &str) -> Option<SecurityLabel>
pub fn label_for(&self, prefix: &str) -> Option<SecurityLabel>
The effective label a mount bound at prefix carries, if any. A prefix
that was never bound ⇒ None ⇒ unlabeled ⇒ deny.
Sourcepub fn resolve(&self, components: &[&str]) -> Option<SecurityLabel>
pub fn resolve(&self, components: &[&str]) -> Option<SecurityLabel>
Resolve a walked object (path components relative to the namespace root) to the effective bind-time label of the nearest enclosing synthetic mount — the floor every node beneath that mount is clamped to.
Walks from the full path up its ancestors; the first bound prefix found is
the enclosing mount, and its label is the descendant floor (the clamp).
None ⇒ no enclosing labeled mount ⇒ unlabeled ⇒ deny.
Sourcepub fn iter(&self) -> impl Iterator<Item = (&str, SecurityLabel)>
pub fn iter(&self) -> impl Iterator<Item = (&str, SecurityLabel)>
Iterate the bound (prefix, effective-label) pairs.
Trait Implementations§
Source§impl Clone for BindLabelMap
impl Clone for BindLabelMap
Source§fn clone(&self) -> BindLabelMap
fn clone(&self) -> BindLabelMap
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BindLabelMap
impl Debug for BindLabelMap
Source§impl Default for BindLabelMap
impl Default for BindLabelMap
Source§fn default() -> BindLabelMap
fn default() -> BindLabelMap
Auto Trait Implementations§
impl Freeze for BindLabelMap
impl RefUnwindSafe for BindLabelMap
impl Send for BindLabelMap
impl Sync for BindLabelMap
impl Unpin for BindLabelMap
impl UnsafeUnpin for BindLabelMap
impl UnwindSafe for BindLabelMap
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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