pub mod impls;
pub mod modes;
pub trait RoleName: Send + Sync {
const NAME: &'static str;
}
pub trait PermissionName: Send + Sync {
const NAME: &'static str;
}
pub trait ModeSpec: Send + Sync {
const STRICT: bool;
}
pub struct Strict;
pub struct Loose;
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum Annotation {
CheckLogin,
CheckPermission(String),
CheckRole(String),
CheckSafe,
CheckDisable,
CheckOr,
CheckAnd,
CheckNot,
Ignore,
CheckBasicAuth,
CheckDigestAuth,
CheckSign,
CheckApiKey {
namespace: Option<String>,
},
Mode(AnnotationMode),
CheckAccessToken,
CheckClientToken,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum AnnotationMode {
And,
Or,
}
#[cfg(feature = "web-axum")]
mod extractors;
#[cfg(feature = "web-axum")]
pub use extractors::{CheckLogin, CheckPermission, CheckRole, Ignore, Mode};
#[cfg(all(test, feature = "web-axum"))]
mod mock;
#[cfg(all(test, feature = "web-axum"))]
mod tests;