From fb63cbc50b8c81d45f18dc26d36408c1e88668ad Mon Sep 17 00:00:00 2001 From: Xander Bil <47951455+xerbalind@users.noreply.github.com> Date: Wed, 2 Oct 2024 18:58:15 +0200 Subject: [PATCH] hide hostname from public ssh keys (#296) --- 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(" "), + ) } } }