pub struct TopologyAuthGate;Expand description
Predicate over the caller’s auth context — answers “does this
principal have cluster:topology:read?”.
Extracted so the gate can be unit-tested in isolation, the way ADR 0008 §1 wants (“one capability, one check, one place to grep”). The advertiser composes this gate, never reimplements it.
Until the capability engine lands, the policy is the one approved in ADR 0008 §2: every authenticated principal carries the capability by default; anonymous and denied callers do not.
Implementations§
Source§impl TopologyAuthGate
impl TopologyAuthGate
Sourcepub fn allows(auth: &AuthResult) -> bool
pub fn allows(auth: &AuthResult) -> bool
true if the principal carries cluster:topology:read and
should receive the full topology. false collapses the
advertiser output to primary-only per ADR 0008 §3.
Auto Trait Implementations§
impl Freeze for TopologyAuthGate
impl RefUnwindSafe for TopologyAuthGate
impl Send for TopologyAuthGate
impl Sync for TopologyAuthGate
impl Unpin for TopologyAuthGate
impl UnsafeUnpin for TopologyAuthGate
impl UnwindSafe for TopologyAuthGate
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request