From 744d6860279c0a3892eee439c9c0d9b1c9b198a6 Mon Sep 17 00:00:00 2001 From: Eugene Pankov Date: Sun, 14 Aug 2022 13:02:46 +0200 Subject: [PATCH] lint --- warpgate-protocol-ssh/src/lib.rs | 13 +++++++++++-- warpgate-protocol-ssh/src/server/session.rs | 3 +-- warpgate/src/commands/test_target.rs | 2 +- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/warpgate-protocol-ssh/src/lib.rs b/warpgate-protocol-ssh/src/lib.rs index cbdb059..31b8869 100644 --- a/warpgate-protocol-ssh/src/lib.rs +++ b/warpgate-protocol-ssh/src/lib.rs @@ -18,7 +18,8 @@ use russh_keys::PublicKeyBase64; pub use server::run_server; use uuid::Uuid; use warpgate_common::{ - ProtocolName, ProtocolServer, Services, Target, TargetOptions, TargetTestError, SshHostKeyVerificationMode, + ProtocolName, ProtocolServer, Services, SshHostKeyVerificationMode, Target, TargetOptions, + TargetTestError, }; use crate::client::{RCCommand, RemoteClient}; @@ -82,7 +83,15 @@ impl ProtocolServer for SSHProtocolServer { println!("\nHost key ({}): {}", key.name(), key.public_key_base64()); println!("There is no trusted {} key for this host.", key.name()); - match self.services.config.lock().await.store.ssh.host_key_verification { + match self + .services + .config + .lock() + .await + .store + .ssh + .host_key_verification + { SshHostKeyVerificationMode::AutoAccept => { let _ = reply.send(true); } diff --git a/warpgate-protocol-ssh/src/server/session.rs b/warpgate-protocol-ssh/src/server/session.rs index 5cf7fbd..c5fe0e0 100644 --- a/warpgate-protocol-ssh/src/server/session.rs +++ b/warpgate-protocol-ssh/src/server/session.rs @@ -1064,8 +1064,7 @@ impl ServerSession { }; login_url.set_path("@warpgate"); - login_url - .set_fragment(Some(&format!("/login/{auth_state_id}"))); + login_url.set_fragment(Some(&format!("/login/{auth_state_id}"))); russh::server::Auth::Partial { name: Cow::Owned(format!( diff --git a/warpgate/src/commands/test_target.rs b/warpgate/src/commands/test_target.rs index 9342200..42c50d8 100644 --- a/warpgate/src/commands/test_target.rs +++ b/warpgate/src/commands/test_target.rs @@ -53,7 +53,7 @@ pub(crate) async fn command(cli: &crate::Cli, target_name: &String) -> Result<() } Ok(()) => { info!("Connection successful!"); - return Ok(()) + return Ok(()); } }