Trait fast_socks5::server::Authentication
source · pub trait Authentication: Send + Sync {
type Item;
// Required method
fn authenticate<'life0, 'async_trait>(
&'life0 self,
credentials: Option<(String, String)>
) -> Pin<Box<dyn Future<Output = Option<Self::Item>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}
Expand description
Use this trait to handle a custom authentication on your end.
Required Associated Types§
Required Methods§
fn authenticate<'life0, 'async_trait>(
&'life0 self,
credentials: Option<(String, String)>
) -> Pin<Box<dyn Future<Output = Option<Self::Item>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Implementors§
source§impl Authentication for DenyAuthentication
impl Authentication for DenyAuthentication
source§impl Authentication for SimpleUserPassword
impl Authentication for SimpleUserPassword
This is an example to auth via simple credentials. If the auth succeed, we return the username authenticated with, for further uses.