diff --git a/src/engines.rs b/src/engines.rs index 78d8f8a..8cf34a9 100644 --- a/src/engines.rs +++ b/src/engines.rs @@ -10,7 +10,7 @@ use axum::{ use log::*; use tower::Service; -use crate::storage::DatabaseDriver; +use crate::{common::HttpError, storage::DatabaseDriver}; #[derive(Clone)] /// State to be used to store the database pool @@ -47,7 +47,7 @@ async fn engine_handler( } } else { // Otherwise, the mount path could not be found - (StatusCode::NOT_FOUND, "Mount path not found").into_response() + HttpError::simple(StatusCode::NOT_FOUND, "Secret engine mount path not found") } } @@ -66,9 +66,9 @@ async fn call_router(engine: Router, mount_path: String, mut req: Request) -> Re /// HTTP error response for unknown engine types /// Occurs when the mount path is found in the database /// but the registered is unknown -fn unknown_engine(engine_type: String) -> (StatusCode, String) { +fn unknown_engine(engine_type: String) -> impl IntoResponse { error!("Engine type {} not implemented", engine_type); - ( + HttpError::simple( StatusCode::INTERNAL_SERVER_ERROR, format!("Engine type {} not implemented", engine_type), ) diff --git a/src/engines/kv/structs.rs b/src/engines/kv/structs.rs index 90b847b..6a29fe5 100644 --- a/src/engines/kv/structs.rs +++ b/src/engines/kv/structs.rs @@ -1,6 +1,5 @@ use chrono::{DateTime, Utc}; use serde::{Deserialize, Serialize}; -use zeroize::ZeroizeOnDrop; use std::{collections::HashMap, vec}; pub type KvSecretData = HashMap;