feat(mars): pass-broker approval gateway for every host

A Telegram bot has a single getUpdates consumer, so a broker per host
would split approval taps between them. mars now runs the gateway: the
bot's only poller, relaying prompts and taps for terra's and titan's
brokers over the tailnet (:8097) without ever seeing an item. Each broker
authenticates with its own pass_broker_gateway_token; mars holds only the
sha256, and the prompt is labelled with the host that token belongs to.

The bot token and chat id move to mars and are dropped from the other
hosts' sops files (terra.yaml also loses its leftover LibreChat keys and
gains protonvpn_wg_private_key, which a later commit uses). Covered by
checks.pass-broker-gateway (two nodes: labels, cancel, expiry, per-host
token isolation, gateway down); the fakes are shared with checks.pass-broker.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-21 11:34:19 +02:00
co-authored by Claude Opus 5.5
parent 760e353335
commit e95726d69c
24 changed files with 1164 additions and 250 deletions
+7 -2
View File
@@ -3,11 +3,14 @@
//!
//! The daemon runs as its own system user and holds the only pass-cli session
//! (an agent PAT), so nothing running as darman can read it directly. Clients
//! talk to it over a unix socket; see services/identity/pass-broker.nix.
//! talk to it over a unix socket; see services/identity/pass-broker.nix. The
//! prompt comes from its own bot or from the shared gateway (gateway.rs).
mod approver;
mod client;
mod config;
mod daemon;
mod gateway;
mod pass;
mod proto;
mod telegram;
@@ -15,13 +18,15 @@ mod telegram;
use anyhow::Result;
const USAGE: &str = "usage: pass-broker get --item <title> --reason <why> [--vault <name>] [--field <name>]
pass-broker daemon";
pass-broker daemon
pass-broker gateway";
#[tokio::main]
async fn main() -> Result<()> {
let args: Vec<String> = std::env::args().skip(1).collect();
match args.first().map(String::as_str) {
Some("daemon") => daemon::run().await,
Some("gateway") => gateway::run().await,
Some("get") => client::get(&args[1..]).await,
_ => {
eprintln!("{USAGE}");