Wire keychain status to local keychain ops
This commit is contained in:
parent
f54920bb65
commit
99f6dee26f
12 changed files with 191 additions and 20 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue