diff --git a/warpgate-admin/src/api/roles.rs b/warpgate-admin/src/api/roles.rs index a205ad6..53965fd 100644 --- a/warpgate-admin/src/api/roles.rs +++ b/warpgate-admin/src/api/roles.rs @@ -49,7 +49,7 @@ impl ListApi { if let Some(ref search) = *search { let search = format!("%{search}%"); - roles = roles.filter(Role::Column::Name.like(&search)); + roles = roles.filter(Role::Column::Name.like(search)); } let roles = roles diff --git a/warpgate-admin/src/api/targets.rs b/warpgate-admin/src/api/targets.rs index 85b83a9..071f26c 100644 --- a/warpgate-admin/src/api/targets.rs +++ b/warpgate-admin/src/api/targets.rs @@ -51,7 +51,7 @@ impl ListApi { if let Some(ref search) = *search { let search = format!("%{search}%"); - targets = targets.filter(Target::Column::Name.like(&search)); + targets = targets.filter(Target::Column::Name.like(search)); } let targets = targets.all(&*db).await.map_err(WarpgateError::from)?; diff --git a/warpgate-admin/src/api/users.rs b/warpgate-admin/src/api/users.rs index ed30551..8ddd640 100644 --- a/warpgate-admin/src/api/users.rs +++ b/warpgate-admin/src/api/users.rs @@ -54,7 +54,7 @@ impl ListApi { if let Some(ref search) = *search { let search = format!("%{search}%"); - users = users.filter(User::Column::Username.like(&search)); + users = users.filter(User::Column::Username.like(search)); } let users = users.all(&*db).await.map_err(WarpgateError::from)?; diff --git a/warpgate-core/src/config_providers/mod.rs b/warpgate-core/src/config_providers/mod.rs index adb3bb4..3ee54cd 100644 --- a/warpgate-core/src/config_providers/mod.rs +++ b/warpgate-core/src/config_providers/mod.rs @@ -10,7 +10,7 @@ use sea_orm::{ActiveModelTrait, ColumnTrait, DatabaseConnection, EntityTrait, Qu use tokio::sync::Mutex; use tracing::*; use uuid::Uuid; -use warpgate_common::auth::{AuthCredential, CredentialPolicy, CredentialKind}; +use warpgate_common::auth::{AuthCredential, CredentialKind, CredentialPolicy}; use warpgate_common::{Secret, Target, User, WarpgateError}; use warpgate_db_entities::Ticket; diff --git a/warpgate-protocol-http/src/api/auth.rs b/warpgate-protocol-http/src/api/auth.rs index 459ae45..83912d0 100644 --- a/warpgate-protocol-http/src/api/auth.rs +++ b/warpgate-protocol-http/src/api/auth.rs @@ -143,7 +143,7 @@ impl Api { let password_cred = AuthCredential::Password(Secret::new(body.password.clone())); if cp - .validate_credential(&state.username(), &password_cred) + .validate_credential(state.username(), &password_cred) .await? { state.add_valid_credential(password_cred); diff --git a/warpgate-protocol-http/src/logging.rs b/warpgate-protocol-http/src/logging.rs index 951b4fa..19ac325 100644 --- a/warpgate-protocol-http/src/logging.rs +++ b/warpgate-protocol-http/src/logging.rs @@ -1,6 +1,6 @@ use http::{Method, StatusCode, Uri}; -use poem::{FromRequest, Request}; use poem::web::Data; +use poem::{FromRequest, Request}; use tracing::*; use warpgate_core::Services; diff --git a/warpgate-protocol-http/src/proxy.rs b/warpgate-protocol-http/src/proxy.rs index 5cb2990..701e296 100644 --- a/warpgate-protocol-http/src/proxy.rs +++ b/warpgate-protocol-http/src/proxy.rs @@ -213,6 +213,7 @@ fn copy_server_request(req: &Request, mut target: B) -> B } fn inject_forwarding_headers(req: &Request, mut target: B) -> Result { + #[allow(clippy::unwrap_used)] if let Some(host) = req.headers().get(http::header::HOST) { target = target.header( X_FORWARDED_HOST.clone(),