Document that Authenticator does the Base64 encoding and decoding.
This commit is contained in:
parent
c2c7e2a3f7
commit
033c23ef11
1 changed files with 11 additions and 0 deletions
|
|
@ -1,5 +1,16 @@
|
|||
/// This will allow plugable authentication mechanisms.
|
||||
///
|
||||
/// This trait is used by `Client::authenticate` to [authenticate
|
||||
/// using SASL](https://tools.ietf.org/html/rfc3501#section-6.2.2).
|
||||
pub trait Authenticator {
|
||||
/// Type of the response to the challenge. This will usually be a
|
||||
/// `Vec<u8>` or `String`. It must not be Base64 encoded: the
|
||||
/// library will do it.
|
||||
type Response: AsRef<[u8]>;
|
||||
/// For each server challenge is passed to `process`. The library
|
||||
/// has already decoded the Base64 string into bytes.
|
||||
///
|
||||
/// The `process` function should return its response, not Base64
|
||||
/// encoded: the library will do it.
|
||||
fn process(&self, &[u8]) -> Self::Response;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue