pub struct CryptoGate { /* private fields */ }Expand description
Cryptographic admission: genesis pin, revocation, verdict, mode.
genesis_hash is a cluster label, not a credential: anyone who knows
it can present it. Membership is the verdict source’s decision.
Implementations§
Source§impl CryptoGate
impl CryptoGate
Sourcepub fn new(
genesis: [u8; 32],
revocations: Arc<RevocationList>,
verdicts: Arc<dyn VerdictSource>,
mode: MeshAdmissionMode,
) -> Self
pub fn new( genesis: [u8; 32], revocations: Arc<RevocationList>, verdicts: Arc<dyn VerdictSource>, mode: MeshAdmissionMode, ) -> Self
Build a gate pinned to genesis.
Sourcepub fn records(&self) -> Vec<AdmissionRecord>
pub fn records(&self) -> Vec<AdmissionRecord>
Recent observe/refuse records, oldest first.
Trait Implementations§
Source§impl AdmissionGate for CryptoGate
impl AdmissionGate for CryptoGate
Source§fn strict(&self) -> bool
fn strict(&self) -> bool
Only enforce bounds connections: observe must stay a no-op for
legacy peers (quiet leaves, large NAT’d fleets).
Source§fn is_revoked(&self, node_id: &str) -> bool
fn is_revoked(&self, node_id: &str) -> bool
Under enforce, a revocation applies to live connections too; under
observe it is recorded at the next admission only, as before.
Source§fn admit<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
hello: &'life1 VerifiedHello,
ctx: &'life2 AdmitContext,
) -> Pin<Box<dyn Future<Output = Admission> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn admit<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
hello: &'life1 VerifiedHello,
ctx: &'life2 AdmitContext,
) -> Pin<Box<dyn Future<Output = Admission> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
A hello verified; decide.
Source§fn admit_unverified<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
failure: &'life1 HelloFailure,
ctx: &'life2 AdmitContext,
) -> Pin<Box<dyn Future<Output = Admission> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn admit_unverified<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
failure: &'life1 HelloFailure,
ctx: &'life2 AdmitContext,
) -> Pin<Box<dyn Future<Output = Admission> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
No hello, or it failed verification; decide.
Auto Trait Implementations§
impl !Freeze for CryptoGate
impl !RefUnwindSafe for CryptoGate
impl !UnwindSafe for CryptoGate
impl Send for CryptoGate
impl Sync for CryptoGate
impl Unpin for CryptoGate
impl UnsafeUnpin for CryptoGate
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
Mutably borrows from an owned value. Read more
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> ⓘ
Converts
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> ⓘ
Converts
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