pub enum AuthPolicy {
Open,
Closed,
InviteToken,
}Expand description
How a peer decides whether to admit a connection. Local policy, never negotiated on the wire —
an impostor cannot assert Open to exempt itself from the other side’s Closed. Per-ACCOUNT,
not per-endpoint: one transport node may legitimately serve several accounts, so a public
account being Open must not open a private one on the same endpoint.
Variants§
Open
Admit any peer. For a public, read-only knowledge base (a later slice) or a trusted LAN.
Closed
Admit only a peer whose binding verifies against this account’s roster and the connection’s authenticated remote node id. The default for a private account.
InviteToken
Admit a not-yet-roster peer via a one-time invite token — the onboarding/pairing flow. Not implemented in this slice (it needs the token issue/redeem exchange); a session configured with it fails closed rather than silently admitting.
Trait Implementations§
Source§impl Clone for AuthPolicy
impl Clone for AuthPolicy
Source§fn clone(&self) -> AuthPolicy
fn clone(&self) -> AuthPolicy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for AuthPolicy
Source§impl Debug for AuthPolicy
impl Debug for AuthPolicy
impl Eq for AuthPolicy
Source§impl PartialEq for AuthPolicy
impl PartialEq for AuthPolicy
impl StructuralPartialEq for AuthPolicy
Auto Trait Implementations§
impl Freeze for AuthPolicy
impl RefUnwindSafe for AuthPolicy
impl Send for AuthPolicy
impl Sync for AuthPolicy
impl Unpin for AuthPolicy
impl UnsafeUnpin for AuthPolicy
impl UnwindSafe for AuthPolicy
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<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.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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