Record SSH-signed keychain init ops

This commit is contained in:
Eric Wendland 2026-05-19 16:04:20 +02:00
commit 48a83c5a26
12 changed files with 283 additions and 18 deletions

View file

@ -158,6 +158,8 @@ pub enum KeychainCommand {
Init {
#[arg(long)]
admin_key: Option<PathBuf>,
#[arg(long)]
signing_key: Option<PathBuf>,
},
Status,
}
@ -548,9 +550,14 @@ fn request_for_command(command: Command) -> Result<ControlRequest> {
command: ResourceCommand::Create { kind, name },
} => ControlRequest::ResourceCreate { kind, name },
Command::Keychain {
command: KeychainCommand::Init { admin_key },
command:
KeychainCommand::Init {
admin_key,
signing_key,
},
} => ControlRequest::KeychainInit {
admin_key_path: admin_key,
signing_key_path: signing_key,
},
Command::Keychain {
command: KeychainCommand::Status,
@ -1099,11 +1106,17 @@ fn print_response(response: ControlResponse, json: bool) -> Result<()> {
println!("devices: {}", status.devices);
println!("nodes: {}", status.nodes);
}
ControlResponse::KeychainInitialized { ops } => {
ControlResponse::KeychainInitialized { ops, signatures } => {
println!("initialized keychain");
for op in ops {
println!("recorded keychain op: {}", op.id);
}
for signature in signatures {
println!(
"signed keychain op: {} by {} ({})",
signature.op_id, signature.signer, signature.namespace
);
}
}
ControlResponse::SecretStatus { secrets } => {
if secrets.is_empty() {