Wire keychain status to local keychain ops

This commit is contained in:
Eric Wendland 2026-05-16 16:34:20 +02:00
commit 99f6dee26f
12 changed files with 191 additions and 20 deletions

View file

@ -131,7 +131,10 @@ pub enum ResourceCommand {
#[derive(Debug, Subcommand)]
pub enum KeychainCommand {
Init,
Init {
#[arg(long)]
admin_key: Option<PathBuf>,
},
Status,
}
@ -341,10 +344,9 @@ fn request_for_command(command: Command) -> Result<ControlRequest> {
command: ResourceCommand::Create { kind, name },
} => ControlRequest::ResourceCreate { kind, name },
Command::Keychain {
command: KeychainCommand::Init,
} => ControlRequest::ModuleStub {
module: "keychain".to_owned(),
command: "init".to_owned(),
command: KeychainCommand::Init { admin_key },
} => ControlRequest::KeychainInit {
admin_key_path: admin_key,
},
Command::Keychain {
command: KeychainCommand::Status,
@ -595,6 +597,12 @@ fn print_response(response: ControlResponse, json: bool) -> Result<()> {
println!("devices: {}", status.devices);
println!("nodes: {}", status.nodes);
}
ControlResponse::KeychainInitialized { ops } => {
println!("initialized keychain");
for op in ops {
println!("recorded keychain op: {}", op.id);
}
}
ControlResponse::AuthExplain(explain) => {
println!("allowed: {}", explain.allowed);
println!("subject: {}", explain.subject);