wip(#1970): github-token injection path (priv wire + hive-priv handler + priv_client + hivectl github set-token)

This commit is contained in:
damocles 2026-07-11 10:45:09 +02:00 committed by mara
commit 80ef7d8151
4 changed files with 102 additions and 0 deletions

View file

@ -411,6 +411,21 @@ pub enum PrivRequest {
homeserver: Option<String>,
},
/// Write `github-token` into `AGENT_STATE_ROOT/<agent_name>/state/github-token`.
///
/// The operator-supplied GitHub personal access token (PAT) for the
/// agent's `hyperhive.githubAccount`. Same write semantics as
/// `WriteAgentForgeToken` — validates `agent_name`, creates the state dir
/// if absent, writes the file 0600, and chowns it to the agent so the
/// `gh` wrapper / git credential helper can read it. No account suffix
/// (single GitHub account per agent).
WriteAgentGithubToken {
/// Logical agent name (validated by `validate_agent_name`).
agent_name: String,
/// PAT value. hive-priv appends a trailing newline before writing.
token: String,
},
/// Restart `hive-matrix-daemon.service` inside an agent container via
/// `systemctl --machine=h-<agent_name> restart hive-matrix-daemon.service`.
/// Used by hive-c0re to kick the daemon after a successful token write