model: Inline the BindRequest in the backend

This commit is contained in:
Valentin Tolmer 2021-08-30 09:54:45 +02:00 committed by nitnelave
parent 2aca9dbe62
commit 651adbe3c8
4 changed files with 18 additions and 11 deletions

View File

@ -5,12 +5,6 @@ use std::collections::HashSet;
pub mod opaque;
#[derive(PartialEq, Eq, Debug, Serialize, Deserialize, Clone)]
pub struct BindRequest {
pub name: String,
pub password: String,
}
/// The messages for the 3-step OPAQUE login process.
pub mod login {
use super::*;

View File

@ -1,8 +1,18 @@
use super::error::*;
use async_trait::async_trait;
use serde::{Deserialize, Serialize};
use std::collections::HashSet;
pub use lldap_model::*;
pub use lldap_model::{
AddUserToGroupRequest, CreateGroupRequest, CreateUserRequest, DeleteUserRequest, Group,
ListUsersRequest, RequestFilter, User, UserDetailsRequest,
};
#[derive(PartialEq, Eq, Debug, Serialize, Deserialize, Clone)]
pub struct BindRequest {
pub name: String,
pub password: String,
}
#[async_trait]
pub trait LoginHandler: Clone + Send {

View File

@ -1,9 +1,12 @@
use super::{
error::*, handler::LoginHandler, opaque_handler::*, sql_backend_handler::SqlBackendHandler,
error::*,
handler::{BindRequest, LoginHandler},
opaque_handler::*,
sql_backend_handler::SqlBackendHandler,
sql_tables::*,
};
use async_trait::async_trait;
use lldap_model::{opaque, BindRequest};
use lldap_model::opaque;
use log::*;
use sea_query::{Expr, Iden, Query};
use sqlx::Row;

View File

@ -1,7 +1,7 @@
use crate::{
domain::{
error::DomainError,
handler::{BackendHandler, LoginHandler},
handler::{BackendHandler, BindRequest, LoginHandler},
opaque_handler::OpaqueHandler,
},
infra::{
@ -23,7 +23,7 @@ use futures::future::{ok, Ready};
use futures_util::{FutureExt, TryFutureExt};
use hmac::Hmac;
use jwt::{SignWithKey, VerifyWithKey};
use lldap_model::{login, registration, BindRequest, JWTClaims};
use lldap_model::{login, registration, JWTClaims};
use log::*;
use sha2::Sha512;
use std::collections::{hash_map::DefaultHasher, HashSet};