[−][src]Trait ellidri::auth::Provider
Required methods
fn is_available(&self) -> bool
Whether the SASL backend is available.
If not, start_auth
and next_challenge
will always return Err(())
.
fn write_mechanisms(&self, buf: &mut String)
Write the SASL mechanisms this provider supports, separated by commas (,).
Example: PLAIN,EXTERNAL
Used for capability advertisment.
fn start_auth(
&self,
mechanism: &str,
next: &mut Vec<u8>
) -> Result<usize, Error>
&self,
mechanism: &str,
next: &mut Vec<u8>
) -> Result<usize, Error>
Start the authentication process of a client.
On success, returns an identifier that must be passed to next_challenge
to continue the
authentication, so that multiple clients can authenticate at the same time.
fn next_challenge(
&self,
auth: usize,
response: &[u8],
next: &mut Vec<u8>
) -> Result<Option<String>, Error>
&self,
auth: usize,
response: &[u8],
next: &mut Vec<u8>
) -> Result<Option<String>, Error>
Given the authentication process identifier auth
, and the response to the previous
challenge from the client response
, returns whether the client is authenticated or not.
If the client is not authenticated yet, the next challenge to be sent to the client is
appended to next
.
Implementors
impl Provider for DummyProvider
[src]
fn is_available(&self) -> bool
[src]
fn write_mechanisms(&self, _: &mut String)
[src]
fn start_auth(&self, _: &str, _: &mut Vec<u8>) -> Result<usize, Error>
[src]
fn next_challenge(
&self,
_: usize,
_: &[u8],
_: &mut Vec<u8>
) -> Result<Option<String>, Error>
[src]
&self,
_: usize,
_: &[u8],
_: &mut Vec<u8>
) -> Result<Option<String>, Error>
impl<M> Provider for DbProvider<M> where
M: ManageConnection,
Pool<M>: Plain,
[src]
M: ManageConnection,
Pool<M>: Plain,