2020-11-16 06:13:16 +00:00
|
|
|
use anyhow::*;
|
|
|
|
use log::LevelFilter;
|
|
|
|
use northstar::{
|
|
|
|
GEMINI_PORT,
|
|
|
|
Request,
|
|
|
|
Response,
|
|
|
|
Server,
|
2020-11-22 04:03:56 +00:00
|
|
|
user_management::UserManagementRoutes,
|
2020-11-16 06:13:16 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#[tokio::main]
|
|
|
|
async fn main() -> Result<()> {
|
|
|
|
env_logger::builder()
|
|
|
|
.filter_module("northstar", LevelFilter::Debug)
|
|
|
|
.init();
|
|
|
|
|
|
|
|
Server::bind(("0.0.0.0", GEMINI_PORT))
|
2020-11-21 02:53:00 +00:00
|
|
|
.add_route("/", handle_request)
|
2020-11-22 04:03:56 +00:00
|
|
|
.add_um_routes::<String>("/")
|
2020-11-21 02:53:00 +00:00
|
|
|
.serve()
|
2020-11-16 06:13:16 +00:00
|
|
|
.await
|
|
|
|
}
|
|
|
|
|
|
|
|
/// An ultra-simple demonstration of simple authentication.
|
|
|
|
///
|
|
|
|
/// If the user attempts to connect, they will be prompted to create a client certificate.
|
|
|
|
/// Once they've made one, they'll be given the opportunity to create an account by
|
|
|
|
/// selecting a username. They'll then get a message confirming their account creation.
|
|
|
|
/// Any time this user visits the site in the future, they'll get a personalized welcome
|
|
|
|
/// message.
|
2020-11-22 04:03:56 +00:00
|
|
|
async fn handle_request(_request: Request) -> Result<Response> {
|
|
|
|
Ok(Response::success_plain("Base handler"))
|
2020-11-16 06:13:16 +00:00
|
|
|
}
|