From 8552052a46d58cc9f8bf86a6c16fd98ccddba6da Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Wed, 13 Nov 2024 07:41:23 +0100 Subject: [PATCH] `inbox`: Add empty `/inbox` handler --- acrate-inbox/src/main.rs | 4 +++- acrate-inbox/src/route.rs | 8 ++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 acrate-inbox/src/route.rs diff --git a/acrate-inbox/src/main.rs b/acrate-inbox/src/main.rs index ee14d9a..8958b4c 100644 --- a/acrate-inbox/src/main.rs +++ b/acrate-inbox/src/main.rs @@ -1,6 +1,7 @@ use anyhow::Context; mod config; +mod route; #[tokio::main] @@ -9,7 +10,8 @@ async fn main() -> anyhow::Result { log::debug!("Logging initialized!"); log::trace!("Creating Axum router..."); - let app = axum::Router::new(); + let app = axum::Router::new() + .route("/inbox", axum::routing::post(route::inbox_handler)); log::trace!("Axum router created successfully!"); log::trace!("Creating Tokio listener..."); diff --git a/acrate-inbox/src/route.rs b/acrate-inbox/src/route.rs new file mode 100644 index 0000000..ca9ec6b --- /dev/null +++ b/acrate-inbox/src/route.rs @@ -0,0 +1,8 @@ +#[allow(unreachable_code)] +pub async fn inbox_handler() { + todo!("pre-validation hook"); + todo!("validate signature"); + todo!("post-validation hook"); + todo!("database storage"); + todo!("post-storage hook"); +}