pub(crate) enum ReactiveAuthVia {
FullAuthKey,
LanKey,
}Expand description
Auth middleware for the two LAN-forwarding-relevant reactive routes
(/agentmux/reactive/agent, /agentmux/reactive/inject) — accepts
EITHER state.auth_key (the normal, full-access case: every other
caller of these two routes, e.g. agentmux-mcp’s SendMessage tool for a
plain host-tier inject) OR state.lan_key (a LAN peer forwarding a
jekt or looking up which agents this instance hosts).
Deliberately a SEPARATE middleware from auth_middleware, applied to a
standalone router merged at the top level rather than nested inside
authed_routes — nesting would put authed_routes’s own
route_layer(auth_middleware) on the outside, rejecting the LAN key
before this middleware ever ran. This is why these two routes live in
their own lan_forward_routes router in router(), not in
reactive_routes.
state.lan_key grants access to ONLY the lan_forward_routes — never the rest
of /agentmux/service, /agentmux/file, shell creation, credential/
identity endpoints, etc. See Config::lan_key’s doc comment for why
this exists.
Which of the two credentials lan_or_full_auth_middleware accepted
authenticated this specific request. Inserted into the request’s
extensions so handle_reactive_inject can force delivery_tier = "lan"
whenever LanKey authenticated the request, regardless of what the JSON
body itself claims — closing the bypass where a lan_key-only holder
could otherwise just self-label a request “host” to dodge LAN’s stricter
verification entirely. See
docs/specs/SPEC_JEKT_LAN_TIER_SIGNING_2026_08_15.md §3 for the full
rationale, including why the reverse (downgrading a “lan” claim seen
under FullAuthKey) is deliberately NOT done — reagentx P0 found that
same-host forwarding (Tier 2a/2b in reactive.rs) legitimately
re-authenticates an already-LAN-originated jekt with a sibling
instance’s own full auth_key, so downgrading there silently discarded
an already-detected signature failure’s forced-sensitive escalation.
Variants§
Trait Implementations§
Source§impl Clone for ReactiveAuthVia
impl Clone for ReactiveAuthVia
Source§fn clone(&self) -> ReactiveAuthVia
fn clone(&self) -> ReactiveAuthVia
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 ReactiveAuthVia
Source§impl Debug for ReactiveAuthVia
impl Debug for ReactiveAuthVia
impl Eq for ReactiveAuthVia
Source§impl PartialEq for ReactiveAuthVia
impl PartialEq for ReactiveAuthVia
impl StructuralPartialEq for ReactiveAuthVia
Auto Trait Implementations§
impl Freeze for ReactiveAuthVia
impl RefUnwindSafe for ReactiveAuthVia
impl Send for ReactiveAuthVia
impl Sync for ReactiveAuthVia
impl Unpin for ReactiveAuthVia
impl UnsafeUnpin for ReactiveAuthVia
impl UnwindSafe for ReactiveAuthVia
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,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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