feat(terra): pass-broker for Telegram-approved Proton Pass access
A Rust daemon running as its own system user holds terra's only pass-cli session, an agent PAT scoped to the HomeLab vaults. `pass-broker get` asks it for an item; per-item rules decide auto/ask/deny, and "ask" sends a Telegram prompt that only darman's account can approve (10-min grant for darman@*/root@*). Requests whose client is gone are dropped or withdrawn, and the client gives up after 30s without an answer. scripts/deploy uses the broker exclusively when its socket exists. Covered by checks.pass-broker (fake pass-cli + Telegram). Secrets added for all hosts; only terra runs the broker so far. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
pub const DEFAULT_SOCKET: &str = "/run/pass-broker.sock";
|
||||
|
||||
/// One JSON line from the client.
|
||||
#[derive(Serialize, Deserialize)]
|
||||
pub struct Request {
|
||||
pub vault: Option<String>,
|
||||
pub item: String,
|
||||
pub field: String,
|
||||
pub reason: String,
|
||||
}
|
||||
|
||||
/// JSON lines from the daemon: any number of `Pending`, then one final reply.
|
||||
#[derive(Serialize, Deserialize)]
|
||||
#[serde(tag = "status", rename_all = "snake_case")]
|
||||
pub enum Reply {
|
||||
Pending { message: String },
|
||||
Ok { value: String },
|
||||
Error { error: String },
|
||||
}
|
||||
Reference in New Issue
Block a user