Neater extractor imports.

This commit is contained in:
2026-10-11 08:16:10 +02:00
parent ea165554d8
commit 02f29f3a99
10 changed files with 21 additions and 17 deletions
+1 -4
View File
@@ -8,10 +8,7 @@ use axum::{
use crate::{ use crate::{
domain::DomainError, domain::DomainError,
repository::RepositoryError, repository::RepositoryError,
routes::extractors::{ routes::extractors::{AuthError, AuthHeaderError, BearerError, ExtractorError},
ExtractorError,
auth::{AuthError, AuthHeaderError, BearerError},
},
}; };
#[derive(Debug, thiserror::Error)] #[derive(Debug, thiserror::Error)]
+1 -1
View File
@@ -5,7 +5,7 @@ use uuid::Uuid;
use super::{ use super::{
dtos::account::{AccountRequest, AccountResponse}, dtos::account::{AccountRequest, AccountResponse},
extractors::{auth::Auth, json::Json, path::Path, query::Query}, extractors::{Auth, Json, Path, Query},
}; };
use crate::{error::AppError, repository}; use crate::{error::AppError, repository};
+1 -1
View File
@@ -10,7 +10,7 @@ use crate::{
repository, repository,
routes::{ routes::{
dtos::token::{TokenRequest, TokenResponse, TokenRevocationRequest, TokenType}, dtos::token::{TokenRequest, TokenResponse, TokenRevocationRequest, TokenType},
extractors::{form::Form, json::Json}, extractors::{Form, Json},
}, },
}; };
+11 -5
View File
@@ -2,11 +2,17 @@ use axum::response::IntoResponse;
use crate::error::AppError; use crate::error::AppError;
pub mod auth; mod auth;
pub mod form; mod form;
pub mod json; mod json;
pub mod path; mod path;
pub mod query; mod query;
pub use auth::*;
pub use form::*;
pub use json::*;
pub use path::*;
pub use query::*;
#[derive(Debug, thiserror::Error)] #[derive(Debug, thiserror::Error)]
pub enum ExtractorError { pub enum ExtractorError {
+2 -1
View File
@@ -8,7 +8,8 @@ pub use bearer::*;
pub use header::*; pub use header::*;
pub use principal::*; pub use principal::*;
use crate::{repository::RepositoryError, routes::extractors::ExtractorError}; use super::ExtractorError;
use crate::repository::RepositoryError;
#[derive(Debug)] #[derive(Debug)]
pub struct Auth<T = Bearer>(pub Principal<T>); pub struct Auth<T = Bearer>(pub Principal<T>);
+1 -1
View File
@@ -10,7 +10,7 @@ use super::{
dtos::scheduled_transaction::{ dtos::scheduled_transaction::{
RecurringTransactionResponse, ScheduledTransactionRequest, ScheduledTransactionResponse, RecurringTransactionResponse, ScheduledTransactionRequest, ScheduledTransactionResponse,
}, },
extractors::{auth::Auth, json::Json, path::Path, query::Query}, extractors::{Auth, Json, Path, Query},
}; };
use crate::{ use crate::{
domain, domain,
+1 -1
View File
@@ -7,7 +7,7 @@ use uuid::Uuid;
use super::{ use super::{
dtos::transaction::{TransactionRequest, TransactionResponse}, dtos::transaction::{TransactionRequest, TransactionResponse},
extractors::{auth::Auth, json::Json, path::Path, query::Query}, extractors::{Auth, Json, Path, Query},
}; };
use crate::{ use crate::{
domain, domain,
+1 -1
View File
@@ -7,7 +7,7 @@ use super::{
dtos::user_app_secret::{ dtos::user_app_secret::{
CreatedUserAppSecretResponse, UserAppSecretRequest, UserAppSecretResponse, CreatedUserAppSecretResponse, UserAppSecretRequest, UserAppSecretResponse,
}, },
extractors::{auth::Auth, json::Json, path::Path, query::Query}, extractors::{Auth, Json, Path, Query},
}; };
use crate::{ use crate::{
crypto::{generate_secret, hash_secret}, crypto::{generate_secret, hash_secret},
+1 -1
View File
@@ -5,7 +5,7 @@ use uuid::Uuid;
use super::{ use super::{
dtos::user_app::{UserAppRequest, UserAppResponse}, dtos::user_app::{UserAppRequest, UserAppResponse},
extractors::{auth::Auth, json::Json, path::Path, query::Query}, extractors::{Auth, Json, Path, Query},
}; };
use crate::{ use crate::{
error::AppError, error::AppError,
+1 -1
View File
@@ -5,7 +5,7 @@ use uuid::Uuid;
use super::{ use super::{
dtos::user::{UserRequest, UserResponse}, dtos::user::{UserRequest, UserResponse},
extractors::{auth::Auth, json::Json, path::Path, query::Query}, extractors::{Auth, Json, Path, Query},
}; };
use crate::{error::AppError, repository}; use crate::{error::AppError, repository};