Add basic server config

This commit is contained in:
2023-09-02 10:28:08 +02:00
parent 129d23f671
commit bb31954b22
7 changed files with 57 additions and 1 deletions

View File

@ -1,5 +1,20 @@
use crate::app_config::AppConfig;
use crate::extractors::local_auth_extractor::LocalAuthEnabled;
use actix_web::{HttpResponse, Responder};
pub async fn root_index() -> impl Responder {
HttpResponse::Ok().body("Hello world!")
}
#[derive(serde::Serialize)]
struct StaticConfig {
local_auth_enabled: bool,
oidc_auth_enabled: bool,
}
pub async fn static_config(local_auth: LocalAuthEnabled) -> impl Responder {
HttpResponse::Ok().json(StaticConfig {
local_auth_enabled: *local_auth,
oidc_auth_enabled: !AppConfig::get().disable_oidc,
})
}