From 033c23ef11d868ec7590b90b6cb79522d2e60f07 Mon Sep 17 00:00:00 2001 From: Kim Minh Kaplan Date: Sat, 10 Nov 2018 09:15:23 +0000 Subject: [PATCH] Document that Authenticator does the Base64 encoding and decoding. --- src/authenticator.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/authenticator.rs b/src/authenticator.rs index ecfe93d..1351b7a 100644 --- a/src/authenticator.rs +++ b/src/authenticator.rs @@ -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` 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; }