feat: Enhance Hackathon Timeline Management and Admin Features
- Updated HackathonTimelineCreateRequestDto to accept optional title and name fields. - Added custom validators for HackathonPhase and date checks in hackathon_dto.rs. - Implemented admin-sensitive data management DTOs for handling user scores and personal info. - Introduced new admin routes for managing users, roles, and permissions in IAM module. - Added timeline enforcement middleware to restrict access based on hackathon phases. - Created tests for timeline enforcement and admin permissions to ensure proper access control. - Implemented payment middleware as a placeholder for future payment processing logic. - Enhanced audit logging middleware for improved error handling and logging.
This commit is contained in:
@@ -4,16 +4,14 @@ use axum::{
|
||||
middleware::Next,
|
||||
Extension,
|
||||
};
|
||||
use chrono::Utc;
|
||||
use imphnen_entities::audit_log::RateLimitSchema;
|
||||
use imphnen_libs::{AppState, ResourceEnum};
|
||||
use imphnen_utils::extract_real_ip;
|
||||
use std::time::Duration;
|
||||
|
||||
/// Rate limiting middleware yang menggunakan SurrealDB memori untuk semua public endpoints
|
||||
pub async fn rate_limiting_middleware(
|
||||
Extension(state): Extension<AppState>,
|
||||
mut req: Request<axum::body::Body>,
|
||||
req: Request<axum::body::Body>,
|
||||
next: Next,
|
||||
) -> Result<Response<Body>, StatusCode> {
|
||||
let uri = req.uri().path().to_string();
|
||||
@@ -54,7 +52,7 @@ pub async fn rate_limiting_middleware(
|
||||
/// Middleware rate limiting khusus untuk endpoint autentikasi (legacy compatibility)
|
||||
pub async fn auth_rate_limiting_middleware(
|
||||
Extension(state): Extension<AppState>,
|
||||
mut req: Request<axum::body::Body>,
|
||||
req: Request<axum::body::Body>,
|
||||
next: Next,
|
||||
) -> Result<Response<Body>, StatusCode> {
|
||||
let uri = req.uri().path().to_string();
|
||||
|
||||
Reference in New Issue
Block a user