Added initial authorization layer.

This commit is contained in:
2026-10-09 17:22:46 +02:00
parent 7fb3abc93d
commit 1f6de34e5b
16 changed files with 184 additions and 64 deletions
+5 -1
View File
@@ -10,7 +10,7 @@ use super::{
dtos::scheduled_transaction::{
RecurringTransactionResponse, ScheduledTransactionRequest, ScheduledTransactionResponse,
},
extractors::{json::Json, path::Path, query::Query},
extractors::{auth::Auth, json::Json, path::Path, query::Query},
};
use crate::{
domain,
@@ -38,6 +38,7 @@ pub struct QueryParams {
#[axum::debug_handler]
#[tracing::instrument(skip(pool))]
async fn list_scheduled_transactions(
Auth(auth): Auth,
State(pool): State<PgPool>,
Query(query): Query<QueryParams>,
) -> Result<Json<Vec<ScheduledTransactionResponse>>, AppError> {
@@ -63,6 +64,7 @@ async fn list_scheduled_transactions(
#[axum::debug_handler]
#[tracing::instrument(skip(pool))]
async fn get_scheduled_transaction(
Auth(auth): Auth,
State(pool): State<PgPool>,
Path(id): Path<Uuid>,
) -> Result<Json<ScheduledTransactionResponse>, AppError> {
@@ -80,6 +82,7 @@ async fn get_scheduled_transaction(
#[axum::debug_handler]
#[tracing::instrument(skip(pool, transaction))]
async fn upsert_scheduled_transaction(
Auth(auth): Auth,
State(pool): State<PgPool>,
Path(id): Path<Uuid>,
Json(transaction): Json<ScheduledTransactionRequest>,
@@ -108,6 +111,7 @@ async fn upsert_scheduled_transaction(
#[axum::debug_handler]
#[tracing::instrument(skip(pool))]
async fn delete_scheduled_transaction(
Auth(auth): Auth,
State(pool): State<PgPool>,
Path(id): Path<Uuid>,
) -> Result<StatusCode, AppError> {