Files
tuliprox/backend/src/auth/mod.rs
T
euzuandGitHub 66915a306d Feature/rbac (#656)
* RBAC implementation
* Schedules config edit mode
2026-03-20 15:31:19 +01:00

30 lines
779 B
Rust

use axum::http::StatusCode;
mod authenticator;
mod password;
mod auth_bearer;
mod auth_basic;
mod access_token;
mod fingerprint;
type Rejection = (StatusCode, &'static str);
#[macro_export]
macro_rules! permission_layer {
($app_state:expr, $permission:expr ) => {
{
let app_state = ::std::sync::Arc::clone($app_state);
::axum::middleware::from_fn_with_state(app_state, move |state, auth, request, next| {
$crate::auth::require_permission_inner($permission, state, auth, request, next)
})
}
};
}
pub use permission_layer;
pub use self::authenticator::*;
pub use self::access_token::*;
pub use self::password::*;
pub use self::fingerprint::*;
pub use self::auth_basic::*;
pub use self::auth_bearer::*;