pub struct AuthLayer { /* private fields */ }Expand description
Auth middleware that manages Authorization headers.
Implementations§
Source§impl AuthLayer
impl AuthLayer
pub fn new(strategy: AuthStrategy) -> Self
Sourcepub fn static_bearer(token: impl Into<String>) -> Self
pub fn static_bearer(token: impl Into<String>) -> Self
Create an auth layer that injects a static bearer token.
Sourcepub fn passthrough() -> Self
pub fn passthrough() -> Self
Create an auth layer that passes through client auth.
Trait Implementations§
Source§impl ProxyLayer for AuthLayer
impl ProxyLayer for AuthLayer
Source§fn on_request<'life0, 'async_trait>(
&'life0 self,
request: ProxyRequest,
) -> Pin<Box<dyn Future<Output = ProxyResult<LayerAction>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn on_request<'life0, 'async_trait>(
&'life0 self,
request: ProxyRequest,
) -> Pin<Box<dyn Future<Output = ProxyResult<LayerAction>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Process an incoming request. Return
Forward to pass it on,
or Respond to short-circuit with an immediate response.Source§fn on_response<'life0, 'async_trait>(
&'life0 self,
response: ProxyResponse,
) -> Pin<Box<dyn Future<Output = ProxyResult<ProxyResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn on_response<'life0, 'async_trait>(
&'life0 self,
response: ProxyResponse,
) -> Pin<Box<dyn Future<Output = ProxyResult<ProxyResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Process a response before it’s sent back to the client.
Called in reverse layer order.
Auto Trait Implementations§
impl Freeze for AuthLayer
impl RefUnwindSafe for AuthLayer
impl Send for AuthLayer
impl Sync for AuthLayer
impl Unpin for AuthLayer
impl UnsafeUnpin for AuthLayer
impl UnwindSafe for AuthLayer
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