2023-06-04 11:28:21 +00:00
|
|
|
use skynet_ldap_server::methods::account_update::post_update_ldap;
|
2023-06-04 11:17:16 +00:00
|
|
|
use skynet_ldap_server::{db_init, get_config, State};
|
2023-06-04 12:27:15 +00:00
|
|
|
use skynet_ldap_server::methods::account_new::post_new_account;
|
2023-05-25 23:02:12 +00:00
|
|
|
|
|
|
|
#[async_std::main]
|
|
|
|
async fn main() -> tide::Result<()> {
|
|
|
|
let config = get_config();
|
|
|
|
let db = db_init(&config.database).await?;
|
|
|
|
|
|
|
|
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-06-04 12:27:15 +00:00
|
|
|
|
|
|
|
app.at("/ldap/new").post(post_new_account);
|
2023-05-25 23:02:12 +00:00
|
|
|
|
|
|
|
app.listen(host_port).await?;
|
|
|
|
Ok(())
|
|
|
|
}
|
|
|
|
|
2023-05-26 09:37:50 +00:00
|
|
|
/* Create new account
|
2023-05-26 09:39:36 +00:00
|
|
|
|
|
|
|
|
|
|
|
1. Check if ID is available
|
|
|
|
2. Ask user to fill in:
|
|
|
|
* uid
|
|
|
|
* First Name
|
|
|
|
* Surname Name
|
|
|
|
* Wolves email
|
|
|
|
3. Email + link is sent to wolves email
|
|
|
|
* only if its paid up and it hasn't been used before
|
|
|
|
4. Ldap entry created
|
|
|
|
5. Email with initial pw is sent to user
|
|
|
|
6. Account added to skynet-users (they are paid up)
|
|
|
|
|
|
|
|
*/
|
2023-05-26 00:23:45 +00:00
|
|
|
|
2023-05-26 09:37:50 +00:00
|
|
|
/* Join existing account to wolves
|
2023-05-26 09:39:36 +00:00
|
|
|
related to above
|
2023-05-26 00:23:45 +00:00
|
|
|
|
2023-05-26 09:39:36 +00:00
|
|
|
*/
|
2023-05-26 00:23:45 +00:00
|
|
|
|
2023-05-26 09:37:50 +00:00
|
|
|
/* Password reset via email
|
2023-05-26 00:23:45 +00:00
|
|
|
|
2023-05-26 09:39:36 +00:00
|
|
|
*/
|
2023-05-26 00:23:45 +00:00
|
|
|
|
2023-05-26 09:37:50 +00:00
|
|
|
/* script to pull in all active members from wolves
|
2023-05-26 09:39:36 +00:00
|
|
|
update the groups
|
|
|
|
check if there are any pending signups
|
2023-05-26 00:23:45 +00:00
|
|
|
|
2023-05-26 09:39:36 +00:00
|
|
|
*/
|