Add OpenSSH KRL spec export
This commit is contained in:
parent
02444a7cfd
commit
b102e07204
9 changed files with 235 additions and 25 deletions
|
|
@ -321,6 +321,8 @@ pub enum SshRevocationCommand {
|
|||
Export {
|
||||
#[arg(long)]
|
||||
out: PathBuf,
|
||||
#[arg(long, default_value = "jsonl")]
|
||||
format: String,
|
||||
},
|
||||
}
|
||||
|
||||
|
|
@ -522,7 +524,9 @@ fn request_for_command(command: Command) -> Result<ControlRequest> {
|
|||
reason,
|
||||
},
|
||||
SshRevocationCommand::List => ControlRequest::SshRevocationList,
|
||||
SshRevocationCommand::Export { out } => ControlRequest::SshRevocationExport { out },
|
||||
SshRevocationCommand::Export { out, format } => {
|
||||
ControlRequest::SshRevocationExport { out, format }
|
||||
}
|
||||
},
|
||||
},
|
||||
Command::Init | Command::Daemon { .. } => bail!("command is handled directly"),
|
||||
|
|
@ -838,8 +842,15 @@ fn print_response(response: ControlResponse, json: bool) -> Result<()> {
|
|||
}
|
||||
}
|
||||
}
|
||||
ControlResponse::SshRevocationExported { out, count } => {
|
||||
ControlResponse::SshRevocationExported {
|
||||
out,
|
||||
format,
|
||||
count,
|
||||
note,
|
||||
} => {
|
||||
println!("exported {count} ssh revocations to {}", out.display());
|
||||
println!("format: {format}");
|
||||
println!("note: {note}");
|
||||
}
|
||||
ControlResponse::DbAdded { db } => {
|
||||
println!("registered db: {}", db.name);
|
||||
|
|
|
|||
Loading…
Reference in a new issue