From 97f2bfe09e2ca866c00fa776511d5258a52ab586 Mon Sep 17 00:00:00 2001 From: jakubmanczak Date: Wed, 24 Jul 2024 22:53:52 +0200 Subject: [PATCH] remove argon endpoint --- src/routes/argon.rs | 47 --------------------------------------------- src/routes/mod.rs | 2 -- 2 files changed, 49 deletions(-) delete mode 100644 src/routes/argon.rs diff --git a/src/routes/argon.rs b/src/routes/argon.rs deleted file mode 100644 index a39a6cb..0000000 --- a/src/routes/argon.rs +++ /dev/null @@ -1,47 +0,0 @@ -// use argon2::Config; -// use axum::{ -// extract::Query, -// http::StatusCode, -// response::{IntoResponse, Response}, -// routing::get, -// Router, -// }; -// use serde::Deserialize; -// use tracing::error; -// -// pub fn route() -> Router { -// Router::new().route("/argon", get(argon)) -// } -// -// #[derive(Deserialize)] -// struct ArgonParams { -// password: String, -// salt: Option, -// } -// -// async fn argon(Query(params): Query) -> Response { -// let password = params.password.as_bytes(); -// let salt = match params.salt { -// Some(s) => s, -// None => "samplesalt".to_owned(), -// }; -// -// let config = Config { -// variant: argon2::Variant::Argon2id, -// version: argon2::Version::Version13, -// mem_cost: 2_u32.pow(15), -// time_cost: 4, -// lanes: 2, -// secret: &[], -// ad: &[], -// hash_length: 32, -// }; -// let hash = match argon2::hash_encoded(password, salt.as_bytes(), &config) { -// Ok(hash) => hash, -// Err(e) => { -// error!("error hashing: {e}"); -// return (StatusCode::INTERNAL_SERVER_ERROR).into_response(); -// } -// }; -// return (StatusCode::OK, hash).into_response(); -// } diff --git a/src/routes/mod.rs b/src/routes/mod.rs index dfab5c1..a7a0ebb 100644 --- a/src/routes/mod.rs +++ b/src/routes/mod.rs @@ -1,6 +1,5 @@ use axum::Router; -mod argon; mod health; mod root; mod splash; @@ -9,7 +8,6 @@ mod version; pub fn routes() -> Router { Router::new() - // .merge(argon::route()) .merge(health::route()) .merge(root::route()) .merge(splash::route())