diff --git a/server/src/routes.rs b/server/src/routes.rs index 69aca4f..2b626d8 100644 --- a/server/src/routes.rs +++ b/server/src/routes.rs @@ -3,6 +3,8 @@ use axum::{http::StatusCode, routing::get}; use crate::error::AppError; pub mod accounts; +pub mod auth_passkey; +pub mod auth_token; pub mod dtos; pub mod extractors; pub mod scheduled_transactions; @@ -10,12 +12,16 @@ pub mod transactions; pub mod users; pub fn create_router(pool: sqlx::PgPool) -> axum::Router { + let auth_passkey = auth_passkey::create_router(); + let auth_token = auth_token::create_router(); let accounts = accounts::create_router(); let scheduled_transactions = scheduled_transactions::create_router(); let transactions = transactions::create_router(); let users = users::create_router(); let api = axum::Router::new() + .nest("/auth/passkey", auth_passkey) + .nest("/auth/token", auth_token) .nest("/accounts", accounts) .nest("/scheduled-transactions", scheduled_transactions) .nest("/transactions", transactions) diff --git a/server/src/routes/auth_passkey.rs b/server/src/routes/auth_passkey.rs new file mode 100644 index 0000000..aa3fd63 --- /dev/null +++ b/server/src/routes/auth_passkey.rs @@ -0,0 +1,22 @@ +use axum::routing::post; +use sqlx::PgPool; + +use crate::error::AppError; + +pub fn create_router() -> axum::Router { + axum::Router::new() + .route("/options", post(get_challenge_options)) + .route("/verify", post(verify_challenge_response)) +} + +#[axum::debug_handler] +#[tracing::instrument()] +async fn get_challenge_options() -> Result<(), AppError> { + Ok(()) +} + +#[axum::debug_handler] +#[tracing::instrument()] +async fn verify_challenge_response() -> Result<(), AppError> { + Ok(()) +} diff --git a/server/src/routes/auth_token.rs b/server/src/routes/auth_token.rs new file mode 100644 index 0000000..1108679 --- /dev/null +++ b/server/src/routes/auth_token.rs @@ -0,0 +1,22 @@ +use axum::routing::post; +use sqlx::PgPool; + +use crate::error::AppError; + +pub fn create_router() -> axum::Router { + axum::Router::new() + .route("/", post(issue_token)) + .route("/revoke", post(revoke_token)) +} + +#[axum::debug_handler] +#[tracing::instrument()] +async fn issue_token() -> Result<(), AppError> { + Ok(()) +} + +#[axum::debug_handler] +#[tracing::instrument()] +async fn revoke_token() -> Result<(), AppError> { + Ok(()) +}