Skip to main content

Module plugin

Module plugin 

Source
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§

CapabilityToken
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.
TokenIssuer
Mints and verifies capability tokens. The supervisor holds one instance; the secret is generated once per process and never written to disk.

Enums§

PluginError
TokenError

Constants§

ENV_PLUGIN_HTTP_SOCKET
The env var the host sets on an agent.http plugin’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.state events 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 (capability telemetry.read). The event’s payload is the state object the MAVLink service publishes on state.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).