Skip to main content

max / makenotwork

2.0 KB · 54 lines History Blame Raw
1 //! ops-exec — the trusted executor.
2 //!
3 //! One crate owns *running a typed step on a host* and *observing a host*,
4 //! across the tailnet, with a capability/trust model built in. It is the
5 //! primitive under the internal ops suite — **Sando** (server promotion),
6 //! **Bento** (app release), and **ops-agent** (the on-host half).
7 //!
8 //! ## Trust root (load-bearing)
9 //!
10 //! SSH keys + Tailscale/Headscale are the *only* trust roots. There is no PKI,
11 //! no token service, no secrets manager. Identity comes from the tailnet node
12 //! (`ops-agent` resolves a caller via the local Tailscale LocalAPI `whois`) and
13 //! from SSH keys (the [`SshExec`] transport authenticates exactly as today).
14 //! `ops-exec` only *maps* that identity to capabilities.
15 //!
16 //! ## Shape
17 //!
18 //! - [`Executor`] — the trait, scoped to one `(host, CapabilitySet)`.
19 //! - [`LocalExec`] / [`SshExec`] — the transports (this crate);
20 //! `AgentRpc` (the `rpc` feature) talks to a remote [`ops-agent`](self).
21 //! - [`Step`] / [`Action`] — the typed step vocabulary the capability check
22 //! gates on.
23 //! - [`CapabilitySet`] — the grant, enforced *twice* (caller-side here, and
24 //! agent-side via [`CapabilitySet::intersect`]).
25 //! - [`remote`] — the low-level streaming command primitive ([`RemoteHost`])
26 //! and the [`LogSink`] sink trait, re-exported by `ops-core`.
27 //!
28 //! Design: `ops-exec-overview` in the shared code wiki (`~/Code/_private/wiki/`).
29 //! <!-- wiki: ops-exec-overview -->
30
31 pub mod capability;
32 pub mod executor;
33 pub mod remote;
34 pub mod step;
35 pub mod transport;
36
37 #[cfg(any(feature = "rpc", feature = "agent"))]
38 pub mod wire;
39
40 #[cfg(feature = "rpc")]
41 pub mod rpc;
42
43 #[cfg(feature = "agent")]
44 pub mod agent;
45
46 pub use capability::{CapabilityDenied, CapabilitySet};
47 pub use executor::{EventStream, Executor, ObserveEvent, SyncOpts};
48 pub use remote::{LogSink, RemoteHost, RunOutput, SSH_FLAGS, sh_quote};
49 pub use step::{Action, ObserveKind, Step};
50 pub use transport::{LocalExec, SshExec};
51
52 #[cfg(feature = "rpc")]
53 pub use rpc::AgentRpc;
54