feat: Enhance validation and permissions handling across controllers

- Added `ValidatedJson` extractor for automatic JSON validation in `events_controller.rs`, `testimonials_controller.rs`, `mentors_controller.rs`, `gacha_items_controller.rs`, and `hackathon_controller.rs`.
- Replaced manual permission checks with `require_permissions!` and `require_auth!` macros in relevant controllers to streamline permission handling.
- Introduced `sanitization` utilities in `sanitization.rs` for improved input sanitization.
- Added `permission_macros.rs` to encapsulate permission checking logic and reduce boilerplate.
- Updated dependencies in `Cargo.toml` to include `serde_json` and `validator`.
- Implemented error handling improvements in `notification_service.rs` for better response management.
This commit is contained in:
MythEclipse
2025-10-28 14:04:41 +07:00
parent d4a6c4c9ea
commit b9a51ce6cc
17 changed files with 551 additions and 225 deletions
+4
View File
@@ -1,4 +1,5 @@
pub mod v1;
pub mod permission_macros;
// Re-export core entity types used throughout the IAM module
pub use imphnen_entities::{
@@ -71,6 +72,9 @@ pub use v1::{
permissions_guard,
};
// Export permission macros
pub use permission_macros::{check_permissions, check_authenticated};
// Export IAM-specific types
pub use v1::auth::{
AuthRepository, AuthOtpSchema,