From 211569930b627b8faf73f6ebb3e4cc143807b44a Mon Sep 17 00:00:00 2001 From: Xander Bil Date: Sun, 29 Sep 2024 22:57:26 +0200 Subject: [PATCH] hide hostname from public ssh keys --- src/controllers/users_controller.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/controllers/users_controller.rs b/src/controllers/users_controller.rs index c4b1187..c50d689 100644 --- a/src/controllers/users_controller.rs +++ b/src/controllers/users_controller.rs @@ -70,7 +70,12 @@ pub async fn show_ssh_key<'r>( for line in ssh_keys.lines() { let line = line.trim(); if !line.is_empty() { - keys.push(line.to_string()) + keys.push( + line.split_ascii_whitespace() + .take(2) + .collect::>() + .join(" "), + ) } } }