pub struct WebSocketAuthExtractor { /* private fields */ }
Expand description
WebSocket authentication extractor
Implementations§
Source§impl WebSocketAuthExtractor
impl WebSocketAuthExtractor
Sourcepub fn new(config: WebSocketAuthConfig) -> Self
pub fn new(config: WebSocketAuthConfig) -> Self
Create a new WebSocket authentication extractor
Sourcepub fn has_handshake_auth(&self, request: &TransportRequest) -> bool
pub fn has_handshake_auth(&self, request: &TransportRequest) -> bool
Check if WebSocket handshake contains authentication
Trait Implementations§
Source§impl AuthExtractor for WebSocketAuthExtractor
impl AuthExtractor for WebSocketAuthExtractor
Source§fn extract_auth<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 TransportRequest,
) -> Pin<Box<dyn Future<Output = AuthExtractionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn extract_auth<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 TransportRequest,
) -> Pin<Box<dyn Future<Output = AuthExtractionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Extract authentication from a transport request
Source§fn transport_type(&self) -> TransportType
fn transport_type(&self) -> TransportType
Get the transport type this extractor handles
Source§fn can_handle(&self, request: &TransportRequest) -> bool
fn can_handle(&self, request: &TransportRequest) -> bool
Check if this extractor can handle the given request
Source§fn validate_auth<'life0, 'life1, 'async_trait>(
&'life0 self,
context: &'life1 TransportAuthContext,
) -> Pin<Box<dyn Future<Output = Result<(), TransportAuthError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn validate_auth<'life0, 'life1, 'async_trait>(
&'life0 self,
context: &'life1 TransportAuthContext,
) -> Pin<Box<dyn Future<Output = Result<(), TransportAuthError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Validate the extracted authentication (optional hook)
Auto Trait Implementations§
impl Freeze for WebSocketAuthExtractor
impl RefUnwindSafe for WebSocketAuthExtractor
impl Send for WebSocketAuthExtractor
impl Sync for WebSocketAuthExtractor
impl Unpin for WebSocketAuthExtractor
impl UnwindSafe for WebSocketAuthExtractor
Blanket Implementations§
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