mirror of
https://github.com/nitnelave/lldap.git
synced 2023-04-12 14:25:13 +00:00
46 lines
1.5 KiB
Rust
46 lines
1.5 KiB
Rust
use super::error::*;
|
|
use async_trait::async_trait;
|
|
|
|
pub use lldap_auth::{login, registration};
|
|
|
|
#[async_trait]
|
|
pub trait OpaqueHandler: Clone + Send {
|
|
async fn login_start(
|
|
&self,
|
|
request: login::ClientLoginStartRequest,
|
|
) -> Result<login::ServerLoginStartResponse>;
|
|
async fn login_finish(&self, request: login::ClientLoginFinishRequest) -> Result<String>;
|
|
async fn registration_start(
|
|
&self,
|
|
request: registration::ClientRegistrationStartRequest,
|
|
) -> Result<registration::ServerRegistrationStartResponse>;
|
|
async fn registration_finish(
|
|
&self,
|
|
request: registration::ClientRegistrationFinishRequest,
|
|
) -> Result<()>;
|
|
}
|
|
|
|
#[cfg(test)]
|
|
mockall::mock! {
|
|
pub TestOpaqueHandler{}
|
|
impl Clone for TestOpaqueHandler {
|
|
fn clone(&self) -> Self;
|
|
}
|
|
#[async_trait]
|
|
impl OpaqueHandler for TestOpaqueHandler {
|
|
async fn login_start(
|
|
&self,
|
|
request: login::ClientLoginStartRequest
|
|
) -> Result<login::ServerLoginStartResponse>;
|
|
async fn login_finish(&self, request: login::ClientLoginFinishRequest ) -> Result<String>;
|
|
async fn registration_start(
|
|
&self,
|
|
request: registration::ClientRegistrationStartRequest
|
|
) -> Result<registration::ServerRegistrationStartResponse>;
|
|
async fn registration_finish(
|
|
&self,
|
|
request: registration::ClientRegistrationFinishRequest
|
|
) -> Result<()>;
|
|
}
|
|
}
|