Skip to main contentModule middleware
Source - Next
- The remainder of a middleware stack, including the handler.
- Redirect
- Response that redirects the request to another location.
- IntoResponse
- Trait for generating responses.
- api_auth_with_pairing
- Middleware autentikasi API: Memvalidasi JWT Bearer token DAN header pairing
X-Token-Pairing. - api_secure_guard
- Middleware komprehensif: Autentikasi JWT Bearer + verifikasi
X-Signature + verifikasi X-Token-Pairing. - auth_required
- Middleware autentikasi standar — memvalidasi JWT Bearer token dari header
Authorization. - bad_request_json
- Helper — buat Response 400 Bad Request dengan body JSON standar Lumina.
- error_json
- Helper — buat Response error JSON standar Lumina.
- forbidden_json
- Helper — buat Response 403 Forbidden dengan body JSON standar Lumina.
- from_fn
- Create a middleware from an async function.
- from_fn_with_state
- Create a middleware from an async function with the given state.
- get_bearer_token
- Helper — ambil Bearer token dari header
Authorization. - get_header
- Helper — ambil string nilai header dari HTTP Request.
- logger
- Middleware logger — mencatat setiap HTTP request ke terminal dengan warna.
- parse_timestamp_seconds
- Helper untuk parsing timestamp (mendukung UNIX timestamp seconds/millis dan ISO 8601 RFC3339).
- permission_required
- Middleware untuk mengecek Permission.
- role_required
- Middleware untuk mengecek Role.
- security_headers
- Middleware untuk menambahkan Security Headers standar industri.
- unauthorized_json
- Helper — buat Response 401 Unauthorized dengan body JSON standar Lumina.
- validate_required_headers
- Helper validator — pastikan request memiliki semua header wajib yang ditentukan.
- verify_api_signature
- Middleware verifikasi API Signature (misal untuk integrasi webhook, perbankan / SNAP BI, HMAC).
Memvalidasi header
X-Signature dan X-Timestamp lengkap dengan replay & clock-drift protection (300 detik). - verify_hmac_sha256
- Helper verifikasi HMAC-SHA256 dengan perbandingan waktu konstan (constant-time comparison anti timing attack).
- web_auth_required
- Middleware autentikasi untuk Web — memvalidasi JWT dari Session.
- Request
- Type alias for
http::Request whose body type defaults to Body, the most common body
type used with axum. - Response
- Type alias for
http::Response whose body type defaults to Body, the most common body
type used with axum.