Skip to main content

CallerClass

Enum CallerClass 

Source
pub enum CallerClass {
    OnBox,
    Lifeline,
    OperatorLan,
    Remote,
}
Expand description

Who is on the other end of a request, derived once at the transport edge by classify_caller.

An unpaired node is a unit someone powered on and has not claimed yet, in a hangar, an office or a hotel. The obvious remedy for its exposure — bind only loopback and link-local until paired — cannot be used, and the reason is worth stating so nobody reaches for it again. A headless node has exactly two operator lifelines and NEITHER is loopback or link-local: the AP hotspot on 192.168.4.1 (the primary first-boot route) and the USB gadget on 192.168.7.1. Binding them away would leave a fresh unit reachable only from a shell the customer does not have. There is also no runtime re-bind: listeners are bound once at startup, so a bind keyed on pairing would need a service restart at the exact moment the operator is mid-claim on that socket.

So the gate is drawn at the caller, per request, where it follows pairing state in both directions with no restart. The honest limitation is that this is request-layer defence: the port stays open and a refused caller receives a refusal rather than finding nothing listening.

Variants§

§

OnBox

A loopback peer whose request carries none of FORWARDED_HEADERS: the local operator (the ados CLI, a root-owned job), who already holds shell-level privilege that exceeds API auth.

§

Lifeline

A first-boot lifeline: IPv4/IPv6 link-local, or a peer reached through the agent’s own AP hotspot (192.168.4.1) or USB gadget (192.168.7.1) address. These are the surfaces a fresh unit is reached from and its PIN is first set on. The subnet alone is not enough: a home or office LAN can be numbered 192.168.4.0/24 too, and every host on it would otherwise be a lifeline.

§

OperatorLan

Any other RFC1918 private-LAN peer (10/8, 172.16/12, 192.168/16): plausibly the operator’s own browser on the local network rather than a public-WAN host. Trusted less than a lifeline: while unpaired the HTTP surface serves it data only behind a dashboard PIN session, and the direct MAVLink proxies do not serve it at all.

§

Remote

Everything else: a public-WAN host, ANY request that carries a proxy-forwarding header (a reverse proxy or tunnel, including one that terminates on this host’s loopback), or a caller whose address is unknown.

Implementations§

Source§

impl CallerClass

Source

pub fn is_first_boot_reach(self) -> bool

Whether this caller may reach an UNPAIRED node’s data plane with no credential at all: the local operator and the first-boot lifelines.

Trait Implementations§

Source§

impl Clone for CallerClass

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for CallerClass

Source§

impl Debug for CallerClass

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for CallerClass

Source§

impl PartialEq for CallerClass

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for CallerClass

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more