Neater extractor imports.
This commit is contained in:
+1
-4
@@ -8,10 +8,7 @@ use axum::{
|
||||
use crate::{
|
||||
domain::DomainError,
|
||||
repository::RepositoryError,
|
||||
routes::extractors::{
|
||||
ExtractorError,
|
||||
auth::{AuthError, AuthHeaderError, BearerError},
|
||||
},
|
||||
routes::extractors::{AuthError, AuthHeaderError, BearerError, ExtractorError},
|
||||
};
|
||||
|
||||
#[derive(Debug, thiserror::Error)]
|
||||
|
||||
@@ -5,7 +5,7 @@ use uuid::Uuid;
|
||||
|
||||
use super::{
|
||||
dtos::account::{AccountRequest, AccountResponse},
|
||||
extractors::{auth::Auth, json::Json, path::Path, query::Query},
|
||||
extractors::{Auth, Json, Path, Query},
|
||||
};
|
||||
use crate::{error::AppError, repository};
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ use crate::{
|
||||
repository,
|
||||
routes::{
|
||||
dtos::token::{TokenRequest, TokenResponse, TokenRevocationRequest, TokenType},
|
||||
extractors::{form::Form, json::Json},
|
||||
extractors::{Form, Json},
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -2,11 +2,17 @@ use axum::response::IntoResponse;
|
||||
|
||||
use crate::error::AppError;
|
||||
|
||||
pub mod auth;
|
||||
pub mod form;
|
||||
pub mod json;
|
||||
pub mod path;
|
||||
pub mod query;
|
||||
mod auth;
|
||||
mod form;
|
||||
mod json;
|
||||
mod path;
|
||||
mod query;
|
||||
|
||||
pub use auth::*;
|
||||
pub use form::*;
|
||||
pub use json::*;
|
||||
pub use path::*;
|
||||
pub use query::*;
|
||||
|
||||
#[derive(Debug, thiserror::Error)]
|
||||
pub enum ExtractorError {
|
||||
|
||||
@@ -8,7 +8,8 @@ pub use bearer::*;
|
||||
pub use header::*;
|
||||
pub use principal::*;
|
||||
|
||||
use crate::{repository::RepositoryError, routes::extractors::ExtractorError};
|
||||
use super::ExtractorError;
|
||||
use crate::repository::RepositoryError;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Auth<T = Bearer>(pub Principal<T>);
|
||||
|
||||
@@ -10,7 +10,7 @@ use super::{
|
||||
dtos::scheduled_transaction::{
|
||||
RecurringTransactionResponse, ScheduledTransactionRequest, ScheduledTransactionResponse,
|
||||
},
|
||||
extractors::{auth::Auth, json::Json, path::Path, query::Query},
|
||||
extractors::{Auth, Json, Path, Query},
|
||||
};
|
||||
use crate::{
|
||||
domain,
|
||||
|
||||
@@ -7,7 +7,7 @@ use uuid::Uuid;
|
||||
|
||||
use super::{
|
||||
dtos::transaction::{TransactionRequest, TransactionResponse},
|
||||
extractors::{auth::Auth, json::Json, path::Path, query::Query},
|
||||
extractors::{Auth, Json, Path, Query},
|
||||
};
|
||||
use crate::{
|
||||
domain,
|
||||
|
||||
@@ -7,7 +7,7 @@ use super::{
|
||||
dtos::user_app_secret::{
|
||||
CreatedUserAppSecretResponse, UserAppSecretRequest, UserAppSecretResponse,
|
||||
},
|
||||
extractors::{auth::Auth, json::Json, path::Path, query::Query},
|
||||
extractors::{Auth, Json, Path, Query},
|
||||
};
|
||||
use crate::{
|
||||
crypto::{generate_secret, hash_secret},
|
||||
|
||||
@@ -5,7 +5,7 @@ use uuid::Uuid;
|
||||
|
||||
use super::{
|
||||
dtos::user_app::{UserAppRequest, UserAppResponse},
|
||||
extractors::{auth::Auth, json::Json, path::Path, query::Query},
|
||||
extractors::{Auth, Json, Path, Query},
|
||||
};
|
||||
use crate::{
|
||||
error::AppError,
|
||||
|
||||
@@ -5,7 +5,7 @@ use uuid::Uuid;
|
||||
|
||||
use super::{
|
||||
dtos::user::{UserRequest, UserResponse},
|
||||
extractors::{auth::Auth, json::Json, path::Path, query::Query},
|
||||
extractors::{Auth, Json, Path, Query},
|
||||
};
|
||||
use crate::{error::AppError, repository};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user