pub struct PeerAllowlist { /* private fields */ }Expand description
Membership policy: which peer subject names are allowed to participate in the replication group.
Construct via PeerAllowlist::new from a list of
expected subject names. Names are normalised to lowercase
at construction time so PeerAllowlist::contains is
case-insensitive.
Implementations§
Source§impl PeerAllowlist
impl PeerAllowlist
Sourcepub fn new<I, S>(names: I) -> Self
pub fn new<I, S>(names: I) -> Self
Build an allowlist from any iterable of subject-name strings. Names are stored lowercased; duplicates and empty strings are filtered out.
An allowlist with zero entries means “no peer is authorised”, which is a valid (if useless) state — the caller should treat zero-entry allowlists as a configuration error before constructing the verifier.
Sourcepub fn contains(&self, name: &str) -> bool
pub fn contains(&self, name: &str) -> bool
true iff name is exactly equal to some entry,
case-insensitive. Wildcards are NOT supported.
Sourcepub fn contains_any<I, S>(&self, names: I) -> bool
pub fn contains_any<I, S>(&self, names: I) -> bool
true iff ANY of names is in the allowlist. The
caller passes every name extracted from the peer cert
(subject CN + each SAN DNS entry); membership is
granted if at least one matches.
Trait Implementations§
Source§impl Clone for PeerAllowlist
impl Clone for PeerAllowlist
Source§fn clone(&self) -> PeerAllowlist
fn clone(&self) -> PeerAllowlist
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 PeerAllowlist
impl Debug for PeerAllowlist
Source§impl Default for PeerAllowlist
impl Default for PeerAllowlist
Source§fn default() -> PeerAllowlist
fn default() -> PeerAllowlist
Auto Trait Implementations§
impl Freeze for PeerAllowlist
impl RefUnwindSafe for PeerAllowlist
impl Send for PeerAllowlist
impl Sync for PeerAllowlist
impl Unpin for PeerAllowlist
impl UnsafeUnpin for PeerAllowlist
impl UnwindSafe for PeerAllowlist
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,
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