Neater extractor imports.
This commit is contained in:
+1
-4
@@ -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)]
|
||||||
|
|||||||
@@ -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};
|
||||||
|
|
||||||
|
|||||||
@@ -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},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -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 {
|
||||||
|
|||||||
@@ -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>);
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
@@ -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},
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
@@ -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};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user