Refactor and enhance SurrealDB integration and resource management
- Updated `lib.rs` to selectively expose specific entities and services for better clarity. - Improved SurrealDB client initialization with detailed logging in `surrealdb/mod.rs`. - Enhanced resource definitions in `resource.rs` with additional utility methods for better resource management. - Refactored user data retrieval logic in `auth_middleware/mod.rs` for improved readability and efficiency. - Cleaned up middleware exports in `lib.rs` for clearer API surface. - Added detailed comments and documentation throughout the SurrealDB module for better maintainability. - Updated tests to ensure compatibility with new changes and improved structure. - Introduced new permissions module structure in `imphnen-utils` for future enhancements.
This commit is contained in:
+70
-18
@@ -1,39 +1,91 @@
|
||||
pub mod logger;
|
||||
pub mod bind_filter;
|
||||
pub mod csrf_token;
|
||||
pub mod extract_email;
|
||||
pub mod generate_date;
|
||||
pub mod generate_otp;
|
||||
pub mod get_id;
|
||||
pub mod logger;
|
||||
pub mod make_thing;
|
||||
pub mod mock_test;
|
||||
pub mod query_builder;
|
||||
pub mod query_list;
|
||||
pub mod response_format;
|
||||
pub mod serde_helpers;
|
||||
pub mod validator;
|
||||
pub mod csrf_token;
|
||||
|
||||
pub use logger::init_logger;
|
||||
pub use bind_filter::*;
|
||||
// Internal module re-exports
|
||||
pub use bind_filter::bind_filter_value;
|
||||
pub use csrf_token::{generate_csrf_token, generate_oauth_csrf_token, validate_csrf_token, validate_oauth_csrf_token};
|
||||
pub use extract_email::{extract_email, extract_email_async, extract_email_token, extract_email_token_async};
|
||||
pub use generate_date::*;
|
||||
pub use generate_otp::*;
|
||||
pub use get_id::*;
|
||||
pub use imphnen_entities::*;
|
||||
pub use imphnen_libs::*;
|
||||
pub use make_thing::*;
|
||||
pub use generate_date::get_iso_date;
|
||||
pub use generate_otp::OtpManager;
|
||||
pub use get_id::{extract_id, get_id};
|
||||
pub use logger::init_logger;
|
||||
pub use make_thing::{make_thing, make_thing_from_enum, make_thing_str};
|
||||
pub use query_builder::{
|
||||
build_thing_condition,
|
||||
build_multi_thing_condition,
|
||||
execute_safe_update_query,
|
||||
build_thing_condition,
|
||||
execute_safe_count_query,
|
||||
ListQueryBuilder,
|
||||
execute_safe_update_query,
|
||||
DetailQueryBuilder,
|
||||
ListQueryBuilder,
|
||||
};
|
||||
pub use query_list::QueryListBuilder;
|
||||
pub use response_format::*;
|
||||
pub use response_format::{common_response, success_created_response, success_list_response, success_response};
|
||||
pub use serde_helpers::{
|
||||
option_thing_or_string, serialize_option_thing, serialize_thing,
|
||||
string_or_empty_string, thing_or_string,
|
||||
deserialize_datetime,
|
||||
option_thing_or_string,
|
||||
serialize_datetime,
|
||||
serialize_option_thing,
|
||||
serialize_thing,
|
||||
string_or_empty_string,
|
||||
thing_or_string,
|
||||
};
|
||||
pub use validator::validate_request;
|
||||
|
||||
// External crate re-exports
|
||||
pub use imphnen_libs::{
|
||||
AppState,
|
||||
Claims,
|
||||
CountResult,
|
||||
EducationDto,
|
||||
ENV,
|
||||
Env,
|
||||
Error,
|
||||
ExperienceDto,
|
||||
FileMetadata,
|
||||
FileType,
|
||||
MessageResponseDto,
|
||||
MetaRequestDto,
|
||||
MetaResponseDto,
|
||||
MinioConfig,
|
||||
MinioService,
|
||||
PermissionsEnum,
|
||||
PermissionsItemDto,
|
||||
PermissionsQueryDto,
|
||||
ResourceEnum,
|
||||
ResponseListSuccessDto,
|
||||
ResponseSuccessDto,
|
||||
SurrealMemClient,
|
||||
SurrealWsClient,
|
||||
UploadRequest,
|
||||
UploadResult,
|
||||
UserLookupService,
|
||||
UsersDetailQueryDto,
|
||||
AuthRepositoryTrait,
|
||||
axum_init,
|
||||
create_minio_service_from_config,
|
||||
decode_access_token,
|
||||
decode_base64_file,
|
||||
decode_refresh_token,
|
||||
encode_access_token,
|
||||
encode_refresh_token,
|
||||
encode_reset_password_token,
|
||||
extract_content_type_from_data_url,
|
||||
generate_jwt,
|
||||
hash_password,
|
||||
send_email,
|
||||
surrealdb_init_mem,
|
||||
surrealdb_init_ws,
|
||||
verify_password,
|
||||
};
|
||||
pub use validator::*;
|
||||
pub use csrf_token::*;
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
pub mod permissions;
|
||||
Reference in New Issue
Block a user