pub struct AuthHook;Expand description
Opt-in ServerHook authenticating incoming requests and populating ATTR_AUTH_PRINCIPAL.
Trait Implementations§
impl Copy for AuthHook
Source§impl ServerHook for AuthHook
Implements ServerHook for AuthHook.
impl ServerHook for AuthHook
Implements ServerHook for AuthHook.
Source§async fn handle(self, stream: &mut Stream, ctx: &mut Context) -> Status
async fn handle(self, stream: &mut Stream, ctx: &mut Context) -> Status
Authenticates protected requests, verifies required roles, and attaches AuthPrincipal.
§Arguments
Self- Hook instance.&mut Stream- Connection stream.&mut Context- Request context.
§Returns
Status-Status::Continuewhen unconfigured, exempt, or authorized;Status::Rejecton401/403.
Auto Trait Implementations§
impl Forget for AuthHook
impl Freeze for AuthHook
impl Move for AuthHook
impl RefUnwindSafe for AuthHook
impl Send for AuthHook
impl Sync for AuthHook
impl Unpin for AuthHook
impl UnsafeUnpin for AuthHook
impl UnwindSafe for AuthHook
Blanket Implementations§
impl<T> AnySend for T
impl<T> AnySendClone for T
impl<T> AnySendSync for T
impl<T> AnySendSyncClone for T
impl<T> AnySync for T
impl<T> AnySyncClone for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more