Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Eugeny committed Nov 23, 2023
1 parent b346ca3 commit 6cace24
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion warpgate-admin/src/api/roles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion warpgate-admin/src/api/targets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)?;
Expand Down
2 changes: 1 addition & 1 deletion warpgate-admin/src/api/users.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)?;
Expand Down
2 changes: 1 addition & 1 deletion warpgate-core/src/config_providers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion warpgate-protocol-http/src/api/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion warpgate-protocol-http/src/logging.rs
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
1 change: 1 addition & 0 deletions warpgate-protocol-http/src/proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ fn copy_server_request<B: SomeRequestBuilder>(req: &Request, mut target: B) -> B
}

fn inject_forwarding_headers<B: SomeRequestBuilder>(req: &Request, mut target: B) -> Result<B> {
#[allow(clippy::unwrap_used)]
if let Some(host) = req.headers().get(http::header::HOST) {
target = target.header(
X_FORWARDED_HOST.clone(),
Expand Down

0 comments on commit 6cace24

Please sign in to comment.