Import SSH revocation metadata
This commit is contained in:
parent
b9e7c61e67
commit
4c368253e4
11 changed files with 212 additions and 13 deletions
|
|
@ -400,6 +400,11 @@ pub enum SshRevocationCommand {
|
|||
#[arg(long)]
|
||||
ca_public: Option<PathBuf>,
|
||||
},
|
||||
Import {
|
||||
path: PathBuf,
|
||||
#[arg(long, default_value = "jsonl")]
|
||||
format: String,
|
||||
},
|
||||
}
|
||||
|
||||
#[derive(Debug, Args)]
|
||||
|
|
@ -671,6 +676,9 @@ fn request_for_command(command: Command) -> Result<ControlRequest> {
|
|||
format,
|
||||
ca_public,
|
||||
},
|
||||
SshRevocationCommand::Import { path, format } => {
|
||||
ControlRequest::SshRevocationImport { path, format }
|
||||
}
|
||||
},
|
||||
},
|
||||
Command::Init | Command::Daemon { .. } => bail!("command is handled directly"),
|
||||
|
|
@ -1084,6 +1092,22 @@ fn print_response(response: ControlResponse, json: bool) -> Result<()> {
|
|||
println!("format: {format}");
|
||||
println!("note: {note}");
|
||||
}
|
||||
ControlResponse::SshRevocationImported {
|
||||
revocations,
|
||||
format,
|
||||
count,
|
||||
note,
|
||||
} => {
|
||||
println!("imported {count} ssh revocations");
|
||||
println!("format: {format}");
|
||||
for revocation in revocations {
|
||||
println!(
|
||||
"{}\t{}\t{}",
|
||||
revocation.id, revocation.kind, revocation.target
|
||||
);
|
||||
}
|
||||
println!("note: {note}");
|
||||
}
|
||||
ControlResponse::DbAdded { db } => {
|
||||
println!("registered db: {}", db.name);
|
||||
println!("id: {}", db.id);
|
||||
|
|
|
|||
Loading…
Reference in a new issue