feat(renew): display seconds
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed

This commit is contained in:
shimun 2023-07-12 15:15:25 +02:00
parent 6cb7ce4a78
commit 675dd4faf6
Signed by: shimun
GPG Key ID: E0420647856EA39E

View File

@ -33,7 +33,7 @@ pub fn renew_command(cert: &Certificate, ca_path: &str, file_name: Option<&str>)
.join(" ");
let opts = opts.trim();
let renew_command = format!(
"ssh-keygen -s {ca_path} {host_key} -I {} -n {} -z {} -V {:#x}:{:#x} {opts} {}",
"ssh-keygen -s {ca_path} {host_key} -I {} -n {} -z {} -V {}:{} {opts} {}",
escape(cert.key_id().into()),
escape(cert.valid_principals().join(",").into()),
cert.serial() + 1,
@ -41,7 +41,7 @@ pub fn renew_command(cert: &Certificate, ca_path: &str, file_name: Option<&str>)
expiry_date.as_secs(),
escape(
file_name
.map(Cow::Borrowed)
.map(|name| name.trim_end_matches("-cert.pub")).map(Cow::Borrowed)
.unwrap_or_else(|| escape(format!("{}.pub", cert.key_id()).into()))
)
);