pub struct CredentialClearance {
pub level: Level,
pub compartments: CompartmentSet,
}Expand description
The credential-clearance wire projection of a SecurityLabel (v16
§11, operator Gate-2 value 11). A credential’s clearance claim is the
semantic two-element array [level, [compartments]] and NOTHING else — the
assurance axis is structurally absent from the wire and is derived only
from verified key material at credential admission (see
super::SecurityContext::new). The authority-asserted clearance claim
therefore carries THIS type, never a full SecurityLabel, so a synthetic
assurance can never ride in on the wire.
Wire grammar (identical for the JWT JSON value and the CWT CBOR value):
- element 0
level: a uint with the frozen mapping0=Public, 1=Internal, 2=Confidential, 3=Secret; - element 1
compartments: an array of compartment bit indices, each a uint0..=63, strictly ascending and unique (empty allowed) — the credential projection of the versioned compartment vocabulary, never a bitmask integer and never names; - the outer array has exactly two elements.
Unknown levels, out-of-range/duplicate/descending compartments, a bitmask integer, names, extra elements, or any assurance field all fail deserialization (fail-closed).
Fields§
§level: LevelMLS sensitivity level (element 0 of the wire array).
compartments: CompartmentSetNeed-to-know compartments (bitset; the wire form is the ascending index list of element 1).
Implementations§
Source§impl CredentialClearance
impl CredentialClearance
Sourcepub fn from_label(label: SecurityLabel) -> Self
pub fn from_label(label: SecurityLabel) -> Self
The wire projection of a full label: level + compartments, dropping the crypto-derived assurance axis (which is never issuer-asserted).
Trait Implementations§
Source§impl Clone for CredentialClearance
impl Clone for CredentialClearance
Source§fn clone(&self) -> CredentialClearance
fn clone(&self) -> CredentialClearance
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 CredentialClearance
impl Debug for CredentialClearance
Source§impl<'de> Deserialize<'de> for CredentialClearance
impl<'de> Deserialize<'de> for CredentialClearance
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Source§impl From<SecurityLabel> for CredentialClearance
impl From<SecurityLabel> for CredentialClearance
Source§fn from(label: SecurityLabel) -> Self
fn from(label: SecurityLabel) -> Self
Source§impl Hash for CredentialClearance
impl Hash for CredentialClearance
Source§impl Ord for CredentialClearance
impl Ord for CredentialClearance
Source§fn cmp(&self, other: &CredentialClearance) -> Ordering
fn cmp(&self, other: &CredentialClearance) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for CredentialClearance
impl PartialEq for CredentialClearance
Source§fn eq(&self, other: &CredentialClearance) -> bool
fn eq(&self, other: &CredentialClearance) -> bool
self and other values to be equal, and is used by ==.Source§impl PartialOrd for CredentialClearance
impl PartialOrd for CredentialClearance
Source§impl Serialize for CredentialClearance
impl Serialize for CredentialClearance
impl Copy for CredentialClearance
impl Eq for CredentialClearance
impl StructuralPartialEq for CredentialClearance
Auto Trait Implementations§
impl Freeze for CredentialClearance
impl RefUnwindSafe for CredentialClearance
impl Send for CredentialClearance
impl Sync for CredentialClearance
impl Unpin for CredentialClearance
impl UnsafeUnpin for CredentialClearance
impl UnwindSafe for CredentialClearance
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§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