pub struct PeerBinding {
pub pid: Option<i32>,
pub session_ulid: Option<u128>,
}Expand description
Master-populated peer binding stored alongside each lease so subsequent
clear requests can be authorised against the apply-time owner. The
binding pairs an OS pid (from SO_PEERCRED on Linux, captured by the
master at command-socket accept time) with the master-side connection
session ULID. A clear request must present BOTH values matching the
apply-time binding. A binding of (None, None) (“unknown”) at apply
time means the connection had no peer credentials available — the
worker then accepts any clear for that client_id to preserve compat
with non-Linux callers and intermediate proxies. See the proto comment
on SetMetricDetail.peer_pid for the trust model.
Fields§
§pid: Option<i32>§session_ulid: Option<u128>Session ULID rendered as a u128 (the master’s session anchor).
Stored as the raw u128 rather than the original Ulid to avoid
dragging that crate into the metrics-aggregator dependencies.
Implementations§
Source§impl PeerBinding
impl PeerBinding
Sourcepub fn is_known(&self) -> bool
pub fn is_known(&self) -> bool
true when both halves are known. A fully-known binding is the
only one against which clear may be authorised; partial bindings
(one half None) degrade to “accept any clear” per the proto
contract on SetMetricDetail.peer_pid / peer_session_ulid.
Sourcepub fn matches(&self, other: &PeerBinding) -> bool
pub fn matches(&self, other: &PeerBinding) -> bool
True when self and other are compatible (same pid + same
session_ulid) AND self.is_known(). Used by lease_clear to
reject mismatched clears.
Trait Implementations§
Source§impl Clone for PeerBinding
impl Clone for PeerBinding
Source§fn clone(&self) -> PeerBinding
fn clone(&self) -> PeerBinding
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 PeerBinding
impl Debug for PeerBinding
Source§impl Default for PeerBinding
impl Default for PeerBinding
Source§fn default() -> PeerBinding
fn default() -> PeerBinding
Source§impl PartialEq for PeerBinding
impl PartialEq for PeerBinding
Source§fn eq(&self, other: &PeerBinding) -> bool
fn eq(&self, other: &PeerBinding) -> bool
self and other values to be equal, and is used by ==.impl Copy for PeerBinding
impl Eq for PeerBinding
impl StructuralPartialEq for PeerBinding
Auto Trait Implementations§
impl Freeze for PeerBinding
impl RefUnwindSafe for PeerBinding
impl Send for PeerBinding
impl Sync for PeerBinding
impl Unpin for PeerBinding
impl UnsafeUnpin for PeerBinding
impl UnwindSafe for PeerBinding
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.