aboutsummaryrefslogtreecommitdiff
path: root/aero-sasl/src
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2024-05-16 17:38:34 +0200
committerQuentin Dufour <quentin@deuxfleurs.fr>2024-05-16 17:38:34 +0200
commit32dfd25f570b7a55bf43752684d286be0f6b2dc2 (patch)
treedd77871cda851bb5795743a3f04be61cf4c3ad61 /aero-sasl/src
parent6b9542088cd1b66af46e95b787493b601accb495 (diff)
downloadaerogramme-32dfd25f570b7a55bf43752684d286be0f6b2dc2.tar.gz
aerogramme-32dfd25f570b7a55bf43752684d286be0f6b2dc2.zip
format + WIP calendar-query
Diffstat (limited to 'aero-sasl/src')
-rw-r--r--aero-sasl/src/flow.rs18
-rw-r--r--aero-sasl/src/lib.rs6
-rw-r--r--aero-sasl/src/types.rs2
3 files changed, 12 insertions, 14 deletions
diff --git a/aero-sasl/src/flow.rs b/aero-sasl/src/flow.rs
index 31c8bc5..5aa4869 100644
--- a/aero-sasl/src/flow.rs
+++ b/aero-sasl/src/flow.rs
@@ -1,8 +1,8 @@
use futures::Future;
use rand::prelude::*;
-use super::types::*;
use super::decode::auth_plain;
+use super::types::*;
#[derive(Debug)]
pub enum AuthRes {
@@ -29,10 +29,10 @@ impl State {
}
async fn try_auth_plain<X, F>(&self, data: &[u8], login: X) -> AuthRes
- where
- X: FnOnce(String, String) -> F,
- F: Future<Output=bool>,
- {
+ where
+ X: FnOnce(String, String) -> F,
+ F: Future<Output = bool>,
+ {
// Check that we can extract user's login+pass
let (ubin, pbin) = match auth_plain(&data) {
Ok(([], (authz, user, pass))) if authz == user || authz == EMPTY_AUTHZ => (user, pass),
@@ -65,10 +65,10 @@ impl State {
}
}
- pub async fn progress<F,X>(&mut self, cmd: ClientCommand, login: X)
- where
- X: FnOnce(String, String) -> F,
- F: Future<Output=bool>,
+ pub async fn progress<F, X>(&mut self, cmd: ClientCommand, login: X)
+ where
+ X: FnOnce(String, String) -> F,
+ F: Future<Output = bool>,
{
let new_state = 'state: {
match (std::mem::replace(self, State::Error), cmd) {
diff --git a/aero-sasl/src/lib.rs b/aero-sasl/src/lib.rs
index 230862a..fdaa8a7 100644
--- a/aero-sasl/src/lib.rs
+++ b/aero-sasl/src/lib.rs
@@ -1,3 +1,6 @@
+pub mod decode;
+pub mod encode;
+pub mod flow;
/// Seek compatibility with the Dovecot Authentication Protocol
///
/// ## Trace
@@ -38,6 +41,3 @@
/// https://doc.dovecot.org/configuration_manual/howto/simple_virtual_install/#simple-virtual-install-smtp-auth
/// https://doc.dovecot.org/configuration_manual/howto/postfix_and_dovecot_sasl/#howto-postfix-and-dovecot-sasl
pub mod types;
-pub mod encode;
-pub mod decode;
-pub mod flow;
diff --git a/aero-sasl/src/types.rs b/aero-sasl/src/types.rs
index d71405e..2686677 100644
--- a/aero-sasl/src/types.rs
+++ b/aero-sasl/src/types.rs
@@ -159,5 +159,3 @@ pub enum ServerCommand {
extra_parameters: Vec<Vec<u8>>,
},
}
-
-