Add basic providers configuration
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
11
src/main.rs
11
src/main.rs
@@ -20,6 +20,7 @@ use basic_oidc::data::app_config::AppConfig;
|
||||
use basic_oidc::data::client::ClientManager;
|
||||
use basic_oidc::data::entity_manager::EntityManager;
|
||||
use basic_oidc::data::jwt_signer::JWTSigner;
|
||||
use basic_oidc::data::provider::ProvidersManager;
|
||||
use basic_oidc::data::user::User;
|
||||
use basic_oidc::data::webauthn_manager::WebAuthManager;
|
||||
use basic_oidc::middlewares::auth_middleware::AuthMiddleware;
|
||||
@@ -77,6 +78,11 @@ async fn main() -> std::io::Result<()> {
|
||||
clients.apply_environment_variables();
|
||||
let clients = Arc::new(clients);
|
||||
|
||||
let mut providers = ProvidersManager::open_or_create(config.providers_file())
|
||||
.expect("Failed to load providers list!");
|
||||
providers.apply_environment_variables();
|
||||
let providers = Arc::new(providers);
|
||||
|
||||
log::info!("Server will listen on {}", config.listen_address);
|
||||
let listen_address = config.listen_address.to_string();
|
||||
|
||||
@@ -101,6 +107,7 @@ async fn main() -> std::io::Result<()> {
|
||||
.app_data(web::Data::new(bruteforce_actor.clone()))
|
||||
.app_data(web::Data::new(openid_sessions_actor.clone()))
|
||||
.app_data(web::Data::new(clients.clone()))
|
||||
.app_data(web::Data::new(providers.clone()))
|
||||
.app_data(web::Data::new(jwt_signer.clone()))
|
||||
.app_data(web::Data::new(webauthn_manager.clone()))
|
||||
.wrap(
|
||||
@@ -207,6 +214,10 @@ async fn main() -> std::io::Result<()> {
|
||||
"/admin/clients",
|
||||
web::get().to(admin_controller::clients_route),
|
||||
)
|
||||
.route(
|
||||
"/admin/providers",
|
||||
web::get().to(admin_controller::providers_route),
|
||||
)
|
||||
.route("/admin/users", web::get().to(admin_controller::users_route))
|
||||
.route(
|
||||
"/admin/users",
|
||||
|
||||
Reference in New Issue
Block a user