2023-07-30 01:50:13 +00:00
|
|
|
use skynet_ldap_backend::{
|
|
|
|
db_init, get_config,
|
2023-08-06 11:43:50 +00:00
|
|
|
methods::{
|
|
|
|
account_new::post::{account, email},
|
|
|
|
account_update::post_update_ldap,
|
|
|
|
},
|
2023-07-30 01:50:13 +00:00
|
|
|
State,
|
|
|
|
};
|
2023-05-25 23:02:12 +00:00
|
|
|
|
|
|
|
#[async_std::main]
|
|
|
|
async fn main() -> tide::Result<()> {
|
|
|
|
let config = get_config();
|
2023-06-04 20:16:24 +00:00
|
|
|
let db = db_init(&config).await?;
|
2023-05-25 23:02:12 +00:00
|
|
|
|
|
|
|
let host_port = config.host_port.clone();
|
|
|
|
|
|
|
|
tide::log::start();
|
|
|
|
|
|
|
|
let state = State {
|
|
|
|
db,
|
|
|
|
config,
|
|
|
|
};
|
|
|
|
|
|
|
|
let mut app = tide::with_state(state);
|
|
|
|
|
2023-05-25 23:38:50 +00:00
|
|
|
app.at("/ldap/update").post(post_update_ldap);
|
2023-08-06 11:43:50 +00:00
|
|
|
app.at("/ldap/new/email").post(email::submit);
|
|
|
|
app.at("/ldap/new/account").post(account::submit);
|
2023-05-25 23:02:12 +00:00
|
|
|
|
|
|
|
app.listen(host_port).await?;
|
|
|
|
Ok(())
|
|
|
|
}
|
|
|
|
|
2023-07-30 04:20:08 +00:00
|
|
|
/*
|
|
|
|
Password reset via email
|
2023-05-26 09:39:36 +00:00
|
|
|
*/
|