Expand description
Plugin RPC envelope and capability tokens.
Wire format: length-prefixed msgpack frames over a Unix domain socket (see
crate::frame). Each frame is a Envelope serialized as a msgpack map
with short keys. At plugin start the supervisor mints a per-process
HMAC-SHA256 capability token bound to (plugin_id, granted_caps, session, exp); the token rides in every envelope and the supervisor verifies it
before routing.
This mirrors ADOSDroneAgent/src/ados/plugins/rpc.py exactly, so a Rust
plugin or a Rust core speaks the identical wire as the Python supervisor.
Structs§
- Capability
Token - A minted, signed capability token. The string form is pipe-delimited:
v1|<plugin_id>|<session_id>|<issued_at>|<expires_at>|<caps_hex>|<sig_hex>. - Envelope
- One RPC message. Serializes to a msgpack map with the short keys the Python
side uses:
v,t,m,c,a,id,tok,err. - Token
Issuer - Mints and verifies capability tokens. The supervisor holds one instance; the secret is generated once per process and never written to disk.
Enums§
Constants§
- ENV_
PLUGIN_ HTTP_ SOCKET - The env var the host sets on an
agent.httpplugin’s process, carrying the Unix socket path the plugin must serve HTTP on. - PROTOCOL_
VERSION - Protocol version carried in every envelope (
PROTOCOL_VERSION). - TELEMETRY_
STATE_ MAX_ HZ - Most
telemetry.stateevents the host pushes to one plugin per second. A snapshot that arrives sooner replaces the one waiting, so a plugin always receives the newest state. - TELEMETRY_
STATE_ TOPIC - The event topic the host pushes the vehicle-state snapshot on, to a plugin
that armed
telemetry.subscribe(capabilitytelemetry.read). The event’s payload is the state object the MAVLink service publishes onstate.sock. - TOKEN_
REFRESH_ METHOD - The event method the host pushes a rotated capability token on.
- TOKEN_
TTL_ SECONDS - Default capability-token lifetime in seconds (
TOKEN_TTL_SECONDS).