Skip to main content

AuthenticationProvider

Trait AuthenticationProvider 

Source
pub trait AuthenticationProvider:
    Send
    + Sync
    + 'static
    + Debug {
    // Required method
    fn authenticate<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        headers: &'life1 HeaderMap,
        auth: Option<&'life2 Value>,
    ) -> Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
}
Expand description

认证提供者抽象 trait Authentication provider abstract trait

Required Methods§

Source

fn authenticate<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, headers: &'life1 HeaderMap, auth: Option<&'life2 Value>, ) -> Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

认证连接请求 Authenticate connection request

§Arguments
  • headers - HTTP 请求头 / HTTP request headers
  • auth - 原始认证数据 / Raw authentication data
§Returns

认证是否成功 / Whether authentication succeeded

Implementors§