Skip to main content

IdentityBindingCache

Struct IdentityBindingCache 

Source
pub struct IdentityBindingCache { /* private fields */ }
Expand description

Cache of the first observed identity binding per GuidPrefix.

Implementations§

Source§

impl IdentityBindingCache

Source

pub fn new() -> Self

Cache with unlimited capacity (default for tests).

Source

pub fn with_capacity(capacity: usize) -> Self

Cache with an explicit cap (DoS protection). On reaching it, Self::observe returns CapacityExhausted and the caller must evict or reject.

Source

pub fn len(&self) -> usize

Current number of bindings.

Source

pub fn is_empty(&self) -> bool

True if there are no bindings in the cache.

Source

pub fn observe( &mut self, guid_prefix: GuidPrefixBytes, identity_token_bytes: &[u8], ) -> BindingDecision

Observes a GuidPrefix-to-IdentityToken binding. identity_token_bytes is the raw CDR DataHolder blob from the PID_IDENTITY_TOKEN value (see C3.5).

Source

pub fn evict(&mut self, guid_prefix: &GuidPrefixBytes) -> bool

Removes a binding — e.g. when a peer was evicted after a lease timeout or OCSP revoke. Allows the peer to re-discover with a new identity.

Source

pub fn fingerprint_for(&self, guid_prefix: &GuidPrefixBytes) -> Option<&[u8]>

Reads the current fingerprint for a GuidPrefix (for audit/ logging).

Trait Implementations§

Source§

impl Debug for IdentityBindingCache

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for IdentityBindingCache

Source§

fn default() -> IdentityBindingCache

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.