use crate::mechanism::{Authentication, MechanismData};
use crate::prelude::*;
use crate::registry::{Matches, Mechanism, Named, Side};
use crate::io::Write;
#[allow(unused)]
pub struct RSaslTest {
state: RsaslState,
}
impl RSaslTest {
#[allow(clippy::unnecessary_wraps)]
pub fn client() -> Result<Box<dyn Authentication>, SASLError> {
Ok(Box::new(Self {
state: RsaslState::New,
}))
}
#[allow(clippy::unnecessary_wraps)]
pub fn server(_config: &SASLConfig) -> Result<Box<dyn Authentication>, SASLError> {
Ok(Box::new(Self {
state: RsaslState::New,
}))
}
}
#[allow(unused)]
enum RsaslState {
New,
First,
Second,
Third,
Fourth,
}
impl Authentication for RSaslTest {
fn step(
&mut self,
session: &mut MechanismData,
input: Option<&[u8]>,
writer: &mut dyn Write,
) -> Result<State, SessionError> {
let _ = (session, input, writer);
todo!()
}
}
pub static RSASLTEST_CF: Mechanism = Mechanism {
mechanism: Mechname::const_new(b"X-RSASLTEST-CF"),
priority: 0,
client: Some(RSaslTest::client),
server: Some(RSaslTest::server),
first: Side::Client,
select: |_| Some(Matches::<SelectCF>::name()),
offer: |_| true,
};
struct SelectCF;
impl Named for SelectCF {
fn mech() -> &'static Mechanism {
&RSASLTEST_CF
}
}
pub static RSASLTEST_SF: Mechanism = Mechanism {
mechanism: Mechname::const_new(b"X-RSASLTEST-SF"),
priority: 0,
client: Some(RSaslTest::client),
server: Some(RSaslTest::server),
first: Side::Client,
select: |_| Some(Matches::<Select>::name()),
offer: |_| true,
};
struct Select;
impl Named for Select {
fn mech() -> &'static Mechanism {
&RSASLTEST_SF
}
}